зеркало из https://github.com/mozilla/gecko-dev.git
Bug 815030 - Invalidate cached background images in when a frame gets a visual style change. r=mattwoodrow, a=lsblakk
This commit is contained in:
Родитель
34b45b6186
Коммит
a5d000c938
|
@ -403,9 +403,9 @@ nsCanvasFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||||
nsHTMLReflowMetrics& aDesiredSize,
|
nsHTMLReflowMetrics& aDesiredSize,
|
||||||
const nsHTMLReflowState& aReflowState,
|
const nsHTMLReflowState& aReflowState,
|
||||||
nsReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame");
|
DO_GLOBAL_REFLOW_COUNT("nsCanvasFrame");
|
||||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
||||||
|
|
|
@ -257,15 +257,6 @@ nsIFrame::MarkAsAbsoluteContainingBlock() {
|
||||||
Properties().Set(AbsoluteContainingBlockProperty(), new nsAbsoluteContainingBlock(GetAbsoluteListID()));
|
Properties().Set(AbsoluteContainingBlockProperty(), new nsAbsoluteContainingBlock(GetAbsoluteListID()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsIFrame::ClearDisplayItemCache()
|
|
||||||
{
|
|
||||||
if (GetStateBits() & NS_FRAME_HAS_CACHED_BACKGROUND) {
|
|
||||||
Properties().Delete(CachedBackgroundImage());
|
|
||||||
RemoveStateBits(NS_FRAME_HAS_CACHED_BACKGROUND);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsIFrame::CheckAndClearPaintedState()
|
nsIFrame::CheckAndClearPaintedState()
|
||||||
{
|
{
|
||||||
|
@ -4807,6 +4798,10 @@ static void InvalidateFrameInternal(nsIFrame *aFrame, bool aHasDisplayItem = tru
|
||||||
aFrame->Properties().Delete(nsIFrame::InvalidationRect());
|
aFrame->Properties().Delete(nsIFrame::InvalidationRect());
|
||||||
aFrame->RemoveStateBits(NS_FRAME_HAS_INVALID_RECT);
|
aFrame->RemoveStateBits(NS_FRAME_HAS_INVALID_RECT);
|
||||||
}
|
}
|
||||||
|
if (aFrame->HasAnyStateBits(NS_FRAME_HAS_CACHED_BACKGROUND)) {
|
||||||
|
aFrame->Properties().Delete(nsIFrame::CachedBackgroundImage());
|
||||||
|
aFrame->RemoveStateBits(NS_FRAME_HAS_CACHED_BACKGROUND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -2667,8 +2667,6 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||||
*/
|
*/
|
||||||
virtual bool IsFocusable(int32_t *aTabIndex = nullptr, bool aWithMouse = false);
|
virtual bool IsFocusable(int32_t *aTabIndex = nullptr, bool aWithMouse = false);
|
||||||
|
|
||||||
void ClearDisplayItemCache();
|
|
||||||
|
|
||||||
// BOX LAYOUT METHODS
|
// BOX LAYOUT METHODS
|
||||||
// These methods have been migrated from nsIBox and are in the process of
|
// These methods have been migrated from nsIBox and are in the process of
|
||||||
// being refactored. DO NOT USE OUTSIDE OF XUL.
|
// being refactored. DO NOT USE OUTSIDE OF XUL.
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<body style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyAQMAAACQ%2B%2Bz9AAAAA1BMVEUA%2FwA0XsCoAAAAD0lEQVQoFWNgGAWjYGgCAAK8AAEb3eOQAAAAAElFTkSuQmCC);">
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html class="reftest-wait">
|
||||||
|
<body style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs%2B9AAAAAXNSR0IArs4c6QAAADdJREFUGNNjZGD4%2F5%2BBCMDCwMDAwNDQiF9VQz0DEwORgPoKGRkY%2Fv9fe%2BM5XkXBGpID7kZiFAIAEbULDl5w%2F68AAAAASUVORK5CYII%3D); background-attachment:fixed">
|
||||||
|
<script>
|
||||||
|
function doTest() {
|
||||||
|
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAyAQMAAACQ%2B%2Bz9AAAAA1BMVEUA%2FwA0XsCoAAAAD0lEQVQoFWNgGAWjYGgCAAK8AAEb3eOQAAAAAElFTkSuQmCC";
|
||||||
|
document.body.style.backgroundImage = "url(" + img + ")";
|
||||||
|
document.documentElement.removeAttribute("class");
|
||||||
|
}
|
||||||
|
window.addEventListener("MozReftestInvalidate", doTest, false);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Загрузка…
Ссылка в новой задаче