Changeset 109096 in webkit
- Timestamp:
- Feb 28, 2012 3:36:37 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r109084 r109096 1 2012-02-28 Shinya Kawanaka <shinyak@chromium.org> 2 3 Element should be able to have multiple shadow roots. 4 https://bugs.webkit.org/show_bug.cgi?id=77931 5 6 Reviewed by Hajime Morita. 7 8 * Source/autotools/symbols.filter: 9 1 10 2012-02-27 Shinya Kawanaka <shinyak@chromium.org> 2 11 -
trunk/LayoutTests/ChangeLog
r109093 r109096 1 2012-02-28 Shinya Kawanaka <shinyak@chromium.org> 2 3 Element should be able to have multiple shadow roots. 4 https://bugs.webkit.org/show_bug.cgi?id=77931 5 6 Reviewed by Hajime Morita. 7 8 * fast/dom/resources/shadow-test-driver.js: 9 (createSpanWithText): 10 (doneTest): 11 (doTest): 12 * fast/dom/shadow/multiple-shadowroot-expected.txt: Added. 13 * fast/dom/shadow/multiple-shadowroot-rendering-expected.txt: Added. 14 * fast/dom/shadow/multiple-shadowroot-rendering.html: Added. 15 * fast/dom/shadow/multiple-shadowroot.html: Added. 16 * platform/efl/Skipped: 17 * platform/gtk/Skipped: 18 * platform/mac/Skipped: 19 * platform/qt/Skipped: 20 * platform/win/Skipped: 21 * platform/wincairo/Skipped: 22 * platform/wk2/Skipped: 23 1 24 2012-02-28 Yoshifumi Inoue <yosin@chromium.org> 2 25 -
trunk/LayoutTests/fast/dom/resources/shadow-test-driver.js
r106619 r109096 54 54 } 55 55 56 function createSpanWithText(text ) {56 function createSpanWithText(text, className) { 57 57 var span = document.createElement('span'); 58 58 span.appendChild(document.createTextNode(text)); 59 if (className) 60 span.className = className; 59 61 return span; 60 62 } … … 119 121 function doneTest() { 120 122 log("TEST COMPLETED"); 123 if (window.tearDownOnce) 124 window.tearDownOnce(); 121 125 layoutTestController.notifyDone(); 122 126 } … … 124 128 // A test driver. Call this body.onload. 125 129 function doTest(tests) { 130 if (window.setUpOnce) 131 window.setUpOnce(); 132 126 133 if (window.layoutTestController) { 127 134 layoutTestController.waitUntilDone(); -
trunk/LayoutTests/platform/efl/Skipped
r109039 r109096 2092 2092 fast/dom/shadow/shadow-root-attached.html 2093 2093 fast/dom/shadow/shadow-root-new.html 2094 fast/dom/shadow/multiple-shadowroot.html 2095 fast/dom/shadow/multiple-shadowroot-rendering.html 2094 2096 2095 2097 # CSS Filters support not yet enabled (needs ENABLE_CSS_FILTERS). -
trunk/LayoutTests/platform/mac/Skipped
r108980 r109096 431 431 fast/dom/shadow/shadow-root-new.html 432 432 fast/dom/shadow/shadow-ul-li.html 433 fast/dom/shadow/multiple-shadowroot.html 434 fast/dom/shadow/multiple-shadowroot-rendering.html 433 435 434 436 # JSC does not support setIsolatedWorldSecurityOrigin (http://webkit.org/b/61540) -
trunk/LayoutTests/platform/qt/Skipped
r109079 r109096 169 169 fast/dom/shadow/shadow-root-new.html 170 170 fast/dom/shadow/shadow-ul-li.html 171 fast/dom/shadow/multiple-shadowroot.html 172 fast/dom/shadow/multiple-shadowroot-rendering.html 171 173 172 174 # CSS Regions support not yet enabled. http://webkit.org/b/57312 -
trunk/LayoutTests/platform/win/Skipped
r108980 r109096 1460 1460 fast/dom/shadow/shadow-root-new.html 1461 1461 fast/dom/shadow/shadow-ul-li.html 1462 fast/dom/shadow/multiple-shadowroot.html 1463 fast/dom/shadow/multiple-shadowroot-rendering.html 1462 1464 1463 1465 # CSS Regions support not yet enabled. http://webkit.org/b/57312 -
trunk/LayoutTests/platform/wincairo/Skipped
r108272 r109096 1970 1970 fast/dom/shadow/shadow-root-attached.html 1971 1971 fast/dom/shadow/shadow-root-new.html 1972 fast/dom/shadow/multiple-shadowroot.html 1973 fast/dom/shadow/multiple-shadowroot-rendering.html 1972 1974 1973 1975 # CSS Regions support not yet enabled. http://webkit.org/b/57312 -
trunk/LayoutTests/platform/wk2/Skipped
r109055 r109096 1071 1071 fast/dom/shadow/shadow-root-new.html 1072 1072 fast/dom/shadow/shadow-ul-li.html 1073 fast/dom/shadow/multiple-shadowroot.html 1074 fast/dom/shadow/multiple-shadowroot-rendering.html 1073 1075 1074 1076 # WTR needs an implementation for eventSender.continuousMouseScrollBy -
trunk/Source/WebCore/ChangeLog
r109091 r109096 1 2012-02-28 Shinya Kawanaka <shinyak@chromium.org> 2 3 Element should be able to have multiple shadow roots. 4 https://bugs.webkit.org/show_bug.cgi?id=77931 5 6 Reviewed by Hajime Morita. 7 8 This patch enables us to add multiple shadow subtrees into elements. 9 Note that multiple shadow subtrees are enabled 10 only if RuntimeEnabledFeatures::multipleShadowSubtrees is enabled. 11 12 Since we don't have <shadow> element yet, only the youngest shadow tree 13 will be rendered. This patch includes tests to confirm adding a new shadow 14 tree dynamically to confirm only the youngest shadow tree is renderered. 15 16 Tests: fast/dom/shadow/multiple-shadowroot-rendering.html 17 fast/dom/shadow/multiple-shadowroot.html 18 19 * WebCore.exp.in: 20 * dom/Element.cpp: 21 Uses ShadowRootList interfaces directly instead of ShadowRootList emulation methods. 22 (WebCore::Element::~Element): 23 (WebCore::Element::attach): 24 (WebCore::Element::addShadowRoot): 25 (WebCore::Element::removeShadowRootList): 26 * dom/Element.h: 27 (Element): 28 * dom/NodeRenderingContext.cpp: 29 Makes non-youngest shadow subtrees hidden. 30 (WebCore::NodeRenderingContext::NodeRenderingContext): 31 (WebCore::NodeRenderingContext::hostChildrenChanged): 32 Since non-youngest children may be changed, make sure host children are changed. 33 * dom/ShadowRoot.cpp: 34 (WebCore::ShadowRoot::create): 35 * dom/ShadowRoot.h: 36 Utility methods to make code intention clear are added. 37 (WebCore::ShadowRoot::youngerShadowRoot): 38 (WebCore::ShadowRoot::olderShadowRoot): 39 (ShadowRoot): 40 (WebCore::ShadowRoot::isYoungest): 41 (WebCore::ShadowRoot::isOldest): 42 * dom/ShadowRootList.cpp: 43 (WebCore::ShadowRootList::popShadowRoot): 44 (WebCore::ShadowRootList::attach): 45 (WebCore::ShadowRootList::detach): 46 Detaches shadow subtrees. 47 * testing/Internals.cpp: 48 (WebCore::Internals::address): 49 (WebCore): 50 (WebCore::Internals::youngerShadowRoot): 51 (WebCore::Internals::olderShadowRoot): 52 (WebCore::Internals::removeShadowRoot): 53 * testing/Internals.h: 54 (Internals): 55 * testing/Internals.idl: 56 1 57 2012-02-28 Antti Koivisto <antti@apple.com> 2 58 -
trunk/Source/WebCore/dom/Element.cpp
r109084 r109096 61 61 #include "RenderView.h" 62 62 #include "RenderWidget.h" 63 #include "RuntimeEnabledFeatures.h" 63 64 #include "Settings.h" 64 65 #include "ShadowRoot.h" … … 932 933 shadowTree()->attach(); 933 934 934 // In a shadow tree, some of light children may be attached by 'content' element.935 // In a shadow tree, some of light children may be attached by <content> or <shadow>. 935 936 // However, when there is no content element or content element does not select 936 937 // all light children, we have to attach the rest of light children here. -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r108959 r109096 58 58 59 59 if (parent->isShadowRoot()) { 60 m_phase = AttachingShadowChild; 60 // FIXME: We don't support <shadow> yet, so the non-youngest shadow won't be rendered. 61 // https://bugs.webkit.org/shod_bugs.cgi?id=78596 62 if (toShadowRoot(parent)->isYoungest()) 63 m_phase = AttachingShadowChild; 64 else 65 m_phase = AttachingNotDistributed; 61 66 m_parentNodeForRenderingAndStyle = parent->shadowHost(); 62 67 return; … … 68 73 if ((m_insertionPoint = m_visualParentShadowTree->insertionPointFor(m_node)) 69 74 && m_visualParentShadowTree->isSelectorActive()) { 70 m_phase = AttachingDistributed; 71 m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_insertionPoint).parentNodeForRenderingAndStyle(); 72 return; 75 76 // FIXME: We don't support <shadow> yet, so the non-youngest shadow won't be rendered. 77 // https://bugs.webkit.org/show_bugs.cgi?id=78596 78 if (toShadowRoot(m_insertionPoint->shadowTreeRootNode())->isYoungest()) { 79 m_phase = AttachingDistributed; 80 m_parentNodeForRenderingAndStyle = NodeRenderingContext(m_insertionPoint).parentNodeForRenderingAndStyle(); 81 return; 82 } 73 83 } 74 84 … … 261 271 void NodeRenderingContext::hostChildrenChanged() 262 272 { 263 if (m_phase == AttachingNotDistributed )273 if (m_phase == AttachingNotDistributed && m_visualParentShadowTree) 264 274 m_visualParentShadowTree->hostChildrenChanged(); 265 275 } -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r109084 r109096 185 185 } 186 186 187 void ShadowRoot::attach()188 {189 // Children of m_selector is populated lazily in190 // ensureSelector(), and here we just ensure that191 // it is in clean state.192 // FIXME: This assertion breaks if multiple shadow roots are being attached.193 // ShadowTree should have responsibility of side effect of selector in attaching/detaching.194 ASSERT(!tree()->selector() || !tree()->selector()->hasCandidates());195 DocumentFragment::attach();196 if (HTMLContentSelector* selector = tree()->selector())197 selector->didSelect();198 187 } 199 200 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r108959 r109096 65 65 void hostChildrenChanged(); 66 66 67 virtual void attach();68 69 67 virtual bool applyAuthorSheets() const; 70 68 void setApplyAuthorSheets(bool); … … 75 73 ShadowRoot* youngerShadowRoot() const { return prev(); } 76 74 ShadowRoot* olderShadowRoot() const { return next(); } 75 76 bool isYoungest() const { return !youngerShadowRoot(); } 77 bool isOldest() const { return !olderShadowRoot(); } 77 78 78 79 bool hasContentElement() const; -
trunk/Source/WebCore/dom/ShadowTree.cpp
r109084 r109096 110 110 111 111 oldRoot->setShadowHost(0); 112 oldRoot->setPrev(0); 113 oldRoot->setNext(0); 112 114 shadowHost->document()->adoptIfNeeded(oldRoot.get()); 113 115 if (oldRoot->inDocument()) … … 157 159 void ShadowTree::attach() 158 160 { 159 // FIXME: Currently we only support the case that the shadow root list has at most one shadow root.160 // See also https://bugs.webkit.org/show_bug.cgi?id=77503 and its dependent bugs.161 ASSERT( m_shadowRoots.size() <= 1);161 // Children of m_selector is populated lazily in 162 // ensureSelector(), and here we just ensure that it is in clean state. 163 ASSERT(!selector() || !selector()->hasCandidates()); 162 164 163 165 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { … … 165 167 root->attach(); 166 168 } 169 170 if (HTMLContentSelector* contentSelector = selector()) 171 contentSelector->didSelect(); 167 172 } 168 173 169 174 void ShadowTree::detach() 170 175 { 171 // FIXME: Currently we only support the case that the shadow root list has at most one shadow root.172 // See also https://bugs.webkit.org/show_bug.cgi?id=77503 and its dependent bugs.173 ASSERT(m_shadowRoots.size() <= 1);174 175 176 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) { 176 177 if (root->attached()) -
trunk/Source/WebCore/testing/Internals.cpp
r109084 r109096 120 120 } 121 121 122 String Internals::address(Node* node) 123 { 124 char buf[32]; 125 sprintf(buf, "%p", node); 126 127 return String(buf); 128 } 129 122 130 bool Internals::isPreloaded(Document* document, const String& url) 123 131 { … … 240 248 241 249 return host->shadowTree()->oldestShadowRoot(); 250 } 251 252 Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::youngerShadowRoot(Node* shadow, ExceptionCode& ec) 253 { 254 if (!shadow || !shadow->isShadowRoot()) { 255 ec = INVALID_ACCESS_ERR; 256 return 0; 257 } 258 259 return toShadowRoot(shadow)->youngerShadowRoot(); 260 } 261 262 Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::olderShadowRoot(Node* shadow, ExceptionCode& ec) 263 { 264 if (!shadow || !shadow->isShadowRoot()) { 265 ec = INVALID_ACCESS_ERR; 266 return 0; 267 } 268 269 return toShadowRoot(shadow)->olderShadowRoot(); 242 270 } 243 271 -
trunk/Source/WebCore/testing/Internals.h
r108831 r109096 56 56 String elementRenderTreeAsText(Element*, ExceptionCode&); 57 57 58 String address(Node*); 59 58 60 bool isPreloaded(Document*, const String& url); 59 61 … … 69 71 ShadowRootIfShadowDOMEnabledOrNode* youngestShadowRoot(Element* host, ExceptionCode&); 70 72 ShadowRootIfShadowDOMEnabledOrNode* oldestShadowRoot(Element* host, ExceptionCode&); 73 ShadowRootIfShadowDOMEnabledOrNode* youngerShadowRoot(Node* shadow, ExceptionCode&); 74 ShadowRootIfShadowDOMEnabledOrNode* olderShadowRoot(Node* shadow, ExceptionCode&); 71 75 void removeShadowRoot(Element* host, ExceptionCode&); 72 76 void setMultipleShadowSubtreesEnabled(bool); -
trunk/Source/WebCore/testing/Internals.idl
r108831 r109096 28 28 OmitConstructor 29 29 ] Internals { 30 DOMString address(in Node node); 31 30 32 DOMString elementRenderTreeAsText(in Element element) raises(DOMException); 31 33 boolean isPreloaded(in Document document, in DOMString url); … … 38 40 ShadowRoot youngestShadowRoot(in Element host) raises (DOMException); 39 41 ShadowRoot oldestShadowRoot(in Element host) raises (DOMException); 42 ShadowRoot youngerShadowRoot(in Node root) raises (DOMException); 43 ShadowRoot olderShadowRoot(in Node root) raises (DOMException); 40 44 #else 41 45 Node ensureShadowRoot(in Element host) raises (DOMException); … … 43 47 Node youngestShadowRoot(in Element host) raises (DOMException); 44 48 Node oldestShadowRoot(in Element host) raises (DOMException); 49 Node youngerShadowRoot(in Node root) raises (DOMException); 50 Node youngerShadowRoot(in Node root) raises (DOMException); 45 51 #endif 46 52 void setMultipleShadowSubtreesEnabled(in boolean enabled); -
trunk/Source/WebKit2/ChangeLog
r109094 r109096 1 2012-02-28 Shinya Kawanaka <shinyak@chromium.org> 2 3 Element should be able to have multiple shadow roots. 4 https://bugs.webkit.org/show_bug.cgi?id=77931 5 6 Reviewed by Hajime Morita. 7 8 * win/WebKit2.def: 9 * win/WebKit2CFLite.def: 10 1 11 2012-02-28 Hugo Parente Lima <hugo.lima@openbossa.org> 2 12 -
trunk/Source/WebKit2/win/WebKit2.def
r109084 r109096 178 178 ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z 179 179 ?removeAllShadowRoots@ShadowTree@WebCore@@QAEXXZ 180 ?s_info@JSNode@WebCore@@2UClassInfo@JSC@@B 180 181 ?scriptExecutionContext@JSDOMGlobalObject@WebCore@@QBEPAVScriptExecutionContext@2@XZ 181 182 ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r109084 r109096 170 170 ?paintControlTints@FrameView@WebCore@@AAEXXZ 171 171 ?rangeFromLocationAndLength@TextIterator@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@PAVElement@2@HH_N@Z 172 ?removeAllShadowRoots@ShadowTree@WebCore@@QAEXXZ 172 ?removeShadowRootList@Element@WebCore@@QAEXXZ 173 ?s_info@JSNode@WebCore@@2UClassInfo@JSC@@B 173 174 ?scriptExecutionContext@JSDOMGlobalObject@WebCore@@QBEPAVScriptExecutionContext@2@XZ 174 175 ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z -
trunk/Source/autotools/symbols.filter
r109084 r109096 68 68 _ZN7WebCore6JSNode6s_infoE; 69 69 _ZN7WebCore6toNodeEN3JSC7JSValueE; 70 _ZN7WebCore7Element20removeShadowRootListEv; 70 71 _ZN7WebCore7toRangeEN3JSC7JSValueE; 71 72 _ZN7WebCore9JSElement10putVirtualEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
Note: See TracChangeset
for help on using the changeset viewer.