Changeset 230642 in webkit
- Timestamp:
- Apr 13, 2018, 11:40:07 AM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
LayoutReloaded/misc/LayoutReloadedWebKit.patch (modified) (34 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r230641 r230642 1 2018-04-13 Zalan Bujtas <zalan@apple.com> 2 3 Rebaseline LayoutReloaded patch file (collectRenderersWithNeedsLayout). 4 5 * LayoutReloaded/misc/LayoutReloadedWebKit.patch: 6 1 7 2018-04-13 Jonathan Bedard <jbedard@apple.com> 2 8 -
trunk/Tools/LayoutReloaded/misc/LayoutReloadedWebKit.patch
r230386 r230642 25 25 $(WebCore)/dom/UIEvent.idl \ 26 26 diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt 27 index ff942b36a44..5bc30f914af10064427 index a461719e2dd..2d48c60758b 100644 28 28 --- a/Source/WebCore/Sources.txt 29 29 +++ b/Source/WebCore/Sources.txt 30 @@ -1 797,7 +1797,9 @@ rendering/InlineBox.cpp30 @@ -1802,7 +1802,9 @@ rendering/InlineBox.cpp 31 31 rendering/InlineElementBox.cpp 32 32 rendering/InlineFlowBox.cpp … … 39 39 rendering/LayoutState.cpp 40 40 diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj 41 index 2ae0c8a22d5..edcd82aa95a10064441 index a6a138060f6..91fb8a5cd04 100644 42 42 --- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj 43 43 +++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj … … 53 53 11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */; settings = {ATTRIBUTES = (Private, ); }; }; 54 54 1400D7A817136EA70077CE05 /* ScriptWrappableInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 55 @@ -5 699,6 +5703,13 @@55 @@ -5706,6 +5710,13 @@ 56 56 119340951FED715500935F1E /* RenderTreeBuilderFormControls.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderFormControls.h; sourceTree = "<group>"; }; 57 57 119340A01FEE024000935F1E /* RenderTreeBuilderBlock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeBuilderBlock.cpp; sourceTree = "<group>"; }; … … 67 67 11C5F1182003E7760001AE60 /* RenderTreeBuilderInline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderInline.h; sourceTree = "<group>"; }; 68 68 11C5F11D2003F69E0001AE60 /* RenderTreeBuilderBlockFlow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTreeBuilderBlockFlow.h; sourceTree = "<group>"; }; 69 @@ -221 15,6 +22126,7 @@69 @@ -22145,6 +22156,7 @@ 70 70 A83B79100CCB001B000B0825 /* Core */ = { 71 71 isa = PBXGroup; … … 75 75 7C30D9801F815AC100268356 /* JSAbortController.h */, 76 76 7C30D9821F815AC200268356 /* JSAbortSignal.cpp */, 77 @@ -254 47,6 +25459,10 @@77 @@ -25479,6 +25491,10 @@ 78 78 F523D2F302DE443B018635CA /* rendering */ = { 79 79 isa = PBXGroup; … … 86 86 439046C212DA25CE00AF80A2 /* mathml */, 87 87 FD08A879175D3926002CD360 /* shapes */, 88 @@ -257 42,6 +25758,8 @@88 @@ -25775,6 +25791,8 @@ 89 89 F523D32402DE4478018635CA /* dom */ = { 90 90 isa = PBXGroup; … … 95 95 2D5036661BCDDDC400E20BB3 /* mac */, 96 96 51ECC3E42005831F00483EAE /* messageports */, 97 @@ -267 36,6 +26754,7 @@97 @@ -26771,6 +26789,7 @@ 98 98 31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */, 99 99 0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */, … … 103 103 A12C59EE2035FC9B0012236B /* ApplePayError.h in Headers */, 104 104 7C6579E31E00827000E3A27A /* ApplePayLineItem.h in Headers */, 105 @@ -303 29,6 +30348,7 @@105 @@ -30369,6 +30388,7 @@ 106 106 4945BFD413CF809000CC3B38 /* TransformState.h in Headers */, 107 107 E17B491616A9B094001C8839 /* TransitionEvent.h in Headers */, … … 111 111 37FD4298118368460093C029 /* TreeDepthLimit.h in Headers */, 112 112 14D64B5D134A5B6B00E58FDA /* TreeScope.h in Headers */, 113 @@ -305 43,6 +30563,7 @@113 @@ -30583,6 +30603,7 @@ 114 114 97AABD1E14FA09D5007457AE /* WebSocketChannel.h in Headers */, 115 115 97AABD1F14FA09D5007457AE /* WebSocketChannelClient.h in Headers */, … … 119 119 97AABD2314FA09D5007457AE /* WebSocketExtensionDispatcher.h in Headers */, 120 120 4A5A2ADC161E7E00005889DD /* WebSocketExtensionParser.h in Headers */, 121 @@ -310 27,6 +31048,7 @@121 @@ -31067,6 +31088,7 @@ 122 122 0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */, 123 123 070363E5181A1CDC00C074A5 /* AVMediaCaptureSource.mm in Sources */, … … 425 425 boolean isDefaultNamespace(DOMString? namespaceURI); 426 426 diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp 427 index 90c3e8e5a78..41e4447ff23100644427 index 0210b08a182..4d3a54691a9 100644 428 428 --- a/Source/WebCore/page/DOMWindow.cpp 429 429 +++ b/Source/WebCore/page/DOMWindow.cpp … … 448 448 #include "MediaQueryList.h" 449 449 #include "MediaQueryMatcher.h" 450 @@ -78,6 +81, 7@@450 @@ -78,6 +81,8 @@ 451 451 #include "PageConsoleClient.h" 452 452 #include "PageTransitionEvent.h" 453 453 #include "Performance.h" 454 +#include "RenderChildIterator.h" 454 455 +#include "RenderView.h" 455 456 #include "RequestAnimationFrameCallback.h" 456 457 #include "ResourceLoadInfo.h" 457 458 #include "ResourceLoadObserver.h" 458 @@ -100,6 +10 4,7 @@459 @@ -100,6 +105,7 @@ 459 460 #include "StyleResolver.h" 460 461 #include "StyleScope.h" … … 464 465 #include "UserGestureIndicator.h" 465 466 #include "VisualViewport.h" 466 @@ -116,6 +12 1,7 @@467 @@ -116,6 +122,7 @@ 467 468 #include <wtf/NeverDestroyed.h> 468 469 #include <wtf/Ref.h> … … 472 473 473 474 #if ENABLE(USER_MESSAGE_HANDLERS) 474 @@ -135 7,6 +1363,41@@ int DOMWindow::scrollY() const475 @@ -1358,6 +1365,72 @@ int DOMWindow::scrollY() const 475 476 return view->mapFromLayoutToCSSUnits(view->contentsScrollPosition().y()); 476 477 } … … 484 485 +{ 485 486 + return m_frame->view()->renderView()->renderTreeStructure(); 487 +} 488 + 489 +static bool hasDirtyChild(RenderElement& parent) 490 +{ 491 + for (auto& child : childrenOfType<RenderElement>(parent)) { 492 + if (child.needsLayout()) 493 + return true; 494 + } 495 + return false; 496 +} 497 + 498 +static void collectDirtyRenderers(RenderElement& container, Vector<long>& dirtyRenderers) 499 +{ 500 + // Collect the leaf marks only -would be cheating othewise. 501 + for (auto& child : childrenOfType<RenderElement>(container)) { 502 + if (!child.needsLayout()) 503 + continue; 504 + if (!hasDirtyChild(child)) 505 + dirtyRenderers.append(child.renderId()); 506 + else 507 + collectDirtyRenderers(child, dirtyRenderers); 508 + } 509 +} 510 + 511 +Vector<long> DOMWindow::collectRenderersWithNeedsLayout() 512 +{ 513 + Vector<long> dirtyRenderers; 514 + auto* renderView = m_frame->view()->renderView(); 515 + m_frame->document()->updateStyleIfNeeded(); 516 + collectDirtyRenderers(*renderView, dirtyRenderers); 517 + return dirtyRenderers; 486 518 +} 487 519 + … … 515 547 return !m_frame; 516 548 diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h 517 index 4 c66b724e29..4ee2993438c100644549 index 499a558d2ee..be60b3aaf79 100644 518 550 --- a/Source/WebCore/page/DOMWindow.h 519 551 +++ b/Source/WebCore/page/DOMWindow.h 520 @@ -4 8,7 +48,6 @@ template<typename> class Strong;552 @@ -49,7 +49,6 @@ template<typename> class Strong; 521 553 } 522 554 … … 526 558 class CSSRuleList; 527 559 class CSSStyleDeclaration; 528 @@ -7 7,6 +76,7 @@ class ScheduledAction;560 @@ -78,6 +77,7 @@ class ScheduledAction; 529 561 class Screen; 530 562 class Storage; … … 534 566 class WebKitNamespace; 535 567 class WebKitPoint; 536 @@ -19 1,6 +191,11@@ public:568 @@ -192,6 +192,12 @@ public: 537 569 String defaultStatus() const; 538 570 void setDefaultStatus(const String&); … … 540 572 + String simplifiedRenderTree() const; 541 573 + String renderTreeStructure() const; 574 + Vector<long> collectRenderersWithNeedsLayout(); 542 575 + int nextBreakingOpportunity(const String& text, unsigned startPosition); 543 576 + Vector<Ref<InlineTextRun>> collectTextRuns(const String&, const Node&, float availableSpace); … … 547 580 DOMWindow* opener() const; 548 581 diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl 549 index 46ebc1561fa.. cbcd213b46a100644582 index 46ebc1561fa..bd35d3f2155 100644 550 583 --- a/Source/WebCore/page/DOMWindow.idl 551 584 +++ b/Source/WebCore/page/DOMWindow.idl 552 @@ -82,6 +82,1 1@@ typedef USVString CSSOMString;585 @@ -82,6 +82,12 @@ typedef USVString CSSOMString; 553 586 readonly attribute Navigator navigator; 554 587 readonly attribute DOMApplicationCache applicationCache; … … 556 589 + readonly attribute DOMString simplifiedRenderTree; 557 590 + readonly attribute DOMString renderTreeStructure; 591 + sequence<long> collectRenderersWithNeedsLayout(); 558 592 + long nextBreakingOpportunity(DOMString text, unsigned long startPosition); 559 593 + sequence<InlineTextRun> collectTextRuns(DOMString text, Node containerNode, optional unrestricted float availableSpace = NaN); … … 1431 1465 namespace WebCore { 1432 1466 diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp 1433 index 02094a327a5..695b02357801006441467 index 744e8e359a6..6351f06c1dd 100644 1434 1468 --- a/Source/WebCore/rendering/RenderImage.cpp 1435 1469 +++ b/Source/WebCore/rendering/RenderImage.cpp … … 1443 1477 #include "RenderFragmentedFlow.h" 1444 1478 diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp 1445 index 7f3d46b7dd8.. 8120bd369ac1006441479 index 7f3d46b7dd8..e73709b2267 100644 1446 1480 --- a/Source/WebCore/rendering/RenderObject.cpp 1447 1481 +++ b/Source/WebCore/rendering/RenderObject.cpp … … 1464 1498 renderView->didCreateRenderer(); 1465 1499 #ifndef NDEBUG 1466 @@ -1012,6 +1014,1 3@@ void RenderObject::showRenderTreeForThis() const1500 @@ -1012,6 +1014,16 @@ void RenderObject::showRenderTreeForThis() const 1467 1501 WTFLogAlways("%s", stream.release().utf8().data()); 1468 1502 } … … 1473 1507 + if (is<RenderBlockFlow>(*this)) 1474 1508 + downcast<RenderBlockFlow>(*this).outputLineTreeAndMark(stream, nullptr, depth + 1); 1509 + 1510 + for (auto* child = firstChildSlow(); child; child = child->nextSibling()) 1511 + child->outputRenderSubTreeAndMark(stream, markedObject, depth + 1); 1475 1512 +} 1476 1513 + … … 1478 1515 { 1479 1516 if (!is<RenderBlockFlow>(*this)) 1480 @@ -1197,14 +120 6,80 @@ void RenderObject::outputRenderObject(TextStream& stream, bool mark, int depth)1517 @@ -1197,14 +1209,80 @@ void RenderObject::outputRenderObject(TextStream& stream, bool mark, int depth) 1481 1518 stream.nextLine(); 1482 1519 } … … 1493 1530 + child->renderSubtreeStructure(stream); 1494 1531 +} 1495 1532 + 1496 1533 +// 1()RenderView|2(1)RenderBlock|3(2)RenderBody|4(3)RenderBlock|5(3)AnonymousRenderBlock| 1497 1534 +void RenderObject::outputRenderObjectStructure(WTF::TextStream& stream) const … … 1514 1551 + stream << "|"; 1515 1552 +} 1516 + 1553 1517 1554 +void RenderObject::simplifiedRenderSubtree(TextStream& stream, int depth) const 1518 1555 +{ … … 1565 1602 #endif // NDEBUG 1566 1603 diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h 1567 index 3c4f15aa4f1..383bb46b8761006441604 index 5d5d82f66ce..e679c6ee154 100644 1568 1605 --- a/Source/WebCore/rendering/RenderObject.h 1569 1606 +++ b/Source/WebCore/rendering/RenderObject.h 1570 @@ -11 3,6 +113,9 @@ public:1607 @@ -114,6 +114,9 @@ public: 1571 1608 1572 1609 auto& weakPtrFactory() const { return m_weakFactory; } … … 1578 1615 1579 1616 virtual const char* renderName() const = 0; 1580 @@ -20 3,10 +206,16@@ public:1617 @@ -204,10 +207,15 @@ public: 1581 1618 void showNodeTreeForThis() const; 1582 1619 void showRenderTreeForThis() const; … … 1587 1624 void outputRenderObject(WTF::TextStream&, bool mark, int depth) const; 1588 1625 void outputRenderSubTreeAndMark(WTF::TextStream&, const RenderObject* markedObject, int depth) const; 1589 + void outputRenderSubTreeAndMarkStructure(WTF::TextStream&) const;1590 1626 void outputRegionsInformation(WTF::TextStream&) const; 1591 1627 + … … 1595 1631 1596 1632 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } 1597 @@ -8 29,6 +838,7 @@ private:1633 @@ -831,6 +839,7 @@ private: 1598 1634 #endif 1599 1635 … … 1604 1640 RenderObject* m_previous; 1605 1641 diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp 1606 index e55be1e6ad8..e99790d1c831006441642 index 8fa51e26ffa..730d97a4620 100644 1607 1643 --- a/Source/WebCore/rendering/RenderText.cpp 1608 1644 +++ b/Source/WebCore/rendering/RenderText.cpp … … 1679 1715 const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override; 1680 1716 diff --git a/Source/WebCore/rendering/SimpleLineLayout.cpp b/Source/WebCore/rendering/SimpleLineLayout.cpp 1681 index 8777dc099b8..702fcc634f41006441717 index 301300f6e37..3e206b15642 100644 1682 1718 --- a/Source/WebCore/rendering/SimpleLineLayout.cpp 1683 1719 +++ b/Source/WebCore/rendering/SimpleLineLayout.cpp
Note:
See TracChangeset
for help on using the changeset viewer.