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(); }
EditingStyle::EditingStyle(const CSSStyleDeclaration* style) : m_mutableStyle(style->copy()) , m_shouldUseFixedDefaultFontSize(false) , m_fontSizeDelta(NoFontDelta) { extractFontSizeDelta(); }
void EditingStyle::setStyle(PassRefPtr<CSSMutableStyleDeclaration> style) { m_mutableStyle = style; // FIXME: We should be able to figure out whether or not font is fixed width for mutable style. // We need to check font-family is monospace as in FontDescription but we don't want to duplicate code here. m_shouldUseFixedDefaultFontSize = false; extractFontSizeDelta(); }
void EditingStyle::overrideWithStyle(const CSSMutableStyleDeclaration* style) { if (!style || !style->length()) return; if (!m_mutableStyle) m_mutableStyle = CSSMutableStyleDeclaration::create(); m_mutableStyle->merge(style); extractFontSizeDelta(); }
EditingStyle::EditingStyle(const CSSStyleDeclaration* style) : m_mutableStyle(style->copy()) , m_shouldUseFixedDefaultFontSize(false) , m_fontSizeDelta(NoFontDelta) //SISO_HTMLComposer start , m_editAction(EditActionUnspecified) //SISO_HTMLComposer end { 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(); }