Commit 6035923a authored by hayato@chromium.org's avatar hayato@chromium.org

Don't expose WebKitShadowRoot constructor.

It's time to expose only ShadowRoot constructor.
The chromium side patch is here: https://codereview.chromium.org/217013005/.

BUG=242153

Review URL: https://codereview.chromium.org/216123005

git-svn-id: svn://svn.chromium.org/blink/trunk@170580 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 536b12c0
...@@ -41,7 +41,7 @@ function isShadowHost(node) ...@@ -41,7 +41,7 @@ function isShadowHost(node)
function isShadowRoot(node) function isShadowRoot(node)
{ {
return node instanceof window.WebKitShadowRoot; return node instanceof window.ShadowRoot;
} }
function isIframeElement(element) function isIframeElement(element)
......
...@@ -4,11 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ...@@ -4,11 +4,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS window.ShadowRoot is defined. PASS window.ShadowRoot is defined.
PASS window.WebKitShadowRoot is defined.
PASS new window.ShadowRoot(document.createElement('div')) threw exception TypeError: Illegal constructor. PASS new window.ShadowRoot(document.createElement('div')) threw exception TypeError: Illegal constructor.
PASS new window.WebKitShadowRoot(document.createElement('div')) threw exception TypeError: Illegal constructor.
PASS shadowRoot instanceof window.ShadowRoot is true PASS shadowRoot instanceof window.ShadowRoot is true
PASS shadowRoot instanceof window.WebKitShadowRoot is true
PASS shadowRoot.getElementById('div1') is div1 PASS shadowRoot.getElementById('div1') is div1
PASS shadowRoot.getElementById('foo') is null PASS shadowRoot.getElementById('foo') is null
PASS shadowRoot.getElementsByClassName('class2') is [div2] PASS shadowRoot.getElementsByClassName('class2') is [div2]
......
...@@ -15,19 +15,15 @@ description("Tests for ShadowRoot JS APIs. Can only run within DRT"); ...@@ -15,19 +15,15 @@ description("Tests for ShadowRoot JS APIs. Can only run within DRT");
if (window.testRunner) if (window.testRunner)
testRunner.dumpAsText(); testRunner.dumpAsText();
// WebKitShadowRoot is always available, while ShadowRoot is available when a run-time flag is set
// (which is always enabled in testing). // (which is always enabled in testing).
shouldBeDefined("window.ShadowRoot"); shouldBeDefined("window.ShadowRoot");
shouldBeDefined("window.WebKitShadowRoot");
shouldThrow("new window.ShadowRoot(document.createElement('div'))"); shouldThrow("new window.ShadowRoot(document.createElement('div'))");
shouldThrow("new window.WebKitShadowRoot(document.createElement('div'))");
var shadowHost = document.createElement('div'); var shadowHost = document.createElement('div');
document.body.appendChild(shadowHost); document.body.appendChild(shadowHost);
var shadowRoot = shadowHost.createShadowRoot(); var shadowRoot = shadowHost.createShadowRoot();
shouldBeTrue("shadowRoot instanceof window.ShadowRoot"); shouldBeTrue("shadowRoot instanceof window.ShadowRoot");
shouldBeTrue("shadowRoot instanceof window.WebKitShadowRoot");
var div1 = document.createElement("div"); var div1 = document.createElement("div");
div1.setAttribute("id", "div1"); div1.setAttribute("id", "div1");
......
...@@ -447,7 +447,6 @@ WebKitGamepad ...@@ -447,7 +447,6 @@ WebKitGamepad
WebKitMediaSource WebKitMediaSource
WebKitMutationObserver WebKitMutationObserver
WebKitPoint WebKitPoint
WebKitShadowRoot
WebKitSourceBuffer WebKitSourceBuffer
WebKitSourceBufferList WebKitSourceBufferList
WebKitTransitionEvent WebKitTransitionEvent
......
...@@ -470,7 +470,6 @@ WebKitGamepad ...@@ -470,7 +470,6 @@ WebKitGamepad
WebKitMediaSource WebKitMediaSource
WebKitMutationObserver WebKitMutationObserver
WebKitPoint WebKitPoint
WebKitShadowRoot
WebKitSourceBuffer WebKitSourceBuffer
WebKitSourceBufferList WebKitSourceBufferList
WebKitTransitionEvent WebKitTransitionEvent
......
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
[ interface ShadowRoot : DocumentFragment {
NoInterfaceObject
] interface ShadowRoot : DocumentFragment {
readonly attribute Element activeElement; readonly attribute Element activeElement;
[ImplementedAs=olderShadowRootForBindings] readonly attribute ShadowRoot olderShadowRoot; [ImplementedAs=olderShadowRootForBindings] readonly attribute ShadowRoot olderShadowRoot;
......
...@@ -230,13 +230,6 @@ ...@@ -230,13 +230,6 @@
[RuntimeEnabled=ScriptedSpeech] attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent; [RuntimeEnabled=ScriptedSpeech] attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent;
[Conditional=WEB_AUDIO] attribute PannerNodeConstructor webkitAudioPannerNode; [Conditional=WEB_AUDIO] attribute PannerNodeConstructor webkitAudioPannerNode;
// Prefixed ShadowRoot constructor should be phased out eventually, but for the moment it must be always exposed.
// Unprefixed ShadowRoot constructor should be visible when the feature flag is enabled.
// FIXME: When it's ready to remove WebKitShadowRoot, get rid of both constructors from Window.idl and remove
// [NoInterfaceObject] from ShadowRoot interface definition.
attribute ShadowRootConstructor ShadowRoot;
[MeasureAs=PrefixedShadowRootConstructor] attribute ShadowRootConstructor WebKitShadowRoot;
// window.toString() requires special handling in V8 // window.toString() requires special handling in V8
[DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString(); [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment