Bug 186019 - [LFC] Add Rect interface to Display::Box
Summary: [LFC] Add Rect interface to Display::Box
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-27 09:11 PDT by zalan
Modified: 2018-05-28 13:40 PDT (History)
6 users (show)

See Also:


Attachments
Patch (18.97 KB, patch)
2018-05-27 09:21 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2018-05-27 09:11:21 PDT
so that we do contentBox().left() without having a fully computed contentBox()

-also it makes more sense to use top/left/bottom/right in the context of layout.
Comment 1 zalan 2018-05-27 09:21:27 PDT
Created attachment 341423 [details]
Patch
Comment 2 Antti Koivisto 2018-05-28 10:06:36 PDT
Comment on attachment 341423 [details]
Patch

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

> Source/WebCore/layout/displaytree/DisplayBox.h:114
> +    LayoutUnit top() const { return m_rect.top(); }
> +    LayoutUnit left() const { return m_rect.left(); }
> +    LayoutUnit bottom() const { return m_rect.bottom(); }
> +    LayoutUnit right() const { return m_rect.right(); }

I guess these helpers are used a lot? box.top() is not that much more compact than box.rect().top().
Comment 3 zalan 2018-05-28 13:12:27 PDT
(In reply to Antti Koivisto from comment #2)
> Comment on attachment 341423 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=341423&action=review
> 
> > Source/WebCore/layout/displaytree/DisplayBox.h:114
> > +    LayoutUnit top() const { return m_rect.top(); }
> > +    LayoutUnit left() const { return m_rect.left(); }
> > +    LayoutUnit bottom() const { return m_rect.bottom(); }
> > +    LayoutUnit right() const { return m_rect.right(); }
> 
> I guess these helpers are used a lot? box.top() is not that much more
> compact than box.rect().top().
They are (or will be) used a lot and from layout logic correctness's point of view displayBox.rect().top() is rather different from displayBox.top() where rect().top() assumes a computed rect() (including width() and height()) even if you only access its top value.
Comment 4 WebKit Commit Bot 2018-05-28 13:39:20 PDT
Comment on attachment 341423 [details]
Patch

Clearing flags on attachment: 341423

Committed r232250: <https://trac.webkit.org/changeset/232250>
Comment 5 WebKit Commit Bot 2018-05-28 13:39:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2018-05-28 13:40:15 PDT
<rdar://problem/40601769>