OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008, 2009 Google Inc. | 3 * Copyright (C) 2008, 2009 Google Inc. |
4 * Copyright (C) 2011 Igalia S.L. | 4 * Copyright (C) 2011 Igalia S.L. |
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. | 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 m_reversedPrecedingMarkup.append(String::adopt(openTag)); | 181 m_reversedPrecedingMarkup.append(String::adopt(openTag)); |
182 appendString(styleNodeCloseTag(isBlock)); | 182 appendString(styleNodeCloseTag(isBlock)); |
183 } | 183 } |
184 | 184 |
185 void StyledMarkupAccumulator::appendStyleNodeOpenTag(Vector<UChar>& out, CSSStyl
eDeclaration* style, Document* document, bool isBlock) | 185 void StyledMarkupAccumulator::appendStyleNodeOpenTag(Vector<UChar>& out, CSSStyl
eDeclaration* style, Document* document, bool isBlock) |
186 { | 186 { |
187 // All text-decoration-related elements should have been treated as special
ancestors | 187 // All text-decoration-related elements should have been treated as special
ancestors |
188 // If we ever hit this ASSERT, we should export StyleChange in ApplyStyleCom
mand and use it here | 188 // If we ever hit this ASSERT, we should export StyleChange in ApplyStyleCom
mand and use it here |
189 ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyTextDecoration) && pro
pertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect)); | 189 ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyTextDecoration) && pro
pertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect)); |
190 DEFINE_STATIC_LOCAL(const String, divStyle, ("<div style=\"")); | 190 DEFINE_STATIC_LOCAL(const String, divStyle, ("<div style=\"")); |
191 DEFINE_STATIC_LOCAL(const String, styleSpanOpen, ("<span style=\"")); | 191 DEFINE_STATIC_LOCAL(const String, styleSpanOpen, ("<span class=\"" AppleStyl
eSpanClass "\" style=\"")); |
192 append(out, isBlock ? divStyle : styleSpanOpen); | 192 append(out, isBlock ? divStyle : styleSpanOpen); |
193 appendAttributeValue(out, style->cssText(), document->isHTMLDocument()); | 193 appendAttributeValue(out, style->cssText(), document->isHTMLDocument()); |
194 out.append('\"'); | 194 out.append('\"'); |
195 out.append('>'); | 195 out.append('>'); |
196 } | 196 } |
197 | 197 |
198 const String StyledMarkupAccumulator::styleNodeCloseTag(bool isBlock) | 198 const String StyledMarkupAccumulator::styleNodeCloseTag(bool isBlock) |
199 { | 199 { |
200 DEFINE_STATIC_LOCAL(const String, divClose, ("</div>")); | 200 DEFINE_STATIC_LOCAL(const String, divClose, ("</div>")); |
201 DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>")); | 201 DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>")); |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 Vector<UChar> markup; | 916 Vector<UChar> markup; |
917 append(markup, "<a href=\""); | 917 append(markup, "<a href=\""); |
918 append(markup, url.string()); | 918 append(markup, url.string()); |
919 append(markup, "\">"); | 919 append(markup, "\">"); |
920 appendCharactersReplacingEntities(markup, title.characters(), title.length()
, EntityMaskInPCDATA); | 920 appendCharactersReplacingEntities(markup, title.characters(), title.length()
, EntityMaskInPCDATA); |
921 append(markup, "</a>"); | 921 append(markup, "</a>"); |
922 return String::adopt(markup); | 922 return String::adopt(markup); |
923 } | 923 } |
924 | 924 |
925 } | 925 } |
OLD | NEW |