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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 PagePopupClient::addString("baseStyle: {", m_buffer); | 186 PagePopupClient::addString("baseStyle: {", m_buffer); |
187 addProperty("backgroundColor", m_backgroundColor.serialized(), m_buffer)
; | 187 addProperty("backgroundColor", m_backgroundColor.serialized(), m_buffer)
; |
188 addProperty("color", baseStyle().visitedDependentColor(CSSPropertyColor)
.serialized(), m_buffer); | 188 addProperty("color", baseStyle().visitedDependentColor(CSSPropertyColor)
.serialized(), m_buffer); |
189 addProperty("textTransform", String(textTransformToString(baseStyle().te
xtTransform())), m_buffer); | 189 addProperty("textTransform", String(textTransformToString(baseStyle().te
xtTransform())), m_buffer); |
190 addProperty("fontSize", baseFont().specifiedSize(), m_buffer); | 190 addProperty("fontSize", baseFont().specifiedSize(), m_buffer); |
191 addProperty("fontStyle", String(fontStyleToString(baseFont().style())),
m_buffer); | 191 addProperty("fontStyle", String(fontStyleToString(baseFont().style())),
m_buffer); |
192 addProperty("fontVariant", String(fontVariantToString(baseFont().variant
())), m_buffer); | 192 addProperty("fontVariant", String(fontVariantToString(baseFont().variant
())), m_buffer); |
193 | 193 |
194 PagePopupClient::addString("fontFamily: [", m_buffer); | 194 PagePopupClient::addString("fontFamily: [", m_buffer); |
195 for (const FontFamily* f = &baseFont().family(); f; f = f->next()) { | 195 for (const FontFamily* f = &baseFont().family(); f; f = f->next()) { |
196 addJavaScriptString(f->family().string(), m_buffer); | 196 addJavaScriptString(f->family().getString(), m_buffer); |
197 if (f->next()) | 197 if (f->next()) |
198 PagePopupClient::addString(",", m_buffer); | 198 PagePopupClient::addString(",", m_buffer); |
199 } | 199 } |
200 PagePopupClient::addString("]", m_buffer); | 200 PagePopupClient::addString("]", m_buffer); |
201 PagePopupClient::addString("},\n", m_buffer); | 201 PagePopupClient::addString("},\n", m_buffer); |
202 } | 202 } |
203 | 203 |
204 Color backgroundColor() const { return m_isInGroup ? m_groupStyle->visitedDe
pendentColor(CSSPropertyBackgroundColor) : m_backgroundColor; } | 204 Color backgroundColor() const { return m_isInGroup ? m_groupStyle->visitedDe
pendentColor(CSSPropertyBackgroundColor) : m_backgroundColor; } |
205 // Do not use baseStyle() for background-color, use backgroundColor() | 205 // Do not use baseStyle() for background-color, use backgroundColor() |
206 // instead. | 206 // instead. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // We don't use FontDescription::specifiedSize() because this element | 330 // We don't use FontDescription::specifiedSize() because this element |
331 // might have its own zoom level. | 331 // might have its own zoom level. |
332 addProperty("fontSize", fontDescription.computedSize() / zoomFactor(), d
ata); | 332 addProperty("fontSize", fontDescription.computedSize() / zoomFactor(), d
ata); |
333 } | 333 } |
334 // Our UA stylesheet has font-weight:normal for OPTION. | 334 // Our UA stylesheet has font-weight:normal for OPTION. |
335 if (FontWeightNormal != fontDescription.weight()) | 335 if (FontWeightNormal != fontDescription.weight()) |
336 addProperty("fontWeight", String(fontWeightToString(fontDescription.weig
ht())), data); | 336 addProperty("fontWeight", String(fontWeightToString(fontDescription.weig
ht())), data); |
337 if (baseFont.family() != fontDescription.family()) { | 337 if (baseFont.family() != fontDescription.family()) { |
338 PagePopupClient::addString("fontFamily: [\n", data); | 338 PagePopupClient::addString("fontFamily: [\n", data); |
339 for (const FontFamily* f = &fontDescription.family(); f; f = f->next())
{ | 339 for (const FontFamily* f = &fontDescription.family(); f; f = f->next())
{ |
340 addJavaScriptString(f->family().string(), data); | 340 addJavaScriptString(f->family().getString(), data); |
341 if (f->next()) | 341 if (f->next()) |
342 PagePopupClient::addString(",\n", data); | 342 PagePopupClient::addString(",\n", data); |
343 } | 343 } |
344 PagePopupClient::addString("],\n", data); | 344 PagePopupClient::addString("],\n", data); |
345 } | 345 } |
346 if (baseFont.style() != fontDescription.style()) | 346 if (baseFont.style() != fontDescription.style()) |
347 addProperty("fontStyle", String(fontStyleToString(fontDescription.style(
))), data); | 347 addProperty("fontStyle", String(fontStyleToString(fontDescription.style(
))), data); |
348 if (baseFont.variant() != fontDescription.variant()) | 348 if (baseFont.variant() != fontDescription.variant()) |
349 addProperty("fontVariant", String(fontVariantToString(fontDescription.va
riant())), data); | 349 addProperty("fontVariant", String(fontVariantToString(fontDescription.va
riant())), data); |
350 if (baseStyle.textTransform() != style->textTransform()) | 350 if (baseStyle.textTransform() != style->textTransform()) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 535 |
536 void PopupMenuImpl::disconnectClient() | 536 void PopupMenuImpl::disconnectClient() |
537 { | 537 { |
538 m_ownerElement = nullptr; | 538 m_ownerElement = nullptr; |
539 // Cannot be done during finalization, so instead done when the | 539 // Cannot be done during finalization, so instead done when the |
540 // layout object is destroyed and disconnected. | 540 // layout object is destroyed and disconnected. |
541 dispose(); | 541 dispose(); |
542 } | 542 } |
543 | 543 |
544 } // namespace blink | 544 } // namespace blink |
OLD | NEW |