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
+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
'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);
}
}
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"]');
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
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();
// 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]);
'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);
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()