Changeset 282441 in webkit
- Timestamp:
- Sep 14, 2021 11:16:57 PM (10 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 1 deleted
- 23 edited
- 4 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/resize-observer/idlharness.window-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/resize-observer/observe-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/ios/imported/w3c/web-platform-tests/resize-observer (deleted)
-
LayoutTests/platform/mac/imported/w3c/web-platform-tests/resize-observer (added)
-
LayoutTests/platform/mac/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt (copied) (copied from trunk/LayoutTests/platform/ios/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt) (2 diffs)
-
Source/WebCore/CMakeLists.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/DerivedSources-input.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources-output.xcfilelist (modified) (1 diff)
-
Source/WebCore/DerivedSources.make (modified) (1 diff)
-
Source/WebCore/Sources.txt (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
Source/WebCore/page/ResizeObservation.cpp (modified) (3 diffs)
-
Source/WebCore/page/ResizeObservation.h (modified) (2 diffs)
-
Source/WebCore/page/ResizeObserver.cpp (modified) (7 diffs)
-
Source/WebCore/page/ResizeObserver.h (modified) (2 diffs)
-
Source/WebCore/page/ResizeObserver.idl (modified) (1 diff)
-
Source/WebCore/page/ResizeObserverBoxOptions.h (added)
-
Source/WebCore/page/ResizeObserverBoxOptions.idl (copied) (copied from trunk/Source/WebCore/page/ResizeObserverCallback.idl) (2 diffs)
-
Source/WebCore/page/ResizeObserverCallback.idl (modified) (1 diff)
-
Source/WebCore/page/ResizeObserverEntry.h (modified) (2 diffs)
-
Source/WebCore/page/ResizeObserverEntry.idl (modified) (2 diffs)
-
Source/WebCore/page/ResizeObserverOptions.h (added)
-
Source/WebCore/page/ResizeObserverOptions.idl (copied) (copied from trunk/Source/WebCore/page/ResizeObserverCallback.idl) (2 diffs)
-
Source/WebCore/page/ResizeObserverSize.h (added)
-
Source/WebCore/page/ResizeObserverSize.idl (copied) (copied from trunk/Source/WebCore/page/ResizeObserverCallback.idl) (2 diffs)
-
Source/WebCore/rendering/RenderBox.h (modified) (3 diffs)
-
Source/WebCore/rendering/RenderElement.h (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r282438 r282441 1 2021-09-14 Simon Fraser <simon.fraser@apple.com> 2 3 Implement the borderBoxSize/contentBoxSize parts of ResizeObserver 4 https://bugs.webkit.org/show_bug.cgi?id=230242 5 6 Reviewed by Sam Weinig. 7 8 Give macOS a platform expectation for this test since its results seem to be the odd one out. 9 10 * platform/ios/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt: Removed. 11 * platform/mac/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt: Copied from LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt. 12 1 13 2021-09-14 Rob Buis <rbuis@igalia.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r282440 r282441 1 2021-09-14 Simon Fraser <simon.fraser@apple.com> 2 3 Implement the borderBoxSize/contentBoxSize parts of ResizeObserver 4 https://bugs.webkit.org/show_bug.cgi?id=230242 5 6 Reviewed by Sam Weinig. 7 8 New results. WebKit seems to fire the "resize loop error" more than 9 other browsers, which seems to be an issue with the spec[1]. 10 11 [1] https://github.com/w3c/csswg-drafts/issues/6610 12 13 * web-platform-tests/resize-observer/idlharness.window-expected.txt: 14 * web-platform-tests/resize-observer/observe-expected.txt: 15 * web-platform-tests/resize-observer/svg-expected.txt: 16 1 17 2021-09-14 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resize-observer/idlharness.window-expected.txt
r269214 r282441 31 31 PASS ResizeObserverEntry interface: attribute target 32 32 PASS ResizeObserverEntry interface: attribute contentRect 33 FAIL ResizeObserverEntry interface: attribute borderBoxSize assert_true: The prototype object must have a property "borderBoxSize" expected true got false34 FAIL ResizeObserverEntry interface: attribute contentBoxSize assert_true: The prototype object must have a property "contentBoxSize" expected true got false33 PASS ResizeObserverEntry interface: attribute borderBoxSize 34 PASS ResizeObserverEntry interface: attribute contentBoxSize 35 35 FAIL ResizeObserverEntry interface: attribute devicePixelContentBoxSize assert_true: The prototype object must have a property "devicePixelContentBoxSize" expected true got false 36 36 PASS ResizeObserverEntry must be primary interface of entry … … 38 38 PASS ResizeObserverEntry interface: entry must inherit property "target" with the proper type 39 39 PASS ResizeObserverEntry interface: entry must inherit property "contentRect" with the proper type 40 FAIL ResizeObserverEntry interface: entry must inherit property "borderBoxSize" with the proper type assert_inherits: property "borderBoxSize" not found in prototype chain 41 FAIL ResizeObserverEntry interface: entry must inherit property "contentBoxSize" with the proper type assert_inherits: property "contentBoxSize" not found in prototype chain 40 PASS ResizeObserverEntry interface: entry must inherit property "borderBoxSize" with the proper type 41 PASS ResizeObserverEntry interface: entry must inherit property "contentBoxSize" with the proper type 42 42 FAIL ResizeObserverEntry interface: entry must inherit property "devicePixelContentBoxSize" with the proper type assert_inherits: property "devicePixelContentBoxSize" not found in prototype chain 43 FAIL ResizeObserverSize interface: existence and properties of interface object assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 44 FAIL ResizeObserverSize interface object length assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 45 FAIL ResizeObserverSize interface object name assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 46 FAIL ResizeObserverSize interface: existence and properties of interface prototype object assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 47 FAIL ResizeObserverSize interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 48 FAIL ResizeObserverSize interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 49 FAIL ResizeObserverSize interface: attribute inlineSize assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 50 FAIL ResizeObserverSize interface: attribute blockSize assert_own_property: self does not have own property "ResizeObserverSize" expected property "ResizeObserverSize" missing 43 PASS ResizeObserverSize interface: existence and properties of interface object 44 PASS ResizeObserverSize interface object length 45 PASS ResizeObserverSize interface object name 46 PASS ResizeObserverSize interface: existence and properties of interface prototype object 47 PASS ResizeObserverSize interface: existence and properties of interface prototype object's "constructor" property 48 PASS ResizeObserverSize interface: existence and properties of interface prototype object's @@unscopables property 49 PASS ResizeObserverSize interface: attribute inlineSize 50 PASS ResizeObserverSize interface: attribute blockSize 51 51 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resize-observer/observe-expected.txt
r267647 r282441 1 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 2 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 3 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 4 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 5 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 6 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 7 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 8 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 9 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 10 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 1 11 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 2 12 CONSOLE MESSAGE: ResizeObserver loop completed with undelivered notifications. 3 13 14 Harness Error (TIMEOUT), message = null 15 4 16 PASS ResizeObserver implemented 5 PASSguard17 NOTRUN guard 6 18 PASS test0: simple observation 7 19 PASS test1: multiple observation on same element trigger only one … … 12 24 PASS test6: iframe notifications 13 25 PASS test7: callback.this 14 FAIL test8: simple content-box observation undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 15 FAIL test9: simple content-box observation but keep border-box size unchanged undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 16 FAIL test10: simple border-box observation undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 17 FAIL test11: simple observation with vertical writing mode undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 18 FAIL test12: no observation is fired after the change of writing mode when box's specified size comes from logical size properties. undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 19 FAIL test13: an observation is fired after the change of writing mode when box's specified size comes from physical size properties. undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 20 FAIL test14: observe the same target but using a different box should override the previous one undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 21 FAIL test15: an observation is fired with box dimensions 0 when element's display property is set to inline undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 26 PASS test8: simple content-box observation 27 PASS test9: simple content-box observation but keep border-box size unchanged 28 PASS test10: simple border-box observation 29 PASS test11: simple observation with vertical writing mode 30 PASS test12: no observation is fired after the change of writing mode when box's specified size comes from logical size properties. 31 PASS test13: an observation is fired after the change of writing mode when box's specified size comes from physical size properties. 32 PASS test14: observe the same target but using a different box should override the previous one 33 PASS test15: an observation is fired with box dimensions 0 when element's display property is set to inline 22 34 PASS test16: observations do not fire for non-replaced inline elements 23 FAIL test17: Box sizing snd Resize Observer notifications undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 24 FAIL test18: an observation is fired when device-pixel-content-box is being observed undefined is not an object (evaluating 'entries[0].contentBoxSize[0]')35 PASS test17: Box sizing snd Resize Observer notifications 36 FAIL test18: an observation is fired when device-pixel-content-box is being observed assert_unreached: Caught a throw, possible syntax error Reached unreachable code 25 37 -
trunk/LayoutTests/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt
r267647 r282441 5 5 svg text tag 6 6 7 Harness Error (TIMEOUT), message = null 8 7 9 PASS ResizeObserver implemented 8 PASSguard10 NOTRUN guard 9 11 PASS test0: observe svg:circle 10 12 PASS test1: observe svg:ellipse … … 19 21 PASS test10: observe svg:svg, top/left is 0 even with padding 20 22 PASS test11: observe svg non-displayable element 21 FAIL test12: observe svg:rect content box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 22 FAIL test13: observe svg:rect border box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 23 FAIL test14: observe g:rect content and border box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 24 FAIL test15: observe svg:text content and border box assert_equals: expected 30 but got 30.015625 25 FAIL test16: observe g:rect content, border and device-pixel-content boxes undefined is not an object (evaluating 'entries[0].contentBoxSize[0]')23 PASS test12: observe svg:rect content box 24 PASS test13: observe svg:rect border box 25 PASS test14: observe g:rect content and border box 26 PASS test15: observe svg:text content and border box 27 FAIL test16: observe g:rect content, border and device-pixel-content boxes assert_unreached: Caught a throw, possible syntax error Reached unreachable code 26 28 -
trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/resize-observer/svg-expected.txt
r282440 r282441 5 5 svg text tag 6 6 7 Harness Error (TIMEOUT), message = null 8 7 9 PASS ResizeObserver implemented 8 PASSguard10 NOTRUN guard 9 11 PASS test0: observe svg:circle 10 12 PASS test1: observe svg:ellipse … … 19 21 PASS test10: observe svg:svg, top/left is 0 even with padding 20 22 PASS test11: observe svg non-displayable element 21 FAIL test12: observe svg:rect content box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 22 FAIL test13: observe svg:rect border box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 23 FAIL test14: observe g:rect content and border box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]') 24 FAIL test15: observe svg:text content and border box undefined is not an object (evaluating 'entries[0].contentBoxSize[0]')25 FAIL test16: observe g:rect content, border and device-pixel-content boxes undefined is not an object (evaluating 'entries[0].contentBoxSize[0]')23 PASS test12: observe svg:rect content box 24 PASS test13: observe svg:rect border box 25 PASS test14: observe g:rect content and border box 26 FAIL test15: observe svg:text content and border box assert_equals: expected 30 but got 30.015625 27 FAIL test16: observe g:rect content, border and device-pixel-content boxes assert_unreached: Caught a throw, possible syntax error Reached unreachable code 26 28 -
trunk/Source/WebCore/CMakeLists.txt
r282401 r282441 1126 1126 page/RemoteDOMWindow.idl 1127 1127 page/ResizeObserver.idl 1128 page/ResizeObserverBoxOptions.idl 1128 1129 page/ResizeObserverCallback.idl 1129 1130 page/ResizeObserverEntry.idl 1131 page/ResizeObserverOptions.idl 1132 page/ResizeObserverSize.idl 1130 1133 page/Screen.idl 1131 1134 page/ScrollBehavior.idl -
trunk/Source/WebCore/ChangeLog
r282440 r282441 1 2021-09-14 Simon Fraser <simon.fraser@apple.com> 2 3 Implement the borderBoxSize/contentBoxSize parts of ResizeObserver 4 https://bugs.webkit.org/show_bug.cgi?id=230242 5 6 Reviewed by Sam Weinig. 7 8 The Resize Observer spec has been updated to allow authors to observe 9 "content-box", "border-box" and "device-pixel-content-box". Add support 10 for the first two, adding ResizeObserverSize, ResizeObserverBoxOptions and 11 ResizeObserverOptions per spec. 12 13 ResizeObserverEntry also contains borderBoxSize and contentBoxSize now, 14 so support that. 15 16 Add some helpers to make it easier to get box logical sizes. 17 18 "device-pixel-content-box" is not yet supported because it's expensive to compute[2]. 19 20 [1] https://drafts.csswg.org/resize-observer 21 [2] https://github.com/w3c/csswg-drafts/issues/6608 22 23 Tested by WPT. 24 25 * DerivedSources-input.xcfilelist: 26 * DerivedSources-output.xcfilelist: 27 * DerivedSources.make: 28 * Sources.txt: 29 * WebCore.xcodeproj/project.pbxproj: 30 * page/ResizeObservation.cpp: 31 (WebCore::ResizeObservation::create): 32 (WebCore::ResizeObservation::ResizeObservation): 33 (WebCore::ResizeObservation::updateObservationSize): 34 (WebCore::ResizeObservation::computeObservedSizes const): 35 (WebCore::ResizeObservation::computeContentRect const): 36 (WebCore::ResizeObservation::borderBoxSize const): 37 (WebCore::ResizeObservation::contentBoxSize const): 38 (WebCore::ResizeObservation::snappedContentBoxSize const): 39 (WebCore::ResizeObservation::elementSizeChanged const): 40 (WebCore::ResizeObservation::~ResizeObservation): Deleted. 41 (WebCore::ResizeObservation::computeObservedSize const): Deleted. 42 * page/ResizeObservation.h: 43 (WebCore::ResizeObservation::observedBox const): 44 * page/ResizeObserver.cpp: 45 (WebCore::ResizeObserver::observe): 46 (WebCore::ResizeObserver::gatherObservations): 47 (WebCore::ResizeObserver::deliverObservations): 48 * page/ResizeObserver.h: 49 * page/ResizeObserver.idl: 50 * page/ResizeObserverBoxOptions.h: Added. 51 * page/ResizeObserverBoxOptions.idl: Copied from Source/WebCore/page/ResizeObserverEntry.idl. 52 * page/ResizeObserverEntry.h: 53 (WebCore::ResizeObserverEntry::create): 54 (WebCore::ResizeObserverEntry::contentRect const): 55 (WebCore::ResizeObserverEntry::borderBoxSize const): 56 (WebCore::ResizeObserverEntry::contentBoxSize const): 57 (WebCore::ResizeObserverEntry::ResizeObserverEntry): 58 (WebCore::ResizeObserverEntry::m_contentBoxSizes): 59 * page/ResizeObserverEntry.idl: 60 * page/ResizeObserverOptions.h: Added. 61 * page/ResizeObserverOptions.idl: Copied from Source/WebCore/page/ResizeObserverEntry.idl. 62 * page/ResizeObserverSize.h: Added. 63 (WebCore::ResizeObserverSize::create): 64 (WebCore::ResizeObserverSize::inlineSize const): 65 (WebCore::ResizeObserverSize::blockSize const): 66 (WebCore::ResizeObserverSize::ResizeObserverSize): 67 * page/ResizeObserverSize.idl: Copied from Source/WebCore/page/ResizeObserverEntry.idl. 68 * rendering/RenderBox.h: 69 (WebCore::RenderBox::logicalSize const): 70 (WebCore::RenderBox::borderBoxLogicalSize const): 71 (WebCore::RenderBox::contentLogicalSize const): 72 * rendering/RenderElement.h: 73 (WebCore::adjustLayoutSizeForAbsoluteZoom): 74 * rendering/style/RenderStyle.h: 75 (WebCore::adjustLayoutSizeForAbsoluteZoom): 76 1 77 2021-09-14 Rob Buis <rbuis@igalia.com> 2 78 -
trunk/Source/WebCore/DerivedSources-input.xcfilelist
r282361 r282441 1192 1192 $(PROJECT_DIR)/page/RemoteDOMWindow.idl 1193 1193 $(PROJECT_DIR)/page/ResizeObserver.idl 1194 $(PROJECT_DIR)/page/ResizeObserverBoxOptions.idl 1194 1195 $(PROJECT_DIR)/page/ResizeObserverCallback.idl 1195 1196 $(PROJECT_DIR)/page/ResizeObserverEntry.idl 1197 $(PROJECT_DIR)/page/ResizeObserverOptions.idl 1198 $(PROJECT_DIR)/page/ResizeObserverSize.idl 1196 1199 $(PROJECT_DIR)/page/Screen.idl 1197 1200 $(PROJECT_DIR)/page/ScrollBehavior.idl -
trunk/Source/WebCore/DerivedSources-output.xcfilelist
r282361 r282441 1842 1842 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserver.cpp 1843 1843 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserver.h 1844 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverBoxOptions.cpp 1845 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverBoxOptions.h 1844 1846 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverCallback.cpp 1845 1847 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverCallback.h 1846 1848 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverEntry.cpp 1847 1849 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverEntry.h 1850 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverOptions.cpp 1851 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverOptions.h 1852 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverSize.cpp 1853 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSResizeObserverSize.h 1848 1854 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRsaHashedImportParams.cpp 1849 1855 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRsaHashedImportParams.h -
trunk/Source/WebCore/DerivedSources.make
r282361 r282441 1039 1039 $(WebCore)/page/RemoteDOMWindow.idl \ 1040 1040 $(WebCore)/page/ResizeObserver.idl \ 1041 $(WebCore)/page/ResizeObserverBoxOptions.idl \ 1041 1042 $(WebCore)/page/ResizeObserverCallback.idl \ 1042 1043 $(WebCore)/page/ResizeObserverEntry.idl \ 1044 $(WebCore)/page/ResizeObserverOptions.idl \ 1045 $(WebCore)/page/ResizeObserverSize.idl \ 1043 1046 $(WebCore)/page/Screen.idl \ 1044 1047 $(WebCore)/page/ScrollBehavior.idl \ -
trunk/Source/WebCore/Sources.txt
r282401 r282441 3404 3404 JSRequestAnimationFrameCallback.cpp 3405 3405 JSResizeObserver.cpp 3406 JSResizeObserverBoxOptions.cpp 3406 3407 JSResizeObserverCallback.cpp 3407 3408 JSResizeObserverEntry.cpp 3409 JSResizeObserverOptions.cpp 3410 JSResizeObserverSize.cpp 3408 3411 JSRsaHashedImportParams.cpp 3409 3412 JSRsaHashedKeyGenParams.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r282401 r282441 363 363 0FD41E6821F80C0E000C006D /* ScrollingTreeFrameHostingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD41E6621F80282000C006D /* ScrollingTreeFrameHostingNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 364 364 0FD41E6921F80D14000C006D /* ScrollingStateFrameHostingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD41E6521F80261000C006D /* ScrollingStateFrameHostingNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 365 0FD6A68526EEC221007B2231 /* JSResizeObserverOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6A68226EEC1D9007B2231 /* JSResizeObserverOptions.h */; }; 366 0FD6A68726EEC226007B2231 /* JSResizeObserverSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6A67D26EEC076007B2231 /* JSResizeObserverSize.h */; }; 367 0FD6A68826EEC22B007B2231 /* JSResizeObserverBoxOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6A67C26EEC076007B2231 /* JSResizeObserverBoxOptions.h */; }; 368 0FD6A68A26EEC32B007B2231 /* ResizeObserverOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6A68926EEC32A007B2231 /* ResizeObserverOptions.h */; }; 369 0FD6A68C26EEC37F007B2231 /* ResizeObserverBoxOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6A68B26EEC37F007B2231 /* ResizeObserverBoxOptions.h */; }; 370 0FD6A68E26EEC5E9007B2231 /* ResizeObserverSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD6A68D26EEC5E8007B2231 /* ResizeObserverSize.h */; }; 365 371 0FD723820EC8BD9300CA5DD7 /* FloatQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD723800EC8BD9300CA5DD7 /* FloatQuad.h */; settings = {ATTRIBUTES = (Private, ); }; }; 366 372 0FD975D5245CCB4700C42299 /* ScrollingTreeGestureState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD975D2245CBDAF00C42299 /* ScrollingTreeGestureState.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6357 6363 0FD41E6621F80282000C006D /* ScrollingTreeFrameHostingNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameHostingNode.h; sourceTree = "<group>"; }; 6358 6364 0FD41E6721F80282000C006D /* ScrollingTreeFrameHostingNode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeFrameHostingNode.cpp; sourceTree = "<group>"; }; 6365 0FD6A67226EEBA05007B2231 /* ResizeObserverOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ResizeObserverOptions.idl; sourceTree = "<group>"; }; 6366 0FD6A67426EEBAB9007B2231 /* ResizeObserverBoxOptions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ResizeObserverBoxOptions.idl; sourceTree = "<group>"; }; 6367 0FD6A67626EEBC7B007B2231 /* ResizeObserverSize.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ResizeObserverSize.idl; sourceTree = "<group>"; }; 6368 0FD6A67926EEC075007B2231 /* JSResizeObserverBoxOptions.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSResizeObserverBoxOptions.cpp; sourceTree = "<group>"; }; 6369 0FD6A67B26EEC075007B2231 /* JSResizeObserverSize.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSResizeObserverSize.cpp; sourceTree = "<group>"; }; 6370 0FD6A67C26EEC076007B2231 /* JSResizeObserverBoxOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSResizeObserverBoxOptions.h; sourceTree = "<group>"; }; 6371 0FD6A67D26EEC076007B2231 /* JSResizeObserverSize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSResizeObserverSize.h; sourceTree = "<group>"; }; 6372 0FD6A68026EEC1D9007B2231 /* JSResizeObserverOptions.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSResizeObserverOptions.cpp; sourceTree = "<group>"; }; 6373 0FD6A68226EEC1D9007B2231 /* JSResizeObserverOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSResizeObserverOptions.h; sourceTree = "<group>"; }; 6374 0FD6A68926EEC32A007B2231 /* ResizeObserverOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResizeObserverOptions.h; sourceTree = "<group>"; }; 6375 0FD6A68B26EEC37F007B2231 /* ResizeObserverBoxOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResizeObserverBoxOptions.h; sourceTree = "<group>"; }; 6376 0FD6A68D26EEC5E8007B2231 /* ResizeObserverSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResizeObserverSize.h; sourceTree = "<group>"; }; 6359 6377 0FD723800EC8BD9300CA5DD7 /* FloatQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatQuad.h; sourceTree = "<group>"; }; 6360 6378 0FD723810EC8BD9300CA5DD7 /* FloatQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatQuad.cpp; sourceTree = "<group>"; }; … … 22358 22376 58B2F9EC2232D43B00938D63 /* ResizeObserver.h */, 22359 22377 58B2F9F12232D43E00938D63 /* ResizeObserver.idl */, 22378 0FD6A68B26EEC37F007B2231 /* ResizeObserverBoxOptions.h */, 22379 0FD6A67426EEBAB9007B2231 /* ResizeObserverBoxOptions.idl */, 22360 22380 58B2F9F02232D43E00938D63 /* ResizeObserverCallback.h */, 22361 22381 58B2F9ED2232D43C00938D63 /* ResizeObserverCallback.idl */, 22362 22382 58B2F9EE2232D43D00938D63 /* ResizeObserverEntry.h */, 22363 22383 58B2F9EA2232D43B00938D63 /* ResizeObserverEntry.idl */, 22384 0FD6A68926EEC32A007B2231 /* ResizeObserverOptions.h */, 22385 0FD6A67226EEBA05007B2231 /* ResizeObserverOptions.idl */, 22386 0FD6A68D26EEC5E8007B2231 /* ResizeObserverSize.h */, 22387 0FD6A67626EEBC7B007B2231 /* ResizeObserverSize.idl */, 22364 22388 A5071E821C56D079009951BE /* ResourceUsageData.h */, 22365 22389 ADBAD6EC1BCDD95000381325 /* ResourceUsageOverlay.cpp */, … … 27527 27551 58B2FA032232D60B00938D63 /* JSResizeObserver.cpp */, 27528 27552 58B2FA012232D60A00938D63 /* JSResizeObserver.h */, 27553 0FD6A67926EEC075007B2231 /* JSResizeObserverBoxOptions.cpp */, 27554 0FD6A67C26EEC076007B2231 /* JSResizeObserverBoxOptions.h */, 27529 27555 58B2F9FE2232D60700938D63 /* JSResizeObserverCallback.cpp */, 27530 27556 58B2F9FF2232D60800938D63 /* JSResizeObserverCallback.h */, 27531 27557 58B2FA002232D60900938D63 /* JSResizeObserverEntry.cpp */, 27532 27558 58B2FA022232D60A00938D63 /* JSResizeObserverEntry.h */, 27559 0FD6A68026EEC1D9007B2231 /* JSResizeObserverOptions.cpp */, 27560 0FD6A68226EEC1D9007B2231 /* JSResizeObserverOptions.h */, 27561 0FD6A67B26EEC075007B2231 /* JSResizeObserverSize.cpp */, 27562 0FD6A67D26EEC076007B2231 /* JSResizeObserverSize.h */, 27533 27563 BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */, 27534 27564 BCEC01C10C274DDD009F4EC9 /* JSScreen.h */, … … 33391 33421 4998AECE13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.h in Headers */, 33392 33422 58B2FA042232D9BE00938D63 /* JSResizeObserver.h in Headers */, 33423 0FD6A68826EEC22B007B2231 /* JSResizeObserverBoxOptions.h in Headers */, 33393 33424 58B2FA062232DC5500938D63 /* JSResizeObserverCallback.h in Headers */, 33394 33425 58B2FA052232DC4F00938D63 /* JSResizeObserverEntry.h in Headers */, 33426 0FD6A68526EEC221007B2231 /* JSResizeObserverOptions.h in Headers */, 33427 0FD6A68726EEC226007B2231 /* JSResizeObserverSize.h in Headers */, 33395 33428 57E233711DCD468F00F28D01 /* JSRsaHashedImportParams.h in Headers */, 33396 33429 5768E4341DB7524500D0A4F7 /* JSRsaHashedKeyGenParams.h in Headers */, … … 34623 34656 58B2F9F42232D45300938D63 /* ResizeObservation.h in Headers */, 34624 34657 58B2F9F52232D45800938D63 /* ResizeObserver.h in Headers */, 34658 0FD6A68C26EEC37F007B2231 /* ResizeObserverBoxOptions.h in Headers */, 34625 34659 58B2F9F62232D45C00938D63 /* ResizeObserverCallback.h in Headers */, 34626 34660 58B2F9F72232D46100938D63 /* ResizeObserverEntry.h in Headers */, 34661 0FD6A68A26EEC32B007B2231 /* ResizeObserverOptions.h in Headers */, 34662 0FD6A68E26EEC5E9007B2231 /* ResizeObserverSize.h in Headers */, 34627 34663 7C2FA6121EA95A3C00A03108 /* ResourceCryptographicDigest.h in Headers */, 34628 34664 7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */, -
trunk/Source/WebCore/page/ResizeObservation.cpp
r279800 r282441 27 27 28 28 #if ENABLE(RESIZE_OBSERVER) 29 29 30 #include "ResizeObservation.h" 30 31 … … 35 36 namespace WebCore { 36 37 37 Ref<ResizeObservation> ResizeObservation::create(Element& target )38 Ref<ResizeObservation> ResizeObservation::create(Element& target, ResizeObserverBoxOptions observedBox) 38 39 { 39 return adoptRef(*new ResizeObservation(target ));40 return adoptRef(*new ResizeObservation(target, observedBox)); 40 41 } 41 42 42 ResizeObservation::ResizeObservation(Element& element )43 ResizeObservation::ResizeObservation(Element& element, ResizeObserverBoxOptions observedBox) 43 44 : m_target { makeWeakPtr(element) } 45 , m_observedBox { observedBox } 44 46 { 45 47 } 46 48 47 ResizeObservation::~ResizeObservation() 49 ResizeObservation::~ResizeObservation() = default; 50 51 void ResizeObservation::updateObservationSize(const BoxSizes& boxSizes) 48 52 { 53 m_lastObservationSizes = boxSizes; 49 54 } 50 55 51 void ResizeObservation::updateObservationSize(const LayoutSize& size) 52 { 53 m_lastObservationSize = size; 54 } 55 56 LayoutSize ResizeObservation::computeObservedSize() const 56 auto ResizeObservation::computeObservedSizes() const -> BoxSizes 57 57 { 58 58 if (m_target->isSVGElement()) { 59 if (auto svgRect = downcast<SVGElement>(*m_target).getBoundingBox()) 60 return LayoutSize(svgRect->width(), svgRect->height()); 59 if (auto svgRect = downcast<SVGElement>(*m_target).getBoundingBox()) { 60 auto size = LayoutSize(svgRect->width(), svgRect->height()); 61 return { size, size, size }; 62 } 61 63 } 62 64 auto* box = m_target->renderBox(); 63 65 if (box) { 64 auto contentSize = box->contentSize(); 65 return LayoutSize(adjustLayoutUnitForAbsoluteZoom(contentSize.width(), *box), adjustLayoutUnitForAbsoluteZoom(contentSize.height(), *box)); 66 return { 67 adjustLayoutSizeForAbsoluteZoom(box->contentSize(), *box), 68 adjustLayoutSizeForAbsoluteZoom(box->contentLogicalSize(), *box), 69 adjustLayoutSizeForAbsoluteZoom(box->borderBoxLogicalSize(), *box) 70 }; 66 71 } 67 72 68 return LayoutSize();73 return { }; 69 74 } 70 75 … … 81 86 FloatRect ResizeObservation::computeContentRect() const 82 87 { 83 return FloatRect(FloatPoint(computeTargetLocation()), FloatSize(m_lastObservationSize ));88 return FloatRect(FloatPoint(computeTargetLocation()), FloatSize(m_lastObservationSizes.contentBoxSize)); 84 89 } 85 90 86 bool ResizeObservation::elementSizeChanged(LayoutSize& currentSize) const91 FloatSize ResizeObservation::borderBoxSize() const 87 92 { 88 currentSize = computeObservedSize(); 89 return m_lastObservationSize != currentSize; 93 return m_lastObservationSizes.borderBoxLogicalSize; 94 } 95 96 FloatSize ResizeObservation::contentBoxSize() const 97 { 98 return m_lastObservationSizes.contentBoxLogicalSize; 99 } 100 101 FloatSize ResizeObservation::snappedContentBoxSize() const 102 { 103 return m_lastObservationSizes.contentBoxLogicalSize; // FIXME: Need to pixel snap. 104 } 105 106 std::optional<ResizeObservation::BoxSizes> ResizeObservation::elementSizeChanged() const 107 { 108 auto currentSizes = computeObservedSizes(); 109 110 switch (m_observedBox) { 111 case ResizeObserverBoxOptions::BorderBox: 112 if (m_lastObservationSizes.borderBoxLogicalSize != currentSizes.borderBoxLogicalSize) 113 return currentSizes; 114 break; 115 case ResizeObserverBoxOptions::ContentBox: 116 if (m_lastObservationSizes.contentBoxLogicalSize != currentSizes.contentBoxLogicalSize) 117 return currentSizes; 118 break; 119 } 120 121 return { }; 90 122 } 91 123 -
trunk/Source/WebCore/page/ResizeObservation.h
r279800 r282441 27 27 28 28 #if ENABLE(RESIZE_OBSERVER) 29 29 30 #include "FloatRect.h" 30 31 #include "LayoutSize.h" 32 #include "ResizeObserverBoxOptions.h" 31 33 32 34 #include <wtf/RefCounted.h> … … 40 42 WTF_MAKE_FAST_ALLOCATED; 41 43 public: 42 static Ref<ResizeObservation> create(Element& target );44 static Ref<ResizeObservation> create(Element& target, ResizeObserverBoxOptions); 43 45 44 46 ~ResizeObservation(); 47 48 struct BoxSizes { 49 LayoutSize contentBoxSize; 50 LayoutSize contentBoxLogicalSize; 51 LayoutSize borderBoxLogicalSize; 52 }; 45 53 46 void updateObservationSize(const LayoutSize&);47 LayoutSize computeObservedSize() const;48 LayoutPoint computeTargetLocation() const; 54 std::optional<BoxSizes> elementSizeChanged() const; 55 void updateObservationSize(const BoxSizes&); 56 49 57 FloatRect computeContentRect() const; 58 FloatSize borderBoxSize() const; 59 FloatSize contentBoxSize() const; 60 FloatSize snappedContentBoxSize() const; 50 61 51 bool elementSizeChanged(LayoutSize&) const;52 62 Element* target() const { return m_target.get(); } 63 ResizeObserverBoxOptions observedBox() const { return m_observedBox; } 53 64 size_t targetElementDepth() const; 54 65 55 66 private: 56 ResizeObservation(Element& target); 67 ResizeObservation(Element&, ResizeObserverBoxOptions); 68 69 BoxSizes computeObservedSizes() const; 70 LayoutPoint computeTargetLocation() const; 57 71 58 72 WeakPtr<Element> m_target; 59 LayoutSize m_lastObservationSize; 73 BoxSizes m_lastObservationSizes; 74 ResizeObserverBoxOptions m_observedBox; 60 75 }; 61 76 -
trunk/Source/WebCore/page/ResizeObserver.cpp
r281188 r282441 32 32 #include "InspectorInstrumentation.h" 33 33 #include "ResizeObserverEntry.h" 34 #include "ResizeObserverOptions.h" 34 35 #include <JavaScriptCore/AbstractSlotVisitorInlines.h> 35 36 … … 54 55 } 55 56 56 void ResizeObserver::observe(Element& target) 57 // https://drafts.csswg.org/resize-observer/#dom-resizeobserver-observe 58 void ResizeObserver::observe(Element& target, const ResizeObserverOptions& options) 57 59 { 58 60 if (!m_callback) … … 63 65 }); 64 66 65 if (position != notFound) 66 return; 67 if (position != notFound) { 68 // The spec suggests unconditionally unobserving here, but that causes a test failure: 69 // https://github.com/web-platform-tests/wpt/issues/30708 70 if (m_observations[position]->observedBox() == options.box) 71 return; 72 73 unobserve(target); 74 } 67 75 68 76 auto& observerData = target.ensureResizeObserverData(); 69 77 observerData.observers.append(makeWeakPtr(this)); 70 78 71 m_observations.append(ResizeObservation::create(target ));79 m_observations.append(ResizeObservation::create(target, options.box)); 72 80 73 81 if (m_document) { … … 77 85 } 78 86 87 // https://drafts.csswg.org/resize-observer/#dom-resizeobserver-unobserve 79 88 void ResizeObserver::unobserve(Element& target) 80 89 { … … 85 94 } 86 95 96 // https://drafts.csswg.org/resize-observer/#dom-resizeobserver-disconnect 87 97 void ResizeObserver::disconnect() 88 98 { … … 100 110 size_t minObservedDepth = maxElementDepth(); 101 111 for (const auto& observation : m_observations) { 102 LayoutSize currentSize; 103 if (observation->elementSizeChanged(currentSize)) { 112 if (auto currentSizes = observation->elementSizeChanged()) { 104 113 size_t depth = observation->targetElementDepth(); 105 114 if (depth > deeperThan) { 106 observation->updateObservationSize( currentSize);115 observation->updateObservationSize(*currentSizes); 107 116 m_activeObservations.append(observation.get()); 108 117 m_activeObservationTargets.append(*observation->target()); … … 120 129 for (const auto& observation : m_activeObservations) { 121 130 ASSERT(observation->target()); 122 entries.append(ResizeObserverEntry::create(observation->target(), observation->computeContentRect() ));131 entries.append(ResizeObserverEntry::create(observation->target(), observation->computeContentRect(), observation->borderBoxSize(), observation->contentBoxSize())); 123 132 } 124 133 m_activeObservations.clear(); -
trunk/Source/WebCore/page/ResizeObserver.h
r279800 r282441 45 45 class Document; 46 46 class Element; 47 struct ResizeObserverOptions; 47 48 48 49 struct ResizeObserverData { … … 59 60 bool hasActiveObservations() const { return m_activeObservations.size(); } 60 61 61 void observe(Element& );62 void observe(Element&, const ResizeObserverOptions&); 62 63 void unobserve(Element&); 63 64 void disconnect(); -
trunk/Source/WebCore/page/ResizeObserver.idl
r279800 r282441 36 36 [CallWith=Document] constructor(ResizeObserverCallback callback); 37 37 38 undefined observe(Element target );38 undefined observe(Element target, optional ResizeObserverOptions options); 39 39 undefined unobserve(Element target); 40 40 undefined disconnect(); -
trunk/Source/WebCore/page/ResizeObserverBoxOptions.idl
r282440 r282441 1 1 /* 2 * Copyright (C) 20 19 Igalia S.L.2 * Copyright (C) 2021 Apple Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 // https://wicg.github.io/ResizeObserver/ 27 28 [ 29 Conditional=RESIZE_OBSERVER, 30 CallbackThisObject=ResizeObserver, 31 IsWeakCallback, 32 ] callback ResizeObserverCallback = undefined (sequence<ResizeObserverEntry> entries, ResizeObserver observer); 26 // https://drafts.csswg.org/resize-observer/#enumdef-resizeobserverboxoptions 27 enum ResizeObserverBoxOptions { 28 "border-box", 29 "content-box" 30 // "device-pixel-content-box" webkit.org/b/219005 31 }; -
trunk/Source/WebCore/page/ResizeObserverCallback.idl
r268860 r282441 24 24 */ 25 25 26 // https://wicg.github.io/ResizeObserver/ 27 26 // https://drafts.csswg.org/resize-observer/#resize-observer-callback 28 27 [ 29 28 Conditional=RESIZE_OBSERVER, -
trunk/Source/WebCore/page/ResizeObserverEntry.h
r243643 r282441 31 31 #include "Element.h" 32 32 #include "FloatRect.h" 33 #include "ResizeObserverSize.h" 33 34 #include <wtf/RefCounted.h> 34 35 … … 36 37 37 38 class Element; 39 class ResizeObserverSize; 38 40 39 41 class ResizeObserverEntry : public RefCounted<ResizeObserverEntry> { 40 42 WTF_MAKE_FAST_ALLOCATED; 41 43 public: 42 static Ref<ResizeObserverEntry> create(Element* target, const FloatRect& contentRect )44 static Ref<ResizeObserverEntry> create(Element* target, const FloatRect& contentRect, FloatSize borderBoxSize, FloatSize contentBoxSize) 43 45 { 44 return adoptRef(*new ResizeObserverEntry(target, contentRect ));46 return adoptRef(*new ResizeObserverEntry(target, contentRect, borderBoxSize, contentBoxSize)); 45 47 } 46 48 47 49 Element* target() const { return m_target.get(); } 48 DOMRectReadOnly* contentRect() const { return m_contentRect.get(); } 50 DOMRectReadOnly* contentRect() const { return m_contentRect.ptr(); } 51 52 const Vector<Ref<ResizeObserverSize>>& borderBoxSize() const { return m_borderBoxSizes; } 53 const Vector<Ref<ResizeObserverSize>>& contentBoxSize() const { return m_contentBoxSizes; } 49 54 50 55 private: 51 ResizeObserverEntry(Element* target, const FloatRect& contentRect )56 ResizeObserverEntry(Element* target, const FloatRect& contentRect, FloatSize borderBoxSize, FloatSize contentBoxSize) 52 57 : m_target(target) 53 58 , m_contentRect(DOMRectReadOnly::create(contentRect.x(), contentRect.y(), contentRect.width(), contentRect.height())) 59 , m_borderBoxSizes({ ResizeObserverSize::create(borderBoxSize.width(), borderBoxSize.height()) }) 60 , m_contentBoxSizes({ ResizeObserverSize::create(contentBoxSize.width(), contentBoxSize.height()) }) 54 61 { 55 62 } 56 63 57 64 RefPtr<Element> m_target; 58 RefPtr<DOMRectReadOnly> m_contentRect; 65 Ref<DOMRectReadOnly> m_contentRect; 66 // The spec is designed to allow mulitple boxes for multicol scenarios, but for now these vectors only ever contain one entry. 67 Vector<Ref<ResizeObserverSize>> m_borderBoxSizes; 68 Vector<Ref<ResizeObserverSize>> m_contentBoxSizes; 59 69 }; 60 70 -
trunk/Source/WebCore/page/ResizeObserverEntry.idl
r267813 r282441 24 24 */ 25 25 26 // https://wicg.github.io/ResizeObserver/ 27 26 // https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface 28 27 [ 29 28 Conditional=RESIZE_OBSERVER, … … 35 34 readonly attribute Element target; 36 35 readonly attribute DOMRectReadOnly contentRect; 36 readonly attribute FrozenArray<ResizeObserverSize> borderBoxSize; 37 readonly attribute FrozenArray<ResizeObserverSize> contentBoxSize; 37 38 }; -
trunk/Source/WebCore/page/ResizeObserverOptions.idl
r282440 r282441 1 1 /* 2 * Copyright (C) 20 19 Igalia S.L.2 * Copyright (C) 2021 Apple Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 // https://wicg.github.io/ResizeObserver/ 27 26 // https://drafts.csswg.org/resize-observer/#dictdef-resizeobserveroptions 28 27 [ 29 28 Conditional=RESIZE_OBSERVER, 30 CallbackThisObject=ResizeObserver, 31 IsWeakCallback,32 ] callback ResizeObserverCallback = undefined (sequence<ResizeObserverEntry> entries, ResizeObserver observer);29 ] dictionary ResizeObserverOptions { 30 ResizeObserverBoxOptions box = "content-box"; 31 }; -
trunk/Source/WebCore/page/ResizeObserverSize.idl
r282440 r282441 1 1 /* 2 * Copyright (C) 20 19 Igalia S.L.2 * Copyright (C) 2021 Apple Inc. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 // https://wicg.github.io/ResizeObserver/ 27 26 // https://drafts.csswg.org/resize-observer/#resizeobserversize 28 27 [ 29 Conditional=RESIZE_OBSERVER, 30 CallbackThisObject=ResizeObserver, 31 IsWeakCallback, 32 ] callback ResizeObserverCallback = undefined (sequence<ResizeObserverEntry> entries, ResizeObserver observer); 28 Exposed=Window, 29 Conditional=RESIZE_OBSERVER 30 ] interface ResizeObserverSize { 31 readonly attribute unrestricted double inlineSize; 32 readonly attribute unrestricted double blockSize; 33 }; -
trunk/Source/WebCore/rendering/RenderBox.h
r281239 r282441 139 139 LayoutSize locationOffset() const { return LayoutSize(x(), y()); } 140 140 LayoutSize size() const { return m_frameRect.size(); } 141 LayoutSize logicalSize() const { return style().isHorizontalWritingMode() ? m_frameRect.size() : m_frameRect.size().transposedSize(); } 141 142 142 143 void setLocation(const LayoutPoint& location) { m_frameRect.setLocation(location); } … … 158 159 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); } 159 160 LayoutRect borderBoundingBox() const final { return borderBoxRect(); } 161 LayoutSize borderBoxLogicalSize() const { return logicalSize(); } 160 162 161 163 WEBCORE_EXPORT RoundedRect::Radii borderRadii() const; … … 222 224 LayoutUnit contentWidth() const { return std::max(0_lu, paddingBoxWidth() - paddingLeft() - paddingRight()); } 223 225 LayoutUnit contentHeight() const { return std::max(0_lu, paddingBoxHeight() - paddingTop() - paddingBottom()); } 226 LayoutSize contentLogicalSize() const { return style().isHorizontalWritingMode() ? contentSize() : contentSize().transposedSize(); } 224 227 LayoutUnit contentLogicalWidth() const { return style().isHorizontalWritingMode() ? contentWidth() : contentHeight(); } 225 228 LayoutUnit contentLogicalHeight() const { return style().isHorizontalWritingMode() ? contentHeight() : contentWidth(); } -
trunk/Source/WebCore/rendering/RenderElement.h
r282223 r282441 532 532 } 533 533 534 inline LayoutSize adjustLayoutSizeForAbsoluteZoom(LayoutSize size, const RenderElement& renderer) 535 { 536 return adjustLayoutSizeForAbsoluteZoom(size, renderer.style()); 537 } 538 534 539 inline RenderObject* RenderElement::firstInFlowChild() const 535 540 { -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r282397 r282441 2006 2006 float adjustFloatForAbsoluteZoom(float, const RenderStyle&); 2007 2007 LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit, const RenderStyle&); 2008 LayoutSize adjustLayoutSizeForAbsoluteZoom(LayoutSize, const RenderStyle&); 2008 2009 2009 2010 BorderStyle collapsedBorderStyle(BorderStyle); … … 2128 2129 } 2129 2130 2131 inline LayoutSize adjustLayoutSizeForAbsoluteZoom(LayoutSize size, const RenderStyle& style) 2132 { 2133 auto zoom = style.effectiveZoom(); 2134 return { 2135 size.width() / zoom, 2136 size.height() / zoom 2137 }; 2138 } 2139 2130 2140 inline BorderStyle collapsedBorderStyle(BorderStyle style) 2131 2141 {
Note: See TracChangeset
for help on using the changeset viewer.