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

Unified Diff: Source/core/layout/LayoutBlock.cpp

Issue 1230013003: Remove the (already disabled) OverflowChangedEvent runtime flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlock.cpp
diff --git a/Source/core/layout/LayoutBlock.cpp b/Source/core/layout/LayoutBlock.cpp
index 431f7599831f5c52c161c32cf917fb835a981be1..1c42b8f5f32f447357b160846bd0be3be5e05680 100644
--- a/Source/core/layout/LayoutBlock.cpp
+++ b/Source/core/layout/LayoutBlock.cpp
@@ -33,7 +33,6 @@
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
#include "core/editing/htmlediting.h"
-#include "core/events/OverflowEvent.h"
#include "core/fetch/ResourceLoadPriorityOptimizer.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -98,49 +97,6 @@ typedef WTF::HashSet<LayoutBlock*> DelayedUpdateScrollInfoSet;
static int gDelayUpdateScrollInfo = 0;
static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = nullptr;
-// This class helps dispatching the 'overflow' event on layout change. overflow can be set on LayoutBoxes, yet the existing code
-// only works on LayoutBlocks. If this changes, this class should be shared with other LayoutBoxes.
-class OverflowEventDispatcher {
- WTF_MAKE_NONCOPYABLE(OverflowEventDispatcher);
-public:
- OverflowEventDispatcher(const LayoutBlock* block)
- : m_block(block)
- , m_hadHorizontalLayoutOverflow(false)
- , m_hadVerticalLayoutOverflow(false)
- {
- m_shouldDispatchEvent = !m_block->isAnonymous() && m_block->hasOverflowClip() && m_block->document().hasListenerType(Document::OVERFLOWCHANGED_LISTENER);
- if (m_shouldDispatchEvent) {
- m_hadHorizontalLayoutOverflow = m_block->hasHorizontalLayoutOverflow();
- m_hadVerticalLayoutOverflow = m_block->hasVerticalLayoutOverflow();
- }
- }
-
- ~OverflowEventDispatcher()
- {
- if (!m_shouldDispatchEvent)
- return;
-
- bool hasHorizontalLayoutOverflow = m_block->hasHorizontalLayoutOverflow();
- bool hasVerticalLayoutOverflow = m_block->hasVerticalLayoutOverflow();
-
- bool horizontalLayoutOverflowChanged = hasHorizontalLayoutOverflow != m_hadHorizontalLayoutOverflow;
- bool verticalLayoutOverflowChanged = hasVerticalLayoutOverflow != m_hadVerticalLayoutOverflow;
-
- if (!horizontalLayoutOverflowChanged && !verticalLayoutOverflowChanged)
- return;
-
- RefPtrWillBeRawPtr<OverflowEvent> event = OverflowEvent::create(horizontalLayoutOverflowChanged, hasHorizontalLayoutOverflow, verticalLayoutOverflowChanged, hasVerticalLayoutOverflow);
- event->setTarget(m_block->node());
- m_block->document().enqueueAnimationFrameEvent(event.release());
- }
-
-private:
- const LayoutBlock* m_block;
- bool m_shouldDispatchEvent;
- bool m_hadHorizontalLayoutOverflow;
- bool m_hadVerticalLayoutOverflow;
-};
-
LayoutBlock::LayoutBlock(ContainerNode* node)
: LayoutBox(node)
, m_hasMarginBeforeQuirk(false)
@@ -896,7 +852,6 @@ void LayoutBlock::updateScrollInfoAfterLayout()
void LayoutBlock::layout()
{
LayoutAnalyzer::Scope analyzer(*this);
- OverflowEventDispatcher dispatcher(this);
// Table cells call layoutBlock directly, so don't add any logic here. Put code into
// layoutBlock().
« no previous file with comments | « Source/core/frame/UseCounter.cpp ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698