| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 static bool isNewLineAtPosition(const Position& position) | 155 static bool isNewLineAtPosition(const Position& position) |
| 156 { | 156 { |
| 157 Node* textNode = position.containerNode(); | 157 Node* textNode = position.containerNode(); |
| 158 int offset = position.offsetInContainerNode(); | 158 int offset = position.offsetInContainerNode(); |
| 159 if (!textNode || !textNode->isTextNode() || offset < 0 || offset >= textNode
->maxCharacterOffset()) | 159 if (!textNode || !textNode->isTextNode() || offset < 0 || offset >= textNode
->maxCharacterOffset()) |
| 160 return false; | 160 return false; |
| 161 | 161 |
| 162 TrackExceptionState es; | 162 TrackExceptionState exceptionState; |
| 163 String textAtPosition = toText(textNode)->substringData(offset, 1, es); | 163 String textAtPosition = toText(textNode)->substringData(offset, 1, exception
State); |
| 164 if (es.hadException()) | 164 if (exceptionState.hadException()) |
| 165 return false; | 165 return false; |
| 166 | 166 |
| 167 return textAtPosition[0] == '\n'; | 167 return textAtPosition[0] == '\n'; |
| 168 } | 168 } |
| 169 | 169 |
| 170 static RenderStyle* renderStyleOfEnclosingTextNode(const Position& position) | 170 static RenderStyle* renderStyleOfEnclosingTextNode(const Position& position) |
| 171 { | 171 { |
| 172 if (position.anchorType() != Position::PositionIsOffsetInAnchor || !position
.containerNode() || !position.containerNode()->isTextNode()) | 172 if (position.anchorType() != Position::PositionIsOffsetInAnchor || !position
.containerNode() || !position.containerNode()->isTextNode()) |
| 173 return 0; | 173 return 0; |
| 174 return position.containerNode()->renderStyle(); | 174 return position.containerNode()->renderStyle(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const | 278 PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const |
| 279 { | 279 { |
| 280 RefPtr<Element> element = createHTMLElement(document(), m_tagName); | 280 RefPtr<Element> element = createHTMLElement(document(), m_tagName); |
| 281 if (m_inlineStyle.length()) | 281 if (m_inlineStyle.length()) |
| 282 element->setAttribute(styleAttr, m_inlineStyle); | 282 element->setAttribute(styleAttr, m_inlineStyle); |
| 283 return element.release(); | 283 return element.release(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } | 286 } |
| OLD | NEW |