chore: bump chromium to a70ba0e79c1551239beb37961f643 (master) (#23199)

* chore: bump chromium in DEPS to 4b8b82c4e48a70ba0e79c1551239beb37961f643

* update patches

Co-authored-by: Electron Bot <anonymous@electronjs.org>
This commit is contained in:
Electron Bot 2020-04-21 11:10:23 -07:00 committed by GitHub
parent f3dc3997b1
commit 6e8446d06d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 209 deletions

2
DEPS
View file

@ -12,7 +12,7 @@ gclient_gn_args = [
vars = {
'chromium_version':
'7b80f9c82122600291d041c530698616a4716cdf',
'4b8b82c4e48a70ba0e79c1551239beb37961f643',
'node_version':
'v12.16.2',
'nan_version':

View file

@ -90,4 +90,3 @@ fix_undo_redo_broken_in_webviews.patch
fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
web_contents.patch
ui_gtk_public_header.patch
layoutng_make_hittestresult_localpoint_for_inline_element.patch

View file

@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
Electrons grit header instead of Chromes
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 0530163fc4536e0153194209a0a1e8566f479fda..3f9ae0020ad07d5c56fa356a37e94e4be0d5f516 100644
index 6292627b6fcec0a993d3c921222a2615af068005..2ec0262c4eb8a419154d412eb73209d8d5f3d560 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -5304,6 +5304,7 @@ jumbo_static_library("browser") {
@@ -5305,6 +5305,7 @@ jumbo_static_library("browser") {
deps += [
"//components/spellcheck/browser",
"//components/spellcheck/common",

View file

@ -455,7 +455,7 @@ index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c0
waiting_on_draw_ack_ = true;
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
index 8e10af98f2b039d0d96f8be908f751b9117193d5..f9501da88a008131e3d046b452ba9c34455a1da4 100644
index 24a753ace9900e31b6e6800b5b33b19def09fb2d..2e8b76a960910a0a17bb261d9a4ecd91d7209ee6 100644
--- a/content/browser/compositor/viz_process_transport_factory.cc
+++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -404,8 +404,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
@ -527,7 +527,7 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
+ Draw(gfx.mojom.Rect damage_rect) => ();
};
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 601c3d175ccd24161b15b2b19ecb1a9241083060..d2ca7469f2a28c8027aca74404a47364dcfe16e3 100644
index cf47803e781a2bf19f71c1eb2e7686cd7513f951..948affdaff9c55edf3d8067237bf64172d30ad8c 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -73,6 +73,7 @@ class DisplayPrivate;
@ -564,7 +564,7 @@ index 601c3d175ccd24161b15b2b19ecb1a9241083060..d2ca7469f2a28c8027aca74404a47364
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -405,6 +418,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
@@ -409,6 +422,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;

View file

@ -42,7 +42,7 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
// another SiteInstance for the same site.
void RegisterSiteInstance(SiteInstanceImpl* site_instance);
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index a43d6d6aaaabbe7ec911ab725ba71ff6f1b36c10..ae3dffb5ba9791b9d46c5939c04d787799e30a31 100644
index 4494c15b90f951615d1c2f08736485017256b877..f0e5e780124ee9c2b6b3a7a0d2ecc3d41eb96150 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -1278,6 +1278,24 @@ void NavigationRequest::BeginNavigation() {

View file

@ -1,194 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yoshifumi Inoue <yosin@chromium.org>
Date: Fri, 17 Apr 2020 09:22:24 +0000
Subject: Make HitTestResult::LocalPoint() for inline element as same as legacy
layout
This patch changes |NGBoxFragmentPainter::NodeAtPoint()| to set offset in
containing block instead of offset in underlying element for inline element as
legacy layout to make hit testing on inline element with ::after pseudo class
with adapting |PositionForPoint()|.
The document[1] contains investigation notes of this CL.
[1] https://bit.ly/2REZ7P9 Hit Test with ::after
Bug: 1043471
Change-Id: I81ada0ccd7bff31a84ce4746785ea83eb175937c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151775
Commit-Queue: Koji Ishii <kojii@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759982}
diff --git a/third_party/blink/renderer/core/layout/hit_testing_test.cc b/third_party/blink/renderer/core/layout/hit_testing_test.cc
index 8927df5bbd218cf3dc400930a9894103780a58f6..76f912f90958e3532e203d7d28a2751f2cb5317d 100644
--- a/third_party/blink/renderer/core/layout/hit_testing_test.cc
+++ b/third_party/blink/renderer/core/layout/hit_testing_test.cc
@@ -3,11 +3,72 @@
// found in the LICENSE file.
#include "third_party/blink/renderer/core/css/css_property_names.h"
+#include "third_party/blink/renderer/core/editing/text_affinity.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
namespace blink {
-class HitTestingTest : public RenderingTest {};
+class HitTestingTest : public RenderingTest {
+ protected:
+ bool LayoutNGEnabled() const {
+ return RuntimeEnabledFeatures::LayoutNGEnabled();
+ }
+
+ PositionWithAffinity HitTest(const PhysicalOffset offset) {
+ const HitTestRequest hit_request(HitTestRequest::kActive);
+ const HitTestLocation hit_location(offset);
+ HitTestResult hit_result(hit_request, hit_location);
+ if (!GetLayoutView().HitTest(hit_location, hit_result))
+ return PositionWithAffinity();
+ // Simulate |PositionWithAffinityOfHitTestResult()| in
+ // "selection_controller.cc"
+ LayoutObject* const layout_object =
+ hit_result.InnerPossiblyPseudoNode()->GetLayoutObject();
+ if (!layout_object)
+ return PositionWithAffinity();
+ return layout_object->PositionForPoint(hit_result.LocalPoint());
+ }
+};
+
+// http://crbug.com/1043471
+TEST_F(HitTestingTest, PseudoElementAfter) {
+ LoadAhem();
+ InsertStyleElement(
+ "body { margin: 0px; font: 10px/10px Ahem; }"
+ "#cd::after { content: 'XYZ'; margin-left: 100px; }");
+ SetBodyInnerHTML("<div id=ab>ab<span id=cd>cd</span></div>");
+ const auto& text_ab = *To<Text>(GetElementById("ab")->firstChild());
+ const auto& text_cd = *To<Text>(GetElementById("cd")->lastChild());
+
+ EXPECT_EQ(PositionWithAffinity(Position(text_ab, 0)),
+ HitTest(PhysicalOffset(5, 5)));
+ // Because of hit testing at "b", position should be |kDownstream|.
+ EXPECT_EQ(PositionWithAffinity(Position(text_ab, 1),
+ LayoutNGEnabled() ? TextAffinity::kDownstream
+ : TextAffinity::kUpstream),
+ HitTest(PhysicalOffset(15, 5)));
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 0)),
+ HitTest(PhysicalOffset(25, 5)));
+ // Because of hit testing at "d", position should be |kDownstream|.
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 1),
+ LayoutNGEnabled() ? TextAffinity::kDownstream
+ : TextAffinity::kUpstream),
+ HitTest(PhysicalOffset(35, 5)));
+ // Because of hit testing at right of <span cd>, result position should be
+ // |kUpstream|.
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 2),
+ LayoutNGEnabled() ? TextAffinity::kUpstream
+ : TextAffinity::kDownstream),
+ HitTest(PhysicalOffset(45, 5)));
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 2),
+ LayoutNGEnabled() ? TextAffinity::kUpstream
+ : TextAffinity::kDownstream),
+ HitTest(PhysicalOffset(55, 5)));
+ EXPECT_EQ(PositionWithAffinity(Position(text_cd, 2),
+ LayoutNGEnabled() ? TextAffinity::kUpstream
+ : TextAffinity::kDownstream),
+ HitTest(PhysicalOffset(65, 5)));
+}
TEST_F(HitTestingTest, OcclusionHitTest) {
SetBodyInnerHTML(R"HTML(
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc
index deee88b999df15150546fe23fe1a90a1d651a69a..abc391f152c509963ead262460323f8579df4d49 100644
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.cc
@@ -818,6 +818,25 @@ PositionWithAffinity NGInlineCursor::PositionForPointInInlineBox(
}
}
+ if (container->Type() == NGFragmentItem::kLine) {
+ // There are no inline items to hit in this line box, e.g. <span> with
+ // size and border. We try in lines before |this| line in the block.
+ // See editing/selection/last-empty-inline.html
+ NGInlineCursor cursor;
+ cursor.MoveTo(*this);
+ const PhysicalOffset point_in_line =
+ point - Current().OffsetInContainerBlock();
+ for (;;) {
+ cursor.MoveToPreviousLine();
+ if (!cursor)
+ break;
+ const PhysicalOffset adjusted_point =
+ point_in_line + cursor.Current().OffsetInContainerBlock();
+ if (auto position = cursor.PositionForPointInInlineBox(adjusted_point))
+ return position;
+ }
+ }
+
return PositionWithAffinity();
}
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
index 043e361924d993fb711951a45edbb2b690b757f0..1f2db82194572337acd767de97a808d475717672 100644
--- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
+++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -1722,9 +1722,25 @@ bool NGBoxFragmentPainter::NodeAtPoint(const HitTestContext& hit_test,
if (fragment.IsInlineBox())
bounds_rect = PhysicalRect(PixelSnappedIntRect(bounds_rect));
if (hit_test.location.Intersects(bounds_rect)) {
- if (hit_test.AddNodeToResult(fragment.NodeForHitTest(), bounds_rect,
- physical_offset))
- return true;
+ // We set offset in container block instead of offset in |fragment| like
+ // |NGBoxFragmentPainter::HitTestTextFragment()|.
+ // See http://crbug.com/1043471
+ if (box_item_ && box_item_->IsInlineBox()) {
+ if (hit_test.AddNodeToResult(
+ fragment.NodeForHitTest(), bounds_rect,
+ physical_offset - box_item_->OffsetInContainerBlock()))
+ return true;
+ } else if (paint_fragment_ &&
+ paint_fragment_->PhysicalFragment().IsInline()) {
+ if (hit_test.AddNodeToResult(
+ fragment.NodeForHitTest(), bounds_rect,
+ physical_offset - paint_fragment_->OffsetInContainerBlock()))
+ return true;
+ } else {
+ if (hit_test.AddNodeToResult(fragment.NodeForHitTest(), bounds_rect,
+ physical_offset))
+ return true;
+ }
}
}
diff --git a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
index 9cd79dd07b2098fbf7efe7d85b3a63b0382ff1c2..bec5324a026e679965873afe387236a0b5e60f85 100644
--- a/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
+++ b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
@@ -1039,6 +1039,25 @@ PositionWithAffinity NGPaintFragment::PositionForPointInInlineLevelBox(
return child_position.value();
}
+ if (PhysicalFragment().IsLineBox()) {
+ // There are no inline items to hit in this line box, e.g. <span> with
+ // size and border. We try in lines before |this| line in the block.
+ // See editing/selection/last-empty-inline.html
+ NGInlineCursor cursor(*Parent());
+ cursor.MoveTo(*this);
+ const PhysicalOffset point_in_line = point - OffsetInContainerBlock();
+ for (;;) {
+ cursor.MoveToPreviousLine();
+ if (!cursor)
+ break;
+ const NGPaintFragment& line = *cursor.CurrentPaintFragment();
+ const PhysicalOffset adjusted_point =
+ point_in_line + line.OffsetInContainerBlock();
+ if (auto position = line.PositionForPointInInlineLevelBox(adjusted_point))
+ return position;
+ }
+ }
+
return PositionWithAffinity();
}

