⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280642 in webkit


Ignore:
Timestamp:
Aug 4, 2021, 11:01:55 AM (5 years ago)
Author:
Russell Epstein
Message:

Revert r280492. rdar://problem/81522050

Location:
branches/safari-612.1-branch/Source/WebCore
Files:
2 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.1-branch/Source/WebCore/ChangeLog

    r280641 r280642  
     12021-08-04  Russell Epstein  <repstein@apple.com>
     2
     3        Revert r280492. rdar://problem/81522050
     4
    152021-08-04  Russell Epstein  <repstein@apple.com>
    26
  • branches/safari-612.1-branch/Source/WebCore/Sources.txt

    r280504 r280642  
    17481748platform/FileStream.cpp
    17491749platform/FrameRateMonitor.cpp
    1750 platform/KeyboardScrollingAnimator.cpp
    17511750platform/LayoutUnit.cpp
    17521751platform/LegacySchemeRegistry.cpp
  • branches/safari-612.1-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r280504 r280642  
    674674                1FAFBF1915A5FA7400083A20 /* UTIUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FAFBF1615A5FA5200083A20 /* UTIUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
    675675                1FC40FBA1655CCB90040F29E /* SubimageCacheWithTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC40FB71655C5910040F29E /* SubimageCacheWithTimer.h */; };
    676                 1FD992F826AA24F90088E596 /* KeyboardScrollingAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FD992F626AA24F80088E596 /* KeyboardScrollingAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    677676                20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D629251253690B00081543 /* InspectorInstrumentation.h */; };
    678677                225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 225A16B30D5C11E900090295 /* WebEventRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    70177016                1FC40FB71655C5910040F29E /* SubimageCacheWithTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubimageCacheWithTimer.h; sourceTree = "<group>"; };
    70187017                1FC40FB81655C5910040F29E /* SubimageCacheWithTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubimageCacheWithTimer.cpp; sourceTree = "<group>"; };
    7019                 1FD992F626AA24F80088E596 /* KeyboardScrollingAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyboardScrollingAnimator.h; sourceTree = "<group>"; };
    7020                 1FD992F926AA254D0088E596 /* KeyboardScrollingAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardScrollingAnimator.cpp; sourceTree = "<group>"; };
    70217018                20D629241253690B00081543 /* InspectorInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentation.cpp; sourceTree = "<group>"; };
    70227019                20D629251253690B00081543 /* InspectorInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentation.h; sourceTree = "<group>"; };
     
    2756627563                                A8748BDF12CBF2DC001FBA41 /* HashTools.h */,
    2756727564                                BC3BC29B0E91AB0F00835588 /* HostWindow.h */,
    27568                                 1FD992F926AA254D0088E596 /* KeyboardScrollingAnimator.cpp */,
    27569                                 1FD992F626AA24F80088E596 /* KeyboardScrollingAnimator.h */,
    2757027565                                1AE00D57182DAC8D00087DD7 /* KeyedCoding.h */,
    2757127566                                E15FF7D418C9553800FE4C87 /* KeypressCommand.h */,
     
    3335133346                                85031B440A44EFC700F992E0 /* KeyboardEvent.h in Headers */,
    3335233347                                1F020AEF26780FCE0000809A /* KeyboardScroll.h in Headers */,
    33353                                 1FD992F826AA24F90088E596 /* KeyboardScrollingAnimator.h in Headers */,
    3335433348                                1AE00D59182DAC8D00087DD7 /* KeyedCoding.h in Headers */,
    3335533349                                517A63C51B74318F00E7DCDC /* KeyedDecoderCF.h in Headers */,
  • branches/safari-612.1-branch/Source/WebCore/dom/Node.cpp

    r280492 r280642  
    24332433        return;
    24342434    const AtomString& eventType = event.type();
    2435     if (eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent || eventType == eventNames().keyupEvent) {
     2435    if (eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent) {
    24362436        if (is<KeyboardEvent>(event)) {
    24372437            if (Frame* frame = document().frame())
  • branches/safari-612.1-branch/Source/WebCore/page/EventHandler.cpp

    r280548 r280642  
    6969#include "InspectorInstrumentation.h"
    7070#include "KeyboardEvent.h"
    71 #include "KeyboardScrollingAnimator.h"
     71#include "KeyboardScroll.h"
    7272#include "Logging.h"
    7373#include "MouseEvent.h"
     
    38103810            defaultSpaceEventHandler(event);
    38113811    }
    3812     if (event.type() == eventNames().keyupEvent) {
    3813         m_frame.editor().handleKeyboardEvent(event);
    3814         if (event.defaultHandled())
    3815             return;
    3816         stopKeyboardScrolling();
    3817     }
    38183812}
    38193813
     
    42104204        return;
    42114205
    4212     bool defaultHandled = m_frame.settings().eventHandlerDrivenSmoothKeyboardScrollingEnabled() ? startKeyboardScrolling(event) : view->logicalScroll(direction, ScrollByPage);
     4206    bool defaultHandled = m_frame.settings().eventHandlerDrivenSmoothKeyboardScrollingEnabled() ? handleKeyboardScrolling(event) : view->logicalScroll(direction, ScrollByPage);
    42134207    if (defaultHandled)
    42144208        event.setDefaultHandled();
     
    42504244        return m_frame.view()->horizontalScrollbar();
    42514245    }();
    4252 
     4246   
    42534247    switch (granularity) {
    42544248    case ScrollGranularity::ScrollByLine:
     
    42654259}
    42664260
    4267 void EventHandler::stopKeyboardScrolling()
     4261bool EventHandler::handleKeyboardScrolling(KeyboardEvent& event)
    42684262{
    42694263    Ref protectedFrame = m_frame;
    4270     FrameView* view = m_frame.view();
    4271 
    4272     KeyboardScrollingAnimator* animator = view->scrollAnimator().keyboardScrollingAnimator();
    4273 
    4274     if (animator)
    4275         animator->handleKeyUpEvent();
    4276 }
    4277 
    4278 bool EventHandler::startKeyboardScrolling(KeyboardEvent& event)
    4279 {
    4280     Ref protectedFrame = m_frame;
    4281     FrameView* view = m_frame.view();
    4282 
    4283     KeyboardScrollingAnimator* animator = view->scrollAnimator().keyboardScrollingAnimator();
    4284 
    4285     if (animator)
    4286         return animator->beginKeyboardScrollGesture(event);
    4287 
    4288     return false;
     4264    // FIXME (bug 227459): This logic does not account for writing-mode.
     4265
     4266    enum class Key : uint8_t { LeftArrow, RightArrow, UpArrow, DownArrow, Space };
     4267
     4268    Key key;
     4269    if (event.keyIdentifier() == "Left")
     4270        key = Key::LeftArrow;
     4271    else if (event.keyIdentifier() == "Right")
     4272        key = Key::RightArrow;
     4273    else if (event.keyIdentifier() == "Up")
     4274        key = Key::UpArrow;
     4275    else if (event.keyIdentifier() == "Down")
     4276        key = Key::DownArrow;
     4277    else if (event.charCode() == ' ')
     4278        key = Key::Space;
     4279    else
     4280        return false;
     4281
     4282    auto granularity = [&] {
     4283        switch (key) {
     4284        case Key::LeftArrow:
     4285        case Key::RightArrow:
     4286            return event.altKey() ? ScrollGranularity::ScrollByPage : ScrollGranularity::ScrollByLine;
     4287        case Key::UpArrow:
     4288        case Key::DownArrow:
     4289            if (event.metaKey())
     4290                return ScrollGranularity::ScrollByDocument;
     4291            if (event.altKey())
     4292                return ScrollGranularity::ScrollByPage;
     4293            return ScrollGranularity::ScrollByLine;
     4294        case Key::Space:
     4295            return ScrollGranularity::ScrollByPage;
     4296        };
     4297        RELEASE_ASSERT_NOT_REACHED();
     4298    }();
     4299
     4300    auto direction = [&] {
     4301        switch (key) {
     4302        case Key::LeftArrow:
     4303            return ScrollDirection::ScrollLeft;
     4304        case Key::RightArrow:
     4305            return ScrollDirection::ScrollRight;
     4306        case Key::UpArrow:
     4307            return ScrollDirection::ScrollUp;
     4308        case Key::DownArrow:
     4309            return ScrollDirection::ScrollDown;
     4310        case Key::Space:
     4311            return event.shiftKey() ? ScrollDirection::ScrollUp : ScrollDirection::ScrollDown;
     4312        }
     4313        RELEASE_ASSERT_NOT_REACHED();
     4314    }();
     4315
     4316    return EventHandler::scrollRecursively(direction, granularity, nullptr);
    42894317}
    42904318
     
    42954323    if (!isSpatialNavigationEnabled(&m_frame)) {
    42964324        if (m_frame.settings().eventHandlerDrivenSmoothKeyboardScrollingEnabled())
    4297             startKeyboardScrolling(event);
     4325            handleKeyboardScrolling(event);
    42984326        return;
    42994327    }
  • branches/safari-612.1-branch/Source/WebCore/page/EventHandler.h

    r280492 r280642  
    378378
    379379    float scrollDistance(ScrollDirection, ScrollGranularity);
    380     bool startKeyboardScrolling(KeyboardEvent&);
    381     void stopKeyboardScrolling();
     380    bool handleKeyboardScrolling(KeyboardEvent&);
    382381
    383382#if ENABLE(DRAG_SUPPORT)
  • branches/safari-612.1-branch/Source/WebCore/platform/ScrollAnimator.cpp

    r280492 r280642  
    3434
    3535#include "FloatPoint.h"
    36 #include "KeyboardScrollingAnimator.h"
    3736#include "LayoutSize.h"
    3837#include "PlatformWheelEvent.h"
     
    6968            m_scrollableArea.setScrollBehaviorStatus(ScrollBehaviorStatus::NotInAnimation);
    7069        }))
    71     , m_keyboardScrollingAnimator(makeUnique<KeyboardScrollingAnimator>(*this, m_scrollController))
    7270{
    7371}
     
    335333    if (m_scrollControllerAnimationTimer.isActive())
    336334        return;
    337 
     335       
    338336    m_scrollControllerAnimationTimer.startRepeating(1_s / 60.);
    339337}
  • branches/safari-612.1-branch/Source/WebCore/platform/ScrollAnimator.h

    r280492 r280642  
    3535#include "PlatformWheelEvent.h"
    3636#include "ScrollController.h"
     37#include "ScrollTypes.h"
    3738#include "Timer.h"
    3839#include "WheelEventTestMonitor.h"
     
    4344
    4445class FloatPoint;
    45 class KeyboardScrollingAnimator;
    4646class PlatformTouchEvent;
    4747class ScrollAnimation;
     
    8181
    8282    virtual bool handleWheelEvent(const PlatformWheelEvent&);
    83 
    84     KeyboardScrollingAnimator *keyboardScrollingAnimator() const override { return m_keyboardScrollingAnimator.get(); }
    8583
    8684#if ENABLE(TOUCH_EVENTS)
     
    181179
    182180    std::unique_ptr<ScrollAnimation> m_scrollAnimation;
    183     std::unique_ptr<KeyboardScrollingAnimator> m_keyboardScrollingAnimator;
    184181};
    185182
  • branches/safari-612.1-branch/Source/WebCore/platform/ScrollController.cpp

    r280492 r280642  
    2727#include "ScrollController.h"
    2828
    29 #include "KeyboardScrollingAnimator.h"
    3029#include "LayoutSize.h"
    3130#include "Logging.h"
     
    4544void ScrollController::animationCallback(MonotonicTime currentTime)
    4645{
    47     LOG_WITH_STREAM(Scrolling, stream << "ScrollController " << this << " animationCallback: isAnimatingRubberBand " << m_isAnimatingRubberBand << " isAnimatingScrollSnap " << m_isAnimatingScrollSnap << "isAnimatingKeyboardScrolling" << m_isAnimatingKeyboardScrolling);
     46    LOG_WITH_STREAM(Scrolling, stream << "ScrollController " << this << " animationCallback: isAnimatingRubberBand " << m_isAnimatingRubberBand << " isAnimatingScrollSnap " << m_isAnimatingScrollSnap);
    4847
    4948    updateScrollSnapAnimatingState(currentTime);
    5049    updateRubberBandAnimatingState(currentTime);
    51     updateKeyboardScrollingAnimatingState(currentTime);
    5250}
    5351
    5452void ScrollController::startOrStopAnimationCallbacks()
    5553{
    56     bool needsCallbacks = m_isAnimatingRubberBand || m_isAnimatingScrollSnap || m_isAnimatingKeyboardScrolling;
     54    bool needsCallbacks = m_isAnimatingRubberBand || m_isAnimatingScrollSnap;
    5755    if (needsCallbacks == m_isRunningAnimatingCallback)
    5856        return;
     
    6866}
    6967
    70 void ScrollController::beginKeyboardScrolling()
    71 {
    72     setIsAnimatingKeyboardScrolling(true);
    73 }
    74 
    75 void ScrollController::stopKeyboardScrolling()
    76 {
    77     setIsAnimatingKeyboardScrolling(false);
    78 }
    79 
    8068void ScrollController::setIsAnimatingRubberBand(bool isAnimatingRubberBand)
    8169{
     
    9381       
    9482    m_isAnimatingScrollSnap = isAnimatingScrollSnap;
    95     startOrStopAnimationCallbacks();
    96 }
    97 
    98 void ScrollController::setIsAnimatingKeyboardScrolling(bool isAnimatingKeyboardScrolling)
    99 {
    100     if (isAnimatingKeyboardScrolling == m_isAnimatingKeyboardScrolling)
    101         return;
    102 
    103     m_isAnimatingKeyboardScrolling = isAnimatingKeyboardScrolling;
    10483    startOrStopAnimationCallbacks();
    10584}
     
    220199
    221200}
    222 
    223 void ScrollController::updateKeyboardScrollingAnimatingState(MonotonicTime currentTime)
    224 {
    225     if (!m_isAnimatingKeyboardScrolling)
    226         return;
    227 
    228     m_client.keyboardScrollingAnimator()->updateKeyboardScrollPosition(currentTime);
    229 }
    230 
    231201// Currently, only Mac supports momentum srolling-based scrollsnapping and rubber banding
    232202// so all of these methods are a noop on non-Mac platforms.
  • branches/safari-612.1-branch/Source/WebCore/platform/ScrollController.h

    r280492 r280642  
    3939namespace WebCore {
    4040
    41 class KeyboardScrollingAnimator;
    4241class LayoutSize;
    4342class PlatformWheelEvent;
     
    7372    virtual void startAnimationCallback(ScrollController&) = 0;
    7473    virtual void stopAnimationCallback(ScrollController&) = 0;
    75 
    76     virtual void updateKeyboardScrollPosition(MonotonicTime) { }
    77     virtual KeyboardScrollingAnimator *keyboardScrollingAnimator() const { return nullptr; }
    7874
    7975#if ENABLE(RUBBER_BANDING)
     
    126122    void stopAllTimers();
    127123    void scrollPositionChanged();
    128 
    129     void beginKeyboardScrolling();
    130     void stopKeyboardScrolling();
    131124   
    132125    // Should be called periodically by the client. Started by startAnimationCallback(), stopped by stopAnimationCallback().
     
    171164    void updateScrollSnapAnimatingState(MonotonicTime);
    172165    void updateRubberBandAnimatingState(MonotonicTime);
    173     void updateKeyboardScrollingAnimatingState(MonotonicTime);
    174 
     166   
    175167    void setIsAnimatingRubberBand(bool);
    176168    void setIsAnimatingScrollSnap(bool);
    177     void setIsAnimatingKeyboardScrolling(bool);
    178169
    179170#if PLATFORM(MAC)
     
    209200    bool m_isAnimatingRubberBand { false };
    210201    bool m_isAnimatingScrollSnap { false };
    211     bool m_isAnimatingKeyboardScrolling { false };
    212202
    213203#if PLATFORM(MAC)
Note: See TracChangeset for help on using the changeset viewer.