Closed
Bug 307646
Opened 19 years ago
Closed 6 years ago
non-HTML and non-XUL element has wrong box model
Categories
(Other Applications :: DOM Inspector, defect)
Other Applications
DOM Inspector
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: surkov, Unassigned)
Details
(Keywords: helpwanted)
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20050821 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20050821 Firefox/1.6a1
XUL document contains element of some custom namespace. When I watch element in
DOM Inspector then x, y, width and height parameters of its box model has value
'undefined'. Since thease properties can be specified by css rules then
properties shouldn't be undefined.
Example you can see in bug 307627.ceht
Reproducible: Always
Comment 1•19 years ago
|
||
This is not a layout issue. It's a DOM inspector issue. See http://lxr.mozilla.org/seamonkey/source/extensions/inspector/resources/content/viewers/boxModel/boxModel.js the showPositionStats and showDimensionStats functions. Inspector assumes that anything that's not a XUL element is an HTML element.
Assignee: nobody → dom-inspector
Status: UNCONFIRMED → NEW
Component: Layout → DOM Inspector
Ever confirmed: true
Keywords: helpwanted
OS: Windows 2000 → All
Product: Core → Other Applications
QA Contact: layout → timeless
Hardware: PC → All
Summary: Element of unknown for mozilla namespace has wrong box model → non-HTML and non-XUL element has wrong box model
Reporter | ||
Comment 2•19 years ago
|
||
(In reply to comment #1)
> This is not a layout issue. It's a DOM inspector issue. See
> http://lxr.mozilla.org/seamonkey/source/extensions/inspector/resources/content/viewers/boxModel/boxModel.js
> the showPositionStats and showDimensionStats functions. Inspector assumes that
> anything that's not a XUL element is an HTML element.
>
I guess the problem has no one issue. XUL element has boxObject property and HTML element has nsIDOMNSHTMLElement interface, but I cannot find proper interface for custorm namespace element. Is there a way to obtain dimensions for custom namespace element?
There are problems what can be related with the one. When custom namespace element is placed in xul document then it is not displayed (it has default value of 'display' property). When I set 'display' property on '-moz-box' then element is displayed properly. It looks strange for me. There is one more problem in bug 313857.
Comment 3•19 years ago
|
||
> Is there a way to obtain dimensions for custom namespace element?
Computed style sorta does it. But "dimensions" is an ill-defined concept -- XUL box object and the HTML properties are not at all equivalent, and neither has much to do with the CSS properties of the same name.
> When custom namespace element is placed in xul document then it is not displayed
Box layout is so much fun. ;)
Reporter | ||
Comment 4•19 years ago
|
||
(In reply to comment #3)
> > Is there a way to obtain dimensions for custom namespace element?
>
> Computed style sorta does it. But "dimensions" is an ill-defined concept --
> XUL box object and the HTML properties are not at all equivalent, and neither
> has much to do with the CSS properties of the same name.
>
Do you mean getComputedStyle() method?
var style = window.getComputedStyle(element, null);
style.width is "auto"
style.height is "auto"
And more how can I get x and y, screenX and screenY coordinates?
Comment 5•19 years ago
|
||
> Do you mean getComputedStyle() method?
Yes.
> style.width is "auto"
> style.height is "auto"
Either the element is not being rendered, or you're using the wrong window.
> And more how can I get x and y, screenX and screenY coordinates?
You can't. They're not well-defined anyway.
Reporter | ||
Comment 6•19 years ago
|
||
Reporter | ||
Comment 7•19 years ago
|
||
(In reply to comment #5)
> Either the element is not being rendered, or you're using the wrong window.
>
I guess it is not rendered. When custom namespace element should be rendered? If I specify "display: -moz-box" then width and height are defined (not 'auto' value). If "display: inline" then element has width and height as 'auto'. It is a right behaviour?
> > And more how can I get x and y, screenX and screenY coordinates?
> You can't. They're not well-defined anyway.
Why are not they well-defined?
Boris, please take a look at the patch.
Comment 8•19 years ago
|
||
> If "display: inline" then element has width and height as 'auto'. It is
> a right behaviour?
Ah, yes. That's correct behavior.
I don't like the namespace URI detection in the patch; please use object detection instead (looking for boxObject or testing instanceof the relevant XUL interface, and testing instanceof the relevant HTML interface). The strings the patch outputs need to be localized and the English localization needs to be "not available", probably.
> Why are not they well-defined?
What is the "x" of some random box?
What is the "screenX" of some random _element_? Consider that an element can generate multiple boxes that appear at different positions on screen.
Reporter | ||
Comment 9•19 years ago
|
||
Attachment #207064 -
Attachment is obsolete: true
Reporter | ||
Comment 10•19 years ago
|
||
(In reply to comment #8)
>
> I don't like the namespace URI detection in the patch; please use object
> detection instead (looking for boxObject or testing instanceof the relevant XUL
> interface, and testing instanceof the relevant HTML interface).
I guess fixed.
The strings
> the patch outputs need to be localized and the English localization needs to be
> "not available", probably.
There is a problem, locales contains many languages and I should add new properties file for each. But I don't know all languages :). What should I do?
Comment 11•19 years ago
|
||
You add it for the en-US locale (and whichever other locales you care to), and then the localizers handle the rest. ;)
Note that you might be able to reuse an existing inspector properties file; not sure.
Comment 12•19 years ago
|
||
For what it's worth, I get:
----- The following addresses had permanent fatal errors -----
<surkov@dc.baikal.ru>
(reason: 550 5.7.1 <surkov@dc.baikal.ru>... Access denied)
when I try to send mail to that address.
Reporter | ||
Comment 13•19 years ago
|
||
(In reply to comment #11)
> You add it for the en-US locale (and whichever other locales you care to), and
> then the localizers handle the rest. ;)
>
Probably I should add no translated (english) string to all locale packages. If I will not do it then no-modified packages will be broken. What do you think?
> Note that you might be able to reuse an existing inspector properties file; not
> sure.
>
Yes, I want to use inspector.properties.
Comment 14•19 years ago
|
||
> If I will not do it then no-modified packages will be broken.
That's fine, on trunk.
Comment 15•19 years ago
|
||
So now I get:
----- The following addresses had permanent fatal errors -----
<surkov@dc.baikal.ru>
(reason: 553 5.3.0 <surkov@dc.baikal.ru>... Spam blocked - see http://spamcop.net/bl.shtml? 18.72.1.2)
(where 18.72.1.2 is the IP address of the MIT SMTP server).
The message I was trying to send was:
Alexander Surkov wrote:
> What is the "x" of some random box?
>
> What is the "screenX" of some random _element_? Consider that an element can
> generate multiple boxes that appear at different positions on screen.
>
> Если элемент где-то отображается, то, мне кажется, он должен иметь координаты,
> где он отображается.
U menya tut net russkoj klaviatury....
Delo v tom, chto element mozhet odnovremenno otobrazhat'sya v neskol'kih mestah. Kakie u nego togda koordinaty?
> Не понял ситуации, когда элемент создает несколько боксов.
Est' neskol'ko takih situacij.
> И почему этого не могу сделать xul и html элементы.
Mogut. Dlya HTML opredelenie koordinat takoe: "Delaj to, chto delaet IE".
Dlya XUL, opredeleniya net -- lyudi kotorye napisali etot kod ne ochen' podumali. I teper' s nim ochen' trudno rabotat' v nekotoryh situaciyah.
Reporter | ||
Comment 16•19 years ago
|
||
Attachment #207145 -
Attachment is obsolete: true
Comment 17•19 years ago
|
||
that should be "not available", not "no available"
Reporter | ||
Comment 18•19 years ago
|
||
(In reply to comment #17)
> that should be "not available", not "no available"
>
fixed
Attachment #207232 -
Attachment is obsolete: true
Reporter | ||
Comment 19•19 years ago
|
||
who can review the patch?
Updated•17 years ago
|
Assignee: dom-inspector → nobody
QA Contact: timeless → dom-inspector
Comment 20•6 years ago
|
||
Bulk close. This component is no longer supported or maintained.
https://bugzilla.mozilla.org/show_bug.cgi?id=1499023
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
Comment 21•6 years ago
|
||
Bulk close. This component is no longer supported or maintained.
https://bugzilla.mozilla.org/show_bug.cgi?id=1499023
You need to log in
before you can comment on or make changes to this bug.
Description
•