Changeset 137112 in webkit
- Timestamp:
- Dec 9, 2012 11:43:42 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r137106 r137112 1 2012-12-09 Takashi Sakamoto <tasak@google.com> 2 3 [Shadow DOM]: reset-style-inheritance doesn't work for insertion point 4 https://bugs.webkit.org/show_bug.cgi?id=103711 5 6 Reviewed by Hajime Morita. 7 8 * fast/dom/shadow/insertion-point-resetStyleInheritance-expected.txt: 9 * fast/dom/shadow/insertion-point-resetStyleInheritance.html: 10 Added two more basic tests to cover <content reset-style-inheritance> 11 and <shadow reset-style-inheritance>. 12 1 13 2012-12-09 Huang Dongsung <luxtella@company100.net> 2 14 -
trunk/LayoutTests/fast/dom/shadow/insertion-point-resetStyleInheritance-expected.txt
r131136 r137112 3 3 PASS window.getComputedStyle(document.getElementById("no-reset-style-inheritance").firstChild).backgroundColor is "rgba(0, 0, 0, 0)" 4 4 Test case: reset-style-inhertiace basic test. color value should be initial because insertion point's resetStyleInheritance is true. 5 PASS window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).color is "rgb(0, 0, 0)" 6 PASS window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).backgroundColor is "rgba(0, 0, 0, 0)" 7 Test case: make a content element reset-style-inhertiace by using its attribute. color value should be initial because insertion point's resetStyleInheritance is true. 8 PASS window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).color is "rgb(0, 0, 0)" 9 PASS window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).backgroundColor is "rgba(0, 0, 0, 0)" 10 Test case: make a shadow element reset-style-inhertiace by using its attribute. color value should be initial because insertion point's resetStyleInheritance is true. 5 11 PASS window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).color is "rgb(0, 0, 0)" 6 12 PASS window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).backgroundColor is "rgba(0, 0, 0, 0)" -
trunk/LayoutTests/fast/dom/shadow/insertion-point-resetStyleInheritance.html
r131136 r137112 31 31 32 32 shadowRoot.getElementById('content').resetStyleInheritance = true; 33 shouldBe('window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).color', '"rgb(0, 0, 0)"'); 34 shouldBe('window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).backgroundColor', '"rgba(0, 0, 0, 0)"'); 35 } 36 37 function testResetStyleInheritanceWithAttribute() { 38 debug("Test case: make a content element reset-style-inhertiace by using its attribute. color value should be initial because insertion point's resetStyleInheritance is true."); 39 var div = document.getElementById('reset-style-inheritance'); 40 41 var shadowRoot = new WebKitShadowRoot(div); 42 shadowRoot.innerHTML = '<content id="content" reset-style-inheritance></content>'; 43 44 shouldBe('window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).color', '"rgb(0, 0, 0)"'); 45 shouldBe('window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).backgroundColor', '"rgba(0, 0, 0, 0)"'); 46 } 47 48 function testShadowResetStyleInheritanceWithAttribute() { 49 debug("Test case: make a shadow element reset-style-inhertiace by using its attribute. color value should be initial because insertion point's resetStyleInheritance is true."); 50 var div = document.getElementById('reset-style-inheritance'); 51 52 var shadowRoot = new WebKitShadowRoot(div); 53 shadowRoot.innerHTML = '<shadow id="content" reset-style-inheritance></content>'; 54 33 55 shouldBe('window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).color', '"rgb(0, 0, 0)"'); 34 56 shouldBe('window.getComputedStyle(document.getElementById("reset-style-inheritance").firstChild).backgroundColor', '"rgba(0, 0, 0, 0)"'); … … 107 129 testNoResetStyleInheritance(); 108 130 testResetStyleInheritance(); 131 testResetStyleInheritanceWithAttribute(); 132 testShadowResetStyleInheritanceWithAttribute(); 109 133 testResetStyleInheritanceDynamic(); 110 134 testResetStyleInheritanceWithoutCrossingUpperBoundary() -
trunk/Source/WebCore/ChangeLog
r137108 r137112 1 2012-12-09 Takashi Sakamoto <tasak@google.com> 2 3 [Shadow DOM]: reset-style-inheritance doesn't work for insertion point 4 https://bugs.webkit.org/show_bug.cgi?id=103711 5 6 Reviewed by Hajime Morita. 7 8 reset-style-inheritance can be specified by using insertion points' 9 attribute, e.g. <content reset-style-inheritance>. 10 c.f. shadow dom spec: 11 https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles 12 13 No new tests. Updated an existing test, 14 fast/dom/shadow/insertion-point-resetStyleInheritance.html to cover 15 this feature. 16 17 * html/HTMLAttributeNames.in: 18 Added HTMLNames::reset_style_inheritanceAttr. 19 * html/shadow/InsertionPoint.cpp: 20 (WebCore::InsertionPoint::InsertionPoint): 21 (WebCore::InsertionPoint::parseAttribute): 22 Since both shadow and content elements have to support 23 reset-style-inheritance, added InsertionPoint::parseAttribute. 24 (WebCore::InsertionPoint::resetStyleInheritance): 25 (WebCore::InsertionPoint::setResetStyleInheritance): 26 Modified to update reset-style-inheritance attribute value. 27 * html/shadow/InsertionPoint.h: 28 (InsertionPoint): 29 Removed m_shouldResetStyleInheritance. Instead, use 30 reset-style-inheritance attribute value. 31 1 32 2012-12-09 Ilya Tikhonovsky <loislo@chromium.org> 2 33 -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r133396 r137112 279 279 rel 280 280 required 281 reset-style-inheritance 281 282 results 282 283 rev -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r136924 r137112 33 33 34 34 #include "ElementShadow.h" 35 #include "HTMLNames.h" 36 #include "QualifiedName.h" 35 37 #include "ShadowRoot.h" 36 38 #include "StaticNodeList.h" … … 38 40 namespace WebCore { 39 41 42 using namespace HTMLNames; 43 40 44 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document* document) 41 45 : HTMLElement(tagName, document, CreateInsertionPoint) 42 , m_shouldResetStyleInheritance(false)43 46 { 44 47 } … … 164 167 } 165 168 169 void InsertionPoint::parseAttribute(const QualifiedName& name, const AtomicString& value) 170 { 171 if (name == reset_style_inheritanceAttr) { 172 if (!inDocument() || !attached() || !isActive()) 173 return; 174 containingShadowRoot()->host()->setNeedsStyleRecalc(); 175 } else 176 HTMLElement::parseAttribute(name, value); 177 } 178 166 179 bool InsertionPoint::resetStyleInheritance() const 167 180 { 168 return m_shouldResetStyleInheritance;181 return fastHasAttribute(reset_style_inheritanceAttr); 169 182 } 170 183 171 184 void InsertionPoint::setResetStyleInheritance(bool value) 172 185 { 173 if (value != m_shouldResetStyleInheritance) { 174 m_shouldResetStyleInheritance = value; 175 if (attached() && isActive()) 176 containingShadowRoot()->host()->setNeedsStyleRecalc(); 177 } 186 setBooleanAttribute(reset_style_inheritanceAttr, value); 178 187 } 179 188 -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r135251 r137112 81 81 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 82 82 virtual void removedFrom(ContainerNode*) OVERRIDE; 83 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 83 84 84 85 private: 86 85 87 ContentDistribution m_distribution; 86 bool m_shouldResetStyleInheritance : 1;87 88 }; 88 89
Note: See TracChangeset
for help on using the changeset viewer.