OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "web/PopupMenuImpl.h" | 5 #include "web/PopupMenuImpl.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/css/CSSFontSelector.h" | 8 #include "core/css/CSSFontSelector.h" |
9 #include "core/dom/ElementTraversal.h" | 9 #include "core/dom/ElementTraversal.h" |
10 #include "core/dom/ExecutionContextTask.h" | 10 #include "core/dom/ExecutionContextTask.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement&
element) | 290 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement&
element) |
291 { | 291 { |
292 const ComputedStyle* style = m_ownerElement->itemComputedStyle(element); | 292 const ComputedStyle* style = m_ownerElement->itemComputedStyle(element); |
293 DCHECK(style); | 293 DCHECK(style); |
294 SharedBuffer* data = context.m_buffer; | 294 SharedBuffer* data = context.m_buffer; |
295 // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no | 295 // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no |
296 // additional style. | 296 // additional style. |
297 PagePopupClient::addString("style: {\n", data); | 297 PagePopupClient::addString("style: {\n", data); |
298 if (style->visibility() == EVisibility::Hidden) | 298 if (style->visibility() == EVisibility::Hidden) |
299 addProperty("visibility", String("hidden"), data); | 299 addProperty("visibility", String("hidden"), data); |
300 if (style->display() == NONE) | 300 if (style->display() == EDisplay::None) |
301 addProperty("display", String("none"), data); | 301 addProperty("display", String("none"), data); |
302 const ComputedStyle& baseStyle = context.baseStyle(); | 302 const ComputedStyle& baseStyle = context.baseStyle(); |
303 if (baseStyle.direction() != style->direction()) | 303 if (baseStyle.direction() != style->direction()) |
304 addProperty("direction", String(style->direction() == RTL ? "rtl" : "ltr
"), data); | 304 addProperty("direction", String(style->direction() == RTL ? "rtl" : "ltr
"), data); |
305 if (isOverride(style->unicodeBidi())) | 305 if (isOverride(style->unicodeBidi())) |
306 addProperty("unicodeBidi", String("bidi-override"), data); | 306 addProperty("unicodeBidi", String("bidi-override"), data); |
307 Color foregroundColor = style->visitedDependentColor(CSSPropertyColor); | 307 Color foregroundColor = style->visitedDependentColor(CSSPropertyColor); |
308 if (baseStyle.visitedDependentColor(CSSPropertyColor) != foregroundColor) | 308 if (baseStyle.visitedDependentColor(CSSPropertyColor) != foregroundColor) |
309 addProperty("color", foregroundColor.serialized(), data); | 309 addProperty("color", foregroundColor.serialized(), data); |
310 Color backgroundColor = style->visitedDependentColor(CSSPropertyBackgroundCo
lor); | 310 Color backgroundColor = style->visitedDependentColor(CSSPropertyBackgroundCo
lor); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 void PopupMenuImpl::disconnectClient() | 526 void PopupMenuImpl::disconnectClient() |
527 { | 527 { |
528 m_ownerElement = nullptr; | 528 m_ownerElement = nullptr; |
529 // Cannot be done during finalization, so instead done when the | 529 // Cannot be done during finalization, so instead done when the |
530 // layout object is destroyed and disconnected. | 530 // layout object is destroyed and disconnected. |
531 dispose(); | 531 dispose(); |
532 } | 532 } |
533 | 533 |
534 } // namespace blink | 534 } // namespace blink |
OLD | NEW |