Closed
Bug 747225
Opened 12 years ago
Closed 12 years ago
[layout view] Show when the margin have the "auto" value
Categories
(DevTools :: Inspector, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 15
People
(Reporter: paul, Assigned: dcamp)
References
Details
(Whiteboard: [fixed-in-fx-team])
Attachments
(1 file, 1 obsolete file)
8.27 KB,
patch
|
paul
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•12 years ago
|
||
So what is the right approach here? I use the computed style for the border/padding/margins. To figure out when the margin is auto, I need to start using the node rules and find which one applies. Should I do that for all the values?
Reporter | ||
Comment 2•12 years ago
|
||
I think I just need to get the "bestmatch" value from the property view.
Reporter | ||
Comment 3•12 years ago
|
||
Reporter | ||
Updated•12 years ago
|
Attachment #622691 -
Flags: review?(dcamp)
Reporter | ||
Updated•12 years ago
|
Attachment #622691 -
Flags: feedback?(mratcliffe)
Reporter | ||
Comment 4•12 years ago
|
||
I am not confident about this approach. There might be a shorter path.
Assignee | ||
Comment 5•12 years ago
|
||
Comment on attachment 622691 [details] [diff] [review] patch v1 Review of attachment 622691 [details] [diff] [review]: ----------------------------------------------------------------- If parsing the css styles is the best way to find this, maybe you could reuse ElementStyle from CssRuleView? You can create an ElementStyle with your node, it'll do all the parsing you need. ElementStyle.rules holds a list of Rule objects, Rule.textProps has a list of TextProperty TextProperty.computed has a list of the expanded shorthand properties. Would that help you at all?
Comment 6•12 years ago
|
||
Comment on attachment 622691 [details] [diff] [review] patch v1 Looks good but Dave does have a point ... using ElementStyle would simplify things slightly.
Attachment #622691 -
Flags: feedback?(mratcliffe)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → dcamp
Assignee | ||
Comment 7•12 years ago
|
||
ElementStyle would have simplified things a bit, but CssLogic simplifies them a lot.
Attachment #622691 -
Attachment is obsolete: true
Attachment #622691 -
Flags: review?(dcamp)
Attachment #626891 -
Flags: review?(paul)
Reporter | ||
Comment 8•12 years ago
|
||
Comment on attachment 626891 [details] [diff] [review] patch v2 Much better :) Thanks. ># HG changeset patch ># User Paul Rouget <paul@mozilla.com> You might want to change that. >+const Cc = Components.classes; >+const Ci = Components.interfaces; > const Cu = Components.utils; > Cu.import("resource://gre/modules/Services.jsm"); > Cu.import("resource:///modules/inspector.jsm"); > Cu.import("resource:///modules/devtools/LayoutHelpers.jsm"); >+Cu.import("resource:///modules/devtools/CssLogic.jsm"); > > var EXPORTED_SYMBOLS = ["LayoutView"]; > >+// Used to split on css line separators >+const CSS_LINE_RE = /(?:[^;\(]*(?:\([^\)]*?\))?[^;\(]*)*;?/g; >+ >+// Used to parse a single property line. >+const CSS_PROP_RE = /\s*([^:\s]*)\s*:\s*(.*?)\s*(?:! (important))?;?$/; >+ I don't think you need these changes anymore.
Attachment #626891 -
Flags: review?(paul) → review+
Assignee | ||
Comment 9•12 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/4798809c94d6 (I made the changes from Comment 8)
Whiteboard: [fixed-in-fx-team]
Comment 10•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4798809c94d6
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•