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

Unified Diff: LayoutTests/fast/text/international/listbox-width-rtl.html

Issue 347773002: Implement select listbox using shadow DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
Index: LayoutTests/fast/text/international/listbox-width-rtl.html
diff --git a/LayoutTests/fast/text/international/listbox-width-rtl.html b/LayoutTests/fast/text/international/listbox-width-rtl.html
index f1f1e86aefaf2711d575154ca743d272b68f5610..59417c2b926aa8046e84bc7b242be356c5c0a452 100644
--- a/LayoutTests/fast/text/international/listbox-width-rtl.html
+++ b/LayoutTests/fast/text/international/listbox-width-rtl.html
@@ -37,18 +37,21 @@
document.body.removeChild(textElement);
return textWidth;
}
-
+
+ var optionPaddingStart = 3;
+ var optionPaddingEnd = 2;
keishi 2014/06/22 11:59:55 emptyWidth does not contain padding anymore, only
+
function testListbox(id)
{
var element = document.getElementById(id);
var emptyWidth = widthForEmptySelect(element.size);
var textWidth = widthForText(element.firstElementChild.textContent);
var dropdownWidth = element.getBoundingClientRect().width;
-
- if (Math.abs(dropdownWidth - (emptyWidth + textWidth)) <= 1)
+ var expectedWidth = emptyWidth + textWidth + optionPaddingStart + optionPaddingEnd;
+ if (Math.abs(dropdownWidth - expectedWidth) <= 1)
testPassed('Width of ' + id + ' matches width of text plus width of empty ' + id + '.');
else
- testFailed('Width ' + id + ' was ' + dropdownWidth + 'px wide, expected ' + (emptyWidth + textWidth) + 'px (' + emptyWidth + 'px for empty ' + id + ' and ' + textWidth + 'px for text).');
+ testFailed('Width ' + id + ' was ' + dropdownWidth + 'px wide, expected ' + expectedWidth + 'px (' + emptyWidth + 'px for empty ' + id + ' and ' + textWidth + 'px for text).');
}
testListbox('list');

Powered by Google App Engine
This is Rietveld 408576698