Changeset 109884 in webkit


Ignore:
Timestamp:
Mar 6, 2012 1:43:27 AM (12 years ago)
Author:
rolandsteiner@chromium.org
Message:

:scope should behave as :root outside scoped style sheet
https://bugs.webkit.org/show_bug.cgi?id=80389

Source/WebCore:

Fall through to :root implementation if no scope is used.

Reviewed by Antti Koivisto.

Test: fast/css/style-scoped/scope-pseudo.html

  • css/SelectorChecker.cpp:

(WebCore::SelectorChecker::checkOneSelector):

LayoutTests:

Update test with :scope in global style sheet

Reviewed by Antti Koivisto.

  • fast/css/style-scoped/scope-pseudo-expected.txt:
  • fast/css/style-scoped/scope-pseudo.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109882 r109884  
     12012-03-06  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        :scope should behave as :root outside scoped style sheet
     4        https://bugs.webkit.org/show_bug.cgi?id=80389
     5
     6        Update test with :scope in global style sheet
     7
     8        Reviewed by Antti Koivisto.
     9
     10        * fast/css/style-scoped/scope-pseudo-expected.txt:
     11        * fast/css/style-scoped/scope-pseudo.html:
     12
    1132012-03-05  Vsevolod Vlasov  <vsevik@chromium.org>
    214
  • trunk/LayoutTests/fast/css/style-scoped/scope-pseudo-expected.txt

    r109573 r109884  
    99Text
    1010--- COMPUTED STYLES ---
     11<html> background: rgb(255, 255, 0)
    1112outer: rgb(0, 0, 0)
    1213sibling1: rgb(0, 0, 0)
  • trunk/LayoutTests/fast/css/style-scoped/scope-pseudo.html

    r109573 r109884  
    2121            log('--- COMPUTED STYLES ---');
    2222
     23            log('<html> background: ' + document.defaultView.getComputedStyle(document.documentElement, null).getPropertyValue('background-color'));
    2324            test('outer');
    2425            test('sibling1');
     
    3738    <style type="text/css">
    3839        body { color: black; }
     40        :scope { background-color: yellow; }
    3941    </style>
    4042</head>
  • trunk/Source/WebCore/ChangeLog

    r109882 r109884  
     12012-03-06  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        :scope should behave as :root outside scoped style sheet
     4        https://bugs.webkit.org/show_bug.cgi?id=80389
     5
     6        Fall through to :root implementation if no scope is used.
     7
     8        Reviewed by Antti Koivisto.
     9
     10        Test: fast/css/style-scoped/scope-pseudo.html
     11
     12        * css/SelectorChecker.cpp:
     13        (WebCore::SelectorChecker::checkOneSelector):
     14
    1152012-03-05  Vsevolod Vlasov  <vsevik@chromium.org>
    216
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r109573 r109884  
    982982            }
    983983            break;
    984         case CSSSelector::PseudoScope:
    985             return element == context.scope;
    986984        case CSSSelector::PseudoTarget:
    987985            if (element == element->document()->cssTarget())
     
    11111109                break;
    11121110            }
     1111        case CSSSelector::PseudoScope:
     1112            if (context.scope)
     1113                return element == context.scope;
     1114            // If there is no scope, :scope should behave as :root -> fall through
    11131115        case CSSSelector::PseudoRoot:
    11141116            if (element == element->document()->documentElement())
Note: See TracChangeset for help on using the changeset viewer.