Changeset 120147 in webkit


Ignore:
Timestamp:
Jun 12, 2012 6:28:33 PM (12 years ago)
Author:
morrita@google.com
Message:

Shadow Pseudo ID should be able to nest to point nested shadow DOM.
https://bugs.webkit.org/show_bug.cgi?id=62218

Reviewed by Dimitri Glazkov.

.:

  • Source/autotools/symbols.filter:

Source/WebCore:

  • updateSpecifiersWithElementName() didn't take nesting into account. tag history can contain selector entries which isn't marked as ShadowDescendant yet. such entry can be found by investigating isUnknownPseudoElement().
  • SelectorChecker::checkSelector() was too strict. Unknown pseudo elements are essentially a kind of class or id in implementation perspective. For such, rejecting by missing elementStyle doesn't make sense: It isn't a pseudo but a real element for WebCore after all.
  • Added Internals::setShadowPseudoId() to create a test harness whose DOM tree contains pseudo shadow ids.

Before this change, following selecdtor chain is created for "p::-shadow-child::-nested-shadow-child":

[both tag name and -shadow-id are set] <-(ShadowDescendant)- [-nested-shadow-id]

What we want, which is created by this change is:

[tag] <-(ShadowDescendant)- [-shadow-id is set] <-(ShadowdescenDant)- [-nested-shadow-id]

Test: fast/dom/shadow/shadow-nested-pseudo-id.html

  • WebCore.exp.in:
  • css/CSSParser.cpp:

(WebCore::CSSParser::updateSpecifiersWithElementName):

  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::checkOneSelector):

  • testing/Internals.cpp:

(WebCore::Internals::setShadowPseudoId):
(WebCore):

  • testing/Internals.h:

(Internals):

  • testing/Internals.idl:

Source/WebKit2:

  • win/WebKit2.def:
  • win/WebKit2CFLite.def:

