diff --git a/engine/core/core.gni b/engine/core/core.gni index bcf15cd31e4..19a1bc07dc4 100644 --- a/engine/core/core.gni +++ b/engine/core/core.gni @@ -650,8 +650,6 @@ sky_core_files = [ "events/MouseRelatedEvent.cpp", "events/NodeEventContext.cpp", "events/NodeEventContext.h", - "events/OverflowEvent.cpp", - "events/OverflowEvent.h", "events/PageTransitionEvent.cpp", "events/PageTransitionEvent.h", "events/PopStateEvent.cpp", @@ -1296,7 +1294,6 @@ core_idl_files = get_path_info([ "events/HashChangeEvent.idl", "events/KeyboardEvent.idl", "events/MouseEvent.idl", - "events/OverflowEvent.idl", "events/PageTransitionEvent.idl", "events/PopStateEvent.idl", "events/ProgressEvent.idl", @@ -1416,7 +1413,6 @@ core_event_idl_files = get_path_info([ "events/HashChangeEvent.idl", "events/KeyboardEvent.idl", "events/MouseEvent.idl", - "events/OverflowEvent.idl", "events/PageTransitionEvent.idl", "events/PopStateEvent.idl", "events/ProgressEvent.idl", diff --git a/engine/core/events/OverflowEvent.cpp b/engine/core/events/OverflowEvent.cpp deleted file mode 100644 index ae61705817a..00000000000 --- a/engine/core/events/OverflowEvent.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "core/events/OverflowEvent.h" - -namespace blink { - -OverflowEventInit::OverflowEventInit() - : orient(0) - , horizontalOverflow(false) - , verticalOverflow(false) -{ -} - -OverflowEvent::OverflowEvent() - : Event(EventTypeNames::overflowchanged, false, false) - , m_orient(VERTICAL) - , m_horizontalOverflow(false) - , m_verticalOverflow(false) -{ - ScriptWrappable::init(this); -} - -OverflowEvent::OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow) - : Event(EventTypeNames::overflowchanged, false, false) - , m_horizontalOverflow(horizontalOverflow) - , m_verticalOverflow(verticalOverflow) -{ - ASSERT(horizontalOverflowChanged || verticalOverflowChanged); - ScriptWrappable::init(this); - - if (horizontalOverflowChanged && verticalOverflowChanged) - m_orient = BOTH; - else if (horizontalOverflowChanged) - m_orient = HORIZONTAL; - else - m_orient = VERTICAL; -} - -OverflowEvent::OverflowEvent(const AtomicString& type, const OverflowEventInit& initializer) - : Event(type, initializer) - , m_orient(initializer.orient) - , m_horizontalOverflow(initializer.horizontalOverflow) - , m_verticalOverflow(initializer.verticalOverflow) -{ - ScriptWrappable::init(this); -} - -const AtomicString& OverflowEvent::interfaceName() const -{ - return EventNames::OverflowEvent; -} - -void OverflowEvent::trace(Visitor* visitor) -{ - Event::trace(visitor); -} - -} diff --git a/engine/core/events/OverflowEvent.h b/engine/core/events/OverflowEvent.h deleted file mode 100644 index 25582658b66..00000000000 --- a/engine/core/events/OverflowEvent.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef OverflowEvent_h -#define OverflowEvent_h - -#include "core/events/Event.h" - -namespace blink { - -struct OverflowEventInit : public EventInit { - OverflowEventInit(); - - unsigned short orient; - bool horizontalOverflow; - bool verticalOverflow; -}; - -class OverflowEvent FINAL : public Event { - DEFINE_WRAPPERTYPEINFO(); -public: - enum orientType { - HORIZONTAL = 0, - VERTICAL = 1, - BOTH = 2 - }; - - static PassRefPtrWillBeRawPtr create() - { - return adoptRefWillBeNoop(new OverflowEvent); - } - static PassRefPtrWillBeRawPtr create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow) - { - return adoptRefWillBeNoop(new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow)); - } - static PassRefPtrWillBeRawPtr create(const AtomicString& type, const OverflowEventInit& initializer) - { - return adoptRefWillBeNoop(new OverflowEvent(type, initializer)); - } - - unsigned short orient() const { return m_orient; } - bool horizontalOverflow() const { return m_horizontalOverflow; } - bool verticalOverflow() const { return m_verticalOverflow; } - - virtual const AtomicString& interfaceName() const OVERRIDE; - - virtual void trace(Visitor*) OVERRIDE; - -private: - OverflowEvent(); - OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow); - OverflowEvent(const AtomicString&, const OverflowEventInit&); - - unsigned short m_orient; - bool m_horizontalOverflow; - bool m_verticalOverflow; -}; - -} // namespace blink - -#endif // OverflowEvent_h diff --git a/engine/core/events/OverflowEvent.idl b/engine/core/events/OverflowEvent.idl deleted file mode 100644 index be779e4e48a..00000000000 --- a/engine/core/events/OverflowEvent.idl +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - EventConstructor, -] interface OverflowEvent : Event { - const unsigned short HORIZONTAL = 0; - const unsigned short VERTICAL = 1; - const unsigned short BOTH = 2; - - [InitializedByEventConstructor] readonly attribute unsigned short orient; - [InitializedByEventConstructor] readonly attribute boolean horizontalOverflow; - [InitializedByEventConstructor] readonly attribute boolean verticalOverflow; -}; - diff --git a/engine/core/frame/FrameView.cpp b/engine/core/frame/FrameView.cpp index 69de4fdfb29..87694f3c8b3 100644 --- a/engine/core/frame/FrameView.cpp +++ b/engine/core/frame/FrameView.cpp @@ -31,7 +31,6 @@ #include "core/css/resolver/StyleResolver.h" #include "core/dom/DocumentMarkerController.h" #include "core/editing/FrameSelection.h" -#include "core/events/OverflowEvent.h" #include "core/fetch/ResourceFetcher.h" #include "core/fetch/ResourceLoadPriorityOptimizer.h" #include "core/frame/FrameHost.h" @@ -1474,19 +1473,6 @@ void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverf m_overflowStatusDirty = false; return; } - - bool horizontalOverflowChanged = (m_horizontalOverflow != horizontalOverflow); - bool verticalOverflowChanged = (m_verticalOverflow != verticalOverflow); - - if (horizontalOverflowChanged || verticalOverflowChanged) { - m_horizontalOverflow = horizontalOverflow; - m_verticalOverflow = verticalOverflow; - - RefPtrWillBeRawPtr event = OverflowEvent::create(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow); - event->setTarget(m_viewportRenderer->node()); - m_frame->document()->enqueueAnimationFrameEvent(event.release()); - } - } IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) const diff --git a/engine/core/rendering/RenderBlock.cpp b/engine/core/rendering/RenderBlock.cpp index 5a9d2774e78..8d526a5ace6 100644 --- a/engine/core/rendering/RenderBlock.cpp +++ b/engine/core/rendering/RenderBlock.cpp @@ -30,7 +30,6 @@ #include "core/dom/shadow/ShadowRoot.h" #include "core/editing/Editor.h" #include "core/editing/FrameSelection.h" -#include "core/events/OverflowEvent.h" #include "core/fetch/ResourceLoadPriorityOptimizer.h" #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" @@ -85,49 +84,6 @@ typedef WTF::HashSet DelayedUpdateScrollInfoSet; static int gDelayUpdateScrollInfo = 0; static DelayedUpdateScrollInfoSet* gDelayedUpdateScrollInfoSet = 0; -// This class helps dispatching the 'overflow' event on layout change. overflow can be set on RenderBoxes, yet the existing code -// only works on RenderBlocks. If this changes, this class should be shared with other RenderBoxes. -class OverflowEventDispatcher { - WTF_MAKE_NONCOPYABLE(OverflowEventDispatcher); -public: - OverflowEventDispatcher(const RenderBlock* 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 event = OverflowEvent::create(horizontalLayoutOverflowChanged, hasHorizontalLayoutOverflow, verticalLayoutOverflowChanged, hasVerticalLayoutOverflow); - event->setTarget(m_block->node()); - m_block->document().enqueueAnimationFrameEvent(event.release()); - } - -private: - const RenderBlock* m_block; - bool m_shouldDispatchEvent; - bool m_hadHorizontalLayoutOverflow; - bool m_hadVerticalLayoutOverflow; -}; - RenderBlock::RenderBlock(ContainerNode* node) : RenderBox(node) , m_hasMarginBeforeQuirk(false) @@ -1016,8 +972,6 @@ void RenderBlock::updateScrollInfoAfterLayout() void RenderBlock::layout() { - OverflowEventDispatcher dispatcher(this); - // Table cells call layoutBlock directly, so don't add any logic here. Put code into // layoutBlock(). layoutBlock(false); diff --git a/engine/public/web/WebDOMEvent.h b/engine/public/web/WebDOMEvent.h index 27056555b65..a6676462621 100644 --- a/engine/public/web/WebDOMEvent.h +++ b/engine/public/web/WebDOMEvent.h @@ -85,7 +85,6 @@ public: BLINK_EXPORT bool isClipboardEvent() const; BLINK_EXPORT bool isWheelEvent() const; BLINK_EXPORT bool isBeforeTextInsertedEvent() const; - BLINK_EXPORT bool isOverflowEvent() const; BLINK_EXPORT bool isPageTransitionEvent() const; BLINK_EXPORT bool isPopStateEvent() const; BLINK_EXPORT bool isProgressEvent() const; diff --git a/engine/web/WebDOMEvent.cpp b/engine/web/WebDOMEvent.cpp index 11966c8aa78..363fa625649 100644 --- a/engine/web/WebDOMEvent.cpp +++ b/engine/web/WebDOMEvent.cpp @@ -159,12 +159,6 @@ bool WebDOMEvent::isBeforeTextInsertedEvent() const return m_private->isBeforeTextInsertedEvent(); } -bool WebDOMEvent::isOverflowEvent() const -{ - ASSERT(m_private.get()); - return m_private->hasInterface(EventNames::OverflowEvent); -} - bool WebDOMEvent::isPageTransitionEvent() const { ASSERT(m_private.get());