WebKit Bugzilla
Attachment 342785 Details for
Bug 186640
: [LFC] Fix static position left/top
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186640-20180614193840.patch (text/plain), 4.86 KB, created by
zalan
on 2018-06-14 19:38:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-14 19:38:41 PDT
Size:
4.86 KB
patch
obsolete
>Subversion Revision: 232839 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9a012c193c444d257f445c6ac12933d9b6657fe6..65fb2df1435394d34e959d3f3090e2f7451fe951 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-06-14 Zalan Bujtas <zalan@apple.com> >+ >+ [LFC] Fix static position left/top >+ https://bugs.webkit.org/show_bug.cgi?id=186640 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In visual formatting model, we normally go like [top, left] while LayoutPoint takes [x, y]. Let's make this less error prone. >+ >+ * layout/FormattingContext.h: >+ (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): >+ * layout/blockformatting/BlockFormattingContext.h: >+ * layout/blockformatting/BlockFormattingContextGeometry.cpp: >+ (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): >+ (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): >+ > 2018-06-13 Zalan Bujtas <zalan@apple.com> > > [LFC] Miscellaneous fixes to be able to layout <div> with fixed width/height >diff --git a/Source/WebCore/layout/FormattingContext.h b/Source/WebCore/layout/FormattingContext.h >index 53e2c1e997e09dd13aa140196a1f32f381248733..1540ff7113971e265c183e1a214ffe32a2066d3c 100644 >--- a/Source/WebCore/layout/FormattingContext.h >+++ b/Source/WebCore/layout/FormattingContext.h >@@ -81,6 +81,12 @@ protected: > // This class implements generic positioning and sizing. > class Geometry { > public: >+ struct Position { >+ LayoutUnit y; // top >+ LayoutUnit x; // left >+ operator LayoutPoint() const { return { x, y }; } >+ }; >+ > struct WidthAndMargin { > LayoutUnit width; > Display::Box::HorizontalEdges margin; >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >index 6d8e212153bbc00abb9b3f3bdf8d8bfe5ed34e41..5072851b880af20451cd274b0a0a5c0fabf2e1f7 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContext.h >@@ -65,8 +65,8 @@ private: > static FormattingContext::Geometry::HeightAndMargin inFlowHeightAndMargin(LayoutContext&, const Box&); > static FormattingContext::Geometry::WidthAndMargin inFlowWidthAndMargin(LayoutContext&, const Box&); > >- static LayoutPoint staticPosition(LayoutContext&, const Box&); >- static LayoutPoint inFlowPositionedPosition(LayoutContext&, const Box&); >+ static FormattingContext::Geometry::Position staticPosition(LayoutContext&, const Box&); >+ static FormattingContext::Geometry::Position inFlowPositionedPosition(LayoutContext&, const Box&); > > private: > static FormattingContext::Geometry::HeightAndMargin inFlowNonReplacedHeightAndMargin(LayoutContext&, const Box&); >diff --git a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >index 38445eac355482b5b8eaec204ff294837a57fb8d..596edc09b284608fc6f9dc75f4dace92c2e36441 100644 >--- a/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp >@@ -252,7 +252,7 @@ FormattingContext::Geometry::WidthAndMargin BlockFormattingContext::Geometry::in > return inlineReplacedWidthAndBlockNonReplacedMargin; > } > >-LayoutPoint BlockFormattingContext::Geometry::staticPosition(LayoutContext& layoutContext, const Box& layoutBox) >+FormattingContext::Geometry::Position BlockFormattingContext::Geometry::staticPosition(LayoutContext& layoutContext, const Box& layoutBox) > { > // https://www.w3.org/TR/CSS22/visuren.html#block-formatting > // In a block formatting context, boxes are laid out one after the other, vertically, beginning at the top of a containing block. >@@ -270,7 +270,7 @@ LayoutPoint BlockFormattingContext::Geometry::staticPosition(LayoutContext& layo > return { top, left }; > } > >-LayoutPoint BlockFormattingContext::Geometry::inFlowPositionedPosition(LayoutContext& layoutContext, const Box& layoutBox) >+FormattingContext::Geometry::Position BlockFormattingContext::Geometry::inFlowPositionedPosition(LayoutContext& layoutContext, const Box& layoutBox) > { > ASSERT(layoutBox.isInFlowPositioned()); > // 9.4.3 Relative positioning >@@ -329,7 +329,7 @@ LayoutPoint BlockFormattingContext::Geometry::inFlowPositionedPosition(LayoutCon > leftDelta = left.value(); > } > >- return { displayBox.left() + leftDelta, displayBox.top() + topDelta }; >+ return { displayBox.top() + topDelta, displayBox.left() + leftDelta }; > } > > FormattingContext::Geometry::HeightAndMargin BlockFormattingContext::Geometry::inFlowHeightAndMargin(LayoutContext& layoutContext, const Box& layoutBox)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
koivisto
:
review+
ltilve+ews
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186640
: 342785 |
342802