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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFrame.cpp

Issue 2107043002: Schedule cursor update on URL cursor image loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eae's review Created 4 years, 5 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
Index: third_party/WebKit/Source/core/layout/LayoutFrame.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFrame.cpp b/third_party/WebKit/Source/core/layout/LayoutFrame.cpp
index 7f019f2d8f4c1c64ab5bd13748cc748a84ff7b13..768bd039e53fca555c0836878d639655b65cac88 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFrame.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFrame.cpp
@@ -24,7 +24,10 @@
#include "core/layout/LayoutFrame.h"
#include "core/frame/FrameView.h"
+#include "core/frame/LocalFrame.h"
#include "core/html/HTMLFrameElement.h"
+#include "core/input/EventHandler.h"
+#include "core/style/CursorData.h"
namespace blink {
@@ -40,6 +43,23 @@ FrameEdgeInfo LayoutFrame::edgeInfo() const
return FrameEdgeInfo(element->noResize(), element->hasFrameBorder());
}
+void LayoutFrame::imageChanged(WrappedImagePtr image, const IntRect*)
+{
+ if (const CursorList* cursors = style()->cursors()) {
+ for (const CursorData& cursor : *cursors) {
+ if (cursor.image() && cursor.image()->cachedImage() == image) {
+ if (LocalFrame* frame = this->frame()) {
+ // Cursor update scheduling is done by the local root, which is the main frame if there
+ // are no RemoteFrame ancestors in the frame tree. Use of localFrameRoot() is
+ // discouraged but will change when cursor update scheduling is moved from EventHandler
+ // to PageEventHandler.
+ frame->localFrameRoot()->eventHandler().scheduleCursorUpdate();
+ }
+ }
+ }
+ }
+}
+
void LayoutFrame::updateFromElement()
{
if (parent() && parent()->isFrameSet())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFrame.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698