Title: [267936] trunk/Source/WebCore
- Revision
- 267936
- Author
- [email protected]
- Date
- 2020-10-03 15:05:25 -0700 (Sat, 03 Oct 2020)
Log Message
[LFC] showLayoutTree should group line runs under individual lines
https://bugs.webkit.org/show_bug.cgi?id=217282
Reviewed by Simon Fraser.
Let's improve inline run output by grouping runs:
line at (0.00,0.00) size 0.00x18.00 baseline at (14.00)
text run at (0.00,0.00) size 15.10x18.00 run(0, 2)
text run at (15.10,0.00) size 0.00x18.00 run(0, 1)
line at (0.00,18.00) size 0.00x18.00 baseline at (14.00)
text run at (0.00,0.00) size 39.09x18.00 run(0, 5)
instead of:
line at (0.00,0.00) size 0.00x18.00 baseline at (14.00)
line at (0.00,18.00) size 0.00x18.00 baseline at (14.00)
text run at (0.00,0.00) size 15.10x18.00 run(0, 2)
text run at (15.10,0.00) size 0.00x18.00 run(0, 1)
text run at (0.00,0.00) size 39.09x18.00 run(0, 5)
So that we can tell which run belongs to which line.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (267935 => 267936)
--- trunk/Source/WebCore/ChangeLog 2020-10-03 21:54:58 UTC (rev 267935)
+++ trunk/Source/WebCore/ChangeLog 2020-10-03 22:05:25 UTC (rev 267936)
@@ -1,3 +1,31 @@
+2020-10-03 Zalan Bujtas <[email protected]>
+
+ [LFC] showLayoutTree should group line runs under individual lines
+ https://bugs.webkit.org/show_bug.cgi?id=217282
+
+ Reviewed by Simon Fraser.
+
+ Let's improve inline run output by grouping runs:
+
+ line at (0.00,0.00) size 0.00x18.00 baseline at (14.00)
+ text run at (0.00,0.00) size 15.10x18.00 run(0, 2)
+ text run at (15.10,0.00) size 0.00x18.00 run(0, 1)
+ line at (0.00,18.00) size 0.00x18.00 baseline at (14.00)
+ text run at (0.00,0.00) size 39.09x18.00 run(0, 5)
+
+ instead of:
+
+ line at (0.00,0.00) size 0.00x18.00 baseline at (14.00)
+ line at (0.00,18.00) size 0.00x18.00 baseline at (14.00)
+ text run at (0.00,0.00) size 15.10x18.00 run(0, 2)
+ text run at (15.10,0.00) size 0.00x18.00 run(0, 1)
+ text run at (0.00,0.00) size 39.09x18.00 run(0, 5)
+
+ So that we can tell which run belongs to which line.
+
+ * layout/layouttree/LayoutTreeBuilder.cpp:
+ (WebCore::Layout::outputInlineRuns):
+
2020-10-03 Sam Weinig <[email protected]>
[WebIDL] Split more IDL files by spec
Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (267935 => 267936)
--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-10-03 21:54:58 UTC (rev 267935)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp 2020-10-03 22:05:25 UTC (rev 267936)
@@ -383,27 +383,30 @@
auto& inlineFormattingState = layoutState.establishedInlineFormattingState(inlineFormattingRoot);
auto& lines = inlineFormattingState.lines();
- for (auto& line : lines) {
+ for (size_t lineIndex = 0; lineIndex < lines.size(); ++lineIndex) {
size_t printedCharacters = 0;
while (++printedCharacters <= depth * 2)
stream << " ";
- stream << " line at (" << line.logicalLeft() << "," << line.logicalTop() << ") size " << line.logicalWidth() << "x" << line.logicalHeight() << " baseline at (" << line.baseline() << ")";
+ auto& line = lines[lineIndex];
+ stream << "line at (" << line.logicalLeft() << "," << line.logicalTop() << ") size " << line.logicalWidth() << "x" << line.logicalHeight() << " baseline at (" << line.baseline() << ")";
stream.nextLine();
- }
+ for (auto& run : inlineFormattingState.lineRuns()) {
+ if (run.lineIndex() != lineIndex)
+ continue;
+ unsigned printedCharacters = 0;
+ while (++printedCharacters <= depth * 2)
+ stream << " ";
+ stream << " ";
+ if (run.text())
+ stream << "text run";
+ else
+ stream << "box run";
+ stream << " at (" << run.logicalLeft() << "," << run.logicalTop() << ") size " << run.logicalWidth() << "x" << run.logicalHeight();
+ if (run.text())
+ stream << " run(" << run.text()->start() << ", " << run.text()->end() << ")";
+ stream.nextLine();
+ }
- for (auto& run : inlineFormattingState.lineRuns()) {
- unsigned printedCharacters = 0;
- while (++printedCharacters <= depth * 2)
- stream << " ";
- stream << " ";
- if (run.text())
- stream << "text run";
- else
- stream << "box run";
- stream << " at (" << run.logicalLeft() << "," << run.logicalTop() << ") size " << run.logicalWidth() << "x" << run.logicalHeight();
- if (run.text())
- stream << " run(" << run.text()->start() << ", " << run.text()->end() << ")";
- stream.nextLine();
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes