Changeset 173226 in webkit
- Timestamp:
- Sep 3, 2014, 2:18:05 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r173221 r173226 1 2014-09-03 Simon Fraser <simon.fraser@apple.com> 2 3 Dump SimpleLineLayout info in showRenderTree() output 4 https://bugs.webkit.org/show_bug.cgi?id=136489 5 6 Reviewed by Zalan Bujtas. 7 8 Include info about SimpleLineLayout to showRenderTree() output. 9 10 Also show RenderText length, and truncate the RenderText contents 11 to 80 chars (since the string is replicated in inline boxes or simple line layout output). 12 13 * rendering/RenderBlockFlow.cpp: 14 (WebCore::RenderBlockFlow::showLineTreeAndMark): 15 * rendering/RenderObject.cpp: 16 (WebCore::RenderObject::showRenderObject): 17 * rendering/SimpleLineLayoutFunctions.cpp: 18 (WebCore::SimpleLineLayout::printPrefix): 19 (WebCore::SimpleLineLayout::showLineTreeForFlow): 20 * rendering/SimpleLineLayoutFunctions.h: 21 1 22 2014-09-03 Tim Horton <timothy_horton@apple.com> 2 23 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r173217 r173226 3508 3508 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRootBox()) 3509 3509 root->showLineTreeAndMark(markedBox, depth); 3510 3511 if (auto simpleLineLayout = this->simpleLineLayout()) 3512 SimpleLineLayout::showLineLayoutForFlow(*this, *simpleLineLayout, depth); 3510 3513 } 3511 3514 #endif -
trunk/Source/WebCore/rendering/RenderObject.cpp
r173114 r173226 1550 1550 if (node()->isTextNode()) { 1551 1551 String value = node()->nodeValue(); 1552 fprintf(stderr, " length->(%u)", value.length()); 1553 1552 1554 value.replaceWithLiteral('\\', "\\\\"); 1553 1555 value.replaceWithLiteral('\n', "\\n"); 1554 fprintf(stderr, " \"%s\"", value.utf8().data()); 1556 1557 const int maxPrintedLength = 80; 1558 if (value.length() > maxPrintedLength) { 1559 String substring = value.substring(0, maxPrintedLength); 1560 fprintf(stderr, " \"%s\"...", substring.utf8().data()); 1561 } else 1562 fprintf(stderr, " \"%s\"", value.utf8().data()); 1555 1563 } 1556 1564 } -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r173047 r173226 201 201 } 202 202 203 } 204 } 203 #ifndef NDEBUG 204 static void printPrefix(int& printedCharacters, int depth) 205 { 206 fprintf(stderr, "------- --"); 207 printedCharacters = 0; 208 while (++printedCharacters <= depth * 2) 209 fputc(' ', stderr); 210 } 211 212 void showLineLayoutForFlow(const RenderBlockFlow& flow, const Layout& layout, int depth) 213 { 214 int printedCharacters = 0; 215 printPrefix(printedCharacters, depth); 216 217 fprintf(stderr, "SimpleLineLayout (%u lines, %u runs) (%p)\n", layout.lineCount(), layout.runCount(), &layout); 218 ++depth; 219 220 auto resolver = runResolver(flow, layout); 221 for (auto it = resolver.begin(), end = resolver.end(); it != end; ++it) { 222 const auto& run = *it; 223 LayoutRect r = run.rect(); 224 printPrefix(printedCharacters, depth); 225 fprintf(stderr, "line %u run(%u, %u) (%.2f, %.2f) (%.2f, %.2f) \"%s\"\n", run.lineIndex(), run.start(), run.end(), 226 r.x().toFloat(), r.y().toFloat(), r.width().toFloat(), r.height().toFloat(), run.text().utf8().data()); 227 } 228 } 229 #endif 230 231 } 232 } -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.h
r167568 r173226 63 63 LayoutUnit lineHeightFromFlow(const RenderBlockFlow&); 64 64 LayoutUnit baselineFromFlow(const RenderBlockFlow&); 65 66 #ifndef NDEBUG 67 void showLineLayoutForFlow(const RenderBlockFlow&, const Layout&, int depth); 68 #endif 65 69 66 70 }
Note:
See TracChangeset
for help on using the changeset viewer.