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

Unified Diff: Source/core/html/forms/ColorInputType.cpp

Issue 34753002: make input type=color RTL direction aware (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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: Source/core/html/forms/ColorInputType.cpp
diff --git a/Source/core/html/forms/ColorInputType.cpp b/Source/core/html/forms/ColorInputType.cpp
index 97448940031a27406b734641670f2b5c731c5693..a43f87e5e751f81cf0b61a283ad38ed7f45f9183 100644
--- a/Source/core/html/forms/ColorInputType.cpp
+++ b/Source/core/html/forms/ColorInputType.cpp
@@ -121,7 +121,11 @@ void ColorInputType::createShadowSubtree()
Document& document = element()->document();
RefPtr<HTMLDivElement> wrapperElement = HTMLDivElement::create(document);
- wrapperElement->setPart(AtomicString("-webkit-color-swatch-wrapper", AtomicString::ConstructFromLiteral));
+ AtomicString dirAttributeValue = element()->fastGetAttribute(dirAttr);
+ if (equalIgnoringCase(dirAttributeValue, "rtl"))
+ wrapperElement->setPart(AtomicString("-webkit-color-swatch-wrapper-rtl", AtomicString::ConstructFromLiteral));
+ else
+ wrapperElement->setPart(AtomicString("-webkit-color-swatch-wrapper", AtomicString::ConstructFromLiteral));
RefPtr<HTMLDivElement> colorSwatch = HTMLDivElement::create(document);
colorSwatch->setPart(AtomicString("-webkit-color-swatch", AtomicString::ConstructFromLiteral));
wrapperElement->appendChild(colorSwatch.release());

Powered by Google App Engine
This is Rietveld 408576698