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

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 82843003: Fire overflowchanged events at raf timing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a test Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 bool hasHorizontalLayoutOverflow = m_block->hasHorizontalLayoutOverflow( ); 122 bool hasHorizontalLayoutOverflow = m_block->hasHorizontalLayoutOverflow( );
123 bool hasVerticalLayoutOverflow = m_block->hasVerticalLayoutOverflow(); 123 bool hasVerticalLayoutOverflow = m_block->hasVerticalLayoutOverflow();
124 124
125 bool horizontalLayoutOverflowChanged = hasHorizontalLayoutOverflow != m_ hadHorizontalLayoutOverflow; 125 bool horizontalLayoutOverflowChanged = hasHorizontalLayoutOverflow != m_ hadHorizontalLayoutOverflow;
126 bool verticalLayoutOverflowChanged = hasVerticalLayoutOverflow != m_hadV erticalLayoutOverflow; 126 bool verticalLayoutOverflowChanged = hasVerticalLayoutOverflow != m_hadV erticalLayoutOverflow;
127 127
128 if (!horizontalLayoutOverflowChanged && !verticalLayoutOverflowChanged) 128 if (!horizontalLayoutOverflowChanged && !verticalLayoutOverflowChanged)
129 return; 129 return;
130 130
131 if (FrameView* frameView = m_block->frameView()) { 131 RefPtr<OverflowEvent> event = OverflowEvent::create(horizontalLayoutOver flowChanged, hasHorizontalLayoutOverflow, verticalLayoutOverflowChanged, hasVert icalLayoutOverflow);
132 RefPtr<OverflowEvent> event = OverflowEvent::create(horizontalLayout OverflowChanged, hasHorizontalLayoutOverflow, verticalLayoutOverflowChanged, has VerticalLayoutOverflow); 132 event->setTarget(m_block->node());
133 event->setTarget(m_block->node()); 133 m_block->document().enqueueAnimationFrameEvent(event.release());
134 frameView->scheduleOverflowEvent(event);
135 }
136 } 134 }
137 135
138 private: 136 private:
139 const RenderBlock* m_block; 137 const RenderBlock* m_block;
140 bool m_shouldDispatchEvent; 138 bool m_shouldDispatchEvent;
141 bool m_hadHorizontalLayoutOverflow; 139 bool m_hadHorizontalLayoutOverflow;
142 bool m_hadVerticalLayoutOverflow; 140 bool m_hadVerticalLayoutOverflow;
143 }; 141 };
144 142
145 RenderBlock::RenderBlock(ContainerNode* node) 143 RenderBlock::RenderBlock(ContainerNode* node)
(...skipping 5642 matching lines...) Expand 10 before | Expand all | Expand 10 after
5788 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5786 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5789 { 5787 {
5790 showRenderObject(); 5788 showRenderObject();
5791 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5789 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5792 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5790 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5793 } 5791 }
5794 5792
5795 #endif 5793 #endif
5796 5794
5797 } // namespace WebCore 5795 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698