Closed
Bug 1445599
Opened 5 years ago
Closed 5 years ago
GetTemporaryStyleForFocusedPositionedElement is broken.
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(1 file, 2 obsolete files)
2.97 KB,
patch
|
masayuki
:
review+
|
Details | Diff | Splinter Review |
I was looking at removing editor calls to GetPropertyCSSValue when I realized that this one is actually unreachable since bug 1339394. I was going to rewrite it to use nsStyleContext or what not, but we may as well remove it.
Assignee | ||
Comment 1•5 years ago
|
||
Attachment #8958773 -
Flags: review?(masayuki)
Assignee | ||
Comment 2•5 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #1) > Created attachment 8958773 [details] [diff] [review] > Remove HTMLEditor::GetTemporaryStyleForFocusedPositionedElement The commit message should also say something like: The background color won't serialize to transparent since bug 1339394 (FF 54). Since nobody has complained about this regression, it seems unlikely this is a useful feature. I can rewrite it to not use GetPropertyCSSValue instead, but nixing it is easier.
Comment 3•5 years ago
|
||
Comment on attachment 8958773 [details] [diff] [review] Remove HTMLEditor::GetTemporaryStyleForFocusedPositionedElement Review of attachment 8958773 [details] [diff] [review]: ----------------------------------------------------------------- ::: editor/libeditor/HTMLAbsPositionEditor.cpp @@ -618,5 @@ > - rv = > - CSSEditUtils::GetComputedProperty(aElement, *nsGkAtoms::backgroundColor, > - bgColorStr); > - NS_ENSURE_SUCCESS(rv, rv); > - if (!bgColorStr.EqualsLiteral("transparent")) { I still don't understand the reason why you're trying to remove the feature yet. Do you mean that this is always true, so, this method never returns "black" and "white" anymore?
Assignee | ||
Comment 4•5 years ago
|
||
Right, transparent serializes as rgba(0, 0, 0, 0) since the bug mentioned in comment 2.
Comment 5•5 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #4) > Right, transparent serializes as rgba(0, 0, 0, 0) since the bug mentioned in > comment 2. Well, then, shouldn't you just change the check from "transparent" to "rgba(0, 0, 0, 0)"? This is a code to support absolute positioned boxes. That must be really rare case to edit it since most HTML editors in the real world is just rich text editors. So, it's not safe to remove the feature itself by the reason "no bugs are reported".
Flags: needinfo?(emilio)
Assignee | ||
Comment 6•5 years ago
|
||
Sure, I can do that if needed. I wanted to get rid of GetPropertyCSSValue and this was effectively dead code. If you think it's worth resurrecting the feature I can rewrite it to use other APIs indeed.
Flags: needinfo?(emilio)
Assignee | ||
Comment 7•5 years ago
|
||
Attachment #8958773 -
Attachment is obsolete: true
Attachment #8958773 -
Flags: review?(masayuki)
Attachment #8959106 -
Flags: review?(masayuki)
Assignee | ||
Comment 8•5 years ago
|
||
Whoops, the other patch should belong to other bug. This one belongs to this bug.
Attachment #8959106 -
Attachment is obsolete: true
Attachment #8959106 -
Flags: review?(masayuki)
Attachment #8959108 -
Flags: review?(masayuki)
Comment 9•5 years ago
|
||
Comment on attachment 8959108 [details] [diff] [review] Unbreak HTMLEditor::GetTemporaryStyleForFocusedPositionedElement >- if (r >= BLACK_BG_RGB_TRIGGER && >- g >= BLACK_BG_RGB_TRIGGER && >- b >= BLACK_BG_RGB_TRIGGER) { >+ if (NS_GET_R(color) >= kBlackBgTrigger || >+ NS_GET_G(color) >= kBlackBgTrigger || >+ NS_GET_B(color) >= kBlackBgTrigger) { > aReturn.AssignLiteral("black"); > } else { Looks like you changed && to ||. It seems that it's not your intention. If so, please fix them before landing. Otherwise, looks good.
Attachment #8959108 -
Flags: review?(masayuki) → review+
Comment 10•5 years ago
|
||
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b96b1d081cdf Unbreak HTMLEditor::GetTemporaryStyleForFocusedPositionedElement, and make it stop using GetPropertyCSSValue. r=masayuki
Comment 11•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b96b1d081cdf
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•