Reuse existing inline elements to set CSS style even if they have some attributes
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox110 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(9 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Gecko does not use existing <span>
which has attribute, but the other browsers use it.
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
In the following patches, the new variations are required. Additionally,
HTMLEditor
should ignore empty class
, id
and style
attributes because
an older API does it.
https://searchfox.org/mozilla-central/rev/2ad13433da20a0749e1e9a10ec0ab49b987c2c8e/editor/libeditor/HTMLStyleEditor.cpp#3398-3402
Depends on D163996
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D163997
Assignee | ||
Comment 4•3 years ago
|
||
This causes some new failures after applying the following patches.
Depends on D163998
Assignee | ||
Comment 5•3 years ago
|
||
Depends on D163999
Assignee | ||
Comment 6•3 years ago
|
||
This change makes the following changes smaller. Once we remove CSS style
first, then, it becomes easier to consider whether we should delete the element
since style
attribute may be deleted by ChangeStyleTransaction
if the
removing style is the last rule in it.
Depends on D164000
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D164001
Assignee | ||
Comment 8•3 years ago
|
||
Now, we can make there simpler because the part does one of them:
- Replaces element with new
<span>
- Removes element
- Removes attribute
- Does nothing
However, there are duplicated code. We should consider what there does with
lambdas.
Depends on D164002
Assignee | ||
Comment 9•3 years ago
|
||
The other browsers use any inline elements to set CSS property for applying
an inline style. However, Gecko limits it to a <span>
which does not have
any attributes. The other browsers' design is better for saving number of
elements and runtime cost of inserting new element (moving all children to the
new element and inserting it to the original position). Therefore, it's nicer
to follow the other browses. Then, we can avoid new WPT failures at aligning
other behaviors to the other browsers.
With doing that, removing style code requires complicated changes because
RemoveStyleInside
assumes that one element has one style, but after taking
the compatible behavior, one element can have multiple styles including the
style represented by the element itself.
Note that the new expected failures are caused by bug 1183844. Gecko returns
closest ancestor element's background color for
queryCommandValue("backColor")
. Therefore, it returns "transparent" of the
inner <span>
element.
Depends on D164003
Assignee | ||
Updated•3 years ago
|
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
Comment 16•3 years ago
|
||
Comment 17•3 years ago
|
||
Comment 18•3 years ago
|
||
Comment 19•3 years ago
|
||
Comment 20•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/95ca7cad0c4a
https://hg.mozilla.org/mozilla-central/rev/3c444b60c784
https://hg.mozilla.org/mozilla-central/rev/a067aad1a901
https://hg.mozilla.org/mozilla-central/rev/5a3b614bf90b
https://hg.mozilla.org/mozilla-central/rev/4ad244ef4253
https://hg.mozilla.org/mozilla-central/rev/71f29a225197
https://hg.mozilla.org/mozilla-central/rev/ceefc7aac79b
https://hg.mozilla.org/mozilla-central/rev/717893e29a82
https://hg.mozilla.org/mozilla-central/rev/14b38d16c5ed
Description
•