Changeset 147295 in webkit


Ignore:
Timestamp:
Mar 31, 2013 8:44:36 PM (11 years ago)
Author:
hayato@chromium.org
Message:

Text representation of pseudo elements, '::-webkit-distributed', is wrong in CSSSelector::selectorText().
https://bugs.webkit.org/show_bug.cgi?id=113560

Reviewed by Dimitri Glazkov.

Source/WebCore:

Fix the text representation of distributed functional pseudo elements in CSSSelector::selectorText().

Test: fast/dom/shadow/distributed-pseudo-element-css-text.html

  • css/CSSSelector.cpp:

(WebCore::CSSSelector::selectorText):

  • css/CSSSelector.h:

(CSSSelector):

LayoutTests:

  • fast/dom/shadow/distributed-pseudo-element-css-text-expected.txt: Added.
  • fast/dom/shadow/distributed-pseudo-element-css-text.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147291 r147295  
     12013-03-31  Hayato Ito  <hayato@chromium.org>
     2
     3        Text representation of pseudo elements, '::-webkit-distributed', is wrong in CSSSelector::selectorText().
     4        https://bugs.webkit.org/show_bug.cgi?id=113560
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        * fast/dom/shadow/distributed-pseudo-element-css-text-expected.txt: Added.
     9        * fast/dom/shadow/distributed-pseudo-element-css-text.html: Added.
     10
    1112013-03-31  Rafael Weinstein  <rafaelw@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r147294 r147295  
     12013-03-31  Hayato Ito  <hayato@chromium.org>
     2
     3        Text representation of pseudo elements, '::-webkit-distributed', is wrong in CSSSelector::selectorText().
     4        https://bugs.webkit.org/show_bug.cgi?id=113560
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        Fix the text representation of distributed functional pseudo elements in CSSSelector::selectorText().
     9
     10        Test: fast/dom/shadow/distributed-pseudo-element-css-text.html
     11
     12        * css/CSSSelector.cpp:
     13        (WebCore::CSSSelector::selectorText):
     14        * css/CSSSelector.h:
     15        (CSSSelector):
     16
    1172013-03-31  Adam Barth  <abarth@webkit.org>
    218
  • trunk/Source/WebCore/css/CSSSelector.cpp

    r145691 r147295  
    609609}
    610610
    611 String CSSSelector::selectorText() const
     611String CSSSelector::selectorText(const String& rightSide) const
    612612{
    613613    StringBuilder str;
     
    710710
    711711    if (const CSSSelector* tagHistory = cs->tagHistory()) {
    712         String tagHistoryText = tagHistory->selectorText();
    713712        switch (cs->relation()) {
    714713        case CSSSelector::Descendant:
    715             return tagHistoryText + " " + str.toString();
     714            return tagHistory->selectorText(" " + str.toString() + rightSide);
    716715        case CSSSelector::Child:
    717             return tagHistoryText + " > " + str.toString();
     716            return tagHistory->selectorText(" > " + str.toString() + rightSide);
    718717        case CSSSelector::DirectAdjacent:
    719             return tagHistoryText + " + " + str.toString();
     718            return tagHistory->selectorText(" + " + str.toString() + rightSide);
    720719        case CSSSelector::IndirectAdjacent:
    721             return tagHistoryText + " ~ " + str.toString();
     720            return tagHistory->selectorText(" ~ " + str.toString() + rightSide);
    722721        case CSSSelector::SubSelector:
    723722            ASSERT_NOT_REACHED();
    724723        case CSSSelector::ShadowDescendant:
    725             return tagHistoryText + str.toString();
     724            return tagHistory->selectorText(str.toString() + rightSide);
    726725#if ENABLE(SHADOW_DOM)
    727726        case CSSSelector::ShadowDistributed:
    728             return tagHistoryText + "::-webkit-distributed(" + str.toString() + ")";
     727            return tagHistory->selectorText("::-webkit-distributed(" + str.toString() + rightSide + ")");
    729728#endif
    730729        }
    731730    }
    732 
    733     return str.toString();
     731    return str.toString() + rightSide;
    734732}
    735733
  • trunk/Source/WebCore/css/CSSSelector.h

    r145691 r147295  
    4545         * Re-create selector text from selector's data
    4646         */
    47         String selectorText() const;
     47        String selectorText(const String& = "") const;
    4848
    4949        // checks if the 2 selectors (including sub selectors) agree.
Note: See TracChangeset for help on using the changeset viewer.