Commit f3b308e5 authored by xji@chromium.org's avatar xji@chromium.org

This CL is a work around for the following 2 issues:

issue 7252 --[New Tab] page, the underline of linked text should be under all text
http://crbug.com/7252

issue 7697 -- RTL: New Tab page - bad display of page titles with RTL text
http://crbug.com/7697

The bug is caused by WebKit not rendering text-overflow:ellipsis correctly for mixed bidi text with rtl directionality.

The workaround is to change text-overflow to 'clip' for text with 'rtl' directionality.

(The workaround we thought by changing 'text-overflow' to 'clip' in the style, such as in 'html[dir='rtl'] .thumbnail-title', does not work well. 'text-overflow:clip' caused pure English text overlap with the right-aligned favicon in RTL New Tab page).


Review URL: http://codereview.chromium.org/42636

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12598 0039d316-1c4b-4281-b951-d872f2087c98
parent 7ea7ec4f
...@@ -561,6 +561,13 @@ function makeMostVisitedDOM(page, number) { ...@@ -561,6 +561,13 @@ function makeMostVisitedDOM(page, number) {
for more information. for more information.
*/ */
div_title.style.direction = page.direction; div_title.style.direction = page.direction;
/* The following if statement is a temporary workaround for
http://crbug.com/7252 and http://crbug.com/7697. It should be removed
before closing these bugs.
*/
if (page.direction == 'rtl') {
div_title.style.textOverflow = 'clip';
}
if (page.title) { if (page.title) {
div_title.appendChild(document.createTextNode(page.title)); div_title.appendChild(document.createTextNode(page.title));
} else { } else {
...@@ -700,6 +707,13 @@ function renderRecentlyBookmarked(entries) { ...@@ -700,6 +707,13 @@ function renderRecentlyBookmarked(entries) {
comment about setting div_title.style.direction above for details. comment about setting div_title.style.direction above for details.
*/ */
link.style.direction = entry.direction; link.style.direction = entry.direction;
/* The following if statement is a temporary workaround for
http://crbug.com/7252 and http://crbug.com/7697. It should be removed
before closing these bugs.
*/
if (entry.direction == 'rtl') {
link.style.textOverflow = 'clip';
}
link.appendChild(document.createTextNode(entry.title)); link.appendChild(document.createTextNode(entry.title));
container.appendChild(link); container.appendChild(link);
} }
...@@ -794,6 +808,14 @@ function createRecentBookmark(tagName, data) { ...@@ -794,6 +808,14 @@ function createRecentBookmark(tagName, data) {
about setting div_title.style.direction above for details. about setting div_title.style.direction above for details.
*/ */
link.style.direction = data.direction; link.style.direction = data.direction;
/* The following if statement is a temporary workaround for
http://crbug.com/7252 and http://crbug.com/7697. It should be removed
before closing these bugs.
*/
if (data.direction == 'rtl') {
link.style.textOverflow = 'clip';
}
link.appendChild(document.createTextNode(data.title)); link.appendChild(document.createTextNode(data.title));
return link; return 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