|
Lines 169-182
static bool isNewLineAtPosition(const Po
Source/WebCore/editing/ApplyBlockElementCommand.cpp_sec1
|
| 169 |
return textAtPosition[0] == '\n'; |
169 |
return textAtPosition[0] == '\n'; |
| 170 |
} |
170 |
} |
| 171 |
|
171 |
|
| 172 |
static RenderStyle* renderStyleOfEnclosingTextNode(const Position& position) |
172 |
RenderStyle* ApplyBlockElementCommand::renderStyleOfEnclosingTextNode(const Position& position) |
| 173 |
{ |
173 |
{ |
| 174 |
if (position.anchorType() != Position::PositionIsOffsetInAnchor |
174 |
if (position.anchorType() != Position::PositionIsOffsetInAnchor |
| 175 |
|| !position.containerNode() |
175 |
|| !position.containerNode() |
| 176 |
|| !position.containerNode()->isTextNode() |
176 |
|| !position.containerNode()->isTextNode()) |
| 177 |
|| !position.containerNode()->renderer()) |
|
|
| 178 |
return 0; |
177 |
return 0; |
| 179 |
return position.containerNode()->renderer()->style(); |
178 |
|
|
|
179 |
document().updateStyleIfNeeded(); |
| 180 |
|
| 181 |
RenderObject* renderer = position.containerNode()->renderer(); |
| 182 |
if (!renderer) |
| 183 |
return 0; |
| 184 |
|
| 185 |
return renderer->style(); |
| 180 |
} |
186 |
} |
| 181 |
|
187 |
|
| 182 |
void ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded(const VisiblePosition& endOfCurrentParagraph, Position& start, Position& end) |
188 |
void ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded(const VisiblePosition& endOfCurrentParagraph, Position& start, Position& end) |