LayoutTests:

  • fast/dom/shadow/shadow-nested-pseudo-id-expected.txt: Added.
  • fast/dom/shadow/shadow-nested-pseudo-id.html: Added.
Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r120144 r120147  
     12012-06-12  MORITA Hajime  <morrita@google.com>
     2
     3        Shadow Pseudo ID should be able to nest to point nested shadow DOM.
     4        https://bugs.webkit.org/show_bug.cgi?id=62218
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * Source/autotools/symbols.filter:
     9
    1102012-06-12  Christophe Dumez  <christophe.dumez@intel.com>
    211
  • trunk/LayoutTests/ChangeLog

    r120146 r120147  
     12012-06-12  MORITA Hajime  <morrita@google.com>
     2
     3        Shadow Pseudo ID should be able to nest to point nested shadow DOM.
     4        https://bugs.webkit.org/show_bug.cgi?id=62218
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/shadow/shadow-nested-pseudo-id-expected.txt: Added.
     9        * fast/dom/shadow/shadow-nested-pseudo-id.html: Added.
     10
    1112012-06-12  Ojan Vafai  <ojan@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r120145 r120147  
     12012-06-12  MORITA Hajime  <morrita@google.com>
     2
     3        Shadow Pseudo ID should be able to nest to point nested shadow DOM.
     4        https://bugs.webkit.org/show_bug.cgi?id=62218
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        - updateSpecifiersWithElementName() didn't take nesting into account.
     9          tag history can contain selector entries which isn't marked as ShadowDescendant yet.
     10          such entry can be found by investigating isUnknownPseudoElement().
     11        - SelectorChecker::checkSelector() was too strict. Unknown pseudo elements are essentially a kind of class or id
     12          in implementation perspective. For such, rejecting by missing elementStyle doesn't make sense:
     13          It isn't a pseudo but a real element for WebCore after all.
     14        - Added Internals::setShadowPseudoId() to create a test harness whose DOM tree contains pseudo shadow ids.
     15
     16        Before this change, following selecdtor chain is created for "p::-shadow-child::-nested-shadow-child":
     17
     18          [both tag name and -shadow-id are set] <-(ShadowDescendant)- [-nested-shadow-id]
     19
     20        What we want, which is created by this change is:
     21
     22          [tag] <-(ShadowDescendant)- [-shadow-id is set] <-(ShadowdescenDant)- [-nested-shadow-id]
     23
     24        Test: fast/dom/shadow/shadow-nested-pseudo-id.html
     25
     26        * WebCore.exp.in:
     27        * css/CSSParser.cpp:
     28        (WebCore::CSSParser::updateSpecifiersWithElementName):
     29        * css/SelectorChecker.cpp:
     30        (WebCore::SelectorChecker::checkOneSelector):
     31        * testing/Internals.cpp:
     32        (WebCore::Internals::setShadowPseudoId):
     33        (WebCore):
     34        * testing/Internals.h:
     35        (Internals):
     36        * testing/Internals.idl:
     37
    1382012-06-12  Christophe Dumez  <christophe.dumez@intel.com>
    239
  • trunk/Source/WebCore/WebCore.exp.in

    r120078 r120147  
    785785__ZN7WebCore7Console24setShouldPrintExceptionsEb
    786786__ZN7WebCore7Element21boundsInRootViewSpaceEv
     787__ZN7WebCore7Element17setShadowPseudoIdERKN3WTF12AtomicStringERi
    787788__ZN7WebCore7Element9innerTextEv
    788789__ZN7WebCore7IntRect5scaleEf
  • trunk/Source/WebCore/css/CSSParser.cpp

    r120029 r120147  
    92709270    while (history->tagHistory()) {
    92719271        history = history->tagHistory();
    9272         if (history->hasShadowDescendant())
     9272        if (history->isUnknownPseudoElement() || history->hasShadowDescendant())
    92739273            lastShadowDescendant = history;
    92749274    }
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r118891 r120147  
    11781178    }
    11791179    if (selector->m_match == CSSSelector::PseudoElement) {
    1180         if ((!context.elementStyle && m_mode == ResolvingStyle) || m_mode == QueryingRules)
    1181             return false;
    1182 
    11831180        if (selector->isUnknownPseudoElement()) {
    11841181            m_hasUnknownPseudoElements = true;
    11851182            return element->shadowPseudoId() == selector->value();
    11861183        }
     1184
     1185        if ((!context.elementStyle && m_mode == ResolvingStyle) || m_mode == QueryingRules)
     1186            return false;
    11871187
    11881188        PseudoId pseudoId = CSSSelector::pseudoId(selector->pseudoType());
  • trunk/Source/WebCore/testing/Internals.cpp

    r120054 r120147  
    382382}
    383383
     384void Internals::setShadowPseudoId(Element* element, const String& id, ExceptionCode& ec)
     385{
     386    if (!element) {
     387        ec = INVALID_ACCESS_ERR;
     388        return;
     389    }
     390
     391    return element->setShadowPseudoId(id, ec);
     392}
     393
    384394String Internals::visiblePlaceholder(Element* element)
    385395{
  • trunk/Source/WebCore/testing/Internals.h

    r120054 r120147  
    7878    Element* includerFor(Node*, ExceptionCode&);
    7979    String shadowPseudoId(Element*, ExceptionCode&);
     80    void setShadowPseudoId(Element*, const String&, ExceptionCode&);
     81
    8082    PassRefPtr<Element> createContentElement(Document*, ExceptionCode&);
    8183    Element* getElementByIdInShadowRoot(Node* shadowRoot, const String& id, ExceptionCode&);
  • trunk/Source/WebCore/testing/Internals.idl

    r120144 r120147  
    5151        Element includerFor(in Node node) raises (DOMException);
    5252        DOMString shadowPseudoId(in Element element) raises (DOMException);
     53        void setShadowPseudoId(in Element element, in DOMString id) raises (DOMException);
    5354        Element createContentElement(in Document document) raises(DOMException);
    5455        Element getElementByIdInShadowRoot(in Node shadowRoot, in DOMString id) raises(DOMException);
  • trunk/Source/WebKit2/ChangeLog

    r120077 r120147  
     12012-06-12  MORITA Hajime  <morrita@google.com>
     2
     3        Shadow Pseudo ID should be able to nest to point nested shadow DOM.
     4        https://bugs.webkit.org/show_bug.cgi?id=62218
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * win/WebKit2.def:
     9        * win/WebKit2CFLite.def:
     10
    1112012-06-12  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    212
  • trunk/Source/WebKit2/win/WebKit2.def

    r120054 r120147  
    221221        ?setSansSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
    222222        ?setScrollbarsSuppressed@ScrollView@WebCore@@QAEX_N0@Z
     223        ?setShadowPseudoId@Element@WebCore@@QAEXABVAtomicString@WTF@@AAH@Z
    223224        ?setDelegatesScrolling@ScrollView@WebCore@@QAEX_N@Z
    224225        ?setScrollOffsetFromInternals@ScrollableArea@WebCore@@QAEXABVIntPoint@2@@Z
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r119937 r120147  
    216216        ?setScrollOffsetFromInternals@ScrollableArea@WebCore@@QAEXABVIntPoint@2@@Z
    217217        ?setSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
     218        ?setShadowPseudoId@Element@WebCore@@QAEXABVAtomicString@WTF@@AAH@Z
    218219        ?setStandardFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
    219220        ?setSuggestedValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
  • trunk/Source/autotools/symbols.filter

    r120144 r120147  
    8787_ZN7WebCore6toNodeEN3JSC7JSValueE;
    8888_ZN7WebCore7Element20removeShadowRootListEv;
     89_ZN7WebCore7Element17setShadowPseudoIdERKN3WTF12AtomicStringERi;
    8990_ZN7WebCore7toRangeEN3JSC7JSValueE;
    9091_ZN7WebCore9JSElement10putVirtualEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
Note: See TracChangeset for help on using the changeset viewer.