Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 227c6a7e9cad3099da4c496dbc311de75808f9b8
      
https://github.com/WebKit/WebKit/commit/227c6a7e9cad3099da4c496dbc311de75808f9b8
  Author: Dan Glastonbury <[email protected]>
  Date:   2025-10-01 (Wed, 01 Oct 2025)

  Changed paths:
    M Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp
    M Source/WebCore/Modules/webxr/WebXRWebGLLayer.h

  Log Message:
  -----------
  [WebXR] Warn when accessing XRWebGLLayer framebuffer dimensions before first 
render
https://bugs.webkit.org/show_bug.cgi?id=299934
rdar://161708558

Reviewed by Mike Wyrzykowski.

Add console warnings when developers access framebufferWidth or
framebufferHeight properties on XRWebGLLayer before the framebuffer has been
properly initialized.  This commonly occurs when accessing these properties
outside of a requestAnimationFrame callback, where the framebuffer dimensions
are not yet available.

The warning message clarifies that accurate dimensions are unavailable until
requestAnimationFrame processing and that the API returns 1 as a fallback value.
This helps developers understand the timing requirements for accessing XR
framebuffer dimensions.

* Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::WebXRWebGLLayer::framebufferWidth const): Add warning when 
framebuffer size is empty.
(WebCore::WebXRWebGLLayer::framebufferHeight const): Add warning when 
framebuffer size is empty.
(WebCore::WebXRWebGLLayer::addConsoleMessage const): New helper method to log 
console messages.
* Source/WebCore/Modules/webxr/WebXRWebGLLayer.h: Add addConsoleMessage 
declaration.

Canonical link: https://commits.webkit.org/300864@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to