Commit 552e4158 authored by huangs's avatar huangs Committed by Commit bot

[Local NTP] block image-related context menu items for thumbnails; CSS fixes.

In https://chromiumcodereview.appspot.com/473583002/ we removed a
'shadow' element in thumbnail <iframe> to improve customization. A side
effect is that this exposes the thumbnail image, thereby alow the user
to futilely access the chrome-search://thumb/#/# image below. This CL
adds back a transparent "blocker" in front of the thumbnail to restore
old behavior. Also making 2 CSS changes to:
- Fix fake box text positioning for RTL.
- Move top-margin back from #ntp-contents to #logo, for correctness.

BUG=411005

Review URL: https://codereview.chromium.org/542033002

Cr-Commit-Position: refs/heads/master@{#293650}
parent 92923e1e
......@@ -15,16 +15,7 @@ body {
text-align: -webkit-center;
}
#ntp-contents.classical {
margin-top: 157px;
}
#ntp-contents.md {
margin-top: 157px;
}
.non-google-page #ntp-contents {
margin-top: 0;
position: absolute;
top: calc(50% - 155px);
width: 100%;
......@@ -50,6 +41,7 @@ body.fakebox-disable #fakebox > input {
background-size: 269px 95px;
height: 95px;
margin-bottom: 24px;
margin-top: 157px;
width: 269px;
}
......@@ -119,7 +111,7 @@ body[dir=rtl] #fakebox > input {
margin-top: 1px;
overflow: hidden;
position: absolute;
text-align: left;
text-align: initial;
text-overflow: ellipsis;
vertical-align: middle;
visibility: inherit;
......
......@@ -9,6 +9,7 @@ body {
a {
height: 100%;
position: relative;
width: 100%;
}
......@@ -27,6 +28,13 @@ div {
width: 90%;
}
span.blocker {
display: inline-block;
height: 100%;
position: absolute;
width: 100%;
}
img {
height: 100%;
width: 100%;
......
......@@ -45,6 +45,10 @@ window.addEventListener('DOMContentLoaded', function() {
var link = createMostVisitedLink(
params, data.url, data.title, undefined, data.direction,
data.provider);
// Use blocker to prevent context menu from showing image-related items.
var blocker = document.createElement('span');
blocker.className = 'blocker';
link.appendChild(blocker);
link.appendChild(image);
displayLink(link);
};
......
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