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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 | 288 |
289 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement&
element) | 289 void PopupMenuImpl::addElementStyle(ItemIterationContext& context, HTMLElement&
element) |
290 { | 290 { |
291 const ComputedStyle* style = m_ownerElement->itemComputedStyle(element); | 291 const ComputedStyle* style = m_ownerElement->itemComputedStyle(element); |
292 DCHECK(style); | 292 DCHECK(style); |
293 SharedBuffer* data = context.m_buffer; | 293 SharedBuffer* data = context.m_buffer; |
294 // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no | 294 // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no |
295 // additional style. | 295 // additional style. |
296 PagePopupClient::addString("style: {\n", data); | 296 PagePopupClient::addString("style: {\n", data); |
297 if (style->visibility() == HIDDEN) | 297 if (style->visibility() == EVisibility::Hidden) |
298 addProperty("visibility", String("hidden"), data); | 298 addProperty("visibility", String("hidden"), data); |
299 if (style->display() == NONE) | 299 if (style->display() == NONE) |
300 addProperty("display", String("none"), data); | 300 addProperty("display", String("none"), data); |
301 const ComputedStyle& baseStyle = context.baseStyle(); | 301 const ComputedStyle& baseStyle = context.baseStyle(); |
302 if (baseStyle.direction() != style->direction()) | 302 if (baseStyle.direction() != style->direction()) |
303 addProperty("direction", String(style->direction() == RTL ? "rtl" : "ltr
"), data); | 303 addProperty("direction", String(style->direction() == RTL ? "rtl" : "ltr
"), data); |
304 if (isOverride(style->unicodeBidi())) | 304 if (isOverride(style->unicodeBidi())) |
305 addProperty("unicodeBidi", String("bidi-override"), data); | 305 addProperty("unicodeBidi", String("bidi-override"), data); |
306 Color foregroundColor = style->visitedDependentColor(CSSPropertyColor); | 306 Color foregroundColor = style->visitedDependentColor(CSSPropertyColor); |
307 if (baseStyle.visitedDependentColor(CSSPropertyColor) != foregroundColor) | 307 if (baseStyle.visitedDependentColor(CSSPropertyColor) != foregroundColor) |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 520 |
521 void PopupMenuImpl::disconnectClient() | 521 void PopupMenuImpl::disconnectClient() |
522 { | 522 { |
523 m_ownerElement = nullptr; | 523 m_ownerElement = nullptr; |
524 // Cannot be done during finalization, so instead done when the | 524 // Cannot be done during finalization, so instead done when the |
525 // layout object is destroyed and disconnected. | 525 // layout object is destroyed and disconnected. |
526 dispose(); | 526 dispose(); |
527 } | 527 } |
528 | 528 |
529 } // namespace blink | 529 } // namespace blink |
OLD | NEW |