Closed Bug 1444036 Opened 6 years ago Closed 6 years ago

Remove trivial usage of getPropertyCSSValue from the tree.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

getPropertyCSSValue("foo").cssText is just getPropertyValue("foo")
Comment on attachment 8957089 [details]
Bug 1444036: Remove trivial uses of getPropertyCSSValue.

https://reviewboard.mozilla.org/r/226042/#review231978

rs=me, assuming that you know what you're talking about and it's really the same thing :)

::: devtools/client/shared/inplace-editor.js:1565
(Diff revision 1)
>   *        the element from which styles are copied
>   * @param {DOMNode} to
>   *        the element on which copied styles are applied
>   */
>  function copyBoxModelStyles(from, to) {
> -  let win = from.ownerDocument.defaultView;
> +  const properties = [

nit: please be consistent in your usage of let/const and use let here :)

::: devtools/client/shared/inplace-editor.js:1585
(Diff revision 1)
> -  to.style.borderLeftWidth = getCssText("border-left-width");
> +    "borderLeftWidth"
> +  ];
> +
> +  let win = from.ownerDocument.defaultView;
> +  let style = win.getComputedStyle(from);
> +  for (const property of properties)

nit: let property
Attachment #8957089 - Flags: review?(jhofmann) → review+
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d15070cd21f4
Remove trivial uses of getPropertyCSSValue. rs=johannh
(In reply to Johann Hofmann [:johannh] from comment #2)
> Comment on attachment 8957089 [details]
> Bug 1444036: Remove trivial uses of getPropertyCSSValue.
> 
> https://reviewboard.mozilla.org/r/226042/#review231978
> 
> rs=me, assuming that you know what you're talking about and it's really the
> same thing :)
> 
> ::: devtools/client/shared/inplace-editor.js:1565
> (Diff revision 1)
> >   *        the element from which styles are copied
> >   * @param {DOMNode} to
> >   *        the element on which copied styles are applied
> >   */
> >  function copyBoxModelStyles(from, to) {
> > -  let win = from.ownerDocument.defaultView;
> > +  const properties = [
> 
> nit: please be consistent in your usage of let/const and use let here :)

Well, it's not my usage, it was pre-existent and thus didn't touch it, but done.

> ::: devtools/client/shared/inplace-editor.js:1585
> (Diff revision 1)
> > -  to.style.borderLeftWidth = getCssText("border-left-width");
> > +    "borderLeftWidth"
> > +  ];
> > +
> > +  let win = from.ownerDocument.defaultView;
> > +  let style = win.getComputedStyle(from);
> > +  for (const property of properties)
> 
> nit: let property

Done

Thanks for the review!
https://hg.mozilla.org/mozilla-central/rev/d15070cd21f4
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: