Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: chrome/browser/resources/local_ntp/local_ntp.js

Issue 16336020: InstantExtended: Workaround Blink bug 68841. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_ntp/local_ntp.js
diff --git a/chrome/browser/resources/local_ntp/local_ntp.js b/chrome/browser/resources/local_ntp/local_ntp.js
index 68f4a93e4ae05fc8139a168ee84d6ceb4023b569..69a003e9b9544eb89d93a02cafefb9fcb80cfaa1 100644
--- a/chrome/browser/resources/local_ntp/local_ntp.js
+++ b/chrome/browser/resources/local_ntp/local_ntp.js
@@ -443,11 +443,27 @@ function createTile(page, position) {
var usingCustomTheme = document.body.classList.contains(
CLASSES.CUSTOM_THEME);
+ // Why iframes have IDs:
+ //
+ // On navigating back to the NTP we see several onmostvisitedchange() events
+ // in series with incrementing RIDs. After the first event, a set of iframes
+ // begins loading RIDs n, n+1, ..., n+k-1; after the second event, these get
+ // destroyed and a new set begins loading RIDs n+k, n+k+1, ..., n+2k-1.
+ // Now due to crbug.com/68841, Chrome incorrectly loads the content for the
+ // first set of iframes into the most recent set of iframes.
+ //
+ // Giving iframes distinct ids seems to cause some invalidation and prevent
+ // associating the incorrect data.
+ //
+ // TODO(jered): Find and fix the root (probably Blink) bug.
+
titleElement.src = getMostVisitedIframeUrl(
MOST_VISITED_TITLE_IFRAME, rid,
usingCustomTheme ? MOST_VISITED_THEME_TITLE_COLOR : MOST_VISITED_COLOR,
MOST_VISITED_FONT_FAMILY, MOST_VISITED_FONT_SIZE, usingCustomTheme,
position);
+ // Keep this id here. See comment above.
+ titleElement.id = 'title-' + rid;
titleElement.hidden = true;
titleElement.onload = function() { titleElement.hidden = false; };
titleElement.className = CLASSES.TITLE;
@@ -459,6 +475,8 @@ function createTile(page, position) {
thumbnailElement.src = getMostVisitedIframeUrl(
MOST_VISITED_THUMBNAIL_IFRAME, rid, MOST_VISITED_COLOR,
MOST_VISITED_FONT_FAMILY, MOST_VISITED_FONT_SIZE, false, position);
+ // Keep this id here. See comment above.
+ thumbnailElement.id = 'thumb-' + rid;
thumbnailElement.hidden = true;
thumbnailElement.onload = function() {
thumbnailElement.hidden = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698