зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1174332 - Correctly compute box-shadow bounds on themed frames with overflow. r=roc
--HG-- extra : rebase_source : 1f8b32e7d05b1501859085c8a3e48c1c904bdf8e
This commit is contained in:
Родитель
1a786425ca
Коммит
f134c090a5
|
@ -7516,11 +7516,26 @@ nsLayoutUtils::GetBoxShadowRectForFrame(nsIFrame* aFrame,
|
|||
if (!boxShadows) {
|
||||
return nsRect();
|
||||
}
|
||||
|
||||
bool nativeTheme;
|
||||
const nsStyleDisplay* styleDisplay = aFrame->StyleDisplay();
|
||||
nsITheme::Transparency transparency;
|
||||
if (aFrame->IsThemed(styleDisplay, &transparency)) {
|
||||
// For opaque (rectangular) theme widgets we can take the generic
|
||||
// border-box path with border-radius disabled.
|
||||
nativeTheme = transparency != nsITheme::eOpaque;
|
||||
} else {
|
||||
nativeTheme = false;
|
||||
}
|
||||
|
||||
nsRect frameRect = nativeTheme ?
|
||||
aFrame->GetVisualOverflowRectRelativeToSelf() :
|
||||
nsRect(nsPoint(0, 0), aFrameSize);
|
||||
|
||||
nsRect shadows;
|
||||
int32_t A2D = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
for (uint32_t i = 0; i < boxShadows->Length(); ++i) {
|
||||
nsRect tmpRect(nsPoint(0, 0), aFrameSize);
|
||||
nsRect tmpRect = frameRect;
|
||||
nsCSSShadowItem* shadow = boxShadows->ShadowAt(i);
|
||||
|
||||
// inset shadows are never painted outside the frame
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for filters on canvas</title>
|
||||
|
||||
<style>
|
||||
|
||||
#checkbox {
|
||||
filter: url(#filter);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<svg style="display: block; height: 0;">
|
||||
|
||||
<defs>
|
||||
<filter id="filter" color-interpolation-filters="sRGB" x="-100%" y="-100%" width="300%" height="300%">
|
||||
<feMorphology operator="dilate" radius="5" in="SourceAlpha" result="mask"/>
|
||||
<feFlood flood-color="blue"/>
|
||||
<feComposite operator="in" in2="mask"/>
|
||||
<feMerge>
|
||||
<feMergeNode/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
</defs>
|
||||
|
||||
</svg>
|
||||
|
||||
<input type="checkbox" id="checkbox">
|
||||
|
||||
<script>
|
||||
|
||||
document.getElementById("checkbox").focus();
|
||||
|
||||
</script>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8">
|
||||
<title>Testcase for filters on canvas</title>
|
||||
|
||||
<style>
|
||||
|
||||
#checkbox {
|
||||
box-shadow: 0 0 0 5px blue;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<input type="checkbox" id="checkbox">
|
||||
|
||||
<script>
|
||||
|
||||
document.getElementById("checkbox").focus();
|
||||
|
||||
</script>
|
|
@ -1926,3 +1926,4 @@ skip-if(B2G||Mulet) == 1150021-1.xul 1150021-1-ref.xul
|
|||
== 1153845-1.html 1153845-1-ref.html
|
||||
== 1156129-1.html 1156129-1-ref.html
|
||||
== 1169331-1.html 1169331-1-ref.html
|
||||
fuzzy(1,74) == 1174332-1.html 1174332-1-ref.html
|
||||
|
|
Загрузка…
Ссылка в новой задаче