<rdar://problem/9750062> REGRESSION: Button text missing in many iTunes Store pages
https://bugs.webkit.org/show_bug.cgi?id=64236
Reviewed by Maciej Stachowiak.
Source/WebCore:
Test: fast/css/empty-display-none.html
When an :empty selector caused an element to not have a renderer, the check for empty style
change when finishing parsing the elemenet did nothing, because it could not check if the
element’s current style was affected by :empty. The fix is to record the fact that the style
was affected by :empty in ElementRareData in the no-renderer case.
* dom/Element.cpp:
(WebCore::Element::recalcStyle): Clear the m_styleAffectedByEmpty flag.
(WebCore::checkForEmptyStyleChange): If the style is null (meaning there is no renderer), check
Element::styleAffectedByEmpty().
(WebCore::Element::setStyleAffectedByEmpty): Added. Sets the flag in rare data.
(WebCore::Element::styleAffectedByEmpty): Added. Checks for the flag in rare data.
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::ElementRareData::ElementRareData): Added m_styleAffectedByEmpty and initialized it
to false.
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRendererFactory::createRendererAndStyle): If an element doesn’t need a renderer
and its style is affected by :empty, record this fact in the element by calling setStyleAffectedByEmpty().
LayoutTests:
* fast/css/empty-display-none-expected.txt: Added.
* fast/css/empty-display-none.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@90691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
8 files changed