Bug 189525 - [IntersectionObserver] Implement rootMargin expansion
Summary: [IntersectionObserver] Implement rootMargin expansion
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ali Juma
URL:
Keywords: InRadar
Depends on:
Blocks: 159475
  Show dependency treegraph
 
Reported: 2018-09-11 14:56 PDT by Ali Juma
Modified: 2018-09-12 10:04 PDT (History)
10 users (show)

See Also:


Attachments
Patch (5.50 KB, patch)
2018-09-11 14:59 PDT, Ali Juma
no flags Details | Formatted Diff | Diff
Patch for landing (6.35 KB, patch)
2018-09-12 08:26 PDT, Ali Juma
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Juma 2018-09-11 14:56:08 PDT
Expand the root intersection rectangle by the observer's rootMargin.
Comment 1 Ali Juma 2018-09-11 14:59:37 PDT
Created attachment 349467 [details]
Patch
Comment 2 Simon Fraser (smfr) 2018-09-11 15:32:33 PDT
Comment on attachment 349467 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=349467&action=review

> Source/WebCore/dom/Document.cpp:7498
> +    localRootBounds.move(-rootMarginFloatBox.left(), -rootMarginFloatBox.top());
> +    localRootBounds.expand(rootMarginFloatBox.left() + rootMarginFloatBox.right(), rootMarginFloatBox.top() + rootMarginFloatBox.bottom());

It feels like there should be a cleaner way to do this.
Comment 3 Ali Juma 2018-09-12 08:26:36 PDT
Created attachment 349548 [details]
Patch for landing
Comment 4 Ali Juma 2018-09-12 08:30:10 PDT
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 349467 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=349467&action=review
> 
> > Source/WebCore/dom/Document.cpp:7498
> > +    localRootBounds.move(-rootMarginFloatBox.left(), -rootMarginFloatBox.top());
> > +    localRootBounds.expand(rootMarginFloatBox.left() + rootMarginFloatBox.right(), rootMarginFloatBox.top() + rootMarginFloatBox.bottom());
> 
> It feels like there should be a cleaner way to do this.

LayoutRect::expand has an overload that takes a LayoutBoxExtent, so I added a version of FloatRect::expand that takes a FloatBoxExtent.
Comment 5 WebKit Commit Bot 2018-09-12 10:03:22 PDT
Comment on attachment 349548 [details]
Patch for landing

Clearing flags on attachment: 349548

Committed r235943: <https://trac.webkit.org/changeset/235943>
Comment 6 WebKit Commit Bot 2018-09-12 10:03:24 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-09-12 10:04:21 PDT
<rdar://problem/44386685>