WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
154424
Enhance EditorState to include TypingAttributes, alignment, and color
https://bugs.webkit.org/show_bug.cgi?id=154424
Summary
Enhance EditorState to include TypingAttributes, alignment, and color
Beth Dakin
Reported
2016-02-18 16:01:19 PST
Enhance EditorState to include TypingAttributes, alignment, and color
Attachments
Patch
(6.97 KB, patch)
2016-02-18 16:03 PST
,
Beth Dakin
sam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Beth Dakin
Comment 1
2016-02-18 16:03:48 PST
Created
attachment 271713
[details]
Patch
Dean Jackson
Comment 2
2016-02-18 16:24:55 PST
Comment on
attachment 271713
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=271713&action=review
> Source/WebKit2/Shared/EditorState.h:48 > +enum TextAlignment {
enum class?
Sam Weinig
Comment 3
2016-02-18 16:34:17 PST
Comment on
attachment 271713
[details]
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?
Beth Dakin
Comment 4
2016-02-19 14:15:39 PST
Thanks Sam and Dean!
http://trac.webkit.org/changeset/196834
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug