diff options
Diffstat (limited to 'chromium/third_party')
7 files changed, 86 insertions, 9 deletions
diff --git a/chromium/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc b/chromium/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc index 8260587fcc9..91318882e2d 100644 --- a/chromium/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc +++ b/chromium/third_party/blink/renderer/core/inspector/inspector_media_context_impl.cc @@ -109,9 +109,13 @@ void MediaInspectorContextImpl::TrimPlayer(const WebString& playerId) { void MediaInspectorContextImpl::CullPlayers(const WebString& prefer_keep) { // Erase all the dead players, but only erase the required number of others. - for (const auto& playerId : dead_players_) + while (!dead_players_.empty()) { + auto playerId = dead_players_.back(); + // remove it first, since |RemovePlayer| can cause a GC event which can + // potentially caues more players to get added to |dead_players_|. + dead_players_.pop_back(); RemovePlayer(playerId); - dead_players_.clear(); + } while (!expendable_players_.empty()) { if (total_event_count_ <= kMaxCachedPlayerEvents) diff --git a/chromium/third_party/blink/renderer/core/page/print_context_test.cc b/chromium/third_party/blink/renderer/core/page/print_context_test.cc index 36df50f346e..c72c5187260 100644 --- a/chromium/third_party/blink/renderer/core/page/print_context_test.cc +++ b/chromium/third_party/blink/renderer/core/page/print_context_test.cc @@ -130,14 +130,17 @@ class PrintContextTest : public PaintTestConfigurations, public RenderingTest { GetDocument().body()->setInnerHTML(body_content); } - void PrintSinglePage(SkCanvas& canvas) { - gfx::Rect page_rect(0, 0, kPageWidth, kPageHeight); + gfx::Rect PrintSinglePage(SkCanvas& canvas, int page_number = 0) { GetDocument().SetPrinting(Document::kBeforePrinting); Event* event = MakeGarbageCollected<BeforePrintEvent>(); GetPrintContext().GetFrame()->DomWindow()->DispatchEvent(*event); - GetPrintContext().BeginPrintMode(page_rect.width(), page_rect.height()); + GetPrintContext().BeginPrintMode(kPageWidth, kPageHeight); GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint( DocumentUpdateReason::kTest); + + GetPrintContext().ComputePageRects(gfx::SizeF(kPageWidth, kPageHeight)); + gfx::Rect page_rect = GetPrintContext().PageRect(page_number); + auto* builder = MakeGarbageCollected<PaintRecordBuilder>(); GraphicsContext& context = builder->Context(); context.SetPrinting(true); @@ -151,6 +154,7 @@ class PrintContextTest : public PaintTestConfigurations, public RenderingTest { } builder->EndRecording()->Playback(&canvas); GetPrintContext().EndPrintMode(); + return page_rect; } static String AbsoluteBlockHtmlForLink(int x, @@ -466,6 +470,57 @@ TEST_P(PrintContextTest, LinkTargetBoundingBox) { EXPECT_SKRECT_EQ(50, 60, 200, 100, operations[0].rect); } +TEST_P(PrintContextTest, LinkInFragmentedContainer) { + SetBodyInnerHTML(R"HTML( + <style> + body { + margin: 0; + line-height: 50px; + orphans: 1; + widows: 1; + } + </style> + <div style="height:calc(100vh - 90px);"></div> + <div> + <a href="http://www.google.com">link 1</a><br> + <!-- Page break here. --> + <a href="http://www.google.com">link 2</a><br> + <a href="http://www.google.com">link 3</a><br> + </div> + )HTML"); + + MockPageContextCanvas first_page_canvas; + gfx::Rect page_rect = PrintSinglePage(first_page_canvas, 0); + Vector<MockPageContextCanvas::Operation> operations = + first_page_canvas.RecordedOperations(); + + // TODO(crbug.com/1392701): Should be 1. + ASSERT_EQ(operations.size(), 3u); + + const auto& page1_link1 = operations[0]; + EXPECT_EQ(page1_link1.type, MockPageContextCanvas::kDrawRect); + EXPECT_GE(page1_link1.rect.y(), page_rect.height() - 90); + EXPECT_LE(page1_link1.rect.bottom(), page_rect.height() - 40); + + MockPageContextCanvas second_page_canvas; + page_rect = PrintSinglePage(second_page_canvas, 1); + operations = second_page_canvas.RecordedOperations(); + + // TODO(crbug.com/1392701): Should be 2. + ASSERT_EQ(operations.size(), 3u); + // TODO(crbug.com/1392701): Should be operations[0] + const auto& page2_link1 = operations[1]; + // TODO(crbug.com/1392701): Should be operations[1] + const auto& page2_link2 = operations[2]; + + EXPECT_EQ(page2_link1.type, MockPageContextCanvas::kDrawRect); + EXPECT_GE(page2_link1.rect.y(), page_rect.y()); + EXPECT_LE(page2_link1.rect.bottom(), page_rect.y() + 50); + EXPECT_EQ(page2_link2.type, MockPageContextCanvas::kDrawRect); + EXPECT_GE(page2_link2.rect.y(), page_rect.y() + 50); + EXPECT_LE(page2_link2.rect.bottom(), page_rect.y() + 100); +} + // Here are a few tests to check that shrink to fit doesn't mess up page count. TEST_P(PrintContextTest, ScaledVerticalRL1) { diff --git a/chromium/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/chromium/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc index 5b7cb08913f..c22267b1c6a 100644 --- a/chromium/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc +++ b/chromium/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc @@ -821,8 +821,20 @@ void NGBoxFragmentPainter::PaintLineBoxes(const PaintInfo& paint_info, if (child_paint_info.phase == PaintPhase::kForeground && child_paint_info.ShouldAddUrlMetadata()) { + // TODO(crbug.com/1392701): Avoid walking the LayoutObject tree (which is + // what AddURLRectsForInlineChildrenRecursively() does). We should walk the + // fragment tree instead (if we can figure out how to deal with culled + // inlines - or get rid of them). Walking the LayoutObject tree means that + // we'll visit every link in the container for each fragment generated, + // leading to duplicate entries. This is only fine as long as the absolute + // offsets is the same every time a given link is visited. Otherwise links + // might end up as unclickable in the resulting PDF. So make sure that the + // paint offset relative to the first fragment generated by this + // container. This matches legacy engine behavior. + PhysicalOffset paint_offset_for_first_fragment = + paint_offset - OffsetInStitchedFragments(box_fragment_); AddURLRectsForInlineChildrenRecursively(*layout_object, child_paint_info, - paint_offset); + paint_offset_for_first_fragment); } // If we have no lines then we have no work to do. diff --git a/chromium/third_party/blink/renderer/platform/widget/widget_base.cc b/chromium/third_party/blink/renderer/platform/widget/widget_base.cc index 2e57c4fe3ca..f779d8d0910 100644 --- a/chromium/third_party/blink/renderer/platform/widget/widget_base.cc +++ b/chromium/third_party/blink/renderer/platform/widget/widget_base.cc @@ -898,8 +898,14 @@ void WidgetBase::BeginMainFrame(base::TimeTicks frame_time) { if (ShouldRecordBeginMainFrameMetrics()) { raf_aligned_input_start_time = base::TimeTicks::Now(); } + + auto weak_this = weak_ptr_factory_.GetWeakPtr(); widget_input_handler_manager_->input_event_queue()->DispatchRafAlignedInput( frame_time); + // DispatchRafAlignedInput could have detached the frame. + if (!weak_this) + return; + if (ShouldRecordBeginMainFrameMetrics()) { client_->RecordDispatchRafAlignedInputTime(raf_aligned_input_start_time); } diff --git a/chromium/third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp b/chromium/third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp index 870824f7460..e2ef5c69369 100644 --- a/chromium/third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp +++ b/chromium/third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp @@ -157,7 +157,7 @@ OnDebugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, // We get to this line if no device was associated with the message. Crash so that the failure // is loud and makes tests fail in Debug. dawn::ErrorLog() << pCallbackData->pMessage; - UNREACHABLE(); + ASSERT(false); return VK_FALSE; } diff --git a/chromium/third_party/dawn/src/dawn/native/vulkan/DeviceVk.cpp b/chromium/third_party/dawn/src/dawn/native/vulkan/DeviceVk.cpp index d352263a035..04de4c693d9 100644 --- a/chromium/third_party/dawn/src/dawn/native/vulkan/DeviceVk.cpp +++ b/chromium/third_party/dawn/src/dawn/native/vulkan/DeviceVk.cpp @@ -1037,7 +1037,7 @@ void Device::CheckDebugMessagesAfterDestruction() const { } // Crash in debug - UNREACHABLE(); + ASSERT(false); } MaybeError Device::WaitForIdleForDestruction() { diff --git a/chromium/third_party/node/node_modules.tar.gz.sha1 b/chromium/third_party/node/node_modules.tar.gz.sha1 index f0c574d25f1..f715cf5d900 100644 --- a/chromium/third_party/node/node_modules.tar.gz.sha1 +++ b/chromium/third_party/node/node_modules.tar.gz.sha1 @@ -1 +1 @@ -22e47d864b766c3e02d8e297390a050db29285de +86745dc1c2122a55cafa111fa8fdf1e0587da224 |