[ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
[WebKit-https.git] / Source / WebCore / ChangeLog
index bf4f5f9..64e301f 100644 (file)
@@ -1,3 +1,416 @@
+2019-03-02  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
+        https://bugs.webkit.org/show_bug.cgi?id=195252
+        <rdar://problem/48539446>
+
+        Reviewed by Simon Fraser.
+
+        Scope the mouse-moved event to make the callsites less error-prone. 
+
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::startObservingMouseMoved):
+        (WebCore::ContentChangeObserver::stopObservingMouseMoved):
+        (WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
+        (WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
+        (WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
+        (WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
+        * page/ios/ContentChangeObserver.h:
+        * page/ios/EventHandlerIOS.mm:
+        (WebCore::EventHandler::mouseMoved):
+
+2019-03-02  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
+        https://bugs.webkit.org/show_bug.cgi?id=195244
+        <rdar://problem/48536737>
+
+        Reviewed by Simon Fraser.
+
+        Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
+        let the client know about the state change (or lack of state change).
+
+        Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
+
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::didInstallDOMTimer):
+        (WebCore::ContentChangeObserver::didRemoveDOMTimer):
+        (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
+        (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
+        (WebCore::ContentChangeObserver::didContentVisibilityChange):
+        (WebCore::ContentChangeObserver::addObservedDOMTimer):
+        (WebCore::ContentChangeObserver::removeObservedDOMTimer):
+        (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
+        (WebCore::ContentChangeObserver::adjustObservedState):
+        (WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
+        * page/ios/ContentChangeObserver.h:
+        (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
+        (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
+        (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
+
+2019-03-02  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Move away from WKContentChange values
+        https://bugs.webkit.org/show_bug.cgi?id=195240
+        <rdar://problem/48532358>
+
+        Reviewed by Simon Fraser.
+
+        This is in preparation for moving towards a state machine-like implementation.
+
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
+        (WebCore::ContentChangeObserver::didRemoveDOMTimer):
+        (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
+        (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
+        (WebCore::ContentChangeObserver::didContentVisibilityChange):
+        (WebCore::ContentChangeObserver::startObservingContentChanges):
+        (WebCore::ContentChangeObserver::observedContentChange const):
+        (WebCore::ContentChangeObserver::removeObservedDOMTimer):
+        (WebCore::ContentChangeObserver::hasDeterminedState const):
+        (WebCore::ContentChangeObserver::observedContentChange): Deleted.
+        (WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
+        (WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
+        (WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
+        * page/ios/ContentChangeObserver.h:
+        (WebCore::ContentChangeObserver::addObservedDOMTimer):
+        (WebCore::ContentChangeObserver::clearObservedDOMTimers):
+        (WebCore::ContentChangeObserver::hasVisibleChangeState const):
+        (WebCore::ContentChangeObserver::hasObservedDOMTimer const):
+        (WebCore::ContentChangeObserver::setHasNoChangeState):
+        (WebCore::ContentChangeObserver::setHasIndeterminateState):
+        (WebCore::ContentChangeObserver::setHasVisibleChangeState):
+        (WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
+
+2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
+        https://bugs.webkit.org/show_bug.cgi?id=195053
+        <rdar://problem/48134710>
+
+        Reviewed by Ryosuke Niwa.
+
+        Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
+        ChangeLog for more details.
+
+        Test: editing/pasteboard/ios/dom-paste-same-origin.html
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
+
+        Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
+        particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
+        throughout the user gesture.
+
+        * dom/UserGestureIndicator.h:
+        (WebCore::UserGestureToken::didRequestDOMPasteAccess):
+        * loader/EmptyClients.cpp:
+        * page/EditorClient.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::requestDOMPasteAccess):
+
+2019-02-27  Darin Adler  <darin@apple.com>
+
+        Fixed makeString(float) to do shortest-form serialization without first converting to double
+        https://bugs.webkit.org/show_bug.cgi?id=195142
+
+        Reviewed by Daniel Bates.
+
+        * platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
+
+2019-03-02  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
+        https://bugs.webkit.org/show_bug.cgi?id=195246
+
+        Reviewed by Frederic Wang.
+
+        r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
+        was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
+        tree, which it did, causing sibling position:fixed to behave incorrectly.
+
+        Test: scrollingcoordinator/mac/multiple-fixed.html
+
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
+        * page/scrolling/ScrollingTree.h:
+
+2019-03-02  Darin Adler  <darin@apple.com>
+
+        Improve some comments
+        https://bugs.webkit.org/show_bug.cgi?id=195243
+
+        Reviewed by Daniel Bates.
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
+        Fix a typo in a comment.
+
+        * dom/RadioButtonGroups.cpp: Fix a typo in a comment.
+        (WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
+        it a bit longer. Use nullptr instead of 0.
+        (WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
+
+2019-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
+        https://bugs.webkit.org/show_bug.cgi?id=190620
+        <rdar://problem/19226679>
+
+        Reviewed by Ryosuke Niwa.
+
+        Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
+        To understand why we hit this assertion, we first note several observations:
+
+            -   The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
+            -   Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
+            -   `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
+                cached value without update.
+
+        Now, consider the following scenario:
+
+            1.  Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
+                several things:
+                a.  The form control changes readonly state
+                b.  The form control changes disabled state
+                c.  The form control is added to a datalist element
+                d.  The form control is removed from a datalist element
+            2.  Call `willValidate()`.
+            3.  Call `isValid()`.
+
+        In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
+        `m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
+        result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
+        control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
+        isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::insertedIntoAncestor):
+        (WebCore::HTMLFormControlElement::removedFromAncestor):
+
+        Make a couple of minor tweaks:
+          - Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
+            control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
+            already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
+            does not yet have an ancestor (in the case where it is being added).
+          - If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
+            as well as its cached validity (`m_isValid`).
+
+2019-03-01  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+
+        * dom/Document.cpp:
+        (WebCore::Document::lastModified const): Use makeString and pad.
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::processFileDateString): Ditto.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
+
+        * page/cocoa/ResourceUsageOverlayCocoa.mm:
+        (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
+
+        * page/linux/ResourceUsageOverlayLinux.cpp:
+        (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
+        (WebCore::gcTimerString): Use String::number.
+
+        * platform/DateComponents.cpp:
+        (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
+        (WebCore::DateComponents::toString const): Ditto.
+
+        * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
+        and that was also inaccurate.
+
+        * platform/audio/HRTFElevation.cpp:
+        (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
+        Use makeString and pad.
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::drawText): Ditto.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
+
+2019-03-01  Chris Dumez  <cdumez@apple.com>
+
+        Do not attempt to set WAL Journal mode on a readonly SQLite database
+        https://bugs.webkit.org/show_bug.cgi?id=195237
+
+        Reviewed by Simon Fraser.
+
+        This avoids logging errors when opening the database.
+
+        * platform/sql/SQLiteDatabase.cpp:
+        (WebCore::SQLiteDatabase::open):
+        (WebCore::SQLiteDatabase::useWALJournalMode):
+        * platform/sql/SQLiteDatabase.h:
+
+2019-03-01  Antoine Quint  <graouts@apple.com>
+
+        [iOS] Turn mouse event simulation on by default
+        https://bugs.webkit.org/show_bug.cgi?id=195218
+        <rdar://problem/48516794>
+
+        Reviewed by Dean Jackson.
+
+        * page/RuntimeEnabledFeatures.h:
+
+2019-03-01  Chris Dumez  <cdumez@apple.com>
+
+        Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=195230
+        <rdar://problem/47925359>
+
+        Reviewed by Ryosuke Niwa.
+
+        Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
+        to address crashes on iOS WK1.
+
+        * platform/network/NetworkStateNotifier.cpp:
+        (WebCore::shouldSuppressThreadSafetyCheck):
+        (WebCore::NetworkStateNotifier::singleton):
+
+2019-03-01  Simon Fraser  <simon.fraser@apple.com>
+
+        Show mouse event regions in the overlay
+        https://bugs.webkit.org/show_bug.cgi?id=195227
+
+        Reviewed by Tim Horton.
+
+        Enhance event region overlays to show more kinds of events.
+
+        * page/DebugPageOverlays.cpp:
+        (WebCore::touchEventRegionColors):
+        (WebCore::NonFastScrollableRegionOverlay::drawRect):
+
+2019-03-01  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
+        https://bugs.webkit.org/show_bug.cgi?id=195220
+        <rdar://problem/48518979>
+
+        Reviewed by Simon Fraser.
+
+        didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
+        when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
+        Let's just check if we've got a pending style recalc when the DOM timer comes back.
+
+        Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::scheduleStyleRecalc):
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::hasPendingStyleRecalc):
+        (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::startObservingContentChanges):
+        (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
+        * page/ios/ContentChangeObserver.h:
+        (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
+        (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
+
+2019-03-01  John Wilander  <wilander@apple.com>
+
+        Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
+        https://bugs.webkit.org/show_bug.cgi?id=195196
+        <rdar://problem/48006419>
+
+        Reviewed by Brent Fulgham.
+
+        Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
+               http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
+               http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
+               http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
+               http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
+
+        Trackers abuse link query parameters to transport user identifiers cross-site.
+        This patch detects such navigations and applies further restrictions to
+        client-site cookies on the destination page.
+
+        * platform/network/NetworkStorageSession.cpp:
+        (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
+            Now sets the regular 7-day cap and a reduced 1-day cap.
+        (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
+            Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
+            NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
+            it now clears out two types of page-specific data.
+        (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
+            This function receives a cross-site navigation and checks if the originating
+            site is a prevalent resource. If so, it marks the page or stricter cookie
+            rules.
+        (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
+            Test infrastructure. This sets a state that overrides the regular per-page
+            clear of data. The reason is that the double clear was racy and caused test
+            failures.
+        (WebCore::NetworkStorageSession::clientSideCookieCap const):
+            New function that returns the current cookie lifetime cap.
+        (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
+            Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
+        * platform/network/NetworkStorageSession.h:
+        * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
+        (WebCore::NetworkStorageSession::setCookiesFromDOM const):
+            Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
+
+2019-03-01  Rob Buis  <rbuis@igalia.com>
+
+        Adjust XMLHttpRequest Content-Type handling
+        https://bugs.webkit.org/show_bug.cgi?id=184645
+
+        Reviewed by Youenn Fablet.
+
+        Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
+
+        Test: web-platform-tests/xhr/send-content-type-charset.htm
+
+        [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
+
+        * platform/network/ParsedContentType.cpp:
+        (WebCore::ParsedContentType::setCharset):
+        * platform/network/ParsedContentType.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::replaceCharsetInMediaTypeIfNeeded):
+        (WebCore::XMLHttpRequest::send):
+        (WebCore::replaceCharsetInMediaType): Deleted.
+
+2019-03-01  Youenn Fablet  <youenn@apple.com>
+
+        Update originsMatch to handle the case of file origins which enforce file path separation
+        https://bugs.webkit.org/show_bug.cgi?id=195216
+
+        Reviewed by Brady Eidson.
+
+        Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
+        Make sure originsMatch returns true if either compared origins are the same object
+        or they have the same file path separation behavior.
+
+        * page/SecurityOrigin.cpp:
+        (WebCore::areOriginsMatching):
+        (WebCore::originsMatch):
+
+2019-03-01  Youenn Fablet  <youenn@apple.com>
+
+        Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
+        https://bugs.webkit.org/show_bug.cgi?id=195213
+
+        Reviewed by Alex Christensen.
+
+        Add traits to enable enum IPC encoding.
+        No change of behavior.
+
+        * Modules/indexeddb/IndexedDB.h:
+
 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
 
         [WinCairo] Enable service worker