Changeset 106208 in webkit
- Timestamp:
- Jan 29, 2012 7:47:32 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r106206 r106208 1 2012-01-29 Hayato Ito <hayato@chromium.org> 2 3 Add a ShadowRoot constructor as 'WebKitShadowRootConstructor', enabled by SHADOW_DOM flag. 4 https://bugs.webkit.org/show_bug.cgi?id=76354 5 6 Reviewed by Hajime Morita. 7 8 We use vendor-prefixed name, 'WebKitShadowRoot', instead of 'ShadowRoot' 9 since this is a feature under development. 10 11 * fast/dom/shadow/shadow-root-js-api.html: 12 1 13 2012-01-29 Yuzo Fujishima <yuzo@google.com> 2 14 -
trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt
r105500 r106208 4 4 5 5 6 PASS new WebKitShadowRoot() threw exception TypeError: Not enough arguments. 7 PASS new WebKitShadowRoot(undefined) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. 8 PASS new WebKitShadowRoot(null) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. 9 PASS new WebKitShadowRoot(1) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. 10 PASS shadowHost is shadowRoot.host 11 PASS new WebKitShadowRoot(shadowHost) threw exception Error: HIERARCHY_REQUEST_ERR: DOM Exception 3. 12 The previous test should not have side effects. 6 13 PASS shadowHost is shadowRoot.host 7 14 PASS successfullyParsed is true -
trunk/LayoutTests/fast/dom/shadow/shadow-root-js-api.html
r105500 r106208 11 11 if (window.layoutTestController) 12 12 layoutTestController.dumpAsText(); 13 shouldThrow("new WebKitShadowRoot()"); 14 shouldThrow("new WebKitShadowRoot(undefined)"); 15 shouldThrow("new WebKitShadowRoot(null)"); 16 shouldThrow("new WebKitShadowRoot(1)"); 13 17 var shadowHost = document.createElement('div'); 14 internals.ensureShadowRoot(shadowHost); 15 var shadowRoot = internals.shadowRoot(shadowHost); 18 var shadowRoot = new WebKitShadowRoot(shadowHost); 19 shouldBe("shadowHost", "shadowRoot.host"); 20 shouldThrow("new WebKitShadowRoot(shadowHost)"); 21 debug('The previous test should not have side effects.'); 16 22 shouldBe("shadowHost", "shadowRoot.host"); 17 23 -
trunk/Source/WebCore/ChangeLog
r106203 r106208 1 2012-01-29 Hayato Ito <hayato@chromium.org> 2 3 Add a ShadowRoot constructor as 'WebKitShadowRootConstructor', enabled by SHADOW_DOM flag. 4 https://bugs.webkit.org/show_bug.cgi?id=76354 5 6 Reviewed by Hajime Morita. 7 8 We use vendor-prefixed name, 'WebKitShadowRoot', instead of 'ShadowRoot' 9 since this is a feature under development. 10 11 * dom/ShadowRoot.cpp: 12 (WebCore::ShadowRoot::create): 13 (WebCore): 14 * dom/ShadowRoot.h: 15 (WebCore): 16 (ShadowRoot): 17 * dom/ShadowRoot.idl: 18 * page/DOMWindow.idl: 19 1 20 2012-01-29 Noel Gordon <noel.gordon@gmail.com> 2 21 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r105249 r106208 52 52 ShadowRoot::~ShadowRoot() 53 53 { 54 } 55 56 PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ExceptionCode& ec) 57 { 58 if (!element || element->shadowRoot()) { 59 ec = HIERARCHY_REQUEST_ERR; 60 return 0; 61 } 62 RefPtr<ShadowRoot> shadowRoot = create(element->document()); 63 element->setShadowRoot(shadowRoot, ec); 64 if (ec) 65 return 0; 66 return shadowRoot.release(); 54 67 } 55 68 -
trunk/Source/WebCore/dom/ShadowRoot.h
r105500 r106208 28 28 #define ShadowRoot_h 29 29 30 #include "ExceptionCode.h" 30 31 #include "TreeScope.h" 31 32 32 33 namespace WebCore { 33 34 35 class ContentInclusionSelector; 34 36 class Document; 35 37 class HTMLContentElement; 36 class ContentInclusionSelector;37 38 38 39 class ShadowRoot : public TreeScope { 39 40 public: 40 41 static PassRefPtr<ShadowRoot> create(Document*); 42 static PassRefPtr<ShadowRoot> create(Element*, ExceptionCode&); 41 43 42 44 void recalcShadowTreeStyle(StyleChange); -
trunk/Source/WebCore/dom/ShadowRoot.idl
r105500 r106208 29 29 interface [ 30 30 Conditional=SHADOW_DOM, 31 EnabledAtRuntime=shadowDOM 31 EnabledAtRuntime=shadowDOM, 32 Constructor(in Element host), 33 ConstructorRaisesException 32 34 ] ShadowRoot : Node { 33 35 readonly attribute Element host; -
trunk/Source/WebCore/page/DOMWindow.idl
r106087 r106208 399 399 attribute EntityReferenceConstructor EntityReference; 400 400 attribute ProcessingInstructionConstructor ProcessingInstruction; 401 attribute [Conditional=SHADOW_DOM, EnabledAtRuntime=shadowDOM] ShadowRootConstructor WebKitShadowRoot; 401 402 402 403 attribute HTMLDocumentConstructor HTMLDocument;
Note: See TracChangeset
for help on using the changeset viewer.