Title: [260114] trunk/Source/WebCore
Revision
260114
Author
[email protected]
Date
2020-04-14 19:46:44 -0700 (Tue, 14 Apr 2020)

Log Message

Content expanding is broken on icourse163.org
https://bugs.webkit.org/show_bug.cgi?id=210510
<rdar://problem/45951820>

Reviewed by Simon Fraser.

www.icourse163.org's animation code expects a decimal point in the rAF timestamp (millisecond resolution).

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
* page/Quirks.cpp:
(WebCore::Quirks::needsMillisecondResolutionForHighResTimeStamp const):
* page/Quirks.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260113 => 260114)


--- trunk/Source/WebCore/ChangeLog	2020-04-15 02:35:04 UTC (rev 260113)
+++ trunk/Source/WebCore/ChangeLog	2020-04-15 02:46:44 UTC (rev 260114)
@@ -1,3 +1,19 @@
+2020-04-14  Zalan Bujtas  <[email protected]>
+
+        Content expanding is broken on icourse163.org
+        https://bugs.webkit.org/show_bug.cgi?id=210510
+        <rdar://problem/45951820>
+
+        Reviewed by Simon Fraser.
+
+        www.icourse163.org's animation code expects a decimal point in the rAF timestamp (millisecond resolution).
+
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
+        * page/Quirks.cpp:
+        (WebCore::Quirks::needsMillisecondResolutionForHighResTimeStamp const):
+        * page/Quirks.h:
+
 2020-04-14  Peng Liu  <[email protected]>
 
         Adopt interface AVAudioRoutingArbiter for Mac

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (260113 => 260114)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2020-04-15 02:35:04 UTC (rev 260113)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2020-04-15 02:46:44 UTC (rev 260114)
@@ -37,6 +37,8 @@
 #include "InspectorInstrumentation.h"
 #include "Logging.h"
 #include "Page.h"
+#include "Performance.h"
+#include "Quirks.h"
 #include "RequestAnimationFrameCallback.h"
 #include "Settings.h"
 #include <algorithm>
@@ -198,8 +200,9 @@
 
     TraceScope tracingScope(RAFCallbackStart, RAFCallbackEnd);
 
-    // We round this to the nearest microsecond so that we can return a time that matches what is returned by document.timeline.currentTime.
-    DOMHighResTimeStamp highResNowMs = std::round(1000 * timestamp);
+    auto highResNowMs = Performance::reduceTimeResolution(Seconds { timestamp }).milliseconds();
+    if (m_document && m_document->quirks().needsMillisecondResolutionForHighResTimeStamp())
+        highResNowMs += 0.1;
 
     // First, generate a list of callbacks to consider.  Callbacks registered from this point
     // on are considered only for the "next" frame, not this one.

Modified: trunk/Source/WebCore/page/Quirks.cpp (260113 => 260114)


--- trunk/Source/WebCore/page/Quirks.cpp	2020-04-15 02:35:04 UTC (rev 260113)
+++ trunk/Source/WebCore/page/Quirks.cpp	2020-04-15 02:46:44 UTC (rev 260114)
@@ -158,6 +158,15 @@
     return host.endsWith(".youtube.com") || host == "youtube.com";
 }
 
+bool Quirks::needsMillisecondResolutionForHighResTimeStamp() const
+{
+    if (!needsQuirks())
+        return false;
+    // webkit.org/b/210527
+    auto host = m_document->url().host();
+    return equalLettersIgnoringASCIICase(host, "www.icourse163.org");
+}
+
 bool Quirks::shouldStripQuotationMarkInFontFaceSetFamily() const
 {
     if (!needsQuirks())

Modified: trunk/Source/WebCore/page/Quirks.h (260113 => 260114)


--- trunk/Source/WebCore/page/Quirks.h	2020-04-15 02:35:04 UTC (rev 260113)
+++ trunk/Source/WebCore/page/Quirks.h	2020-04-15 02:46:44 UTC (rev 260114)
@@ -64,6 +64,8 @@
     bool needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand() const;
     bool shouldDisableContentChangeObserverTouchEventAdjustment() const;
 
+    bool needsMillisecondResolutionForHighResTimeStamp() const;
+
     WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const;
     WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const;
     WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to