Title: [269229] trunk/Source/WebCore
- Revision
- 269229
- Author
- [email protected]
- Date
- 2020-10-31 14:11:23 -0700 (Sat, 31 Oct 2020)
Log Message
[LFC][Integration] LineIteratorModernPath::top/bottom map to Line::enclosingRect::top/bottom
https://bugs.webkit.org/show_bug.cgi?id=218415
Reviewed by Antti Koivisto.
Line::enclosingRect includes all the inline level boxes on the line.
* layout/integration/LayoutIntegrationLineIteratorModernPath.h:
(WebCore::LayoutIntegration::LineIteratorModernPath::top const):
(WebCore::LayoutIntegration::LineIteratorModernPath::bottom const):
(WebCore::LayoutIntegration::LineIteratorModernPath::selectionTop const):
(WebCore::LayoutIntegration::LineIteratorModernPath::selectionTopForHitTesting const):
(WebCore::LayoutIntegration::LineIteratorModernPath::selectionBottom const):
(WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const):
(WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const):
(WebCore::LayoutIntegration::LineIteratorModernPath::y const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (269228 => 269229)
--- trunk/Source/WebCore/ChangeLog 2020-10-31 19:06:24 UTC (rev 269228)
+++ trunk/Source/WebCore/ChangeLog 2020-10-31 21:11:23 UTC (rev 269229)
@@ -1,3 +1,22 @@
+2020-10-31 Zalan Bujtas <[email protected]>
+
+ [LFC][Integration] LineIteratorModernPath::top/bottom map to Line::enclosingRect::top/bottom
+ https://bugs.webkit.org/show_bug.cgi?id=218415
+
+ Reviewed by Antti Koivisto.
+
+ Line::enclosingRect includes all the inline level boxes on the line.
+
+ * layout/integration/LayoutIntegrationLineIteratorModernPath.h:
+ (WebCore::LayoutIntegration::LineIteratorModernPath::top const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::bottom const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::selectionTop const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::selectionTopForHitTesting const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::selectionBottom const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxTop const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::lineBoxBottom const):
+ (WebCore::LayoutIntegration::LineIteratorModernPath::y const):
+
2020-10-31 Simon Fraser <[email protected]>
Clean up BoxSide and BorderEdge code
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h (269228 => 269229)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h 2020-10-31 19:06:24 UTC (rev 269228)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineIteratorModernPath.h 2020-10-31 21:11:23 UTC (rev 269229)
@@ -49,16 +49,16 @@
LineIteratorModernPath& operator=(const LineIteratorModernPath&) = default;
LineIteratorModernPath& operator=(LineIteratorModernPath&&) = default;
- LayoutUnit top() const { return LayoutUnit::fromFloatRound(line().rect().y()); }
- LayoutUnit bottom() const { return LayoutUnit::fromFloatRound(line().rect().maxY()); }
+ LayoutUnit top() const { return LayoutUnit::fromFloatRound(line().enclosingRect().y()); }
+ LayoutUnit bottom() const { return LayoutUnit::fromFloatRound(line().enclosingRect().maxY()); }
// FIXME: What should these really be?
- LayoutUnit selectionTop() const { return top(); }
- LayoutUnit selectionTopForHitTesting() const { return top(); }
- LayoutUnit selectionBottom() const { return bottom(); }
- LayoutUnit lineBoxTop() const { return top(); }
- LayoutUnit lineBoxBottom() const { return bottom(); }
+ LayoutUnit selectionTop() const { return lineBoxTop(); }
+ LayoutUnit selectionTopForHitTesting() const { return lineBoxTop(); }
+ LayoutUnit selectionBottom() const { return lineBoxBottom(); }
+ LayoutUnit lineBoxTop() const { return LayoutUnit::fromFloatRound(line().rect().y()); }
+ LayoutUnit lineBoxBottom() const { return LayoutUnit::fromFloatRound(line().rect().maxY()); }
- float y() const { return top(); }
+ float y() const { return lineBoxTop(); }
float logicalHeight() const { return line().rect().height(); }
bool isHorizontal() const { return true; }
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (269228 => 269229)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-10-31 19:06:24 UTC (rev 269228)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp 2020-10-31 21:11:23 UTC (rev 269229)
@@ -252,6 +252,8 @@
auto& lineBox = lineBoxes[lineIndex];
for (auto& inlineLevelBox : lineBox.inlineLevelBoxList()) {
auto inlineLevelBoxLogicalRect = lineBox.logicalRectForInlineLevelBox(inlineLevelBox->layoutBox());
+ // inlineLevelBoxLogicalRect is relative to the line.
+ inlineLevelBoxLogicalRect.moveBy(lineRect.location());
enclosingRect.setY(std::min(enclosingRect.y(), inlineLevelBoxLogicalRect.top()));
enclosingRect.shiftMaxYEdgeTo(std::max(enclosingRect.maxY(), inlineLevelBoxLogicalRect.bottom()));
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes