mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Bug 621253: Transfer a document's zoom levels to its external resources when they're created. r=bz a=blocking-final+
This commit is contained in:
parent
f2cc5a0073
commit
02c7528ae9
@ -855,6 +855,33 @@ nsExternalResourceMap::ShowViewers()
|
||||
mMap.EnumerateRead(ExternalResourceShower, nsnull);
|
||||
}
|
||||
|
||||
void
|
||||
TransferZoomLevels(nsIDocument* aFromDoc,
|
||||
nsIDocument* aToDoc)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(aFromDoc && aToDoc,
|
||||
"transferring zoom levels from/to null doc");
|
||||
|
||||
nsIPresShell* fromShell = aFromDoc->GetShell();
|
||||
if (!fromShell)
|
||||
return;
|
||||
|
||||
nsPresContext* fromCtxt = fromShell->GetPresContext();
|
||||
if (!fromCtxt)
|
||||
return;
|
||||
|
||||
nsIPresShell* toShell = aToDoc->GetShell();
|
||||
if (!toShell)
|
||||
return;
|
||||
|
||||
nsPresContext* toCtxt = toShell->GetPresContext();
|
||||
if (!toCtxt)
|
||||
return;
|
||||
|
||||
toCtxt->SetFullZoom(fromCtxt->GetFullZoom());
|
||||
toCtxt->SetTextZoom(fromCtxt->TextZoom());
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsExternalResourceMap::AddExternalResource(nsIURI* aURI,
|
||||
nsIDocumentViewer* aViewer,
|
||||
@ -912,6 +939,9 @@ nsExternalResourceMap::AddExternalResource(nsIURI* aURI,
|
||||
newResource->mDocument = doc;
|
||||
newResource->mViewer = aViewer;
|
||||
newResource->mLoadGroup = aLoadGroup;
|
||||
if (doc) {
|
||||
TransferZoomLevels(aDisplayDocument, doc);
|
||||
}
|
||||
}
|
||||
|
||||
const nsTArray< nsCOMPtr<nsIObserver> > & obs = load->Observers();
|
||||
|
9
layout/reftests/bugs/621253-1-helper.svg
Normal file
9
layout/reftests/bugs/621253-1-helper.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<filter id="greyscale">
|
||||
<feColorMatrix values="0.5 0.5 0.5 0 0
|
||||
0.5 0.5 0.5 0 0
|
||||
0.5 0.5 0.5 0 0
|
||||
0 0 0 1 0"/>
|
||||
</filter>
|
||||
</svg>
|
After Width: | Height: | Size: 292 B |
20
layout/reftests/bugs/621253-1-ref.xhtml
Normal file
20
layout/reftests/bugs/621253-1-ref.xhtml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
reftest-zoom="0.5">
|
||||
<body style="margin: 0px">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: block; height: 0px">
|
||||
<defs>
|
||||
<filter id="greyscale">
|
||||
<feColorMatrix values="0.5 0.5 0.5 0 0
|
||||
0.5 0.5 0.5 0 0
|
||||
0.5 0.5 0.5 0 0
|
||||
0 0 0 1 0"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
<div style="filter: url(#greyscale);
|
||||
background: lime;
|
||||
height: 100px; width: 100px">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
10
layout/reftests/bugs/621253-1.xhtml
Normal file
10
layout/reftests/bugs/621253-1.xhtml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
reftest-zoom="0.5">
|
||||
<body style="margin: 0px">
|
||||
<div style="filter: url(621253-1-helper.svg#greyscale);
|
||||
background: lime;
|
||||
height: 100px; width: 100px">
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1562,6 +1562,7 @@ HTTP(..) == 615121-1.html 615121-1-ref.html
|
||||
HTTP(..) != 615121-2.html 615121-2-notref.html
|
||||
== 617242-1.html 617242-1-ref.html
|
||||
!= 618071.html 618071-notref.html
|
||||
== 621253-1.xhtml 621253-1-ref.xhtml
|
||||
HTTP(..) == 619511-1.html 619511-1-ref.html
|
||||
random-if(winWidget) == 621918-1.svg 621918-1-ref.svg # 1-pixel diacritic positioning discrepancy in rotated text (may depend on platform fonts)
|
||||
HTTP(..) == 621918-2.svg 621918-2-ref.svg # http(..) for filters.svg, used to mask antialiasing issues where glyphs touch
|
||||
|
Loading…
x
Reference in New Issue
Block a user