Changeset 77654 in webkit
- Timestamp:
- Feb 4, 2011 12:30:20 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r77652 r77654 1 2011-02-04 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by David Levin. 4 5 Implement "<option> should implement the dir attribute" for chromium port after r76983. 6 https://bugs.webkit.org/show_bug.cgi?id=50969 7 8 Use manual test Source/WebCore/manual-tests/pop-up-alignment-and-direction.html 9 added in r76983. 10 11 * platform/chromium/PopupMenuChromium.cpp: Remove directionality hint from 12 <select> drop-down setting. 13 (WebCore::PopupListBox::paintRow): Use <option>'s directionality to paint 14 items in drop-down and pass-in bidi override flag when creating text run. 15 * platform/chromium/PopupMenuChromium.h: Remove directionalityHint from 16 PopupContainerSettings. 17 1 18 2011-02-04 Jeremy Orlow <jorlow@chromium.org> 2 19 -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp
r77424 r77654 79 79 // This is the delegate used if none is provided. 80 80 static const PopupContainerSettings dropDownSettings = { 81 true, // setTextOnIndexChange 82 true, // acceptOnAbandon 83 false, // loopSelectionNavigation 84 false, // restrictWidthOfListBox 85 // display item text in its first strong directional character's directionality. 86 PopupContainerSettings::FirstStrongDirectionalCharacterDirection, 81 true, // setTextOnIndexChange 82 true, // acceptOnAbandon 83 false, // loopSelectionNavigation 84 false // restrictWidthOfListBox 87 85 }; 88 86 … … 969 967 970 968 // Prepare the directionality to draw text. 971 bool rtl = false; 972 if (m_settings.itemTextDirectionalityHint == PopupContainerSettings::DOMElementDirection) 973 rtl = style.textDirection() == RTL; 974 else if (m_settings.itemTextDirectionalityHint == 975 PopupContainerSettings::FirstStrongDirectionalCharacterDirection) 976 rtl = itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft; 977 TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl); 969 bool rtl = style.textDirection() == RTL; 970 TextRun textRun(itemText.characters(), itemText.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl, style.hasTextDirectionOverride()); 978 971 // If the text is right-to-left, make it right-aligned by adjusting its 979 972 // beginning position. … … 1003 996 if (itemLabel.isEmpty()) 1004 997 return; 1005 TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl );998 TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, rtl, style.hasTextDirectionOverride()); 1006 999 if (rightAligned) 1007 1000 textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft()); -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h
r77370 r77654 98 98 // Autocomplete popups are restricted, combo-boxes (select tags) aren't. 99 99 bool restrictWidthOfListBox; 100 101 // A hint on the display directionality of the item text in popup menu.102 //103 // We could either display the items in the drop-down using its DOM element's104 // directionality, or we could display the items in the drop-down using heuristics:105 // such as in its first strong directionality character's direction.106 // Please refer to the discussion (especially comment #7 and #10) in107 // https://bugs.webkit.org/show_bug.cgi?id=27889 for details.108 enum DirectionalityHint {109 // Use the DOM element's directionality to display the item text in popup menu.110 DOMElementDirection,111 // Use the item text's first strong-directional character's directionality112 // to display the item text in popup menu.113 FirstStrongDirectionalCharacterDirection,114 };115 DirectionalityHint itemTextDirectionalityHint;116 100 }; 117 101 -
trunk/Source/WebKit/chromium/ChangeLog
r77647 r77654 1 2011-02-04 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by David Levin. 4 5 Implement "<option> should implement the dir attribute" for chromium port after r76983. 6 https://bugs.webkit.org/show_bug.cgi?id=50969 7 8 * src/ChromeClientImpl.cpp: 9 (WebKit::ChromeClientImpl::selectItemAlignmentFollowsMenuWritingDirection): Override as true. 10 * src/WebViewImpl.cpp: Remove directionality hint from autofill drop-down setting. 11 1 12 2011-02-01 Jeremy Orlow <jorlow@chromium.org> 2 13 -
trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp
r77607 r77654 863 863 bool ChromeClientImpl::selectItemAlignmentFollowsMenuWritingDirection() 864 864 { 865 return false;865 return true; 866 866 } 867 867 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r77406 r77654 202 202 false, // setTextOnIndexChange 203 203 false, // acceptOnAbandon 204 true, // loopSelectionNavigation 205 false, // restrictWidthOfListBox (For security reasons show the entire entry 206 // so the user doesn't enter information he did not intend to.) 207 // For suggestions, we use the direction of the input field as the direction 208 // of the popup items. The main reason is to keep the display of items in 209 // drop-down the same as the items in the input field. 210 PopupContainerSettings::DOMElementDirection, 204 true, // loopSelectionNavigation 205 false // restrictWidthOfListBox (For security reasons show the entire entry 206 // so the user doesn't enter information he did not intend to.) 211 207 }; 212 208
Note: See TracChangeset
for help on using the changeset viewer.