[Webkit-unassigned] [Bug 81102] blur() on shadow host should work when a shadow host contains a focused element in its shadow DOM subtrees.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 15 20:35:55 PDT 2012


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





--- Comment #3 from Hayato Ito <hayato at chromium.org>  2012-03-15 20:35:54 PST ---
(From update of attachment 132048)
View in context: https://bugs.webkit.org/attachment.cgi?id=132048&action=review

> Source/WebCore/dom/Element.cpp:1600
> +    } else if (hasShadowRoot()) {

You can make this function more simple, avoiding duplication of duplication L1616-1619.
Element::blur could be:

void Element::blur()
{
  ...
  Node* focused = doc->focusedNode();
  ...
  if (hasShadowRoot) {
    ...
    ..
    // Omit L1616-1619
  }

  if (focused != this)
   return;

  if (doc->frame())
      doc->frame()->page()->focusController()->setFocusedNode(0, doc->frame());
  else
      doc->setFocusedNode(0);
}

> LayoutTests/fast/dom/shadow/shadow-root-blur-expected.txt:1
> +This tests the activeElement property of a ShadowRoot.

Need to update.

> LayoutTests/fast/dom/shadow/shadow-root-blur.html:31
> +// First ShodowHost

It's optional, but you might want to use some functions on LayoutTests/fast/dom/shadow/resources/shadow-dom.js.
Using createDOM and createShadowRoot, you don't have to construct Shadow DOM tree manually and make tree in one expression.

That helps reviewers to understand the tree structure easily and you don't have to add comments which only explain the tree structure.

> LayoutTests/fast/dom/shadow/shadow-root-blur.html:73
> +evalAndLog("shadowHostInside.blur();");

Could you add the following test case?

shouldBe("childInTreeTwo.focus();document.activeElement", "shadowHost");
evalAndLog("shadowHost.blur();");
shouldBe(...);
shouldBe(...);
...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list