Closed Bug 644514 Opened 13 years ago Closed 13 years ago

-moz-box-ordinal-group:0 doesn't work, as opposed to ordinal="0"

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla7

People

(Reporter: dao, Assigned: dbaron)

References

Details

Attachments

(2 files, 3 obsolete files)

spinoff from bug 636034
Specifically, the code looks like this:

519   PRUint32 ordinal = DEFAULT_ORDINAL_GROUP;
....
526     content->GetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, value);
527     if (!value.IsEmpty()) {
528       ordinal = value.ToInteger(&error);
529     }
530     else {
531       // No attribute value.  Check CSS.
532       const nsStyleXUL* boxInfo = GetStyleXUL();
533       if (boxInfo->mBoxOrdinal > 1) {
534         // The ordinal group was defined in CSS.
535         ordinal = (nscoord)boxInfo->mBoxOrdinal;
536       }
537     }

DEFAULT_ORDINAL_GROUP is 1.

I think the right thing to do is to just take out that |if| test.  The default value of mBoxOrdinal is 1 already, I would assume (and if it's not we should make it so), thus assigning to |ordinal| would only have an effect if it's set to a non-default value anyway, right?
Should it also accept negative values, or just zero?
I should add a test for this too...
Attachment #522141 - Flags: review?(bzbarsky)
patch 3 (the nsCSSPropList.h change) is yet to be written, depending on the answer to comment 2.
Regarding patch 2:  I'd note nsIBox::AddCSSPrefSize already checks IsXUL.  This is making the other functions do the same.
(And I wonder whether it's safe for nsBoxFrame::RegUnRegAccessKey to do the same.)
The fact that I needed one change, though, suggests there might be more.
Attachment #522141 - Attachment is obsolete: true
Attachment #522141 - Flags: review?(bzbarsky)
Comment on attachment 522720 [details] [diff] [review]
patch 2: accept XUL attributes only

>--- a/browser/base/content/urlbarBindings.xml
>+++ b/browser/base/content/urlbarBindings.xml
>@@ -59,17 +59,17 @@
>           <xul:image class="autocomplete-icon" allowevents="true"/>
>         </children>
>         <xul:hbox anonid="textbox-input-box"
>                   class="textbox-input-box urlbar-input-box"
>                   flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
>           <children/>
>           <html:input anonid="input"
>                       class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
>-                      flex="1" allowevents="true"
>+                      style="-moz-box-flex: 1" allowevents="true"
>                       xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
>         </xul:hbox>

toolkit/content/widgets/autocomplete.xml has the same markup
toolkit/content/widgets/textbox.xml is affected as well.
Comment on attachment 522140 [details] [diff] [review]
patch 1: use any values that come from CSS

r=me, but this removes the only consumer of DEFAULT_ORDINAL_GROUP.  Can you remove the macro too?
Attachment #522140 - Flags: review?(bzbarsky) → review+
Comment on attachment 522720 [details] [diff] [review]
patch 2: accept XUL attributes only

r=me.  This looks like it fixes bug 102440 too, right?
Attachment #522720 - Flags: review?(bzbarsky) → review+
Blocks: 102440
Dão, Neil, do you have an opinion on comment 2?
I audited all "html:input" and "html:textarea" in the tree, which while in theory isn't sufficient, in practice I suspect it is.
Attachment #527167 - Flags: review?(bzbarsky)
Comment on attachment 527167 [details] [diff] [review]
patch 2: accept XUL attributes only

Actually, moved patch 2 to bug 102440.
Attachment #527167 - Attachment is obsolete: true
Attachment #527167 - Flags: review?(bzbarsky)
(In reply to comment #2)
> Should it also accept negative values, or just zero?

I can't say I see a striking need for negative values, but I don't see a downside of accepting them either...
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #534813 - Flags: review?(bzbarsky)
Comment on attachment 534813 [details] [diff] [review]
patch 2: allow zero

This still doesn't do comment 11...
Attachment #534813 - Flags: review?(bzbarsky) → review+
Yeah, I stuck that in my queue as a separate patch. :-)
(In reply to comment #13)
> Dão, Neil, do you have an opinion on comment 2?

Negative values shouldn't be supported.
comment 11:
https://hg.mozilla.org/mozilla-central/rev/d0b3065150f7

patch 2:
http://hg.mozilla.org/mozilla-central/rev/db0bcc6ab526
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Priority: -- → P4
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: