Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Issue 791533004: Don't updateRenderTree in the middle of a DOM insertion. (Closed)

Created:
6 years ago by rune
Modified:
6 years ago
Reviewers:
keishi, esprehn, dglazkov
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Project:
blink
Visibility:
Public.

Description

Don't updateRenderTree in the middle of a DOM insertion. After [1] landed, this CL is now a revert of using a flag for postponing scrolling, and scroll from didNotifySubtreeInsertion instead. The original description for this fix below. The crasher was fixed by [1]. [1] https://codereview.chromium.org/783983005 The original description: When inserting an OPTION element with the selected attribute set, we synchronously scroll to that OPTION to make it visible. A prerequisite for scrolling is to have the render tree up-to-date. At this point only parts of the inserted fragment had its inDocument() flag set which caused a crash when a nullptr was returned for the computed style of an input spinner. Ideally, we should not scroll synchronously from the dom insertion code. This CL moves scrolling from insertedInto() to didNotifySubtreeInsertion(). The inDocument() flags are up-to-date when didNotifySubtreeInsertion() is called. An ASSERT is added to Element::recalcStyle to catch other cases of calling updateRenderTree in the middle of a dom insertion. R=esprehn@chromium.org BUG=438615 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=187437

Patch Set 1 #

Patch Set 2 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -15 lines) Patch
A LayoutTests/fast/html/insert-selected-option-crash.html View 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/insert-selected-option-crash-expected.html View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLOptionElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLOptionElement.cpp View 1 1 chunk +5 lines, -1 line 0 comments Download
M Source/core/html/HTMLSelectElement.h View 1 2 chunks +0 lines, -2 lines 0 comments Download
M Source/core/html/HTMLSelectElement.cpp View 1 4 chunks +2 lines, -12 lines 0 comments Download

Messages

Total messages: 25 (7 generated)
rune
PTAL. It took me forever to figure out I needed a (text-)node before the <form> ...
6 years ago (2014-12-10 14:41:07 UTC) #1
rune
ping
6 years ago (2014-12-12 15:44:44 UTC) #2
dglazkov
lgtm
6 years ago (2014-12-12 15:59:57 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/791533004/1
6 years ago (2014-12-13 01:58:04 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/35288)
6 years ago (2014-12-13 04:33:30 UTC) #8
chrishtr
On 2014/12/13 at 04:33:30, commit-bot wrote: > Try jobs failed on following builders: > mac_blink_rel ...
6 years ago (2014-12-13 05:33:01 UTC) #9
rune
On 2014/12/13 at 05:33:01, chrishtr wrote: > On 2014/12/13 at 04:33:30, commit-bot wrote: > > ...
6 years ago (2014-12-15 10:24:37 UTC) #10
rune
On 2014/12/15 at 10:24:37, rune wrote: > On 2014/12/13 at 05:33:01, chrishtr wrote: > > ...
6 years ago (2014-12-16 23:49:54 UTC) #11
esprehn
lgtm
6 years ago (2014-12-16 23:57:33 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/791533004/1
6 years ago (2014-12-17 00:23:06 UTC) #14
commit-bot: I haz the power
Failed to apply patch for Source/core/html/HTMLOptionElement.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years ago (2014-12-17 00:23:49 UTC) #16
rune
Ended up in a conflict with [1]. I think this CL is cleaner/clearer, so it's ...
6 years ago (2014-12-17 14:05:49 UTC) #17
rune
keishi@ do you have any objections with regards to landing this approach instead of the ...
6 years ago (2014-12-18 06:23:46 UTC) #19
keishi
On 2014/12/18 06:23:46, rune wrote: > keishi@ do you have any objections with regards to ...
6 years ago (2014-12-18 06:31:50 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/791533004/20001
6 years ago (2014-12-18 06:38:05 UTC) #22
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=187437
6 years ago (2014-12-18 08:49:16 UTC) #23
chrishtr
On 2014/12/15 at 10:24:37, rune wrote: > On 2014/12/13 at 05:33:01, chrishtr wrote: > > ...
6 years ago (2014-12-20 18:11:27 UTC) #24
rune
6 years ago (2014-12-22 08:40:04 UTC) #25
Message was sent while issue was closed.
On 2014/12/20 at 18:11:27, chrishtr wrote:
> On 2014/12/15 at 10:24:37, rune wrote:
> > On 2014/12/13 at 05:33:01, chrishtr wrote:
> > > On 2014/12/13 at 04:33:30, commit-bot wrote:
> > > > Try jobs failed on following builders:
> > > >   mac_blink_rel on tryserver.blink
(http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/35288)
> > > 
> > > Is it not web compatible to just dump this behavior?
> > 
> > You mean not to scroll at all when options are selected, or selected options
are inserted into the dom?
> 
> I mean the need to scroll at all in either scenario. It's magic behavior,
right?
> 
> Sorry for not replying earlier. For some reason I never got cc'd on this issue
despite replying to it..

It's a user experience thing, I think. If you through some user interaction in a
page adds a selected option to a select, it would probably be confusing to the
user if that option is added to some non-visible position in the multi-select. I
was not able to find anything in the HTML spec about it, but I'm not that used
to navigate that spec, so it might be something somewhere.

Powered by Google App Engine
This is Rietveld 408576698