Move :placeholder-shown out of experimental
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Nov 2014 00:20:35 +0000 (00:20 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Nov 2014 00:20:35 +0000 (00:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138998

Reviewed by Andreas Kling.

The pseudo class :placeholder-shown is used by the inspector, disabling it breaks
the sidebar.

The implementation has been stable for a while, we can move it to stable.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176529 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSSelector.cpp
Source/WebCore/css/CSSSelector.h
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in
Source/WebCore/cssjit/SelectorCompiler.cpp

index fc3115e..9caa6ad 100644 (file)
@@ -1,3 +1,26 @@
+2014-11-24  Benjamin Poulain  <benjamin@webkit.org>
+
+        Move :placeholder-shown out of experimental
+        https://bugs.webkit.org/show_bug.cgi?id=138998
+
+        Reviewed by Andreas Kling.
+
+        The pseudo class :placeholder-shown is used by the inspector, disabling it breaks
+        the sidebar.
+
+        The implementation has been stable for a while, we can move it to stable.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText):
+        * css/CSSSelector.h:
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::checkOne):
+        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::addPseudoClassType):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):
+
 2014-11-24  Antti Koivisto  <antti@apple.com>
 
         Avoid String concatenation with line break iterator
index c67899b..0121eff 100644 (file)
@@ -564,11 +564,9 @@ String CSSSelector::selectorText(const String& rightSide) const
                 str.append(')');
                 break;
             }
-#if ENABLE(CSS_SELECTORS_LEVEL4)
             case CSSSelector::PseudoClassPlaceholderShown:
                 str.appendLiteral(":placeholder-shown");
                 break;
-#endif
             case CSSSelector::PseudoClassOutOfRange:
                 str.appendLiteral(":out-of-range");
                 break;
index 85227ad..9c155c6 100644 (file)
@@ -120,11 +120,9 @@ namespace WebCore {
             PseudoClassFullPageMedia,
             PseudoClassDefault,
             PseudoClassDisabled,
+            PseudoClassMatches,
             PseudoClassOptional,
-#if ENABLE(CSS_SELECTORS_LEVEL4)
             PseudoClassPlaceholderShown,
-#endif
-            PseudoClassMatches,
             PseudoClassRequired,
             PseudoClassReadOnly,
             PseudoClassReadWrite,
index 3072251..be1a220 100644 (file)
@@ -729,7 +729,6 @@ bool SelectorChecker::checkOne(const CheckingContextWithStatus& context, PseudoI
                 }
                 return hasMatchedAnything;
             }
-#if ENABLE(CSS_SELECTORS_LEVEL4)
         case CSSSelector::PseudoClassPlaceholderShown:
             if (is<HTMLTextFormControlElement>(*element)) {
                 if (context.resolvingMode == Mode::ResolvingStyle) {
@@ -739,7 +738,6 @@ bool SelectorChecker::checkOne(const CheckingContextWithStatus& context, PseudoI
                 return downcast<HTMLTextFormControlElement>(*element).isPlaceholderVisible();
             }
             return false;
-#endif
         case CSSSelector::PseudoClassNthChild:
             if (!selector->parseNth())
                 break;
index 7e91b0e..f106f0c 100644 (file)
@@ -45,9 +45,7 @@ only-child
 only-of-type
 optional
 out-of-range
-#if ENABLE(CSS_SELECTORS_LEVEL4)
 placeholder-shown
-#endif
 read-only
 read-write
 required
index 0942423..eb56e22 100644 (file)
@@ -293,9 +293,7 @@ private:
     void generateElementIsInLanguage(Assembler::JumpList& failureCases, const AtomicString&);
     void generateElementIsLastChild(Assembler::JumpList& failureCases, const SelectorFragment&);
     void generateElementIsOnlyChild(Assembler::JumpList& failureCases, const SelectorFragment&);
-#if ENABLE(CSS_SELECTORS_LEVEL4)
     void generateElementHasPlaceholderShown(Assembler::JumpList& failureCases, const SelectorFragment&);
-#endif
     void generateSynchronizeStyleAttribute(Assembler::RegisterID elementDataArraySizeAndFlags);
     void generateSynchronizeAllAnimatedSVGAttribute(Assembler::RegisterID elementDataArraySizeAndFlags);
     void generateElementAttributesMatching(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const SelectorFragment&);
@@ -610,9 +608,7 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec
     case CSSSelector::PseudoClassHover:
     case CSSSelector::PseudoClassLastChild:
     case CSSSelector::PseudoClassOnlyChild:
-#if ENABLE(CSS_SELECTORS_LEVEL4)
     case CSSSelector::PseudoClassPlaceholderShown:
-#endif
         fragment.pseudoClasses.add(type);
         if (selectorContext == SelectorContext::QuerySelector)
             return FunctionType::SimpleSelectorChecker;
@@ -2443,10 +2439,8 @@ void SelectorCodeGenerator::generateElementMatching(Assembler::JumpList& matchin
         generateElementIsHovered(matchingPostTagNameFailureCases, fragment);
     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassOnlyChild))
         generateElementIsOnlyChild(matchingPostTagNameFailureCases, fragment);
-#if ENABLE(CSS_SELECTORS_LEVEL4)
     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassPlaceholderShown))
         generateElementHasPlaceholderShown(matchingPostTagNameFailureCases, fragment);
-#endif
     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassFirstChild))
         generateElementIsFirstChild(matchingPostTagNameFailureCases, fragment);
     if (fragment.pseudoClasses.contains(CSSSelector::PseudoClassLastChild))
@@ -3287,7 +3281,6 @@ void SelectorCodeGenerator::generateElementIsOnlyChild(Assembler::JumpList& fail
     failureCases.append(m_assembler.branchTest32(Assembler::NonZero, isOnlyChildRegister));
 }
 
-#if ENABLE(CSS_SELECTORS_LEVEL4)
 static bool makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown(Element* element, const SelectorChecker::CheckingContext* checkingContext)
 {
     if (is<HTMLTextFormControlElement>(*element)) {
@@ -3337,7 +3330,6 @@ void SelectorCodeGenerator::generateElementHasPlaceholderShown(Assembler::JumpLi
     functionCall.setTwoArguments(elementAddressRegister, checkingContext);
     failureCases.append(functionCall.callAndBranchOnBooleanReturnValue(Assembler::Zero));
 }
-#endif
 
 inline void SelectorCodeGenerator::generateElementHasTagName(Assembler::JumpList& failureCases, const QualifiedName& nameToMatch)
 {