| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. |
| 6 * (C) 2007 Rob Buis (buis@kde.org) | 6 * (C) 2007 Rob Buis (buis@kde.org) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 #include "sky/engine/config.h" | 24 #include "sky/engine/config.h" |
| 25 #include "sky/engine/core/html/HTMLStyleElement.h" | 25 #include "sky/engine/core/html/HTMLStyleElement.h" |
| 26 | 26 |
| 27 #include "gen/sky/core/HTMLNames.h" | 27 #include "gen/sky/core/HTMLNames.h" |
| 28 #include "sky/engine/core/css/MediaList.h" | 28 #include "sky/engine/core/css/MediaList.h" |
| 29 #include "sky/engine/core/css/MediaQueryEvaluator.h" | 29 #include "sky/engine/core/css/MediaQueryEvaluator.h" |
| 30 #include "sky/engine/core/dom/Document.h" | 30 #include "sky/engine/core/dom/Document.h" |
| 31 #include "sky/engine/core/dom/Element.h" | 31 #include "sky/engine/core/dom/Element.h" |
| 32 #include "sky/engine/core/dom/StyleEngine.h" | 32 #include "sky/engine/core/dom/StyleEngine.h" |
| 33 #include "sky/engine/core/dom/Text.h" |
| 33 #include "sky/engine/core/dom/shadow/ShadowRoot.h" | 34 #include "sky/engine/core/dom/shadow/ShadowRoot.h" |
| 34 #include "sky/engine/core/frame/LocalFrame.h" | 35 #include "sky/engine/core/frame/LocalFrame.h" |
| 35 #include "sky/engine/platform/TraceEvent.h" | 36 #include "sky/engine/platform/TraceEvent.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 inline HTMLStyleElement::HTMLStyleElement(Document& document) | 40 inline HTMLStyleElement::HTMLStyleElement(Document& document) |
| 40 : HTMLElement(HTMLNames::styleTag, document) | 41 : HTMLElement(HTMLNames::styleTag, document) |
| 41 { | 42 { |
| 42 } | 43 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 TRACE_EVENT0("blink", "StyleElement::process"); | 130 TRACE_EVENT0("blink", "StyleElement::process"); |
| 130 | 131 |
| 131 if (m_sheet) | 132 if (m_sheet) |
| 132 clearSheet(); | 133 clearSheet(); |
| 133 | 134 |
| 134 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media()); | 135 RefPtr<MediaQuerySet> mediaQueries = MediaQuerySet::create(media()); |
| 135 | 136 |
| 136 MediaQueryEvaluator screenEval("screen", true); | 137 MediaQueryEvaluator screenEval("screen", true); |
| 137 if (screenEval.eval(mediaQueries.get())) { | 138 if (screenEval.eval(mediaQueries.get())) { |
| 138 const String& text = textFromChildren(); | 139 if (hasOneTextChild()) |
| 139 m_sheet = document().styleEngine()->createSheet(this, text); | 140 toText(firstChild())->atomize(); |
| 141 m_sheet = document().styleEngine()->createSheet(this, textContent()); |
| 140 m_sheet->setMediaQueries(mediaQueries.release()); | 142 m_sheet->setMediaQueries(mediaQueries.release()); |
| 141 } | 143 } |
| 142 | 144 |
| 143 document().styleResolverChanged(); | 145 document().styleResolverChanged(); |
| 144 } | 146 } |
| 145 | 147 |
| 146 } | 148 } |
| OLD | NEW |