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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 popupItem.type = WebMenuItemInfo::Separator; | 247 popupItem.type = WebMenuItemInfo::Separator; |
248 } else if (isHTMLOptGroupElement(itemElement)) { | 248 } else if (isHTMLOptGroupElement(itemElement)) { |
249 popupItem.type = WebMenuItemInfo::Group; | 249 popupItem.type = WebMenuItemInfo::Group; |
250 } else { | 250 } else { |
251 popupItem.type = WebMenuItemInfo::Option; | 251 popupItem.type = WebMenuItemInfo::Option; |
252 popupItem.checked = toHTMLOptionElement(itemElement).selected(); | 252 popupItem.checked = toHTMLOptionElement(itemElement).selected(); |
253 } | 253 } |
254 popupItem.enabled = !itemElement.isDisabledFormControl(); | 254 popupItem.enabled = !itemElement.isDisabledFormControl(); |
255 const ComputedStyle& style = *ownerElement.itemComputedStyle(itemElement); | 255 const ComputedStyle& style = *ownerElement.itemComputedStyle(itemElement); |
256 popupItem.textDirection = toWebTextDirection(style.direction()); | 256 popupItem.textDirection = toWebTextDirection(style.direction()); |
257 popupItem.hasTextDirectionOverride = isOverride(style.unicodeBidi()); | 257 popupItem.hasTextDirectionOverride = isOverride(style.getUnicodeBidi()); |
258 } | 258 } |
259 | 259 |
260 const ComputedStyle& menuStyle = ownerElement.computedStyle() | 260 const ComputedStyle& menuStyle = ownerElement.computedStyle() |
261 ? *ownerElement.computedStyle() | 261 ? *ownerElement.computedStyle() |
262 : *ownerElement.ensureComputedStyle(); | 262 : *ownerElement.ensureComputedStyle(); |
263 const SimpleFontData* fontData = menuStyle.font().primaryFont(); | 263 const SimpleFontData* fontData = menuStyle.font().primaryFont(); |
264 DCHECK(fontData); | 264 DCHECK(fontData); |
265 info.itemHeight = fontData ? fontData->getFontMetrics().height() : 0; | 265 info.itemHeight = fontData ? fontData->getFontMetrics().height() : 0; |
266 info.itemFontSize = | 266 info.itemFontSize = |
267 static_cast<int>(menuStyle.font().getFontDescription().computedSize()); | 267 static_cast<int>(menuStyle.font().getFontDescription().computedSize()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 if (ownerElement.itemIsDisplayNone(*items[i])) | 302 if (ownerElement.itemIsDisplayNone(*items[i])) |
303 continue; | 303 continue; |
304 if (popupMenuItemIndex == i) | 304 if (popupMenuItemIndex == i) |
305 return indexTracker; | 305 return indexTracker; |
306 ++indexTracker; | 306 ++indexTracker; |
307 } | 307 } |
308 return -1; | 308 return -1; |
309 } | 309 } |
310 | 310 |
311 } // namespace blink | 311 } // namespace blink |
OLD | NEW |