void EditingStyle::removeStyleAddedByNode(Node* node) { if (!node || !node->parentNode()) return; RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode())); RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node)); parentStyle->diff(nodeStyle.get()); nodeStyle->diff(m_mutableStyle.get()); }
void EditingStyle::removeStyleConflictingWithStyleOfNode(Node* node) { if (!node || !node->parentNode() || !m_mutableStyle) return; RefPtr<CSSMutableStyleDeclaration> parentStyle = editingStyleFromComputedStyle(computedStyle(node->parentNode())); RefPtr<CSSMutableStyleDeclaration> nodeStyle = editingStyleFromComputedStyle(computedStyle(node)); parentStyle->diff(nodeStyle.get()); CSSMutableStyleDeclaration::const_iterator end = nodeStyle->end(); for (CSSMutableStyleDeclaration::const_iterator it = nodeStyle->begin(); it != end; ++it) m_mutableStyle->removeProperty(it->id()); }
void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude) { if (isTabSpanTextNode(node)) node = tabSpanNode(node)->parentNode(); else if (isTabSpanNode(node)) node = node->parentNode(); RefPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = computedStyle(node); m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copy() : editingStyleFromComputedStyle(computedStyleAtPosition); if (node && node->computedStyle()) { RenderStyle* renderStyle = node->computedStyle(); removeTextFillAndStrokeColorsIfNeeded(renderStyle); replaceFontSizeByKeywordIfPossible(renderStyle, computedStyleAtPosition.get()); //SISO_HTMLComposer start if(node->document() && node->document()->frame() && (node->document()->frame()->textZoomFactor() > 1.0 || node->document()->frame()->pageZoomFactor() > 1.0)) { replaceComputedFontSizeBySpecifiedSize(computedStyleAtPosition.get()); } //SISO_HTMLComposer end } m_shouldUseFixedDefaultFontSize = computedStyleAtPosition->useFixedFontDefaultSize(); extractFontSizeDelta(); }
void EditingStyle::init(Node* node, PropertiesToInclude propertiesToInclude) { if (isTabSpanTextNode(node)) node = tabSpanNode(node)->parentNode(); else if (isTabSpanNode(node)) node = node->parentNode(); RefPtr<CSSComputedStyleDeclaration> computedStyleAtPosition = computedStyle(node); m_mutableStyle = propertiesToInclude == AllProperties && computedStyleAtPosition ? computedStyleAtPosition->copy() : editingStyleFromComputedStyle(computedStyleAtPosition); if (node && node->computedStyle()) { RenderStyle* renderStyle = node->computedStyle(); removeTextFillAndStrokeColorsIfNeeded(renderStyle); replaceFontSizeByKeywordIfPossible(renderStyle, computedStyleAtPosition.get()); } m_shouldUseFixedDefaultFontSize = computedStyleAtPosition->useFixedFontDefaultSize(); extractFontSizeDelta(); }