View file

@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 0819194e335de3cc63ad72c4c4abf632694828ac..7ef12b4fd4dde87bf677dc6f4823ce4cb8fc187a 100644
index 65065b781a0ae6e70c59d7c31d1410b4457fca49..04a13092de8e18f6a960f7b46be217bb4af34301 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -21,7 +21,6 @@

View file

@ -9,7 +9,7 @@ necessary for native modules to load.
Also, some fixes relating to mksnapshot on ARM.
diff --git a/BUILD.gn b/BUILD.gn
index b88d6ae937683ee39d73a208e98c8218dbfba32e..212ee5494fb7c05e616af1c2f42159151c2a18f8 100644
index 4517daa8563c0f1aca10419d6b523af62608bc16..f9f83b412e92999b6187dfdc24a63c0686d93bce 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -315,7 +315,7 @@ config("internal_config") {
@ -21,7 +21,7 @@ index b88d6ae937683ee39d73a208e98c8218dbfba32e..212ee5494fb7c05e616af1c2f4215915
defines += [ "BUILDING_V8_SHARED" ]
}
}
@@ -4131,7 +4131,7 @@ if (current_toolchain == v8_generator_toolchain) {
@@ -4134,7 +4134,7 @@ if (current_toolchain == v8_generator_toolchain) {
"src/interpreter/bytecodes.h",
]
@ -30,7 +30,7 @@ index b88d6ae937683ee39d73a208e98c8218dbfba32e..212ee5494fb7c05e616af1c2f4215915
deps = [
":v8_libbase",
@@ -4164,6 +4164,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
@@ -4167,6 +4167,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
configs = [ ":internal_config" ]

View file

@ -12,7 +12,7 @@ This patch can be safely removed if, when it is removed, `node.lib` does not
contain any standard C++ library exports (e.g. `std::ostringstream`).
diff --git a/BUILD.gn b/BUILD.gn
index 44702bd7f08ff311841f514a7fc1ee7d970317cd..f6718a94ad391adb53bc60b425d27834de9bd964 100644
index 61d9ad2aeb3543d2468e7cc8f3cf59247e527a8b..732e29b5b3f576d135acb1840d7d6a31c27f80dc 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -315,6 +315,10 @@ config("internal_config") {

View file

@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch
Needed in order to target mksnapshot for mksnapshot zip.
diff --git a/BUILD.gn b/BUILD.gn
index 212ee5494fb7c05e616af1c2f42159151c2a18f8..44702bd7f08ff311841f514a7fc1ee7d970317cd 100644
index f9f83b412e92999b6187dfdc24a63c0686d93bce..61d9ad2aeb3543d2468e7cc8f3cf59247e527a8b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -4142,7 +4142,6 @@ if (current_toolchain == v8_generator_toolchain) {
@@ -4145,7 +4145,6 @@ if (current_toolchain == v8_generator_toolchain) {
if (current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") {