Bug 434102: Make outlines behave reasonably on XUL tree pseudo-elements again. r=roc

This was a regression from bug 133165 which I noticed while working on
bug 480888, but wished to fix in a separate patch (despite that it would
have been slightly easier to fix it in the same patch).
This commit is contained in:
L. David Baron 2014-02-17 20:07:46 -08:00
Родитель 7f961c4964
Коммит 191a0147b8
5 изменённых файлов: 85 добавлений и 7 удалений

Просмотреть файл

@ -614,15 +614,10 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
false
#endif
) {
// FIXME: This behavior doesn't make sense; we should switch back to
// using aBorderArea. But since this has been broken since bug
// 133165 in August of 2004, that switch should be made in its own
// patch changing only that behavior.
innerRect = aForFrame->GetVisualOverflowRect();
innerRect = aBorderArea;
} else {
innerRect = GetOutlineInnerRect(aForFrame);
innerRect = GetOutlineInnerRect(aForFrame) + aBorderArea.TopLeft();
}
innerRect += aBorderArea.TopLeft();
nscoord offset = ourOutline->mOutlineOffset;
innerRect.Inflate(offset, offset);
// If the dirty rect is completely inside the border area (e.g., only the

Просмотреть файл

@ -5,3 +5,5 @@ random-if(Android||B2G) fails-if(winWidget) == menulist-shrinkwrap-2.xul menulis
== textbox-overflow-1.xul textbox-overflow-1-ref.xul # for bug 749658
# accesskeys are not normally displayed on Mac, so skip this test
skip-if(cocoaWidget) == accesskey.xul accesskey-ref.xul
== tree-row-outline-1.xul tree-row-outline-1-ref.xul
!= tree-row-outline-1.xul tree-row-outline-1-notref.xul

Просмотреть файл

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
>
<tree seltype="single" flex="1">
<treecols>
<treecol flex="1"/>
<treecol flex="1"/>
</treecols>
<treechildren>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
</treechildren>
</tree>
</window>

Просмотреть файл

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
>
<html:style>
<![CDATA[
treechildren::-moz-tree-row(odd) {
border: 2px solid blue;
}
]]>
</html:style>
<tree seltype="single" flex="1">
<treecols>
<treecol flex="1"/>
<treecol flex="1"/>
</treecols>
<treechildren>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
</treechildren>
</tree>
</window>

Просмотреть файл

@ -0,0 +1,31 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
>
<html:style>
<![CDATA[
treechildren::-moz-tree-row(odd) {
outline: 2px solid blue;
outline-offset: -2px;
}
]]>
</html:style>
<tree seltype="single" flex="1">
<treecols>
<treecol flex="1"/>
<treecol flex="1"/>
</treecols>
<treechildren>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
<treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
</treechildren>
</tree>
</window>