| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index 8a3c55dc5d609d6304bf5fcb54fc2baa967b7c1f..a570a858fd96fe6ea9eb68a6b1f8e116d024db06 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -199,20 +199,13 @@ void Element::clearElementFlag(ElementFlags mask)
|
|
|
| void Element::clearTabIndexExplicitlyIfNeeded()
|
| {
|
| - if (hasRareData()) {
|
| + if (hasRareData())
|
| elementRareData()->clearTabIndexExplicitly();
|
| - // As tabindex is removed, unless there is an tabstop attribute,
|
| - // revert tabstop to default to match tabindex at this point (0).
|
| - if (!fastHasAttribute(tabstopAttr))
|
| - setTabStopInternal(true);
|
| - }
|
| }
|
|
|
| void Element::setTabIndexExplicitly(short tabIndex)
|
| {
|
| ensureElementRareData().setTabIndexExplicitly(tabIndex);
|
| - if (!fastHasAttribute(tabstopAttr))
|
| - setTabStopInternal(tabIndex >= 0);
|
| }
|
|
|
| void Element::setTabIndex(int value)
|
| @@ -2059,27 +2052,6 @@ void Element::parseAttribute(const QualifiedName& name, const AtomicString& valu
|
| // Clamp tabindex to the range of 'short' to match Firefox's behavior.
|
| setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), std::min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
|
| }
|
| - } else if (RuntimeEnabledFeatures::tabStopAttributeEnabled() && name == tabstopAttr) {
|
| - UseCounter::count(document(), UseCounter::TabStopAttribute);
|
| - if (!hasAttribute(tabstopAttr)) {
|
| - // tabstop attribute removed.
|
| - clearElementFlag(TabStopWasSetExplicitly);
|
| - setTabStopInternal(tabIndex() >= 0);
|
| - } else {
|
| - // Treat empty attribute as true.
|
| - if (equalIgnoringCase(value, "true") || equalIgnoringCase(value, "")) {
|
| - setElementFlag(TabStopWasSetExplicitly, true);
|
| - setTabStopInternal(true);
|
| - } else if (equalIgnoringCase(value, "false")) {
|
| - setElementFlag(TabStopWasSetExplicitly, true);
|
| - setTabStopInternal(false);
|
| - } else {
|
| - // When value is other than "true", "false", "", the value is ignored and
|
| - // falls back the default state.
|
| - clearElementFlag(TabStopWasSetExplicitly);
|
| - setTabStopInternal(tabIndex() >= 0);
|
| - }
|
| - }
|
| }
|
| }
|
|
|
| @@ -2216,18 +2188,6 @@ void Element::focus(bool restorePreviousSelection, WebFocusType type)
|
| if (!isFocusable())
|
| return;
|
|
|
| - if (shadowRoot() && tabIndex() >= 0 && !tabStop()) {
|
| - if (containsIncludingShadowDOM(document().focusedElement()))
|
| - return;
|
| -
|
| - // Slide the focus to its inner node.
|
| - Node* next = document().page()->focusController().findFocusableNode(WebFocusTypeForward, *this);
|
| - if (next && next->isElementNode() && containsIncludingShadowDOM(next)) {
|
| - toElement(next)->focus(false, WebFocusTypeForward);
|
| - return;
|
| - }
|
| - }
|
| -
|
| RefPtrWillBeRawPtr<Node> protect(this);
|
| if (!document().page()->focusController().setFocusedElement(this, document().frame(), type))
|
| return;
|
| @@ -2332,28 +2292,6 @@ bool Element::isMouseFocusable() const
|
| return isFocusable();
|
| }
|
|
|
| -bool Element::tabStop() const
|
| -{
|
| - if (hasElementFlag(TabStopWasSetExplicitly))
|
| - return elementRareData()->tabStop();
|
| - return tabIndex() >= 0;
|
| -}
|
| -
|
| -void Element::setTabStop(bool flag)
|
| -{
|
| - // Reflect the value in the HTML attribute. Note that we cannot use setBooleanAttribute()
|
| - // because the tabstop attribute is an enumerated attribute.
|
| - // After tabstop attribute is set, the property value is modified accordingly.
|
| - setAttribute(tabstopAttr, flag ? "true" : "false");
|
| -}
|
| -
|
| -void Element::setTabStopInternal(bool flag)
|
| -{
|
| - ensureElementRareData().setTabStop(flag);
|
| - if (shadowRoot() && shadowRoot()->containsIncludingShadowDOM(document().focusedElement()))
|
| - setFocus(true);
|
| -}
|
| -
|
| bool Element::isFocusedElementInDocument() const
|
| {
|
| return this == document().focusedElement();
|
|
|