Reduce style marking when using the pseudo class :placeholder-shown
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Aug 2014 19:33:30 +0000 (19:33 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Aug 2014 19:33:30 +0000 (19:33 +0000)
commit1013614210c5da61bac395d57baee1a1a8ca8887
tree1d5eee5c09158748b1b3afdd90d2a0f141bf7c03
parenta234c3153f349d1c893456be41bca544d3fd6acf
Reduce style marking when using the pseudo class :placeholder-shown
https://bugs.webkit.org/show_bug.cgi?id=136203

Reviewed by Darin Adler.

When the :placeholder-shown filter is hit, we were always marking the RenderStyle as unique.
As a result, if :placeholder-shown was used without a more restrictive filter (e.g. "*:placeholder-shown"
or simply ":placeholder-shown"), style sharing was disabled for the whole tree.

This patch rescope the tree marking to any element that can be affected by a placeholder:
any the subclass of HTMLTextFormControlElement. For other elements, any change in internal state
would be irrelevant for "isPlaceholderVisible".

Styling of :placeholder-shown is covered by the existing tests. Style sharing of :placeholder-shown
is covered by LayoutTests/fast/css/placeholder-shown-basics.html.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isPlaceholderShown): Deleted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
(WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
(WebCore::SelectorCompiler::isPlaceholderShown):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):
(WebCore::SelectorCompiler::makeUniqueIfNecessaryAndTestIsPlaceholderShown): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/SelectorCheckerTestFunctions.h
Source/WebCore/cssjit/SelectorCompiler.cpp