[Webkit-unassigned] [Bug 154424] Enhance EditorState to include TypingAttributes, alignment, and color
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 18 16:34:17 PST 2016
https://bugs.webkit.org/show_bug.cgi?id=154424
Sam Weinig <sam at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #271713|review+ |review?
Flags| |
--- Comment #3 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 271713
--> https://bugs.webkit.org/attachment.cgi?id=271713
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=271713&action=review
> Source/WebKit2/Shared/EditorState.h:95
> + WebCore::Color textColor { WebCore::Color::black };
Since not every platform has these implemented, should they remain enabled? Can we refactor at all to make these supported on all platforms?
> Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:160
> + if (RenderStyle* style = Editor::styleForSelectionStart(&frame, nodeToRemove)) {
> + NSFont *font = style->fontCascade().primaryFont().getNSFont();
> + NSFontTraitMask traits = [[NSFontManager sharedFontManager] traitsOfFont:font];
> +
> + if (traits & NSBoldFontMask)
> + postLayoutData.typingAttributes |= AttributeBold;
> + if (traits & NSItalicFontMask)
> + postLayoutData.typingAttributes |= AttributeItalics;
> +
Can this be done by doing:
if (style->fontCascade().weight() == FontWeightBold)
postLayoutData.typingAttributes |= AttributeBold;
if (style->fontCascade().italic() == FontItalicOn)
postLayoutData.typingAttributes |= AttributeItalics;
or
just look at the style itself?
> Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:200
> + nodeToRemove->remove(ASSERT_NO_EXCEPTION);
> + }
Can any of this be shared across Mac and iOS?
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160219/573bc221/attachment.html>
More information about the webkit-unassigned
mailing list