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