Rename getElementInShadowTreeStack to getNodeInShadowTreeStack
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 07:06:04 +0000 (07:06 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 07:06:04 +0000 (07:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81324

Since getElementInShadowTreeStack returns ShadowRoot as well which is not an element
it should be renamed to getNodeInShadowTreeStack.

Patch by Kaustubh Atrawalkar <kaustubh@motorola.com> on 2012-03-21
Reviewed by Hajime Morita.

* fast/dom/shadow/access-key.html:
* fast/dom/shadow/get-element-by-id-in-shadow-root-expected.txt:
* fast/dom/shadow/get-element-by-id-in-shadow-root.html:
* fast/dom/shadow/resources/shadow-dom.js:
(getNodeInShadowTreeStack):
* fast/dom/shadow/shadow-boundary-events.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111505 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/access-key.html
LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root-expected.txt
LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html
LayoutTests/fast/dom/shadow/resources/shadow-dom.js
LayoutTests/fast/dom/shadow/shadow-boundary-events.html

index 2804159e60648790dea4280547f5b1e07f275f5d..b50ae4685586f1662853b90ff83857b88fc40d80 100644 (file)
@@ -1,3 +1,20 @@
+2012-03-21  Kaustubh Atrawalkar  <kaustubh@motorola.com>
+
+        Rename getElementInShadowTreeStack to getNodeInShadowTreeStack
+        https://bugs.webkit.org/show_bug.cgi?id=81324
+
+        Since getElementInShadowTreeStack returns ShadowRoot as well which is not an element
+        it should be renamed to getNodeInShadowTreeStack.
+
+        Reviewed by Hajime Morita.
+
+        * fast/dom/shadow/access-key.html:
+        * fast/dom/shadow/get-element-by-id-in-shadow-root-expected.txt:
+        * fast/dom/shadow/get-element-by-id-in-shadow-root.html:
+        * fast/dom/shadow/resources/shadow-dom.js:
+        (getNodeInShadowTreeStack):
+        * fast/dom/shadow/shadow-boundary-events.html:
+
 2012-03-20  Keishi Hattori  <keishi@webkit.org>
 
         Adding MISSING to platform/qt for platform/qt/plugins/application-plugin-plugins-disabled.html
index f096185bc096a326a94e337c2a0c217b959d5ee8..6c198bc791f8873f23d5b47043b1856efe1b1205 100644 (file)
@@ -61,7 +61,7 @@ function prepareDOMTree(parent)
                'shadowC/inputD', 'shadowC/inputE',
                'shadowC/shadowF/inputG'];
     for (var i = 0; i < ids.length; ++i) {
-        var element = getElementInShadowTreeStack(ids[i]);
+        var element = getNodeInShadowTreeStack(ids[i]);
         element.addEventListener('focus', recordEvent, false);
     }
 }
@@ -82,12 +82,12 @@ function test()
     pressAccessKey('a');
     shouldBe('dispatchedEvent("focus")', '["inputE"]');
 
-    getElementInShadowTreeStack('shadowC/inputD').focus();
+    getNodeInShadowTreeStack('shadowC/inputD').focus();
     clearEventRecords();
     pressAccessKey('a');
     shouldBe('dispatchedEvent("focus")', '["inputE"]');
 
-    getElementInShadowTreeStack('shadowC/shadowF/inputG').focus();
+    getNodeInShadowTreeStack('shadowC/shadowF/inputG').focus();
     clearEventRecords();
     pressAccessKey('a');
     shouldBe('dispatchedEvent("focus")', '["inputE"]');
