Changeset 116521 in webkit


Ignore:
Timestamp:
May 9, 2012 5:53:42 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

ShadowRoot needs applyAuthorStyles
https://bugs.webkit.org/show_bug.cgi?id=78472

Patch by Takashi Sakamoto <tasak@google.com> on 2012-05-09
Reviewed by Hajime Morita.

Source/WebCore:

Implemented applyAuthorStyles attribute defined in the following spec:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes
Since applyAuthorSheets attribute has been already implemented,
renamed all applyAuthorSheets to applyAuthorStyles and
added applyAuthorStyles to ShadowRoot.idl.
Currently, changing dynamically applyAuthorStyles doesn't work. I will fix this isse in bugs:84215: https://bugs.webkit.org/show_bug.cgi?id=84251

Test: fast/dom/shadow/shadow-root-applyAuthorStyles.html

fast/dom/shadow/shadow-root-applyAuthorStyles-expected.html

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::collectMatchingRulesForList):

  • dom/ShadowRoot.cpp:

(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::applyAuthorStyles):
(WebCore::ShadowRoot::setApplyAuthorStyles):

  • dom/ShadowRoot.h:
  • dom/TreeScope.cpp:

(WebCore::TreeScope::applyAuthorStyles):

  • dom/TreeScope.h:

(TreeScope):
Changed all applyAuthorSheets to applyAuthorSytles.
(ShadowRoot):

  • dom/ShadowRoot.idl:

Added a new attribute, boolean applyAuthorStyles.

LayoutTests:

  • fast/dom/shadow/shadow-root-applyAuthorStyles.html:
  • fast/dom/shadow/shadow-root-applyAuthorStyles-expected.html:

