Bug 172503

Summary: Dynamic updates to display: contents reach unreachable code within RenderTreeUpdater::updateTextRenderer
Product: WebKit Reporter: Emilio Cobos Álvarez <ecobos>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, commit-queue, dbates, esprehn+autocc, jlewis3, kangil.han, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=172515
https://bugs.webkit.org/show_bug.cgi?id=172514
https://bugs.webkit.org/show_bug.cgi?id=172596
Bug Depends on:    
Bug Blocks: 157477    
Attachments:
Description Flags
Stack
none
Patch
none
Patch
none
Patch none

Description Emilio Cobos Álvarez 2017-05-23 09:02:21 PDT
Created attachment 311016 [details]
Stack

When importing the css-display-3 tests, a few tests that check dynamic changes to display: contents are crashing within that function, reaching unreachable code in RenderElement::insertChildInternal.
Comment 1 Emilio Cobos Álvarez 2017-05-25 04:23:17 PDT
So I debugged this today, and it's likely the same bug as bug 172514.

In particular, we're finding as the next sibling a text renderer that hasn't been torn down when "display" changes, so it's still reparented to the old parent...
Comment 2 Emilio Cobos Álvarez 2017-05-25 09:37:25 PDT
I finally found it. I was going crazy, and it required a lot of logging to see what's going on... This is likely to fix bug 172514 too, so I'll try to re-enable the test.
Comment 3 Emilio Cobos Álvarez 2017-05-25 09:54:55 PDT
Created attachment 311234 [details]
Patch
Comment 4 Emilio Cobos Álvarez 2017-05-25 09:57:40 PDT
Created attachment 311235 [details]
Patch
Comment 5 Antti Koivisto 2017-05-25 11:35:19 PDT
Comment on attachment 311235 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311235&action=review

> Source/WebCore/ChangeLog:14
> +        In practice, we may want to remove that bit and use ElementRareData's
> +        RenderStyle instead (keeping it around as appropriate), to ensure they
> +        don't go out of sync, but that's out of scope of this patch for now.

Yeah, this is the way to go in long run. Not keeping the full style currently requires some awkward code in style resolution.
Comment 6 Emilio Cobos Álvarez 2017-05-25 11:41:23 PDT
Comment on attachment 311235 [details]
Patch

Whoops, forgot to add the commit-queue flag :)
Comment 7 WebKit Commit Bot 2017-05-25 14:04:46 PDT
Comment on attachment 311235 [details]
Patch

Rejecting attachment 311235 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 311235, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

/Volumes/Data/EWS/WebKit/LayoutTests/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://webkit-queues.webkit.org/results/3816649
Comment 8 Emilio Cobos Álvarez 2017-05-25 14:26:45 PDT
Created attachment 311291 [details]
Patch
Comment 9 Emilio Cobos Álvarez 2017-05-25 14:27:28 PDT
Comment on attachment 311291 [details]
Patch

Gah, I'm really bad at this ChangeLog thing, apparently :P.

Added the missing "Reviewed by" line.
Comment 10 WebKit Commit Bot 2017-05-25 23:46:30 PDT
Comment on attachment 311291 [details]
Patch

Clearing flags on attachment: 311291

Committed r217477: <http://trac.webkit.org/changeset/217477>
Comment 11 WebKit Commit Bot 2017-05-25 23:46:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 Alexey Proskuryakov 2017-05-27 12:32:27 PDT
*** Bug 172613 has been marked as a duplicate of this bug. ***
Comment 13 Radar WebKit Bug Importer 2017-05-30 20:25:17 PDT
<rdar://problem/32479799>