Diff
Modified: trunk/Source/WebCore/ChangeLog (235377 => 235378)
--- trunk/Source/WebCore/ChangeLog 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/ChangeLog 2018-08-27 17:06:09 UTC (rev 235378)
@@ -1,3 +1,66 @@
+2018-08-27 Daniel Bates <[email protected]>
+
+ Spelling dots do not scale with page on iOS; share spelling dot painting code between Mac and iOS
+ https://bugs.webkit.org/show_bug.cgi?id=188828
+ <rdar://problem/15966403>
+
+ Reviewed by Simon Fraser.
+
+ The look of the spelling dots on Mac and iOS are identical up to color. Towards making the
+ spelling dots in WebKit on iOS more closely match the look of the spelling dots in UIKit-
+ apps, standardize on using the same painting code for both Mac and iOS.
+
+ Currently iOS uses bitmaps to render the spelling dots and does not account for user/CSS
+ zooming. As a result, the spelling dots on iOS render with artifacts (e.g. truncated dots).
+ A side benefit of having iOS share the same painting code as Mac is that iOS will now paint
+ the dots programmatically and we avoid both the need to use bitmaps and fix the bugs in
+ the painting of the bitmap dots with respect to zooming.
+
+ * Resources/DictationPhraseWithAlternativesDot.png: Removed.
+ * Resources/[email protected]: Removed.
+ * Resources/SpellingDot.png: Removed.
+ * Resources/[email protected]: Removed.
+ * Resources/[email protected]: Removed.
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/Page.cpp:
+ (WebCore::Page::setDeviceScaleFactor):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
+ * platform/graphics/cocoa/GraphicsContextCocoa.mm:
+ (WebCore::GraphicsContext::drawLineForDocumentMarker):
+ (WebCore::findImage): Deleted.
+ (WebCore::createDotPattern): Deleted.
+ (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
+ * platform/graphics/win/GraphicsContextCGWin.cpp:
+ (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
+ * platform/graphics/win/GraphicsContextDirect2D.cpp:
+ (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
+ * platform/ios/wak/WKGraphics.mm:
+ (WKRectFill): Incorporated the logic from _FillRectUsingOperation().
+ (_FillRectUsingOperation): Deleted; moved the logic into WKRectFill() since WKRectFill()
+ is now the only caller of this function.
+ (WKRectFillUsingOperation): Deleted.
+ (imageResourcePath): Deleted.
+ (WKGraphicsCreateImageFromBundleWithName): Deleted.
+ (WKDrawPatternBitmap): Deleted.
+ (WKReleasePatternBitmap): Deleted.
+ (WKSetPattern): Deleted.
+ * platform/ios/wak/WKGraphicsInternal.h: Removed.
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintPlatformDocumentMarker):
+ * rendering/RenderThemeCocoa.h: Add headers RenderText.h and GraphicsContextCG.h. Fix some style nits while I am here;
+ substitute #import for #include and remove some unnecessary headers TranslateTransformOperation.h, RenderStyle.h, and
+ RenderElement.h.
+ * rendering/RenderThemeCocoa.mm:
+ (WebCore::colorForStyle):
+ (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Moved from RenderThemeMac. I renamed
+ the local variable ctx to context and fixed a type in a comment while moving this code.
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::colorForStyle): Deleted; moved to class RenderThemeCocoa.
+ (WebCore::RenderThemeMac::drawLineForDocumentMarker): Deleted; moved to class RenderThemeCocoa.
+
2018-08-27 Wenson Hsieh <[email protected]>
[Attachment Support] [WK2] Images copied from Mail message view paste with the wrong file name in compose
Deleted: trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png
(Binary files differ)
Deleted: trunk/Source/WebCore/Resources/SpellingDot.png
(Binary files differ)
Deleted: trunk/Source/WebCore/Resources/[email protected] (235377 => 235378)
--- trunk/Source/WebCore/Resources/[email protected] 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/Resources/[email protected] 2018-08-27 17:06:09 UTC (rev 235378)
@@ -1,5 +0,0 @@
-\x89PNG
-
-������-IHDR������������ ������\xB8\xCDT������tEXtSoftware��Adobe ImageReadyq\xC9e<������\xB0IDATx\xDAt\x91\xB1-\x830E\xEF\xA4\x92:\xA5;f\xF0a\x8AԑX6\xF0.\xA9\xD9��\x92\xDB\xCB\xCFq\x8E\xED"_\xFE\x96u\xFEe\xBA\xC3=\xECaG8\xC0\xBC\xD28R\xD6\xCD\xC2o\xF8IE\x9D\xF9\xBF\xFA)\xF5Č\xB0\xE8"b\xB2\xC3\xF7\x88:/\xD6Ѐ\xF3\xF0W\xC8$3_\x8C\x96ŷ\xC0\xB6;\xBB\xC0\xE2\xC2*\xA0\x9B\xAB^\xC0\xBEE\v\xA5\xC4W0?A8\xB6\xC0q\xFD\xC0ұt%B\xA44\xD94\xEA)e\xCD6\xDAf\xAC\xAB\x8Dn\xF9\xFB*}��\x9C\xAC:\xF2\xED%��������IEND\xAEB`\x82
\ No newline at end of file
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (235377 => 235378)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-08-27 17:06:09 UTC (rev 235378)
@@ -57,7 +57,6 @@
01D3CF8514BD0A3000FE9970 /* WebGLContextObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 01D3CF7F14BD0A3000FE9970 /* WebGLContextObject.h */; };
01D3CF8614BD0A3000FE9970 /* WebGLSharedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01D3CF8014BD0A3000FE9970 /* WebGLSharedObject.cpp */; };
01D3CF8714BD0A3000FE9970 /* WebGLSharedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 01D3CF8114BD0A3000FE9970 /* WebGLSharedObject.h */; };
- 01E6C2E41194B2820050821C /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 01E6C2E31194B2820050821C /* [email protected] */; };
0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0562F9601573F88F0031CA16 /* PlatformLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */ = {isa = PBXBuildFile; fileRef = 05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */; settings = {ATTRIBUTES = (Private, ); }; };
06027CAD0B1CBFC000884B2D /* ContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -630,7 +629,6 @@
1C12AC2B1EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C12AC291EE778AE0079E0A0 /* FontFamilySpecificationCoreText.h */; settings = {ATTRIBUTES = (Private, ); }; };
1C18DA59181AF6A500C4EF22 /* TextPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C18DA57181AF6A500C4EF22 /* TextPainter.h */; };
1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C21E57B183ED1FF001C289D /* IOSurfacePool.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 1C2417BA1992C04100EF9938 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 1C2417B91992C04100EF9938 /* [email protected] */; };
1C24EEA51C729CE40080F8FC /* FontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C24EEA31C729CE40080F8FC /* FontFaceSet.h */; };
1C24EEA91C72A7B40080F8FC /* JSFontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C24EEA71C72A7B40080F8FC /* JSFontFaceSet.h */; };
1C6626111C6E7CA600AB527C /* FontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C66260F1C6E7CA600AB527C /* FontFace.h */; };
@@ -3865,7 +3863,6 @@
BE88E0DF1715D2A200658D98 /* VideoTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = BE88E0D31715D2A200658D98 /* VideoTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
BE88E0E11715D2A200658D98 /* VideoTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE88E0D51715D2A200658D98 /* VideoTrackList.cpp */; };
BE88E0E21715D2A200658D98 /* VideoTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = BE88E0D61715D2A200658D98 /* VideoTrackList.h */; };
- BE8C753110681324001E93F5 /* SpellingDot.png in Resources */ = {isa = PBXBuildFile; fileRef = BE8C753010681324001E93F5 /* SpellingDot.png */; };
BE8EF043171C8FF9009B48C3 /* JSAudioTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8EF03F171C8FF9009B48C3 /* JSAudioTrack.h */; };
BE8EF045171C8FF9009B48C3 /* JSAudioTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8EF041171C8FF9009B48C3 /* JSAudioTrackList.h */; };
BE8EF04B171C9014009B48C3 /* JSVideoTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8EF047171C9014009B48C3 /* JSVideoTrack.h */; };
@@ -4126,8 +4123,6 @@
D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */; settings = {ATTRIBUTES = (Private, ); }; };
D000ED2811C1B9CD00C47726 /* SubframeLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = D000ED2611C1B9CD00C47726 /* SubframeLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */ = {isa = PBXBuildFile; fileRef = D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */; settings = {ATTRIBUTES = (Private, ); }; };
- D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */; };
- D02B64B314089E56006EFA21 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B114089E56006EFA21 /* [email protected] */; };
D05CED2A0A40BB2C00C5AF38 /* FormatBlockCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */; };
D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */; };
D07DEABA0A36554A00CA30F8 /* InsertListCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D07DEAB80A36554A00CA30F8 /* InsertListCommand.h */; };
@@ -4801,7 +4796,6 @@
EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF5121B1696496C0056BD25 /* JSTypeConversions.h */; };
ECA680C71E67724500731D20 /* StringUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = ECA680C61E67724500731D20 /* StringUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
ECCDB8811E4B8C5900A1AEA6 /* WKContentObservationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */; };
- ECCDB8871E4BB63F00A1AEA6 /* WKGraphicsInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ECCDB8861E4BB63F00A1AEA6 /* WKGraphicsInternal.h */; };
ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */; settings = {ATTRIBUTES = (Private, ); }; };
EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
@@ -5160,7 +5154,6 @@
01D3CF7F14BD0A3000FE9970 /* WebGLContextObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLContextObject.h; sourceTree = "<group>"; };
01D3CF8014BD0A3000FE9970 /* WebGLSharedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLSharedObject.cpp; sourceTree = "<group>"; };
01D3CF8114BD0A3000FE9970 /* WebGLSharedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLSharedObject.h; sourceTree = "<group>"; };
- 01E6C2E31194B2820050821C /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
0562F9601573F88F0031CA16 /* PlatformLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLayer.h; sourceTree = "<group>"; };
05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTimeStamp.h; sourceTree = "<group>"; };
06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ContextMenuItem.h; sourceTree = "<group>"; };
@@ -6299,7 +6292,6 @@
1C18DA57181AF6A500C4EF22 /* TextPainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPainter.h; sourceTree = "<group>"; };
1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IOSurfacePool.cpp; sourceTree = "<group>"; };
1C21E57B183ED1FF001C289D /* IOSurfacePool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSurfacePool.h; sourceTree = "<group>"; };
- 1C2417B91992C04100EF9938 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1C24EEA11C729B320080F8FC /* FontFaceSet.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FontFaceSet.idl; sourceTree = "<group>"; };
1C24EEA21C729CE40080F8FC /* FontFaceSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFaceSet.cpp; sourceTree = "<group>"; };
1C24EEA31C729CE40080F8FC /* FontFaceSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFaceSet.h; sourceTree = "<group>"; };
@@ -12964,7 +12956,6 @@
BE88E0D51715D2A200658D98 /* VideoTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoTrackList.cpp; sourceTree = "<group>"; };
BE88E0D61715D2A200658D98 /* VideoTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackList.h; sourceTree = "<group>"; };
BE88E0D71715D2A200658D98 /* VideoTrackList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VideoTrackList.idl; sourceTree = "<group>"; };
- BE8C753010681324001E93F5 /* SpellingDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SpellingDot.png; sourceTree = "<group>"; };
BE8EF03E171C8FF9009B48C3 /* JSAudioTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioTrack.cpp; sourceTree = "<group>"; };
BE8EF03F171C8FF9009B48C3 /* JSAudioTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAudioTrack.h; sourceTree = "<group>"; };
BE8EF040171C8FF9009B48C3 /* JSAudioTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioTrackList.cpp; sourceTree = "<group>"; };
@@ -13476,8 +13467,6 @@
D000ED2611C1B9CD00C47726 /* SubframeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubframeLoader.h; sourceTree = "<group>"; };
D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; };
D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; };
- D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DictationPhraseWithAlternativesDot.png; sourceTree = "<group>"; };
- D02B64B114089E56006EFA21 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D036DD8D208FFC0C00F9F4B2 /* WebGLCompressedTextureASTC.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebGLCompressedTextureASTC.idl; sourceTree = "<group>"; };
D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; };
D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; };
@@ -14454,7 +14443,6 @@
ECA680C61E67724500731D20 /* StringUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtilities.h; sourceTree = "<group>"; };
ECA680C81E67730B00731D20 /* StringUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringUtilities.mm; sourceTree = "<group>"; };
ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentObservationInternal.h; sourceTree = "<group>"; };
- ECCDB8861E4BB63F00A1AEA6 /* WKGraphicsInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKGraphicsInternal.h; sourceTree = "<group>"; };
ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarker.h; sourceTree = "<group>"; };
ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorMac.mm; sourceTree = "<group>"; };
EDE3A4FF0C7A430600956A37 /* ColorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMac.h; sourceTree = "<group>"; };
@@ -19171,13 +19159,8 @@
children = (
2D50A4B51CE10E0000198049 /* AttachmentPlaceholder.png */,
2D50A4B61CE10E0000198049 /* [email protected] */,
- D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */,
- D02B64B114089E56006EFA21 /* [email protected] */,
E59DD4B721098285003C8B47 /* ListButtonArrow.png */,
E516698F20FF9916009D2C27 /* [email protected] */,
- BE8C753010681324001E93F5 /* SpellingDot.png */,
- 01E6C2E31194B2820050821C /* [email protected] */,
- 1C2417B91992C04100EF9938 /* [email protected] */,
);
name = images;
sourceTree = "<group>";
@@ -21215,7 +21198,6 @@
ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */,
A14832A4187F508700DA63A6 /* WKGraphics.h */,
A14832A5187F508700DA63A6 /* WKGraphics.mm */,
- ECCDB8861E4BB63F00A1AEA6 /* WKGraphicsInternal.h */,
A14832A6187F508700DA63A6 /* WKTypes.h */,
A14832A7187F508700DA63A6 /* WKUtilities.c */,
A14832A8187F508700DA63A6 /* WKUtilities.h */,
@@ -30912,7 +30894,6 @@
A14832BE187F64CC00DA63A6 /* WKContentObservation.h in Headers */,
ECCDB8811E4B8C5900A1AEA6 /* WKContentObservationInternal.h in Headers */,
A14832BF187F652C00DA63A6 /* WKGraphics.h in Headers */,
- ECCDB8871E4BB63F00A1AEA6 /* WKGraphicsInternal.h in Headers */,
A14832C1187F657A00DA63A6 /* WKTypes.h in Headers */,
A14832C3187F65DF00DA63A6 /* WKUtilities.h in Headers */,
A14832C4187F663C00DA63A6 /* WKView.h in Headers */,
@@ -31137,8 +31118,6 @@
2D50A4B81CE10E0000198049 /* [email protected] in Resources */,
A1AA9AB91D23911500FEADB3 /* ContentFilterBlockedPage.html in Resources */,
A11E8C051B1E28F40003A7C7 /* copyCursor.png in Resources */,
- D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */,
- D02B64B314089E56006EFA21 /* [email protected] in Resources */,
7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */,
2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */,
E59DD4B821098287003C8B47 /* ListButtonArrow.png in Resources */,
@@ -31159,9 +31138,6 @@
A11E8C071B1E28FE0003A7C7 /* northEastSouthWestResizeCursor.png in Resources */,
A11E8C081B1E29020003A7C7 /* northSouthResizeCursor.png in Resources */,
A11E8C091B1E29070003A7C7 /* northWestSouthEastResizeCursor.png in Resources */,
- BE8C753110681324001E93F5 /* SpellingDot.png in Resources */,
- 01E6C2E41194B2820050821C /* [email protected] in Resources */,
- 1C2417BA1992C04100EF9938 /* [email protected] in Resources */,
93153BDC141959BC00FCF5BE /* textAreaResizeCorner.png in Resources */,
9370918D1416D86B00477333 /* [email protected] in Resources */,
);
Modified: trunk/Source/WebCore/page/Page.cpp (235377 => 235378)
--- trunk/Source/WebCore/page/Page.cpp 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/page/Page.cpp 2018-08-27 17:06:09 UTC (rev 235378)
@@ -933,8 +933,6 @@
mainFrame().deviceOrPageScaleFactorChanged();
PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this);
- GraphicsContext::updateDocumentMarkerResources();
-
pageOverlayController().didChangeDeviceScaleFactor();
}
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (235377 => 235378)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2018-08-27 17:06:09 UTC (rev 235378)
@@ -422,7 +422,6 @@
FloatRect computeUnderlineBoundsForText(const FloatPoint&, float width, bool printing);
WEBCORE_EXPORT void drawLineForText(const FloatPoint&, float width, bool printing, bool doubleLines = false, StrokeStyle = SolidStroke);
void drawLinesForText(const FloatPoint&, const DashArray& widths, bool printing, bool doubleLines = false, StrokeStyle = SolidStroke);
- static void updateDocumentMarkerResources();
void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
WEBCORE_EXPORT void beginTransparencyLayer(float opacity);
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (235377 => 235378)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2018-08-27 17:06:09 UTC (rev 235378)
@@ -337,11 +337,6 @@
Cairo::drawLinesForText(*platformContext(), point, widths, printing, doubleUnderlines, m_state.strokeColor, m_state.strokeThickness);
}
-void GraphicsContext::updateDocumentMarkerResources()
-{
- // Unnecessary, since our document markers don't use resources.
-}
-
void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
{
if (paintingDisabled())
Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm (235377 => 235378)
--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm 2018-08-27 17:06:09 UTC (rev 235378)
@@ -41,7 +41,6 @@
#if PLATFORM(IOS)
#import "Color.h"
#import "WKGraphics.h"
-#import "WKGraphicsInternal.h"
#endif
#if PLATFORM(MAC)
@@ -174,51 +173,6 @@
#endif
}
-#if PLATFORM(MAC)
-
-static NSImage *findImage(NSString* firstChoiceName, NSString* secondChoiceName, bool& usingDot)
-{
- // Eventually we should be able to get rid of the secondChoiceName. For the time being we need both to keep
- // this working on all platforms.
- NSImage *image = [NSImage imageNamed:firstChoiceName];
- if (!image)
- image = [NSImage imageNamed:secondChoiceName];
- ASSERT(image); // if image is not available, we want to know
- usingDot = image;
- return image;
-}
-
-// FIXME: Should use RetainPtr instead of handwritten retain/release.
-static NSImage *spellingImage = nullptr;
-static NSImage *grammarImage = nullptr;
-static NSImage *correctionImage = nullptr;
-
-#endif
-
-#if PLATFORM (IOS)
-
-static RetainPtr<CGPatternRef> createDotPattern(bool& usingDot, const char* resourceName)
-{
- RetainPtr<CGImageRef> image = adoptCF(WKGraphicsCreateImageFromBundleWithName(resourceName));
- ASSERT(image); // if image is not available, we want to know
- usingDot = true;
- return adoptCF(WKCreatePatternFromCGImage(image.get()));
-}
-
-#endif
-
-void GraphicsContext::updateDocumentMarkerResources()
-{
-#if PLATFORM(MAC)
- [spellingImage release];
- spellingImage = nullptr;
- [grammarImage release];
- grammarImage = nullptr;
- [correctionImage release];
- correctionImage = nullptr;
-#endif
-}
-
static inline void setPatternPhaseInUserSpace(CGContextRef context, CGPoint phasePoint)
{
CGAffineTransform userToBase = getUserToBaseCTM(context);
@@ -227,142 +181,10 @@
CGContextSetPatternPhase(context, CGSizeMake(phase.x, phase.y));
}
-// WebKit on Mac is a standard platform component, so it must use the standard platform artwork for underline.
-void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
+// FIXME: We need to keep this function since it is referenced by DrawLineForDocumentMarker::apply().
+void GraphicsContext::drawLineForDocumentMarker(const FloatPoint&, float, DocumentMarkerLineStyle)
{
- if (paintingDisabled())
- return;
-
- // These are the same for misspelling or bad grammar.
- int patternHeight = cMisspellingLineThickness;
- float patternWidth = cMisspellingLinePatternWidth;
-
- bool usingDot;
-#if !PLATFORM(IOS)
- NSImage *image;
- NSColor *fallbackColor;
-#else
- CGPatternRef dotPattern;
-#endif
- switch (style) {
- case DocumentMarkerLineStyle::Spelling: {
- // Constants for spelling pattern color.
- static bool usingDotForSpelling = false;
-#if !PLATFORM(IOS)
- if (!spellingImage)
- spellingImage = [findImage(@"NSSpellingDot", @"SpellingDot", usingDotForSpelling) retain];
- image = spellingImage;
- fallbackColor = [NSColor redColor];
-#else
- static CGPatternRef spellingPattern = createDotPattern(usingDotForSpelling, "SpellingDot").leakRef();
- dotPattern = spellingPattern;
-#endif
- usingDot = usingDotForSpelling;
- break;
- }
- case DocumentMarkerLineStyle::Grammar: {
-#if !PLATFORM(IOS)
- // Constants for grammar pattern color.
- static bool usingDotForGrammar = false;
- if (!grammarImage)
- grammarImage = [findImage(@"NSGrammarDot", @"GrammarDot", usingDotForGrammar) retain];
- usingDot = grammarImage;
- image = grammarImage;
- fallbackColor = [NSColor greenColor];
- break;
-#else
- ASSERT_NOT_REACHED();
- return;
-#endif
- }
-#if PLATFORM(MAC)
- // To support correction panel.
- case DocumentMarkerLineStyle::AutocorrectionReplacement:
- case DocumentMarkerLineStyle::DictationAlternatives: {
- // Constants for spelling pattern color.
- static bool usingDotForSpelling = false;
- if (!correctionImage)
- correctionImage = [findImage(@"NSCorrectionDot", @"CorrectionDot", usingDotForSpelling) retain];
- usingDot = usingDotForSpelling;
- image = correctionImage;
- fallbackColor = [NSColor blueColor];
- break;
- }
-#endif
-#if PLATFORM(IOS)
- case DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives: {
- static bool usingDotForDictationPhraseWithAlternatives = false;
- static CGPatternRef dictationPhraseWithAlternativesPattern = createDotPattern(usingDotForDictationPhraseWithAlternatives, "DictationPhraseWithAlternativesDot").leakRef();
- dotPattern = dictationPhraseWithAlternativesPattern;
- usingDot = usingDotForDictationPhraseWithAlternatives;
- break;
- }
-#endif // PLATFORM(IOS)
- default:
-#if PLATFORM(IOS)
- // FIXME: Should remove default case so we get compile-time errors.
- ASSERT_NOT_REACHED();
-#endif // PLATFORM(IOS)
- return;
- }
-
- FloatPoint offsetPoint = point;
-
- // Make sure to draw only complete dots.
- if (usingDot) {
- // allow slightly more considering that the pattern ends with a transparent pixel
- float widthMod = fmodf(width, patternWidth);
- if (patternWidth - widthMod > cMisspellingLinePatternGapWidth) {
- float gapIncludeWidth = 0;
- if (width > patternWidth)
- gapIncludeWidth = cMisspellingLinePatternGapWidth;
- offsetPoint.move(floor((widthMod + gapIncludeWidth) / 2), 0);
- width -= widthMod;
- }
- }
-
- // FIXME: This code should not use NSGraphicsContext currentContext
- // In order to remove this requirement we will need to use CGPattern instead of NSColor
- // FIXME: This code should not be using setPatternPhaseInUserSpace, as this approach is wrong
- // for transforms.
-
- // Draw underline.
- CGContextRef context = platformContext();
- CGContextStateSaver stateSaver { context };
-
-#if PLATFORM(IOS)
- WKSetPattern(context, dotPattern, YES, YES);
-#endif
-
- setPatternPhaseInUserSpace(context, offsetPoint);
-
- CGRect destinationRect = CGRectMake(offsetPoint.x(), offsetPoint.y(), width, patternHeight);
-#if !PLATFORM(IOS)
- if (image) {
- CGContextClipToRect(context, destinationRect);
-
- // We explicitly flip coordinates so as to ensure we paint the image right-side up. We do this because
- // -[NSImage CGImageForProposedRect:context:hints:] does not guarantee that the returned image will respect
- // any transforms applied to the context or any specified hints.
- CGContextTranslateCTM(context, 0, patternHeight);
- CGContextScaleCTM(context, 1, -1);
-
- NSRect dotRect = NSMakeRect(offsetPoint.x(), patternHeight - offsetPoint.y(), patternWidth, patternHeight); // Adjust y position as we flipped coordinates.
-
- // FIXME: Rather than getting the NSImage and then picking the CGImage from it, we should do what iOS does and
- // just load the CGImage in the first place.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- CGImageRef cgImage = [image CGImageForProposedRect:&dotRect context:[NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO] hints:nullptr];
-#pragma clang diagnostic pop
- CGContextDrawTiledImage(context, NSRectToCGRect(dotRect), cgImage);
- } else {
- CGContextSetFillColorWithColor(context, [fallbackColor CGColor]);
- CGContextFillRect(context, destinationRect);
- }
-#else
- WKRectFillUsingOperation(context, destinationRect, kCGCompositeSover);
-#endif
+ // Cocoa platforms use RenderTheme::drawLineForDocumentMarker() to paint the platform document markers.
}
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp (235377 => 235378)
--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp 2018-08-27 17:06:09 UTC (rev 235378)
@@ -185,11 +185,6 @@
return grammarColor;
}
-void GraphicsContext::updateDocumentMarkerResources()
-{
- // Unnecessary, since our document markers don't use resources.
-}
-
void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
{
if (paintingDisabled())
Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp (235377 => 235378)
--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp 2018-08-27 17:06:09 UTC (rev 235378)
@@ -319,10 +319,6 @@
{
}
-void GraphicsContext::updateDocumentMarkerResources()
-{
-}
-
void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
{
}
Modified: trunk/Source/WebCore/platform/ios/wak/WKGraphics.mm (235377 => 235378)
--- trunk/Source/WebCore/platform/ios/wak/WKGraphics.mm 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/ios/wak/WKGraphics.mm 2018-08-27 17:06:09 UTC (rev 235378)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,16 +25,11 @@
#import "config.h"
#import "WKGraphics.h"
-#import "WKGraphicsInternal.h"
#if PLATFORM(IOS)
-#import "FontCascade.h"
-#import "PlatformScreen.h"
#import "WebCoreThreadInternal.h"
-#import <ImageIO/ImageIO.h>
#import <pal/spi/cg/CoreGraphicsSPI.h>
-#import <wtf/StdLibExtras.h>
using namespace WebCore;
@@ -56,32 +51,16 @@
CGContextSetCompositeOperation(context, oldOp);
}
-static inline void _FillRectUsingOperation(CGContextRef context, CGRect rect, CGCompositeOperation op)
-{
- if (rect.size.width > 0 && rect.size.height > 0) {
- _FillRectsUsingOperation (context, &rect, 1, op);
- }
-}
-
void WKRectFill(CGContextRef context, CGRect aRect)
{
if (aRect.size.width > 0 && aRect.size.height > 0) {
CGContextSaveGState(context);
- _FillRectUsingOperation(context, aRect, kCGCompositeCopy);
+ if (aRect.size.width > 0 && aRect.size.height > 0)
+ _FillRectsUsingOperation(context, &aRect, 1, kCGCompositeCopy);
CGContextRestoreGState(context);
}
}
-void WKRectFillUsingOperation(CGContextRef context, CGRect aRect, WKCompositeOperation compositeOperation)
-{
- COMPILE_ASSERT(sizeof(WKCompositeOperation) == sizeof(CGCompositeOperation), "WKCompositeOperation must be the same size as CGCompositeOperation.");
- if (aRect.size.width > 0 && aRect.size.height > 0.0) {
- CGContextSaveGState(context);
- _FillRectUsingOperation(context, aRect, static_cast<CGCompositeOperation>(compositeOperation));
- CGContextRestoreGState(context);
- }
-}
-
void WKSetCurrentGraphicsContext(CGContextRef context)
{
WebThreadContext* threadContext = WebThreadCurrentContext();
@@ -94,83 +73,4 @@
return threadContext->currentCGContext;
}
-static NSString *imageResourcePath(const char* imageFile, unsigned scaleFactor)
-{
- NSString *fileName = scaleFactor == 1 ? [NSString stringWithUTF8String:imageFile] : [NSString stringWithFormat:@"%s@%dx", imageFile, scaleFactor];
-#if PLATFORM(IOS_SIMULATOR)
- NSBundle *bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebCore"];
- return [bundle pathForResource:fileName ofType:@"png"];
-#else
- // Workaround for <rdar://problem/7780665> CFBundleCopyResourceURL takes a long time on iPhone 3G.
- NSString *imageDirectory = @"/System/Library/PrivateFrameworks/WebCore.framework";
- return [NSString stringWithFormat:@"%@/%@.png", imageDirectory, fileName];
-#endif
-}
-
-CGImageRef WKGraphicsCreateImageFromBundleWithName(const char *image_file)
-{
- if (!image_file)
- return NULL;
-
- CGImageRef image = nullptr;
- NSData *imageData = nullptr;
- for (unsigned scaleFactor = screenScaleFactor(); scaleFactor > 0; --scaleFactor) {
- imageData = [NSData dataWithContentsOfFile:imageResourcePath(image_file, scaleFactor)];
- ASSERT(scaleFactor != screenScaleFactor() || imageData);
- if (imageData)
- break;
- }
-
- if (imageData) {
- RetainPtr<CGDataProviderRef> dataProvider = adoptCF(CGDataProviderCreateWithCFData(reinterpret_cast<CFDataRef>(imageData)));
- image = CGImageCreateWithPNGDataProvider(dataProvider.get(), nullptr, NO, kCGRenderingIntentDefault);
- }
-
- return image;
-}
-
-static void WKDrawPatternBitmap(void *info, CGContextRef c)
-{
- CGImageRef image = (CGImageRef)info;
- CGFloat scale = screenScaleFactor();
- CGContextDrawImage(c, CGRectMake(0, 0, CGImageGetWidth(image) / scale, CGImageGetHeight(image) / scale), image);
-}
-
-static void WKReleasePatternBitmap(void *info)
-{
- CGImageRelease(reinterpret_cast<CGImageRef>(info));
-}
-
-static const CGPatternCallbacks WKPatternBitmapCallbacks =
-{
- 0, WKDrawPatternBitmap, WKReleasePatternBitmap
-};
-
-CGPatternRef WKCreatePatternFromCGImage(CGImageRef imageRef)
-{
- // retain image since it's freed by our callback
- CGImageRetain(imageRef);
-
- CGFloat scale = screenScaleFactor();
- return CGPatternCreate((void*)imageRef, CGRectMake(0, 0, CGImageGetWidth(imageRef) / scale, CGImageGetHeight(imageRef) / scale), CGAffineTransformIdentity, CGImageGetWidth(imageRef) / scale, CGImageGetHeight(imageRef) / scale, kCGPatternTilingConstantSpacing, 1 /*isColored*/, &WKPatternBitmapCallbacks);
-}
-
-void WKSetPattern(CGContextRef context, CGPatternRef pattern, bool fill, bool stroke)
-{
- if (pattern == NULL)
- return;
-
- CGFloat patternAlpha = 1;
- CGColorSpaceRef colorspace = CGColorSpaceCreatePattern(NULL);
- if (fill) {
- CGContextSetFillColorSpace(context, colorspace);
- CGContextSetFillPattern(context, pattern, &patternAlpha);
- }
- if (stroke) {
- CGContextSetStrokeColorSpace(context, colorspace);
- CGContextSetStrokePattern(context, pattern, &patternAlpha);
- }
- CGColorSpaceRelease(colorspace);
-}
-
#endif // PLATFORM(IOS)
Deleted: trunk/Source/WebCore/platform/ios/wak/WKGraphicsInternal.h (235377 => 235378)
--- trunk/Source/WebCore/platform/ios/wak/WKGraphicsInternal.h 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/platform/ios/wak/WKGraphicsInternal.h 2018-08-27 17:06:09 UTC (rev 235378)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if TARGET_OS_IPHONE
-
-#import <CoreGraphics/CoreGraphics.h>
-
-typedef int WKCompositeOperation;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void WKRectFillUsingOperation(CGContextRef, CGRect, WKCompositeOperation);
-CGImageRef WKGraphicsCreateImageFromBundleWithName(const char *image_file);
-CGPatternRef WKCreatePatternFromCGImage(CGImageRef imageRef);
-void WKSetPattern(CGContextRef context, CGPatternRef pattern, bool fill, bool stroke);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // TARGET_OS_IPHONE
Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (235377 => 235378)
--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp 2018-08-27 17:06:09 UTC (rev 235378)
@@ -726,7 +726,7 @@
underlineOffset = baseline + 2;
}
-#if PLATFORM(MAC)
+#if PLATFORM(COCOA)
RenderTheme::singleton().drawLineForDocumentMarker(renderer(), context, FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, lineStyleForMarkedTextType(markedText.type));
#else
context.drawLineForDocumentMarker(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + underlineOffset), width, lineStyleForMarkedTextType(markedText.type));
Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.h (235377 => 235378)
--- trunk/Source/WebCore/rendering/RenderThemeCocoa.h 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.h 2018-08-27 17:06:09 UTC (rev 235378)
@@ -36,6 +36,8 @@
class RenderThemeCocoa : public RenderTheme {
private:
+ void drawLineForDocumentMarker(const RenderText&, GraphicsContext&, const FloatPoint& origin, float width, DocumentMarkerLineStyle) final;
+
#if ENABLE(APPLE_PAY)
void adjustApplePayButtonStyle(StyleResolver&, RenderStyle&, const Element*) const override;
bool paintApplePayButton(const RenderObject&, const PaintInfo&, const IntRect&) override;
Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.mm (235377 => 235378)
--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm 2018-08-27 17:06:09 UTC (rev 235378)
@@ -23,16 +23,16 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "config.h"
-#include "RenderThemeCocoa.h"
+#import "config.h"
+#import "RenderThemeCocoa.h"
+#import "GraphicsContextCG.h"
+#import "RenderText.h"
+
#if ENABLE(APPLE_PAY)
-#include "RenderElement.h"
-#include "RenderStyle.h"
-#include "TranslateTransformOperation.h"
-#include <pal/spi/cocoa/PassKitSPI.h>
-#include <wtf/SoftLinking.h>
+#import <pal/spi/cocoa/PassKitSPI.h>
+#import <wtf/SoftLinking.h>
#if PLATFORM(MAC)
SOFT_LINK_PRIVATE_FRAMEWORK(PassKit);
@@ -45,12 +45,56 @@
#endif // ENABLE(APPLE_PAY)
#if ENABLE(VIDEO)
-#include "LocalizedStrings.h"
-#include <wtf/BlockObjCExceptions.h>
+#import "LocalizedStrings.h"
+#import <wtf/BlockObjCExceptions.h>
#endif
namespace WebCore {
+static CGColorRef colorForStyle(DocumentMarkerLineStyle style, bool useDarkMode)
+{
+ switch (style) {
+ // Red
+ case DocumentMarkerLineStyle::Spelling:
+ return cachedCGColor(useDarkMode ? Color { 255, 140, 140, 217 } : Color { 255, 59, 48, 191 });
+ // Blue
+ case DocumentMarkerLineStyle::DictationAlternatives:
+ case DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives:
+ case DocumentMarkerLineStyle::AutocorrectionReplacement:
+ return cachedCGColor(useDarkMode ? Color { 40, 145, 255, 217 } : Color { 0, 122, 255, 191 });
+ // Green
+ case DocumentMarkerLineStyle::Grammar:
+ return cachedCGColor(useDarkMode ? Color { 50, 215, 75, 217 } : Color { 25, 175, 50, 191 });
+ }
+}
+
+void RenderThemeCocoa::drawLineForDocumentMarker(const RenderText& renderer, GraphicsContext& context, const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
+{
+ if (context.paintingDisabled())
+ return;
+
+ auto circleColor = colorForStyle(style, renderer.page().useSystemAppearance() && renderer.page().useDarkAppearance());
+
+ // Center the underline and ensure we only draw entire dots.
+ FloatPoint offsetPoint = origin;
+ float widthMod = fmodf(width, cMisspellingLinePatternWidth);
+ if (cMisspellingLinePatternWidth - widthMod > cMisspellingLinePatternGapWidth) {
+ float gapIncludeWidth = 0;
+ if (width > cMisspellingLinePatternWidth)
+ gapIncludeWidth = cMisspellingLinePatternGapWidth;
+ offsetPoint.move(floor((widthMod + gapIncludeWidth) / 2), 0);
+ width -= widthMod;
+ }
+
+ CGContextRef platformContext = context.platformContext();
+ CGContextStateSaver stateSaver { platformContext };
+ CGContextSetFillColorWithColor(platformContext, circleColor);
+ for (int x = 0; x < width; x += cMisspellingLinePatternWidth)
+ CGContextAddEllipseInRect(platformContext, CGRectMake(offsetPoint.x() + x, offsetPoint.y(), cMisspellingLineThickness, cMisspellingLineThickness));
+ CGContextSetCompositeOperation(platformContext, kCGCompositeSover);
+ CGContextFillPath(platformContext);
+}
+
#if ENABLE(APPLE_PAY)
static const auto applePayButtonMinimumWidth = 140;
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (235377 => 235378)
--- trunk/Source/WebCore/rendering/RenderThemeMac.h 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h 2018-08-27 17:06:09 UTC (rev 235378)
@@ -174,8 +174,6 @@
bool paintAttachment(const RenderObject&, const PaintInfo&, const IntRect&) final;
#endif
- void drawLineForDocumentMarker(const RenderText&, GraphicsContext&, const FloatPoint& origin, float width, DocumentMarkerLineStyle) final;
-
bool usingDarkAppearance(const RenderObject&) const final;
private:
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (235377 => 235378)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2018-08-27 16:59:39 UTC (rev 235377)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2018-08-27 17:06:09 UTC (rev 235378)
@@ -37,7 +37,6 @@
#import "FrameView.h"
#import "GeometryUtilities.h"
#import "GraphicsContext.h"
-#import "GraphicsContextCG.h"
#import "HTMLAttachmentElement.h"
#import "HTMLInputElement.h"
#import "HTMLMediaElement.h"
@@ -2984,50 +2983,6 @@
#endif // ENABLE(ATTACHMENT_ELEMENT)
-static CGColorRef colorForStyle(DocumentMarkerLineStyle style, bool useDarkMode)
-{
- switch (style) {
- // Red.
- case DocumentMarkerLineStyle::Spelling:
- return cachedCGColor(useDarkMode ? Color { 255, 140, 140, 217 } : Color { 255, 59, 48, 191 });
- // Blue.
- case DocumentMarkerLineStyle::DictationAlternatives:
- case DocumentMarkerLineStyle::TextCheckingDictationPhraseWithAlternatives:
- case DocumentMarkerLineStyle::AutocorrectionReplacement:
- return cachedCGColor(useDarkMode ? Color { 40, 145, 255, 217 } : Color { 0, 122, 255, 191 });
- // Green.
- case DocumentMarkerLineStyle::Grammar:
- return cachedCGColor(useDarkMode ? Color { 50, 215, 75, 217 } : Color { 25, 175, 50, 191 });
- }
-}
-
-void RenderThemeMac::drawLineForDocumentMarker(const RenderText& renderer, GraphicsContext& context, const FloatPoint& origin, float width, DocumentMarkerLineStyle style)
-{
- if (context.paintingDisabled())
- return;
-
- auto circleColor = colorForStyle(style, renderer.page().useSystemAppearance() && renderer.page().useDarkAppearance());
-
- // Center the underline and ensure we only draw entires dots.
- FloatPoint offsetPoint = origin;
- float widthMod = fmodf(width, cMisspellingLinePatternWidth);
- if (cMisspellingLinePatternWidth - widthMod > cMisspellingLinePatternGapWidth) {
- float gapIncludeWidth = 0;
- if (width > cMisspellingLinePatternWidth)
- gapIncludeWidth = cMisspellingLinePatternGapWidth;
- offsetPoint.move(floor((widthMod + gapIncludeWidth) / 2), 0);
- width -= widthMod;
- }
-
- CGContextRef ctx = context.platformContext();
- CGContextStateSaver stateSaver { ctx };
- CGContextSetFillColorWithColor(ctx, circleColor);
- for (int x = 0; x < width; x += cMisspellingLinePatternWidth)
- CGContextAddEllipseInRect(ctx, CGRectMake(offsetPoint.x() + x, offsetPoint.y(), cMisspellingLineThickness, cMisspellingLineThickness));
- CGContextSetCompositeOperation(ctx, kCGCompositeSover);
- CGContextFillPath(ctx);
-}
-
bool RenderThemeMac::usingDarkAppearance(const RenderObject& o) const
{
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400