Bug 95699
| Summary: | !needsLayout assertion firing often | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Dean Jackson <dino> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | mitz, simon.fraser, zalan |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Dean Jackson
I'm hitting this assertion fairly often.
ASSERTION FAILED: !needsLayout()
/Users/dino/apple/code/WebKit-OpenSource/Source/WebCore/page/FrameView.cpp(3148) : virtual void WebCore::FrameView::paintContents(WebCore::GraphicsContext *, const WebCore::IntRect &)
1 0x1021e788d WebCore::FrameView::paintContents(WebCore::GraphicsContext*, WebCore::IntRect const&)
2 0x1006e1993 -[WebFrame(WebInternal) _drawRect:contentsOnly:]
3 0x100737fc0 -[WebHTMLView drawSingleRect:]
4 0x1007386a0 -[WebHTMLView drawRect:]
The setup is a single document with an iframe element. The script in the top level sets the src of the iframe and then extracts some of the content (each of the sub-documents is a test case). Overall, it updates the iframe src about 300 times, and almost certainly asserts at some point in the run. Commenting it out appears harmless (the next line is an early return).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
alan
(In reply to comment #0)
> I'm hitting this assertion fairly often.
>
> ASSERTION FAILED: !needsLayout()
> /Users/dino/apple/code/WebKit-OpenSource/Source/WebCore/page/FrameView.cpp(3148) : virtual void WebCore::FrameView::paintContents(WebCore::GraphicsContext *, const WebCore::IntRect &)
> 1 0x1021e788d WebCore::FrameView::paintContents(WebCore::GraphicsContext*, WebCore::IntRect const&)
> 2 0x1006e1993 -[WebFrame(WebInternal) _drawRect:contentsOnly:]
> 3 0x100737fc0 -[WebHTMLView drawSingleRect:]
> 4 0x1007386a0 -[WebHTMLView drawRect:]
>
> The setup is a single document with an iframe element. The script in the top level sets the src of the iframe and then extracts some of the content (each of the sub-documents is a test case). Overall, it updates the iframe src about 300 times, and almost certainly asserts at some point in the run.
Could you share your test case? I quickly put one together, but couldn't reproduce it. (although i was pretty sure it won't work as this assert is highly content dependent)
>Commenting it out appears harmless (the next line is an early return).
It might appear harmless, but this is actually a good indicator when something goes wrong while layouting a frame. The frame needs to be layout clean, when painting phase hits.
On release build, you would end up with blank content, unless there are an additional layout-paint loop that does the job.
Dean Jackson
I'll try to set up a test case. It was actually the Khronos WebGL conformance test suite that I was running.
alan
(In reply to comment #2)
> I'll try to set up a test case. It was actually the Khronos WebGL conformance test suite that I was running.
is this the actual test suite you were running?
https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html
Apparently it fails on some GL code, before it hits the needsLayout() assert. Do you see this assert too?
ASSERTION FAILED: GLCompileSuccess == GL_TRUE
/Users/bujtas/WebKit/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp(486) : void WebCore::GraphicsContext3D::compileShader(Platform3DObject)
1 0x10704caff WebCore::GraphicsContext3D::compileShader(unsigned int)
2 0x108140b3a WebCore::WebGLRenderingContext::compileShader(WebCore::WebGLShader*, int&)
3 0x107845df3 WebCore::jsWebGLRenderingContextPrototypeFunctionCompileShader(JSC::ExecState*)
4 0x10ca37265
5 0x105cba674 JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*, JSC::JSGlobalData*)
6 0x105cb6b03 JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*)
7 0x105b9b81e JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, JSC::JSValue*)
8 0x1075c36c2 WebCore::JSMainThreadExecState::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, JSC::JSValue*)
9 0x107d71e93 WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld*)
10 0x107d71fc4 WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&)
11 0x107d89ec6 WebCore::ScriptElement::executeScript(WebCore::ScriptSourceCode const&)
12 0x107d88ced WebCore::ScriptElement::prepareScript(WTF::TextPosition const&, WebCore::ScriptElement::LegacyTypeSupport)
13 0x107162a53 WebCore::HTMLScriptRunner::runScript(WebCore::Element*, WTF::TextPosition const&)
14 0x10716283c WebCore::HTMLScriptRunner::execute(WTF::PassRefPtr<WebCore::Element>, WTF::TextPosition const&)
15 0x1070d5f28 WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder()
16 0x1070d5fe1 WebCore::HTMLDocumentParser::canTakeNextToken(WebCore::HTMLDocumentParser::SynchronousMode, WebCore::PumpSession&)
17 0x1070d5944 WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode)
18 0x1070d559b WebCore::HTMLDocumentParser::pumpTokenizerIfPossible(WebCore::HTMLDocumentParser::SynchronousMode)
19 0x1070d644f WebCore::HTMLDocumentParser::append(WebCore::SegmentedString const&)
20 0x106c8e267 WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, unsigned long)
21 0x106d3962e WebCore::DocumentWriter::addData(char const*, unsigned long)
22 0x106d17470 WebCore::DocumentLoader::commitData(char const*, unsigned long)
23 0x104cbe791 WebKit::WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int)
24 0x106d17550 WebCore::DocumentLoader::commitLoad(char const*, int)
25 0x106d179d3 WebCore::DocumentLoader::receivedData(char const*, int)
26 0x1078fffc7 WebCore::MainResourceLoader::addData(char const*, int, bool)
27 0x107d2d54c WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool)
28 0x107901848 WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool)
29 0x107d2de6f WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int)
30 0x107d2a81a -[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]
31 0x7fff8bf7e1e8 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0
Dean Jackson
Yes, that's actually an unrelated failure.
https://bugs.webkit.org/show_bug.cgi?id=94034
which is actually
https://bugs.webkit.org/show_bug.cgi?id=70989
alan
(In reply to comment #4)
> Yes, that's actually an unrelated failure.
>
> https://bugs.webkit.org/show_bug.cgi?id=94034
>
> which is actually
>
> https://bugs.webkit.org/show_bug.cgi?id=70989
By commenting out that GL assertion, I managed to complete the tests without seeing the needsLayout() assert. I am wondering if you could pinpoint the actual test case that triggers the assert for you. (unless you are creating this simplified test case)
Dean Jackson
(In reply to comment #5)
> (In reply to comment #4)
> By commenting out that GL assertion, I managed to complete the tests without seeing the needsLayout() assert. I am wondering if you could pinpoint the actual test case that triggers the assert for you. (unless you are creating this simplified test case)
I'll make the simplified case asap. It might not be for a day or so though.