Closed Bug 1445605 Opened 6 years ago Closed 6 years ago

Make GetCSSFloatValue use GetPropertyValue instead of GetPropertyCSSValue.

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file, 1 obsolete file)

We only use it for properties that return pixels anyway, so we can use it without much problem.

This also fixes bug 1428974.
We only use it for properties that return pixels anyway, so we can use it without much problem.
    
This also fixes bug 1428974.
Attachment #8958777 - Flags: review?(masayuki)
Comment on attachment 8958777 [details] [diff] [review]
Make GetCSSFloatValue use GetPropertyValue instead of GetPropertyCSSValue.

Review of attachment 8958777 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ +62,4 @@
>      return 0;
>    }
>  
> +  MOZ_ASSERT(value.Length() > 2, "Should always have a `px` suffix");

So, does nsComputedDOMStyle::GetPropertyValue() always return the value as CSS pixels, i.e., even if border-width is specified with "thin"/"medium"/"thick"? Your commit message and this bug report is really unclear to me. Please explain more for making any other developers who are not familiar with CSS implementation can understand easier.
Attachment #8958777 - Flags: review?(masayuki) → review-
Comment on attachment 8958777 [details] [diff] [review]
Make GetCSSFloatValue use GetPropertyValue instead of GetPropertyCSSValue.

Yes, see bug 1428974, which was filed because we don't need to handle those. Per spec borders are resolved to pixels.
Attachment #8958777 - Flags: review- → review?(masayuki)
You can see this easily with:

  document.body.style.border = "1px solid thin"; getComputedStyle(document.body).getPropertyValue("border")
Err, getPropertyValue("border-left-width"); I mean
Okay, could you explain that getPropertyValue() always returns pixels in the commit message and comment in HTMLAnonymousNodeEditor.cpp? Without the explanation, some developers may start to investigate if it's buggy like me.
Attached patch With comments.Splinter Review
Attachment #8959109 - Flags: review?(masayuki)
Attachment #8958777 - Attachment is obsolete: true
Attachment #8958777 - Flags: review?(masayuki)
Comment on attachment 8959109 [details] [diff] [review]
With comments.

Thanks!
Attachment #8959109 - Flags: review?(masayuki) → review+
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7b2dbf5775c9
Make GetCSSFloatValue use GetPropertyValue instead of GetPropertyCSSValue. r=masayuki
https://hg.mozilla.org/mozilla-central/rev/7b2dbf5775c9
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Depends on: 1446451
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: