Commit a0699cfa authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Fix border of frame under frameset

FrameSetPainter paints everything in the foreground phase, so
a frame under frameset should paint its box decoration background
in the foreground phase.

Bug: 902274
Change-Id: Id56af37a478b8503f17199753a485f6fe1261c95
Reviewed-on: https://chromium-review.googlesource.com/c/1326205Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606650}
parent d4589f59
<!DOCTYPE html>
<body style="margin: 0; height: 100vh; box-sizing: border-box; border: 10px solid blue">
</body>
<!DOCTYPE html>
<frameset frameborder="0">
<frame style="border: 10px solid blue">
</frameset>
...@@ -74,6 +74,15 @@ ScopedReplacedContentPaintState::ScopedReplacedContentPaintState( ...@@ -74,6 +74,15 @@ ScopedReplacedContentPaintState::ScopedReplacedContentPaintState(
} // anonymous namespace } // anonymous namespace
bool ReplacedPainter::ShouldPaintBoxDecorationBackground(
const PaintInfo& paint_info) {
// LayoutFrameSet paints everything in the foreground phase.
if (layout_replaced_.IsLayoutEmbeddedContent() &&
layout_replaced_.Parent()->IsFrameSet())
return paint_info.phase == PaintPhase::kForeground;
return ShouldPaintSelfBlockBackground(paint_info.phase);
}
void ReplacedPainter::Paint(const PaintInfo& paint_info) { void ReplacedPainter::Paint(const PaintInfo& paint_info) {
// TODO(crbug.com/797779): For now embedded contents don't know whether // TODO(crbug.com/797779): For now embedded contents don't know whether
// they are painted in a fragmented context and may do something bad in a // they are painted in a fragmented context and may do something bad in a
...@@ -94,7 +103,7 @@ void ReplacedPainter::Paint(const PaintInfo& paint_info) { ...@@ -94,7 +103,7 @@ void ReplacedPainter::Paint(const PaintInfo& paint_info) {
auto paint_offset = paint_state.PaintOffset(); auto paint_offset = paint_state.PaintOffset();
LayoutRect border_rect(paint_offset, layout_replaced_.Size()); LayoutRect border_rect(paint_offset, layout_replaced_.Size());
if (ShouldPaintSelfBlockBackground(local_paint_info.phase)) { if (ShouldPaintBoxDecorationBackground(local_paint_info)) {
if (layout_replaced_.StyleRef().Visibility() == EVisibility::kVisible && if (layout_replaced_.StyleRef().Visibility() == EVisibility::kVisible &&
layout_replaced_.HasBoxDecorationBackground()) { layout_replaced_.HasBoxDecorationBackground()) {
if (layout_replaced_.HasLayer() && if (layout_replaced_.HasLayer() &&
......
...@@ -26,6 +26,8 @@ class ReplacedPainter { ...@@ -26,6 +26,8 @@ class ReplacedPainter {
bool ShouldPaint(const ScopedPaintState&) const; bool ShouldPaint(const ScopedPaintState&) const;
private: private:
bool ShouldPaintBoxDecorationBackground(const PaintInfo&);
const LayoutReplaced& layout_replaced_; const LayoutReplaced& layout_replaced_;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment