Title: [153700] trunk/Source/WebCore
- Revision
- 153700
- Author
- [email protected]
- Date
- 2013-08-04 09:17:32 -0700 (Sun, 04 Aug 2013)
Log Message
Document needn't expose its active element.
<http://webkit.org/b/119466>
Reviewed by Antonio Gomes.
The Document::m_activeElement pointer is only used inside updateHoverActiveState(),
so we can remove the activeElement()/setActiveElement() accessors.
* dom/Document.h:
* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (153699 => 153700)
--- trunk/Source/WebCore/ChangeLog 2013-08-04 15:57:13 UTC (rev 153699)
+++ trunk/Source/WebCore/ChangeLog 2013-08-04 16:17:32 UTC (rev 153700)
@@ -1,5 +1,19 @@
2013-08-04 Andreas Kling <[email protected]>
+ Document needn't expose its active element.
+ <http://webkit.org/b/119466>
+
+ Reviewed by Antonio Gomes.
+
+ The Document::m_activeElement pointer is only used inside updateHoverActiveState(),
+ so we can remove the activeElement()/setActiveElement() accessors.
+
+ * dom/Document.h:
+ * dom/Document.cpp:
+ (WebCore::Document::updateHoverActiveState):
+
+2013-08-04 Andreas Kling <[email protected]>
+
Inserting a rule into an empty style sheet shouldn't trigger style recalc unless necessary.
<http://webkit.org/b/119475>
<rdar://problem/14643481>
Modified: trunk/Source/WebCore/dom/Document.cpp (153699 => 153700)
--- trunk/Source/WebCore/dom/Document.cpp 2013-08-04 15:57:13 UTC (rev 153699)
+++ trunk/Source/WebCore/dom/Document.cpp 2013-08-04 16:17:32 UTC (rev 153700)
@@ -3217,16 +3217,6 @@
}
}
-void Document::setActiveElement(PassRefPtr<Element> newActiveElement)
-{
- if (!newActiveElement) {
- m_activeElement.clear();
- return;
- }
-
- m_activeElement = newActiveElement;
-}
-
void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly)
{
if (!m_focusedElement || this->inPageCache()) // If the document is in the page cache, then we don't need to clear out the focused node.
@@ -5806,7 +5796,7 @@
innerElementInDocument = innerElementInDocument->document()->ownerElement();
}
- Element* oldActiveElement = activeElement();
+ Element* oldActiveElement = m_activeElement.get();
if (oldActiveElement && !request.active()) {
// We are clearing the :active chain because the mouse has been released.
for (RenderObject* curr = oldActiveElement->renderer(); curr; curr = curr->parent()) {
@@ -5816,7 +5806,7 @@
element->setActive(false);
m_userActionElements.setInActiveChain(element, false);
}
- setActiveElement(0);
+ m_activeElement.clear();
} else {
Element* newActiveElement = innerElementInDocument;
if (!oldActiveElement && newActiveElement && request.active() && !request.touchMove()) {
@@ -5828,12 +5818,12 @@
m_userActionElements.setInActiveChain(toElement(curr->node()), true);
}
- setActiveElement(newActiveElement);
+ m_activeElement = newActiveElement;
}
}
// If the mouse has just been pressed, set :active on the chain. Those (and only those)
// nodes should remain :active until the mouse is released.
- bool allowActiveChanges = !oldActiveElement && activeElement();
+ bool allowActiveChanges = !oldActiveElement && m_activeElement;
// If the mouse is down and if this is a mouse move event, we want to restrict changes in
// :hover/:active to only apply to elements that are in the :active chain that we froze
Modified: trunk/Source/WebCore/dom/Document.h (153699 => 153700)
--- trunk/Source/WebCore/dom/Document.h 2013-08-04 15:57:13 UTC (rev 153699)
+++ trunk/Source/WebCore/dom/Document.h 2013-08-04 16:17:32 UTC (rev 153700)
@@ -678,9 +678,6 @@
bool ignoreAutofocus() const { return m_ignoreAutofocus; };
void setIgnoreAutofocus(bool shouldIgnore = true) { m_ignoreAutofocus = shouldIgnore; };
- void setActiveElement(PassRefPtr<Element>);
- Element* activeElement() const { return m_activeElement.get(); }
-
void removeFocusedNodeOfSubtree(Node*, bool amongChildrenOnly = false);
void hoveredElementDidDetach(Element*);
void elementInActiveChainDidDetach(Element*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes