https://bugs.webkit.org/show_bug.cgi?id=117024
Reviewed by Andreas Kling.
Removed the function.
* dom/Position.cpp:
* dom/Position.h:
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): We need a position
inside the dummy element since we'll get the containing element's style instead
if we had the position before the dummy element.
* editing/EditingStyle.cpp:
(WebCore::StyleChange::StyleChange):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150954
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-05-30 Ryosuke Niwa <rniwa@webkit.org>
+
+ Get rid of Position::computedStyle
+ https://bugs.webkit.org/show_bug.cgi?id=117024
+
+ Reviewed by Andreas Kling.
+
+ Removed the function.
+
+ * dom/Position.cpp:
+ * dom/Position.h:
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): We need a position
+ inside the dummy element since we'll get the containing element's style instead
+ if we had the position before the dummy element.
+ * editing/EditingStyle.cpp:
+ (WebCore::StyleChange::StyleChange):
+
2013-05-30 Seokju Kwon <seokju.kwon@gmail.com>
Remove obsolete forward declaration from InspectorFrontendHost.h
return toElement(n);
}
-PassRefPtr<CSSComputedStyleDeclaration> Position::computedStyle() const
-{
- Element* elem = element();
- if (!elem)
- return 0;
- return CSSComputedStyleDeclaration::create(elem);
-}
-
Position Position::previous(PositionMoveType moveType) const
{
Node* n = deprecatedNode();
bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument(); }
Element* element() const;
- PassRefPtr<CSSComputedStyleDeclaration> computedStyle() const;
// Move up or down the DOM by one position.
// Offsets are computed using render text for nodes that have renderers - but note that even when
Position ApplyStyleCommand::positionToComputeInlineStyleChange(PassRefPtr<Node> startNode, RefPtr<Node>& dummyElement)
{
// It's okay to obtain the style at the startNode because we've removed all relevant styles from the current run.
- Position positionForStyleComparison;
if (!startNode->isElementNode()) {
dummyElement = createStyleSpanElement(document());
insertNodeAt(dummyElement, positionBeforeNode(startNode.get()));
- return positionBeforeNode(dummyElement.get());
+ return firstPositionInOrBeforeNode(dummyElement.get());
}
return firstPositionInOrBeforeNode(startNode.get());
if (!style || !style->style() || !document || !document->frame())
return;
- RefPtr<CSSComputedStyleDeclaration> computedStyle = position.computedStyle();
+ Node* node = position.containerNode();
+ if (!node)
+ return;
+
+ RefPtr<CSSComputedStyleDeclaration> computedStyle = CSSComputedStyleDeclaration::create(node);
+
// FIXME: take care of background-color in effect
RefPtr<MutableStylePropertySet> mutableStyle = getPropertiesNotIn(style->style(), computedStyle.get());