index 34d22e3cb0b4335fad786867a76be9c064e648f7..a37448dd9feefc37936fed3e15adb20a8ae45c6e 100644 (file)
@@ -3,11 +3,11 @@ Tests to ensure that internals.getElementByIdInShadowRoot can get an element in
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS getElementInShadowTreeStack('divA/inputB').id is "inputB"
-PASS getElementInShadowTreeStack('divA/divC').id is "divC"
-PASS getElementInShadowTreeStack('divA/divC/inputD').id is "inputD"
-PASS getElementInShadowTreeStack('divA/divC//inputE').id is "inputE"
-PASS getElementInShadowTreeStack('divA/divC///inputF').id is "inputF"
+PASS getNodeInShadowTreeStack('divA/inputB').id is "inputB"
+PASS getNodeInShadowTreeStack('divA/divC').id is "divC"
+PASS getNodeInShadowTreeStack('divA/divC/inputD').id is "inputD"
+PASS getNodeInShadowTreeStack('divA/divC//inputE').id is "inputE"
+PASS getNodeInShadowTreeStack('divA/divC///inputF').id is "inputF"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 93370f95f3ac9626f0d1763955b9dbed44f33d3c..14ffde3be3284b08db172a8cd30c824dac28bf9e 100644 (file)
@@ -29,11 +29,11 @@ function test()
         layoutTestController.dumpAsText();
 
     prepareDomTree(document.body);
-    shouldBeEqualToString("getElementInShadowTreeStack('divA/inputB').id", 'inputB');
-    shouldBeEqualToString("getElementInShadowTreeStack('divA/divC').id", 'divC');
-    shouldBeEqualToString("getElementInShadowTreeStack('divA/divC/inputD').id", 'inputD');
-    shouldBeEqualToString("getElementInShadowTreeStack('divA/divC//inputE').id", 'inputE');
-    shouldBeEqualToString("getElementInShadowTreeStack('divA/divC///inputF').id", 'inputF');
+    shouldBeEqualToString("getNodeInShadowTreeStack('divA/inputB').id", 'inputB');
+    shouldBeEqualToString("getNodeInShadowTreeStack('divA/divC').id", 'divC');
+    shouldBeEqualToString("getNodeInShadowTreeStack('divA/divC/inputD').id", 'inputD');
+    shouldBeEqualToString("getNodeInShadowTreeStack('divA/divC//inputE').id", 'inputE');
+    shouldBeEqualToString("getNodeInShadowTreeStack('divA/divC///inputF').id", 'inputF');
 }
 
 test();
index 31d601f3061baaf442462d91ada3e46c1ef6deb1..15576021299e13f390d43134310e55b3aa13403e 100644 (file)
@@ -42,7 +42,7 @@ function isShadowRoot(node)
 
 // You can spefify youngerShadowRoot by consecutive slashes.
 // See LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-root.html for actual usages.
-function getElementInShadowTreeStack(path)
+function getNodeInShadowTreeStack(path)
 {
     var ids = path.split('/');
     var node = document.getElementById(ids[0]);
index 303e7c1dc530b94aac7490098be094ba0b5250d7..ec2e2f808ada0a60754a49c80bc993a85a25c1d9 100644 (file)
@@ -89,7 +89,7 @@ function prepareDOMTree(parent)
                'shadowD/shadowF/shadowG/divH', 'shadowD/shadowF/shadowG/divI',
                'shadowD/divJ', 'shadowD/shadowK', 'shadowD/shadowK/divL'];
     for (var i = 0; i < ids.length; ++i) {
-        var element = getElementInShadowTreeStack(ids[i]);
+        var element = getNodeInShadowTreeStack(ids[i]);
         element.addEventListener('mouseover', recordEvent, false);
         element.addEventListener('mouseout', recordEvent, false);
         element.addEventListener('focusin', recordEvent, false);
@@ -102,17 +102,17 @@ function prepareDOMTree(parent)
 function moveMouse(oldElementId, newElementId, message)
 {
     debug('\n' + message + '\n' + 'Moving mouse from ' + oldElementId + ' to ' + newElementId);
-    moveMouseOver(getElementInShadowTreeStack(oldElementId));
+    moveMouseOver(getNodeInShadowTreeStack(oldElementId));
     clearEventRecords();
-    moveMouseOver(getElementInShadowTreeStack(newElementId));
+    moveMouseOver(getNodeInShadowTreeStack(newElementId));
 }
 
 function moveFocus(oldElementId, newElementId, message)
 {
     debug('\n' + message + '\n' + 'Moving focus from ' + oldElementId + ' to ' + newElementId);
-    getElementInShadowTreeStack(oldElementId).focus();
+    getNodeInShadowTreeStack(oldElementId).focus();
     clearEventRecords();
-    getElementInShadowTreeStack(newElementId).focus();
+    getNodeInShadowTreeStack(newElementId).focus();
 }
 
 function test()