Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: Source/core/html/HTMLLabelElement.cpp

Issue 1064543002: Set hovered state of current Hovered node even if it is also common ancestor of oldHovered node and (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Incorporated review comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLabelElement.cpp
diff --git a/Source/core/html/HTMLLabelElement.cpp b/Source/core/html/HTMLLabelElement.cpp
index 6aed87286ccee9e02cdd6aa6651e72f46a2cb094..8900abd58a74bd22187bfa7b0b5f4460410f3b96 100644
--- a/Source/core/html/HTMLLabelElement.cpp
+++ b/Source/core/html/HTMLLabelElement.cpp
@@ -86,28 +86,28 @@ HTMLFormElement* HTMLLabelElement::formOwner() const
void HTMLLabelElement::setActive(bool down)
{
- if (down == active())
- return;
-
- // Update our status first.
- HTMLElement::setActive(down);
+ if (down != active()) {
+ // Update our status first.
+ HTMLElement::setActive(down);
+ }
// Also update our corresponding control.
- if (HTMLElement* element = control())
- element->setActive(down);
+ HTMLElement* controlElement = control();
+ if (controlElement && controlElement->active() != active())
+ controlElement->setActive(active());
}
void HTMLLabelElement::setHovered(bool over)
{
- if (over == hovered())
- return;
-
- // Update our status first.
- HTMLElement::setHovered(over);
+ if (over != hovered()) {
+ // Update our status first.
+ HTMLElement::setHovered(over);
+ }
// Also update our corresponding control.
- if (HTMLElement* element = control())
- element->setHovered(over);
+ HTMLElement* element = control();
+ if (element && element->hovered() != hovered())
+ element->setHovered(hovered());
}
bool HTMLLabelElement::isInteractiveContent() const
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698