Be more restrictive about when canvas2d is allowed to update style
Created attachment 422542 [details] Patch
Comment on attachment 422542 [details] Patch I shouldn't move toTextDirection() before the RAII classes.
<rdar://problem/75416260>
Created attachment 423304 [details] Patch
Comment on attachment 423304 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423304&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:121 > + WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; > + ScriptDisallowedScope::InMainThread scriptDisallowedScope; > + Style::PostResolutionCallbackDisabler callbackDisabler(canvas().document()); We don't need WidgetHierarchyUpdatesSuspensionScope or PostResolutionCallbackDisabler. Just ScriptDisallowedScope::InMainThread is enough. > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:163 > - auto* style = (computedStyle || direction == Direction::Inherit) ? canvas().computedStyle() : nullptr; > + auto* style = (computedStyle || direction == Direction::Inherit) ? canvas().existingComputedStyle() : nullptr; Maybe get rid of the unnecessary parenthesis here? > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:201 > + WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; > + ScriptDisallowedScope::InMainThread scriptDisallowedScope; > + Style::PostResolutionCallbackDisabler callbackDisabler(canvas().document()); Ditto. We just need ScriptDisallowedScope::InMainThread here. > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:-195 > - auto& canvas = downcast<HTMLCanvasElement>(canvasBase()); > - canvas.document().updateStyleIfNeeded(); Let's also add ScriptDisallowedScope::InMainThread here? > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:234 > + WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; > + ScriptDisallowedScope::InMainThread scriptDisallowedScope; > + Style::PostResolutionCallbackDisabler callbackDisabler(canvas().document()); Ditto. We just need ScriptDisallowedScope::InMainThread.
Created attachment 423378 [details] Patch for committing
Committed r274531 (235382@main): <https://commits.webkit.org/235382@main>