| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 251 } |
| 252 popupItem.enabled = !itemElement.isDisabledFormControl(); | 252 popupItem.enabled = !itemElement.isDisabledFormControl(); |
| 253 const ComputedStyle& style = *ownerElement.itemComputedStyle(itemElement); | 253 const ComputedStyle& style = *ownerElement.itemComputedStyle(itemElement); |
| 254 popupItem.textDirection = toWebTextDirection(style.direction()); | 254 popupItem.textDirection = toWebTextDirection(style.direction()); |
| 255 popupItem.hasTextDirectionOverride = isOverride(style.unicodeBidi()); | 255 popupItem.hasTextDirectionOverride = isOverride(style.unicodeBidi()); |
| 256 } | 256 } |
| 257 | 257 |
| 258 const ComputedStyle& menuStyle = ownerElement.computedStyle() | 258 const ComputedStyle& menuStyle = ownerElement.computedStyle() |
| 259 ? *ownerElement.computedStyle() | 259 ? *ownerElement.computedStyle() |
| 260 : *ownerElement.ensureComputedStyle(); | 260 : *ownerElement.ensureComputedStyle(); |
| 261 info.itemHeight = menuStyle.font().getFontMetrics().height(); | 261 const SimpleFontData* fontData = menuStyle.font().primaryFont(); |
| 262 DCHECK(fontData); |
| 263 info.itemHeight = fontData ? fontData->getFontMetrics().height() : 0; |
| 262 info.itemFontSize = | 264 info.itemFontSize = |
| 263 static_cast<int>(menuStyle.font().getFontDescription().computedSize()); | 265 static_cast<int>(menuStyle.font().getFontDescription().computedSize()); |
| 264 info.selectedIndex = toExternalPopupMenuItemIndex( | 266 info.selectedIndex = toExternalPopupMenuItemIndex( |
| 265 ownerElement.selectedListIndex(), ownerElement); | 267 ownerElement.selectedListIndex(), ownerElement); |
| 266 info.rightAligned = menuStyle.direction() == RTL; | 268 info.rightAligned = menuStyle.direction() == RTL; |
| 267 info.allowMultipleSelection = ownerElement.isMultiple(); | 269 info.allowMultipleSelection = ownerElement.isMultiple(); |
| 268 if (count < itemCount) | 270 if (count < itemCount) |
| 269 items.shrink(count); | 271 items.shrink(count); |
| 270 info.items = items; | 272 info.items = items; |
| 271 } | 273 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 298 if (ownerElement.itemIsDisplayNone(*items[i])) | 300 if (ownerElement.itemIsDisplayNone(*items[i])) |
| 299 continue; | 301 continue; |
| 300 if (popupMenuItemIndex == i) | 302 if (popupMenuItemIndex == i) |
| 301 return indexTracker; | 303 return indexTracker; |
| 302 ++indexTracker; | 304 ++indexTracker; |
| 303 } | 305 } |
| 304 return -1; | 306 return -1; |
| 305 } | 307 } |
| 306 | 308 |
| 307 } // namespace blink | 309 } // namespace blink |
| OLD | NEW |