Closed
Bug 1016063
Opened 11 years ago
Closed 11 years ago
Trees display row selection even with seltype="cell" or seltype="text"
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: neil, Assigned: bzbarsky)
References
Details
(Keywords: regression)
Attachments
(2 files, 2 obsolete files)
2.84 KB,
patch
|
Details | Diff | Splinter Review | |
2.33 KB,
patch
|
heycam
:
review+
lsblakk
:
approval-mozilla-aurora+
lsblakk
:
approval-mozilla-beta-
|
Details | Diff | Splinter Review |
SeaMonkey's UI has a tree with seltype="text". As of SeaMonkey 2.25 (Gecko 28), this tree displays a full row selection. SeaMonkey 2.24 correctly displays the text selection.
Note that the alternating background used by DOM Inspector does display correctly.
Reporter | ||
Comment 1•11 years ago
|
||
Reporter | ||
Comment 2•11 years ago
|
||
Out of the bugs in that range, bug 922669 looks most suspicious.
Reporter | ||
Comment 3•11 years ago
|
||
The first bad revision is:
changeset: 157911:3315c6b05d23
user: Cameron McCormack <cam@mcc.id.au>
date: Thu Nov 28 17:46:38 2013 +1100
summary: Bug 922669 - Part 1: Parse selectors with user action pseudo-classes after pseudo-elements. r=bz
Blocks: 922669
Component: XP Toolkit/Widgets: XUL → CSS Parsing and Computation
Flags: needinfo?(cam)
![]() |
Assignee | |
Comment 4•11 years ago
|
||
Neil, are there any CSS errors being reported in this case?
Flags: needinfo?(neil)
Reporter | ||
Comment 5•11 years ago
|
||
No, there are no CSS errors, in fact I think the CSS rules are being applied, but in the wrong order, so that the rules for tree[seltype="cell"] > treechildren aren't overriding the base treechildren rules. (This is hard to see with the background rules, but if I'm careful I can see that both row and text borders are being applied.)
Flags: needinfo?(neil)
![]() |
Assignee | |
Comment 6•11 years ago
|
||
What do the selectors for the relevant rules look like?
![]() |
Assignee | |
Updated•11 years ago
|
Flags: needinfo?(neil)
Reporter | ||
Comment 7•11 years ago
|
||
Well, I think the relevent part of the windows theme looks like this:
treechildren::-moz-tree-row {
border: 1px solid transparent;
min-height: 18px;
height: 1.3em;
}
treechildren::-moz-tree-row(selected) {
background-color: -moz-cellhighlight;
}
treechildren::-moz-tree-row(selected, focus) {
background-color: Highlight;
}
treechildren::-moz-tree-row(current, focus) {
border: 1px dotted Highlight;
}
treechildren::-moz-tree-row(selected, current, focus) {
border: 1px dotted #F3D982;
}
tree[seltype="cell"] > treechildren::-moz-tree-row,
tree[seltype="text"] > treechildren::-moz-tree-row {
border: none;
background-color: transparent;
}
So what seems to be happening is that those last rules aren't overriding the earlier rules as they should.
Flags: needinfo?(neil)
Reporter | ||
Comment 8•11 years ago
|
||
This patch tweaks about:config to use seltype="text" which will readily demonstrate the problem.
![]() |
Assignee | |
Comment 9•11 years ago
|
||
Ah, thank you.
So consider these three selectors:
treechildren::-moz-tree-row
treechildren::-moz-tree-row(selected, current, focus)
tree[seltype="cell"] > treechildren::-moz-tree-row
On trunk, those are assigned weights of 1, 769, 258 respectively. The reason for that is that we're now including the weight of pseudo-element selectors, since those can now have different weights (e.g. depending on whether they have :hover or not). But tree pseudo-elements abuse the selector storage by storing the stuff in parens in the class list. So we think that selector has three extra classes in it, effectively. We need to fix CalcWeight to ignore those pseudo-classes for XUL tree pseudo-element selectors.
![]() |
Assignee | |
Comment 10•11 years ago
|
||
David, since Cameron is out, do you have time to review this?
Attachment #8430537 -
Flags: review?(dbaron)
![]() |
Assignee | |
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
![]() |
Assignee | |
Comment 11•11 years ago
|
||
Er, let's try to use PseudoType() consistently...
Attachment #8430538 -
Flags: review?(dbaron)
![]() |
Assignee | |
Updated•11 years ago
|
Attachment #8430537 -
Attachment is obsolete: true
Attachment #8430537 -
Flags: review?(dbaron)
![]() |
Assignee | |
Updated•11 years ago
|
Flags: needinfo?(cam)
Reporter | ||
Comment 12•11 years ago
|
||
Comment on attachment 8430538 [details] [diff] [review]
Don't include the fake classnames XUL tree pseudo-elements have when calculating style rule specificity
I can verify that this patch fixes the bug, thanks!
>+ "If pseudo-elements can have id or attribute selectors "
Whitespace nit ^^
Attachment #8430538 -
Flags: feedback+
![]() |
Assignee | |
Comment 13•11 years ago
|
||
You're very welcome, and thank you for doing all the hard debugging bits!
Comment 14•11 years ago
|
||
Comment on attachment 8430538 [details] [diff] [review]
Don't include the fake classnames XUL tree pseudo-elements have when calculating style rule specificity
Review of attachment 8430538 [details] [diff] [review]:
-----------------------------------------------------------------
Stealing now I'm back. Looks good, but I wonder if the assertions might be more easily understood if you inverted them:
MOZ_ASSERT(!(IsPseudoElement() &&
#ifdef MOZ_XUL
PseudoType() != nsCSSPseudoElements::ePseudo_XULTree &&
#endif
mClassList),
...);
and similar for the other assertion. It's easier to get my head around it this way, but maybe it's just me.
Attachment #8430538 -
Flags: review?(dbaron) → review+
![]() |
Assignee | |
Comment 15•11 years ago
|
||
That patch didn't compile on Windows anyway, due to #ifdef in a macro argument, so let's try this
Attachment #8432936 -
Flags: review?(cam)
![]() |
Assignee | |
Updated•11 years ago
|
Attachment #8430538 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #8432936 -
Flags: review?(cam) → review+
Comment 16•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
![]() |
Assignee | |
Updated•11 years ago
|
Flags: in-testsuite?
![]() |
Assignee | |
Comment 17•11 years ago
|
||
Comment on attachment 8432936 [details] [diff] [review]
Don't include the fake classnames XUL tree pseudo-elements have when calculating style rule specificity
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 922669
User impact if declined: Some XUL style rules for trees don't work right
Testing completed (on m-c, etc.): Passes tests
Risk to taking this patch (and alternatives if risky): I think this is low risk.
String or IDL/UUID changes made by this patch: None.
Attachment #8432936 -
Flags: approval-mozilla-beta?
Attachment #8432936 -
Flags: approval-mozilla-aurora?
Comment 18•11 years ago
|
||
Comment on attachment 8432936 [details] [diff] [review]
Don't include the fake classnames XUL tree pseudo-elements have when calculating style rule specificity
Too late for FF30 here, we've gone to build on our final candidate and this is not serious enough a regression (also has already shipped in 28/29) so we can let it ride up from FF31.
Attachment #8432936 -
Flags: approval-mozilla-beta?
Attachment #8432936 -
Flags: approval-mozilla-beta-
Attachment #8432936 -
Flags: approval-mozilla-aurora?
Attachment #8432936 -
Flags: approval-mozilla-aurora+
Comment 19•11 years ago
|
||
status-firefox31:
--- → fixed
status-firefox32:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•