| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 6532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6543 // Now set the active state for our new object up to the root. | 6543 // Now set the active state for our new object up to the root. |
| 6544 for (Element* curr = new_element; curr; | 6544 for (Element* curr = new_element; curr; |
| 6545 curr = FlatTreeTraversal::ParentElement(*curr)) { | 6545 curr = FlatTreeTraversal::ParentElement(*curr)) { |
| 6546 if (!must_be_in_active_chain || curr->InActiveChain()) | 6546 if (!must_be_in_active_chain || curr->InActiveChain()) |
| 6547 curr->SetActive(true); | 6547 curr->SetActive(true); |
| 6548 } | 6548 } |
| 6549 } | 6549 } |
| 6550 | 6550 |
| 6551 void Document::UpdateHoverState(const HitTestRequest& request, | 6551 void Document::UpdateHoverState(const HitTestRequest& request, |
| 6552 Element* inner_element_in_document) { | 6552 Element* inner_element_in_document) { |
| 6553 // Do not set hover state if event is from touch and on mobile. | |
| 6554 bool allow_hover_changes = | |
| 6555 !(request.TouchEvent() && GetPage() && | |
| 6556 GetPage()->GetVisualViewport().ShouldDisableDesktopWorkarounds()); | |
| 6557 | |
| 6558 Element* old_hover_element = HoverElement(); | 6553 Element* old_hover_element = HoverElement(); |
| 6559 | 6554 |
| 6560 // The passed in innerElement may not be a result of a hit test for the | 6555 // The passed in innerElement may not be a result of a hit test for the |
| 6561 // current up-to-date flat/layout tree. That means the element may be | 6556 // current up-to-date flat/layout tree. That means the element may be |
| 6562 // display:none at this point. Skip up the ancestor chain until we reach an | 6557 // display:none at this point. Skip up the ancestor chain until we reach an |
| 6563 // element with a layoutObject or a display:contents element. | 6558 // element with a layoutObject or a display:contents element. |
| 6564 Element* new_hover_element = | 6559 Element* new_hover_element = |
| 6565 SkipDisplayNoneAncestors(inner_element_in_document); | 6560 SkipDisplayNoneAncestors(inner_element_in_document); |
| 6566 | 6561 |
| 6567 // Update our current hover element. | 6562 // Update our current hover element. |
| 6568 if (allow_hover_changes) | 6563 SetHoverElement(new_hover_element); |
| 6569 SetHoverElement(new_hover_element); | |
| 6570 | 6564 |
| 6571 if (old_hover_element == new_hover_element || !allow_hover_changes) | 6565 if (old_hover_element == new_hover_element) |
| 6572 return; | 6566 return; |
| 6573 | 6567 |
| 6574 Node* ancestor_element = nullptr; | 6568 Node* ancestor_element = nullptr; |
| 6575 if (old_hover_element && old_hover_element->isConnected() && | 6569 if (old_hover_element && old_hover_element->isConnected() && |
| 6576 new_hover_element) { | 6570 new_hover_element) { |
| 6577 Node* ancestor = FlatTreeTraversal::CommonAncestor(*old_hover_element, | 6571 Node* ancestor = FlatTreeTraversal::CommonAncestor(*old_hover_element, |
| 6578 *new_hover_element); | 6572 *new_hover_element); |
| 6579 if (ancestor && ancestor->IsElementNode()) | 6573 if (ancestor && ancestor->IsElementNode()) |
| 6580 ancestor_element = ToElement(ancestor); | 6574 ancestor_element = ToElement(ancestor); |
| 6581 } | 6575 } |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6973 } | 6967 } |
| 6974 | 6968 |
| 6975 void showLiveDocumentInstances() { | 6969 void showLiveDocumentInstances() { |
| 6976 WeakDocumentSet& set = liveDocumentSet(); | 6970 WeakDocumentSet& set = liveDocumentSet(); |
| 6977 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6971 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6978 for (blink::Document* document : set) | 6972 for (blink::Document* document : set) |
| 6979 fprintf(stderr, "- Document %p URL: %s\n", document, | 6973 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6980 document->Url().GetString().Utf8().data()); | 6974 document->Url().GetString().Utf8().data()); |
| 6981 } | 6975 } |
| 6982 #endif | 6976 #endif |
| OLD | NEW |