OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 popupItem.type = WebMenuItemInfo::Option; | 253 popupItem.type = WebMenuItemInfo::Option; |
254 popupItem.checked = toHTMLOptionElement(itemElement).selected(); | 254 popupItem.checked = toHTMLOptionElement(itemElement).selected(); |
255 } | 255 } |
256 popupItem.enabled = !itemElement.isDisabledFormControl(); | 256 popupItem.enabled = !itemElement.isDisabledFormControl(); |
257 const ComputedStyle& style = *ownerElement.itemComputedStyle(itemElement
); | 257 const ComputedStyle& style = *ownerElement.itemComputedStyle(itemElement
); |
258 popupItem.textDirection = toWebTextDirection(style.direction()); | 258 popupItem.textDirection = toWebTextDirection(style.direction()); |
259 popupItem.hasTextDirectionOverride = isOverride(style.unicodeBidi()); | 259 popupItem.hasTextDirectionOverride = isOverride(style.unicodeBidi()); |
260 } | 260 } |
261 | 261 |
262 const ComputedStyle& menuStyle = ownerElement.computedStyle() ? *ownerElemen
t.computedStyle() : *ownerElement.ensureComputedStyle(); | 262 const ComputedStyle& menuStyle = ownerElement.computedStyle() ? *ownerElemen
t.computedStyle() : *ownerElement.ensureComputedStyle(); |
263 info.itemHeight = menuStyle.font().fontMetrics().height(); | 263 info.itemHeight = menuStyle.font().getFontMetrics().height(); |
264 info.itemFontSize = static_cast<int>(menuStyle.font().fontDescription().comp
utedSize()); | 264 info.itemFontSize = static_cast<int>(menuStyle.font().getFontDescription().c
omputedSize()); |
265 info.selectedIndex = toExternalPopupMenuItemIndex(ownerElement.optionToListI
ndex(ownerElement.selectedIndex()), ownerElement); | 265 info.selectedIndex = toExternalPopupMenuItemIndex(ownerElement.optionToListI
ndex(ownerElement.selectedIndex()), ownerElement); |
266 info.rightAligned = menuStyle.direction() == RTL; | 266 info.rightAligned = menuStyle.direction() == RTL; |
267 info.allowMultipleSelection = ownerElement.multiple(); | 267 info.allowMultipleSelection = ownerElement.multiple(); |
268 if (count < itemCount) | 268 if (count < itemCount) |
269 items.shrink(count); | 269 items.shrink(count); |
270 info.items = items; | 270 info.items = items; |
271 | 271 |
272 } | 272 } |
273 | 273 |
274 int ExternalPopupMenu::toPopupMenuItemIndex(int externalPopupMenuItemIndex, HTML
SelectElement& ownerElement) | 274 int ExternalPopupMenu::toPopupMenuItemIndex(int externalPopupMenuItemIndex, HTML
SelectElement& ownerElement) |
(...skipping 23 matching lines...) Expand all Loading... |
298 if (ownerElement.itemIsDisplayNone(*items[i])) | 298 if (ownerElement.itemIsDisplayNone(*items[i])) |
299 continue; | 299 continue; |
300 if (popupMenuItemIndex == i) | 300 if (popupMenuItemIndex == i) |
301 return indexTracker; | 301 return indexTracker; |
302 ++indexTracker; | 302 ++indexTracker; |
303 } | 303 } |
304 return -1; | 304 return -1; |
305 } | 305 } |
306 | 306 |
307 } // namespace blink | 307 } // namespace blink |
OLD | NEW |