WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
222406
Render tree updates for Text node content mutations should happen during rendering update
https://bugs.webkit.org/show_bug.cgi?id=222406
Summary
Render tree updates for Text node content mutations should happen during rend...
Antti Koivisto
Reported
2021-02-24 22:55:47 PST
Render tree should be mutated lazily as a part of rendering update like in all other cases.
Attachments
wip
(4.50 KB, patch)
2021-02-24 22:56 PST
,
Antti Koivisto
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
patch
(11.21 KB, patch)
2021-02-25 07:24 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(11.17 KB, patch)
2021-02-25 07:42 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(11.02 KB, patch)
2021-02-25 10:54 PST
,
Antti Koivisto
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
patch
(9.47 KB, patch)
2021-02-26 03:15 PST
,
Antti Koivisto
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
patch
(14.82 KB, patch)
2021-02-26 06:38 PST
,
Antti Koivisto
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
patch
(14.84 KB, patch)
2021-02-26 07:37 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
alternative approach
(3.63 KB, patch)
2021-02-26 08:00 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(14.84 KB, patch)
2021-02-26 08:06 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(16.89 KB, patch)
2021-02-26 09:46 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(16.92 KB, patch)
2021-02-26 09:49 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch
(16.36 KB, patch)
2021-02-26 11:21 PST
,
Antti Koivisto
simon.fraser
: review+
Details
Formatted Diff
Diff
patch
(16.86 KB, patch)
2021-02-26 23:45 PST
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
patch for relanding
(16.94 KB, patch)
2021-04-19 11:05 PDT
,
Antti Koivisto
no flags
Details
Formatted Diff
Diff
Show Obsolete
(12)
View All
Add attachment
proposed patch, testcase, etc.
Antti Koivisto
Comment 1
2021-02-24 22:56:44 PST
Created
attachment 421504
[details]
wip
Antti Koivisto
Comment 2
2021-02-25 07:24:47 PST
Created
attachment 421523
[details]
patch
Antti Koivisto
Comment 3
2021-02-25 07:42:08 PST
Created
attachment 421525
[details]
patch
Antti Koivisto
Comment 4
2021-02-25 10:54:50 PST
Created
attachment 421546
[details]
patch
Simon Fraser (smfr)
Comment 5
2021-02-25 13:15:20 PST
Comment on
attachment 421546
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=421546&action=review
> Source/WebCore/ChangeLog:35 > + This is because subsequent steps in multipart commands expect render tree to be up to date.
Shouldn't this be handled by the next step triggering a render tree update? It's going to be hard for author of new code to know if they have to call updateStyleIfNeeded() or not.
> Source/WebCore/ChangeLog:47 > + Pending text update mat ref the node so this refcount assert is not correct.
mat ref?
Antti Koivisto
Comment 6
2021-02-25 13:38:55 PST
> Shouldn't this be handled by the next step triggering a render tree update?
In theory yes, but it is very difficult to discover all the paths that would need it as there is no guarantee test coverage is complete. In practice missing cases would be discover via regressions.
> It's going to be hard for author of new code to know if they have to call > updateStyleIfNeeded() or not.
These just maintain the existing behaviour (sync render tree update on Text content mutations). Anyone working on this code needs to be careful about updates in any case, this patch in no way changes that.
Antti Koivisto
Comment 7
2021-02-25 13:39:43 PST
(In reply to Antti Koivisto from
comment #6
)
> These just maintain the existing behaviour (sync render tree update on Text > content mutations).
...in editing code specifically.
Antti Koivisto
Comment 8
2021-02-26 03:15:49 PST
Created
attachment 421631
[details]
patch
Antti Koivisto
Comment 9
2021-02-26 06:38:45 PST
Created
attachment 421636
[details]
patch
Antti Koivisto
Comment 10
2021-02-26 07:37:09 PST
Created
attachment 421643
[details]
patch
Antti Koivisto
Comment 11
2021-02-26 08:00:47 PST
Comment hidden (obsolete)
Created
attachment 421645
[details]
alternative approach FWIW, here is a patch I made for this bug earlier. The idea is to let the first paint triggered by a resource load to always happen, even if the size has been computed to zero. It is bit hacky but so is rest of the code.
Antti Koivisto
Comment 12
2021-02-26 08:06:55 PST
Created
attachment 421647
[details]
patch
Antti Koivisto
Comment 13
2021-02-26 09:46:00 PST
Created
attachment 421664
[details]
patch
Antti Koivisto
Comment 14
2021-02-26 09:49:39 PST
Created
attachment 421667
[details]
patch
Antti Koivisto
Comment 15
2021-02-26 11:21:58 PST
Created
attachment 421679
[details]
patch
Simon Fraser (smfr)
Comment 16
2021-02-26 22:20:57 PST
Comment on
attachment 421679
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=421679&action=review
> Source/WebCore/dom/CharacterData.cpp:105 > - if (is<Text>(*this) && parentNode()) > + if (is<Text>(*this))
This doesn't seem to be mentioned in the changelog.
> Source/WebCore/editing/CompositeEditCommand.cpp:1062 > + if (!nodes.isEmpty()) > + document().updateLayoutIgnorePendingStylesheets();
This is still pretty mysterious.
Antti Koivisto
Comment 17
2021-02-26 22:47:28 PST
> This doesn't seem to be mentioned in the changelog.
The check just moves to the function.
Antti Koivisto
Comment 18
2021-02-26 23:45:29 PST
Created
attachment 421738
[details]
patch
EWS
Comment 19
2021-02-27 00:24:07 PST
Committed
r273621
: <
https://commits.webkit.org/r273621
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 421738
[details]
.
Radar WebKit Bug Importer
Comment 20
2021-02-27 00:25:19 PST
<
rdar://problem/74822830
>
Darin Adler
Comment 21
2021-03-01 14:26:14 PST
Comment on
attachment 421738
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=421738&action=review
> Source/WebCore/style/StyleUpdate.cpp:104 > + auto result = m_texts.ensure(&text, [&] { > + return WTFMove(textUpdate); > + });
I think this is identical to: auto result = m_texts.add(&text, WTFMove(textUpdate)); Maybe because it looks like WTFMove causes a "move" that the ensure form seems safer, but pretty sure it’s no different.
Antti Koivisto
Comment 22
2021-03-02 07:33:03 PST
> Maybe because it looks like WTFMove causes a "move" that the ensure form > seems safer, but pretty sure it’s no different.
Yeah, it just looked less dangerous. I think you are right that it is equivalent.
Antti Koivisto
Comment 23
2021-04-08 06:44:36 PDT
Reverted in
r275657
due to PLT regression.
Antti Koivisto
Comment 24
2021-04-19 11:05:43 PDT
Created
attachment 426446
[details]
patch for relanding
EWS
Comment 25
2021-04-19 23:33:58 PDT
Committed
r276287
(
236769@main
): <
https://commits.webkit.org/236769@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 426446
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug