Changeset 101987 in webkit


Ignore:
Timestamp:
Dec 5, 2011 3:48:28 AM (12 years ago)
Author:
rolandsteiner@chromium.org
Message:

<style scoped>: Add 'scoped' attribute
https://bugs.webkit.org/show_bug.cgi?id=67718

Source/WebCore:

Add 'scoped' attribute to IDL and attribute list,
implement and test setting/resetting of the attribute.

Reviewed by Antti Koivisto.

Test: fast/css/style-scoped/basic-attribute.html

  • html/HTMLAttributeNames.in:
  • html/HTMLStyleElement.cpp:

(WebCore::HTMLStyleElement::scoped):
(WebCore::HTMLStyleElement::setScoped):
(WebCore::HTMLStyleElement::scopingElement):

  • html/HTMLStyleElement.h:
  • html/HTMLStyleElement.idl:

LayoutTests:

Test setting/resetting of the 'scoped' attribute in various circumstances.
Disable test directory, since STYLE_SCOPED is not enabled by default.

Reviewed by Antti Koivisto.

  • fast/css/style-scoped/basic-attribute-expected.txt: Added.
  • fast/css/style-scoped/basic-attribute.html: Added.
  • platform/chromium/test_expectations.txt:
  • platform/efl/Skipped:
  • platform/gtk/Skipped:
  • platform/mac/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
  • platform/wincairo/Skipped:
