Skip to content

Commit b7f48f4

Browse files
browser(webkit): layout before returning DOM.getContentQuads (#970)
Otherwise we can get stale quads. Causes failures of "ElementHandle.boundingBox should work with page scale" test. JoelEinbinder/webkit@6835789
1 parent b188f39 commit b7f48f4

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1148
1+
1149

browser_patches/webkit/patches/bootstrap.diff

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ index b67e89b80b4e7a8586cac81ade5d58a1bcb0d431..c468bc0981d1fb13272b28095f9f7584
20622062
{
20632063
FAST_RETURN_IF_NO_FRONTENDS(false);
20642064
diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
2065-
index 0f46a3033aef4007f6eb837a6105f05a0c59067f..bfcafe332af75e0def0d9487eceef7c9384dc3d1 100644
2065+
index 0f46a3033aef4007f6eb837a6105f05a0c59067f..38140e53555b86af72b3c9707d4c6bd48350a1e7 100644
20662066
--- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
20672067
+++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
20682068
@@ -61,12 +61,16 @@
@@ -2155,7 +2155,7 @@ index 0f46a3033aef4007f6eb837a6105f05a0c59067f..bfcafe332af75e0def0d9487eceef7c9
21552155
if (!node)
21562156
return;
21572157

2158-
@@ -1486,18 +1499,143 @@ void InspectorDOMAgent::setInspectedNode(ErrorString& errorString, int nodeId)
2158+
@@ -1486,18 +1499,147 @@ void InspectorDOMAgent::setInspectedNode(ErrorString& errorString, int nodeId)
21592159
m_suppressEventListenerChangedEvent = false;
21602160
}
21612161

@@ -2275,6 +2275,10 @@ index 0f46a3033aef4007f6eb837a6105f05a0c59067f..bfcafe332af75e0def0d9487eceef7c9
22752275
+ errorString = "Node doesn't have renderer"_s;
22762276
+ return;
22772277
+ }
2278+
+
2279+
+ // Ensure quads are up to date.
2280+
+ renderer->document().updateLayoutIgnorePendingStylesheets();
2281+
+
22782282
+ Frame* containingFrame = renderer->document().frame();
22792283
+ FrameView* containingView = containingFrame ? containingFrame->view() : nullptr;
22802284
+ if (!containingView) {
@@ -2305,7 +2309,7 @@ index 0f46a3033aef4007f6eb837a6105f05a0c59067f..bfcafe332af75e0def0d9487eceef7c9
23052309
}
23062310

23072311
void InspectorDOMAgent::getAttributes(ErrorString& errorString, int nodeId, RefPtr<JSON::ArrayOf<String>>& result)
2308-
@@ -2662,7 +2800,7 @@ void InspectorDOMAgent::pushNodeByPathToFrontend(ErrorString& errorString, const
2312+
@@ -2662,7 +2804,7 @@ void InspectorDOMAgent::pushNodeByPathToFrontend(ErrorString& errorString, const
23092313
errorString = "Missing node for given path"_s;
23102314
}
23112315

@@ -2314,7 +2318,7 @@ index 0f46a3033aef4007f6eb837a6105f05a0c59067f..bfcafe332af75e0def0d9487eceef7c9
23142318
{
23152319
Document* document = &node->document();
23162320
if (auto* templateHost = document->templateDocumentHost())
2317-
@@ -2671,12 +2809,16 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNod
2321+
@@ -2671,12 +2813,16 @@ RefPtr<Inspector::Protocol::Runtime::RemoteObject> InspectorDOMAgent::resolveNod
23182322
if (!frame)
23192323
return nullptr;
23202324

@@ -2334,7 +2338,7 @@ index 0f46a3033aef4007f6eb837a6105f05a0c59067f..bfcafe332af75e0def0d9487eceef7c9
23342338
}
23352339

23362340
Node* InspectorDOMAgent::scriptValueAsNode(JSC::JSValue value)
2337-
@@ -2697,4 +2839,46 @@ void InspectorDOMAgent::setAllowEditingUserAgentShadowTrees(ErrorString&, bool a
2341+
@@ -2697,4 +2843,46 @@ void InspectorDOMAgent::setAllowEditingUserAgentShadowTrees(ErrorString&, bool a
23382342
m_allowEditingUserAgentShadowTrees = allow;
23392343
}
23402344

0 commit comments

Comments
 (0)