| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 DCHECK(style); | 313 DCHECK(style); |
| 314 SharedBuffer* data = context.m_buffer; | 314 SharedBuffer* data = context.m_buffer; |
| 315 // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no | 315 // TODO(tkent): We generate unnecessary "style: {\n},\n" even if no |
| 316 // additional style. | 316 // additional style. |
| 317 PagePopupClient::addString("style: {\n", data); | 317 PagePopupClient::addString("style: {\n", data); |
| 318 if (style->visibility() == EVisibility::Hidden) | 318 if (style->visibility() == EVisibility::Hidden) |
| 319 addProperty("visibility", String("hidden"), data); | 319 addProperty("visibility", String("hidden"), data); |
| 320 if (style->display() == EDisplay::None) | 320 if (style->display() == EDisplay::None) |
| 321 addProperty("display", String("none"), data); | 321 addProperty("display", String("none"), data); |
| 322 const ComputedStyle& baseStyle = context.baseStyle(); | 322 const ComputedStyle& baseStyle = context.baseStyle(); |
| 323 if (baseStyle.direction() != style->direction()) | 323 if (baseStyle.direction() != style->direction()) { |
| 324 addProperty("direction", String(style->direction() == RTL ? "rtl" : "ltr"), | 324 addProperty( |
| 325 data); | 325 "direction", |
| 326 String(style->direction() == TextDirection::Rtl ? "rtl" : "ltr"), data); |
| 327 } |
| 326 if (isOverride(style->unicodeBidi())) | 328 if (isOverride(style->unicodeBidi())) |
| 327 addProperty("unicodeBidi", String("bidi-override"), data); | 329 addProperty("unicodeBidi", String("bidi-override"), data); |
| 328 Color foregroundColor = style->visitedDependentColor(CSSPropertyColor); | 330 Color foregroundColor = style->visitedDependentColor(CSSPropertyColor); |
| 329 if (baseStyle.visitedDependentColor(CSSPropertyColor) != foregroundColor) | 331 if (baseStyle.visitedDependentColor(CSSPropertyColor) != foregroundColor) |
| 330 addProperty("color", foregroundColor.serialized(), data); | 332 addProperty("color", foregroundColor.serialized(), data); |
| 331 Color backgroundColor = | 333 Color backgroundColor = |
| 332 style->visitedDependentColor(CSSPropertyBackgroundColor); | 334 style->visitedDependentColor(CSSPropertyBackgroundColor); |
| 333 if (context.backgroundColor() != backgroundColor && | 335 if (context.backgroundColor() != backgroundColor && |
| 334 backgroundColor != Color::transparent) | 336 backgroundColor != Color::transparent) |
| 335 addProperty("backgroundColor", backgroundColor.serialized(), data); | 337 addProperty("backgroundColor", backgroundColor.serialized(), data); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 } | 554 } |
| 553 | 555 |
| 554 void PopupMenuImpl::disconnectClient() { | 556 void PopupMenuImpl::disconnectClient() { |
| 555 m_ownerElement = nullptr; | 557 m_ownerElement = nullptr; |
| 556 // Cannot be done during finalization, so instead done when the | 558 // Cannot be done during finalization, so instead done when the |
| 557 // layout object is destroyed and disconnected. | 559 // layout object is destroyed and disconnected. |
| 558 dispose(); | 560 dispose(); |
| 559 } | 561 } |
| 560 | 562 |
| 561 } // namespace blink | 563 } // namespace blink |
| OLD | NEW |