Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Shadow DOM] HTMLContentElement and HTMLShadowElement constructors sh…
…ould be visible.

https://bugs.webkit.org/show_bug.cgi?id=87818

Source/WebCore:

Reviewed by Kentaro Hara.

Added them as DOMWindow properties

Tests: fast/dom/shadow/content-element-api.html
       fast/dom/shadow/shadow-element.html

* page/DOMWindow.idl:

LayoutTests:

Added constructor checks.

Reviewed by Kentaro Hara.

* fast/dom/shadow/content-element-api-expected.txt:
* fast/dom/shadow/content-element-api.html:
* fast/dom/shadow/shadow-element-expected.txt:
* fast/dom/shadow/shadow-element.html:


Canonical link: https://commits.webkit.org/105626@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
omo committed May 30, 2012
1 parent 4554bf2 commit ec43e09
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
2012-05-30 MORITA Hajime <morrita@google.com>

[Shadow DOM] HTMLContentElement and HTMLShadowElement constructors should be visible.
https://bugs.webkit.org/show_bug.cgi?id=87818

Added constructor checks.

Reviewed by Kentaro Hara.

* fast/dom/shadow/content-element-api-expected.txt:
* fast/dom/shadow/content-element-api.html:
* fast/dom/shadow/shadow-element-expected.txt:
* fast/dom/shadow/shadow-element.html:

2012-05-30 Mike Lawther <mikelawther@chromium.org>

CSS3 calc: Implement CSSOM support
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/fast/dom/shadow/content-element-api-expected.txt
Expand Up @@ -6,6 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS contentSimplest.select is ''
PASS contentSimplest.select is 'foo'
PASS contentSimplest.getAttribute('select') is 'bar'
PASS 0 <= contentSimplest.constructor.toString().indexOf('HTMLContentElement') is true
PASS typeof window.HTMLContentElement is 'function'
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/fast/dom/shadow/content-element-api.html
Expand Up @@ -15,6 +15,8 @@
shouldBe("contentSimplest.select", "'foo'");
contentSimplest.select = "bar"
shouldBe("contentSimplest.getAttribute('select')", "'bar'");
shouldBeTrue("0 <= contentSimplest.constructor.toString().indexOf('HTMLContentElement')");
shouldBe("typeof window.HTMLContentElement", "'function'");
</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
Expand Down
2 changes: 2 additions & 0 deletions LayoutTests/fast/dom/shadow/shadow-element-expected.txt
Expand Up @@ -4,6 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE


PASS shadow.nodeName is 'SHADOW'
PASS 0 <= shadow.constructor.toString().indexOf('HTMLShadowElement') is true
PASS typeof window.HTMLShadowElement is 'function'
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
5 changes: 3 additions & 2 deletions LayoutTests/fast/dom/shadow/shadow-element.html
Expand Up @@ -9,10 +9,11 @@
</div>
<script>
description("This test ensures that the shadow element is available.")
// Since shadow element does not have its own APIS, it acts like a normal element.
// We don't have to guard this by SHADOW_DOM flag for now.
var shadow = document.getElementById("shadow");
shouldBe("shadow.nodeName", "'SHADOW'");
shouldBeTrue("0 <= shadow.constructor.toString().indexOf('HTMLShadowElement')");
shouldBe("typeof window.HTMLShadowElement", "'function'");

</script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
Expand Down
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
2012-05-30 MORITA Hajime <morrita@google.com>

[Shadow DOM] HTMLContentElement and HTMLShadowElement constructors should be visible.
https://bugs.webkit.org/show_bug.cgi?id=87818

Reviewed by Kentaro Hara.

Added them as DOMWindow properties

Tests: fast/dom/shadow/content-element-api.html
fast/dom/shadow/shadow-element.html

* page/DOMWindow.idl:

2012-05-30 Mike Lawther <mikelawther@chromium.org>

CSS3 calc: Implement CSSOM support
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/page/DOMWindow.idl
Expand Up @@ -388,6 +388,8 @@ module window {
attribute EntityReferenceConstructor EntityReference;
attribute ProcessingInstructionConstructor ProcessingInstruction;
attribute [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] ShadowRootConstructor WebKitShadowRoot;
attribute [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] HTMLContentElementConstructor HTMLContentElement;
attribute [Conditional=SHADOW_DOM, V8EnabledPerContext=shadowDOM] HTMLShadowElementConstructor HTMLShadowElement;

attribute DOMSelectionConstructor Selection;
attribute DOMWindowConstructor Window;
Expand Down

0 comments on commit ec43e09

Please sign in to comment.