Tested four cases:
case 1: applyAuthorStyles is false,
case 2: applyAuthorStyles is true with <script>..</script>,
case 3: applyAuthorStyles is true with inline script declaration, and
case 4: applyAuthorStyles is true with important UA property.
The case 1, 2 and 3 specify "span { ... }" with author styles and
verify rendering results.
The case 4 specifies '<input type="file" />' with an author style,
text-align: end, and verify rendering result.

Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r116519 r116521  
     12012-05-09  Takashi Sakamoto  <tasak@google.com>
     2
     3        ShadowRoot needs applyAuthorStyles
     4        https://bugs.webkit.org/show_bug.cgi?id=78472
     5
     6        Reviewed by Hajime Morita.
     7
     8        * fast/dom/shadow/shadow-root-applyAuthorStyles.html:
     9        * fast/dom/shadow/shadow-root-applyAuthorStyles-expected.html:
     10        Tested four cases:
     11        case 1: applyAuthorStyles is false,
     12        case 2: applyAuthorStyles is true with <script>..</script>,
     13        case 3: applyAuthorStyles is true with inline script declaration, and
     14        case 4: applyAuthorStyles is true with important UA property.
     15        The case 1, 2 and 3 specify "span { ... }" with author styles and
     16        verify rendering results.
     17        The case 4 specifies '<input type="file" />' with an author style,
     18        text-align: end, and verify rendering result.
     19
    1202012-05-09  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    221
  • trunk/Source/WebCore/ChangeLog

    r116513 r116521  
     12012-05-09  Takashi Sakamoto  <tasak@google.com>
     2
     3        ShadowRoot needs applyAuthorStyles
     4        https://bugs.webkit.org/show_bug.cgi?id=78472
     5
     6        Reviewed by Hajime Morita.
     7
     8        Implemented applyAuthorStyles attribute defined in the following spec:
     9        http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-root-attributes
     10        Since applyAuthorSheets attribute has been already implemented,
     11        renamed all applyAuthorSheets to applyAuthorStyles and
     12        added applyAuthorStyles to ShadowRoot.idl.
     13        Currently, changing dynamically applyAuthorStyles doesn't work. I will fix this isse in bugs:84215: https://bugs.webkit.org/show_bug.cgi?id=84251
     14
     15        Test: fast/dom/shadow/shadow-root-applyAuthorStyles.html
     16              fast/dom/shadow/shadow-root-applyAuthorStyles-expected.html
     17
     18        * css/StyleResolver.cpp:
     19        (WebCore::StyleResolver::collectMatchingRulesForList):
     20        * dom/ShadowRoot.cpp:
     21        (WebCore::ShadowRoot::ShadowRoot):
     22        (WebCore::ShadowRoot::applyAuthorStyles):
     23        (WebCore::ShadowRoot::setApplyAuthorStyles):
     24        * dom/ShadowRoot.h:
     25        * dom/TreeScope.cpp:
     26        (WebCore::TreeScope::applyAuthorStyles):
     27        * dom/TreeScope.h:
     28        (TreeScope):
     29        Changed all applyAuthorSheets to applyAuthorSytles.
     30        (ShadowRoot):
     31        * dom/ShadowRoot.idl:
     32        Added a new attribute, boolean applyAuthorStyles.
     33
    1342012-05-09  Yoshifumi Inoue  <yosin@chromium.org>
    235
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r116471 r116521  
    10391039            TreeScope* treeScope = m_element->treeScope();
    10401040            if (!MatchingUARulesScope::isMatchingUARules()
    1041                 && !treeScope->applyAuthorSheets()
     1041                && !treeScope->applyAuthorStyles()
    10421042#if ENABLE(STYLE_SCOPED)
    10431043                && (!options.scope || options.scope->treeScope() != treeScope)
  • trunk/Source/WebCore/dom/ShadowRoot.cpp

    r116277 r116521  
    5050    , m_prev(0)
    5151    , m_next(0)
    52     , m_applyAuthorSheets(false)
     52    , m_applyAuthorStyles(false)
    5353    , m_insertionPointAssignedTo(0)
    5454{
     
    189189}
    190190
    191 bool ShadowRoot::applyAuthorSheets() const
    192 {
    193     return m_applyAuthorSheets;
    194 }
    195 
    196 void ShadowRoot::setApplyAuthorSheets(bool value)
    197 {
    198     m_applyAuthorSheets = value;
     191bool ShadowRoot::applyAuthorStyles() const
     192{
     193    return m_applyAuthorStyles;
     194}
     195
     196void ShadowRoot::setApplyAuthorStyles(bool value)
     197{
     198    m_applyAuthorStyles = value;
    199199}
    200200
  • trunk/Source/WebCore/dom/ShadowRoot.h

    r116277 r116521  
    6868    void hostChildrenChanged();
    6969
    70     virtual bool applyAuthorSheets() const;
    71     void setApplyAuthorSheets(bool);
     70    virtual bool applyAuthorStyles() const OVERRIDE;
     71    void setApplyAuthorStyles(bool);
    7272
    7373    Element* host() const { return shadowHost(); }
     
    105105    ShadowRoot* m_prev;
    106106    ShadowRoot* m_next;
    107     bool m_applyAuthorSheets : 1;
     107    bool m_applyAuthorStyles : 1;
    108108    InsertionPoint* m_insertionPointAssignedTo;
    109109};
  • trunk/Source/WebCore/dom/ShadowRoot.idl

    r113667 r116521  
    3636        readonly attribute Element activeElement;
    3737        readonly attribute DOMSelection selection;
     38        attribute boolean applyAuthorStyles;
    3839
    3940        attribute [TreatNullAs=NullString] DOMString innerHTML
  • trunk/Source/WebCore/dom/TreeScope.cpp

    r111672 r116521  
    140140}
    141141
    142 bool TreeScope::applyAuthorSheets() const
     142bool TreeScope::applyAuthorStyles() const
    143143{
    144144    return true;
  • trunk/Source/WebCore/dom/TreeScope.h

    r112978 r116521  
    7070    Element* findAnchor(const String& name);
    7171
    72     virtual bool applyAuthorSheets() const;
     72    virtual bool applyAuthorStyles() const;
    7373
    7474    // Used by the basic DOM mutation methods (e.g., appendChild()).
Note: See TracChangeset for help on using the changeset viewer.