Location:
trunk
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101986 r101987  
     12011-12-05  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        <style scoped>: Add 'scoped' attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=67718
     5
     6        Test setting/resetting of the 'scoped' attribute in various circumstances.
     7        Disable test directory, since STYLE_SCOPED is not enabled by default.
     8
     9        Reviewed by Antti Koivisto.
     10
     11        * fast/css/style-scoped/basic-attribute-expected.txt: Added.
     12        * fast/css/style-scoped/basic-attribute.html: Added.
     13        * platform/chromium/test_expectations.txt:
     14        * platform/efl/Skipped:
     15        * platform/gtk/Skipped:
     16        * platform/mac/Skipped:
     17        * platform/qt/Skipped:
     18        * platform/win/Skipped:
     19        * platform/wincairo/Skipped:
     20
    1212011-12-05  Vsevolod Vlasov  <vsevik@chromium.org>
    222
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r101984 r101987  
    31963196BUGWK68729 SKIP : fast/mutation = PASS
    31973197
     3198// <style scoped> not yet enabled.
     3199BUGWK49142 SKIP: fast/css/style-scoped = PASS
     3200
    31983201BUGCR85755 : fast/js/exception-properties.html = TEXT
    31993202
  • trunk/LayoutTests/platform/efl/Skipped

    r101916 r101987  
    18901890fast/css-grid-layout
    18911891
     1892# <style scoped> is not yet enabled. http://webkit.org/b/49142
     1893fast/css/style-scoped
     1894
    18921895# CSS Filters support not yet enabled (needs ENABLE_CSS_FILTERS).
    18931896# https://bugs.webkit.org/show_bug.cgi?id=68469
  • trunk/LayoutTests/platform/gtk/Skipped

    r101978 r101987  
    353353# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
    354354fast/css-grid-layout
     355
     356# <style scoped> is not yet enabled. http://webkit.org/b/49142
     357fast/css/style-scoped
    355358
    356359# CSS Regions support not yet enabled. http://webkit.org/b/57312
  • trunk/LayoutTests/platform/mac/Skipped

    r101855 r101987  
    420420fast/css-grid-layout
    421421
     422# <style scoped> is not yet enabled. http://webkit.org/b/49142
     423fast/css/style-scoped
     424
    422425# JSC does not support setIsolatedWorldSecurityOrigin (http://webkit.org/b/61540)
    423426http/tests/security/isolatedWorld/cross-origin-xhr.html
  • trunk/LayoutTests/platform/qt/Skipped

    r101978 r101987  
    160160# CSS Grid Layout is not yet enabled. http://webkit.org/b/60731
    161161fast/css-grid-layout
     162
     163# <style scoped> is not yet enabled. http://webkit.org/b/49142
     164fast/css/style-scoped
    162165
    163166# CSS Regions support not yet enabled. http://webkit.org/b/57312
  • trunk/LayoutTests/platform/win/Skipped

    r101855 r101987  
    14001400fast/css-grid-layout
    14011401
     1402# <style scoped> is not yet enabled. http://webkit.org/b/49142
     1403fast/css/style-scoped
     1404
    14021405# CSS Regions support not yet enabled. http://webkit.org/b/57312
    14031406fast/regions
  • trunk/LayoutTests/platform/wincairo/Skipped

    r101128 r101987  
    19111911fast/css-grid-layout
    19121912
     1913# <style scoped> is not yet enabled. http://webkit.org/b/49142
     1914fast/css/style-scoped
     1915
    19131916# CSS Regions support not yet enabled. http://webkit.org/b/57312
    19141917fast/regions
  • trunk/Source/WebCore/ChangeLog

    r101983 r101987  
     12011-12-05  Roland Steiner  <rolandsteiner@chromium.org>
     2
     3        <style scoped>: Add 'scoped' attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=67718
     5
     6        Add 'scoped' attribute to IDL and attribute list,
     7        implement and test setting/resetting of the attribute.
     8
     9        Reviewed by Antti Koivisto.
     10
     11        Test: fast/css/style-scoped/basic-attribute.html
     12
     13        * html/HTMLAttributeNames.in:
     14        * html/HTMLStyleElement.cpp:
     15        (WebCore::HTMLStyleElement::scoped):
     16        (WebCore::HTMLStyleElement::setScoped):
     17        (WebCore::HTMLStyleElement::scopingElement):
     18        * html/HTMLStyleElement.h:
     19        * html/HTMLStyleElement.idl:
     20
    1212011-12-05  Hajime Morrita  <morrita@chromium.org>
    222
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r100965 r101987  
    274274scheme
    275275scope
     276scoped
    276277scrollamount
    277278scrolldelay
  • trunk/Source/WebCore/html/HTMLStyleElement.cpp

    r98208 r101987  
    9595}
    9696
     97#if ENABLE(STYLE_SCOPED)
     98bool HTMLStyleElement::scoped() const
     99{
     100    return fastHasAttribute(scopedAttr);
     101}
     102
     103void HTMLStyleElement::setScoped(bool scopedValue)
     104{
     105    setBooleanAttribute(scopedAttr, scopedValue);
     106}
     107
     108Element* HTMLStyleElement::scopingElement() const
     109{
     110    if (!scoped())
     111        return 0;
     112
     113    // FIXME: This probably needs to be refined for scoped stylesheets within shadow DOM.
     114    // As written, such a stylesheet could style the host element, as well as children of the host.
     115    // OTOH, this paves the way for a :bound-element implementation.
     116    ContainerNode* parentOrHost = parentOrHostNode();
     117    if (!parentOrHost || !parentOrHost->isElementNode())
     118        return 0;
     119
     120    return toElement(parentOrHost);
     121}
     122#endif // ENABLE(STYLE_SCOPED)
     123
    97124void HTMLStyleElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
    98125{   
  • trunk/Source/WebCore/html/HTMLStyleElement.h

    r94813 r101987  
    3838    void setType(const AtomicString&);
    3939
     40#if ENABLE(STYLE_SCOPED)
     41    bool scoped() const;
     42    void setScoped(bool);
     43    Element* scopingElement() const;
     44#endif
     45
    4046    using StyleElement::sheet;
    4147
  • trunk/Source/WebCore/html/HTMLStyleElement.idl

    r94813 r101987  
    2323    interface HTMLStyleElement : HTMLElement {
    2424        attribute boolean disabled;
     25        attribute [Conditional=STYLE_SCOPED] boolean scoped;
    2526        attribute [Reflect] DOMString media;
    2627        attribute [Reflect] DOMString type;
Note: See TracChangeset for help on using the changeset viewer.