Skip to content

Fetch margins, padding, and borders for layout inspector #3598

Closed

Description

@jdm

See the "getLayout" message in components/devtools/actors/inspector.rs. Currently we only fetch the width and height; instead we want to adjust the code in handle_get_layout to query the layout properties using LayoutRPC, rather than just calling getBoundingClientRect.

Activity

  1. added
    E-more-complex
    on Oct 7, 2014
  2. gilles-leblanc commented on Oct 17, 2014

    @gilles-leblanc
    Contributor

    I'd like to have a look at this one.

  3. jdm commented on Oct 17, 2014

    @jdm
    MemberAuthor

    It will probably be easier to fix this once we have #1722 implemented, since what we want to return to the devtools here is the computed style for elements. I don't have a good idea of how to obtain that information right now, otherwise.

  4. gilles-leblanc commented on Oct 17, 2014

    @gilles-leblanc
    Contributor

    Ok, I'll wait for #1722 and turn my attention to another issue in the mean time.
    Thanks for the heads up.

  5. jdm commented on Aug 3, 2015

    @jdm
    MemberAuthor

    getComputedStyle exists now!

  6. benschulz commented on Aug 15, 2015

    @benschulz
    Contributor

    Determining autoMargins is gonna be tricky. I hope to take a look at that over the next couple of days.

    Perhaps someone can look at my progress in the meantime. I have one question in particular: Should I stick with rustc_serialize or is it alright to use serde_json?
    From a readability point of view I'm very much in favor of serde. It allows for JSON property names such as "margin-top" without having to manually construct HashMaps. However, I'll gladly rewrite that part if other factors outweigh the readibility argument.

  7. jdm commented on Aug 15, 2015

    @jdm
    MemberAuthor

    If serde makes it easier, go right ahead. You can also file an issue to convert the existing code that uses rustc_serialize, or do the work yourself.

  8. jdm commented on Aug 15, 2015

    @jdm
    MemberAuthor

    Current progress looks great to me!

  9. benschulz commented on Aug 16, 2015

    @benschulz
    Contributor

    I've added the missing implementation for autoMargins. However, I can't say that I like it. It is based on a new ReflowQueryType just for the autoMargins; essentially devtools UI specific code in the layout and script components.

    Firefox's devtools base autoMargins on DOMUtils.getCSSStyleRules, on which most of the style inspector is based anyways. I'm wondering if it would not be better to defer implementation of autoMargins until similar functionality is available in servo.

    For reference:

  10. jdm commented on Aug 16, 2015

    @jdm
    MemberAuthor

    I don't think it's worth deferring. These things happen, and we can refactor it if there's a need for similar functionality at some other point in the future.

  11. added
    C-assigned
    on Aug 16, 2015
  12. KiChjang commented on Dec 1, 2015

    @KiChjang
    Contributor

    @benschulz what's the status of this?

  13. benschulz commented on Dec 1, 2015

    @benschulz
    Contributor

    Sorry, I didn't properly link this issue with PR #7267.

  14. added a commit that references this issue on Feb 24, 2016
    09e987b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-devtoolsC-assignedE-more-complex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions