WebKit Bugzilla
Attachment 347972 Details for
Bug 188828
: Spelling dots do not scale with page on iOS; share spelling dot painting code between Mac and iOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
For landing
bug-188828-20180823164723.patch (text/plain), 50.40 KB, created by
Daniel Bates
on 2018-08-23 16:47:24 PDT
(
hide
)
Description:
For landing
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-08-23 16:47:24 PDT
Size:
50.40 KB
patch
obsolete
>Subversion Revision: 235260 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 57b14a12ac3284376dadfeb01b977154b7d17995..2047f13ad45cff1f63239a2d663be8470464538d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,66 @@ >+2018-08-23 Daniel Bates <dabates@apple.com> >+ >+ 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/DictationPhraseWithAlternativesDot@2x.png: Removed. >+ * Resources/SpellingDot.png: Removed. >+ * Resources/SpellingDot@2x.png: Removed. >+ * Resources/SpellingDot@3x.png: 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-23 David Fenton <david_fenton@apple.com> > > Unreviewed, rolling out r235129. >diff --git a/Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png b/Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png >deleted file mode 100644 >index 42e10f8ca667020dddb8be84f968495174385061..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 183 >zcmeAS@N?(olHy`uVBq!ia0vp^EI`c6!3HF^d|7u4NO2Z;L>4nJa0`PlBg3pY5<o$P >zWRD<U28JqC28M=a28N&if%HoThEf9thF1v;3|2E37{v1@#UFJ8s<riWaSW-r#d6S) >z>wtm)!@;Zk(GglIt!2~p=`%V`*!+RL{M?T1k&HqC^F6+8()lxA@ibGzeCOXcPs!Y3 >ae8=F(Bz}_FZe}jfAO=rYKbLh*2~7Z`MKuio > >diff --git a/Source/WebCore/Resources/DictationPhraseWithAlternativesDot@2x.png b/Source/WebCore/Resources/DictationPhraseWithAlternativesDot@2x.png >deleted file mode 100644 >index ff369fb4869dff99062bd6032ced299008a257bf..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 267 >zcmeAS@N?(olHy`uVBq!ia0vp^96-#*!3HG%vEKg;q&N#aB8wRqxP?KOkzv*x380`t >zvPY0F14ET614BbI1H;e%K>8&EL#Y7+!>a@a2CEqi4C48d;*Yuk)lT$uaSW-r<#WoK >z>yU#4!^24P$jJ*@=bgTE%Ik!xi0j2_j+Hq&dqb`)NVpeyD1RdtpU?M|r$c+TzOgzj >zbl``|zVn54i<v*%vuuCf9U8}QpyEiHl_PUDgTAk-Uw*(<J{QFjT|*6axpKwR3*O7F >z@Vda|z-W+>ZE3pnLw&UOA#;7M8`8SVG9nmQ+KMegZp;7RVX!)B<G|T>G85=H22WQ% >Jmvv4FO#t@OSiArL > >diff --git a/Source/WebCore/Resources/SpellingDot.png b/Source/WebCore/Resources/SpellingDot.png >deleted file mode 100644 >index 761a9b788d44062892c5d3762686874ef071f524..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 195 >zcmeAS@N?(olHy`uVBq!ia0vp^EI`c6!3-puwc@^j1kxRS9T^y|-MHc(VFct$mbgZg >z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%U4)6(a{eSi9ztyY%hKK*}pYYGY >z;a`9MUwQd|;SvA;|2K4Fy$e*vSrX(I4CI0VL$H5^5Xb^g7srr_TS*BCDGw47k`kXM >gB%~%kW8g4gV6<j14O_AhsD^>T)78&qol`;+0Dcoho&W#< > >diff --git a/Source/WebCore/Resources/SpellingDot@2x.png b/Source/WebCore/Resources/SpellingDot@2x.png >deleted file mode 100644 >index fa8e31c2daa583e0435a53a4bc1be353b1350ef7..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 256 >zcmeAS@N?(olHy`uVBq!ia0vp^96-#*!3HG%vEKg;q&N#aB8wRqxP?KOkzv*x380`t >zvPY0F14ET614BbI1H%^}-ExtEAvd0Z;YAJugH1OBgLFjmbM^|L+BQ!Y$B>F!A*VKS >zH91He_*nnt?n4DDi(gTGzK!~cBCdPgA6$84{j#L{gKqm}&1(f6UuM_0=U<O}_S26e >zoncL`;WO7zRtCqfomtJ_878ELcRk{WNqX^H>UqMfB#&T?(^dS38O|NtbVPwkaf4vU >z{hs8{;**x#Z8qe;cJ<L;&IX(R3PraM<umAP)xGg3^xs>cix@mz{an^LB{Ts5o|ax5 > >diff --git a/Source/WebCore/Resources/SpellingDot@3x.png b/Source/WebCore/Resources/SpellingDot@3x.png >deleted file mode 100644 >index 61b7f7afe7889530ca7c87378547c34e0aa0b02f..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 270 >zcmV+p0rCEcP)<h;3K|Lk000e1NJLTq000aC000RH1^@s62Dr^s0000PbVXQnQ*UN; >zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUyut`KgRCwBSk+BVfFc3xWqzsZer8{Qu >z24N72)R9;OHt-rQso4MllH1GAagOaGU;dVL{_lW;Wf%y$!#(U_2S+%-6TH$mQr6AF >zZ}>??o%sR36#4-v^~8*@=ptgW!}o|fFV@h2^YB;5BnUHKjF!c>z_vTPz~aIxpqr~+ >z6~MklTy~|zS1><8IJUrX2K~U&v2+(DLJOoc*)-}YWz9C)W~{4?Zu$EkDt!bP0GzBk >U1M=+xB>(^b07*qoM6N<$g0%l{O#lD@ > >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 6a55d13aff49422e5a87665029b7300915a5a162..a786a061e92f078c2d1b0d26f4d133d045d97844 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -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 /* SpellingDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 01E6C2E31194B2820050821C /* SpellingDot@2x.png */; }; > 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 /* SpellingDot@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C2417B91992C04100EF9938 /* SpellingDot@3x.png */; }; > 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 /* DictationPhraseWithAlternativesDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */; }; > 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 /* SpellingDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SpellingDot@2x.png"; 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 /* SpellingDot@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SpellingDot@3x.png"; 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 /* DictationPhraseWithAlternativesDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "DictationPhraseWithAlternativesDot@2x.png"; 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 /* AttachmentPlaceholder@2x.png */, >- D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */, >- D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */, > E59DD4B721098285003C8B47 /* ListButtonArrow.png */, > E516698F20FF9916009D2C27 /* ListButtonArrow@2x.png */, >- BE8C753010681324001E93F5 /* SpellingDot.png */, >- 01E6C2E31194B2820050821C /* SpellingDot@2x.png */, >- 1C2417B91992C04100EF9938 /* SpellingDot@3x.png */, > ); > 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 /* AttachmentPlaceholder@2x.png in Resources */, > A1AA9AB91D23911500FEADB3 /* ContentFilterBlockedPage.html in Resources */, > A11E8C051B1E28F40003A7C7 /* copyCursor.png in Resources */, >- D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */, >- D02B64B314089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png 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 /* SpellingDot@2x.png in Resources */, >- 1C2417BA1992C04100EF9938 /* SpellingDot@3x.png in Resources */, > 93153BDC141959BC00FCF5BE /* textAreaResizeCorner.png in Resources */, > 9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */, > ); >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 8c5a779b733c90a7dfaba7ab3018a71d9c419e87..e12b5ffccd025031741d2ea70b2eb852fb379e32 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -933,8 +933,6 @@ void Page::setDeviceScaleFactor(float scaleFactor) > mainFrame().deviceOrPageScaleFactorChanged(); > PageCache::singleton().markPagesForDeviceOrPageScaleChanged(*this); > >- GraphicsContext::updateDocumentMarkerResources(); >- > pageOverlayController().didChangeDeviceScaleFactor(); > } > >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index 57b3bf466f834b5a1ea348d0d3bd45f3e55cf57b..497d2c79fd2cb08fc3d0ccbf8f8ea2273c43101c 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -422,7 +422,6 @@ public: > 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); >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp >index 8cfb1e92257e43252706aea545b426394fe99fd6..5f8570b121705a6ba91506e31bed97f64788cf6f 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp >@@ -337,11 +337,6 @@ void GraphicsContext::drawLinesForText(const FloatPoint& point, const DashArray& > 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()) >diff --git a/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm b/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm >index b5a9d668f18a5918ba28c9edec0adeeb7edfcd10..b157865df3f7cc90be1fa012311f91b4c6b8c203 100644 >--- a/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm >@@ -41,7 +41,6 @@ > #if PLATFORM(IOS) > #import "Color.h" > #import "WKGraphics.h" >-#import "WKGraphicsInternal.h" > #endif > > #if PLATFORM(MAC) >@@ -174,51 +173,6 @@ void GraphicsContext::drawFocusRing(const Vector<FloatRect>& rects, float width, > #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 @@ static inline void setPatternPhaseInUserSpace(CGContextRef context, CGPoint phas > 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 >diff --git a/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp b/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp >index c68e606c08447c3b402d187f2e692f57cd69cf29..120638b251b4297f9a3dfe13f535ebaaa9772f68 100644 >--- a/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp >+++ b/Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp >@@ -185,11 +185,6 @@ static const Color& grammarPatternColor() { > 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()) >diff --git a/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp b/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp >index 2f82161b3f4891c0cb49dacb12fa4c520ab603ba..5eace1088667c229b5afc39ec93687e0d45a52fb 100644 >--- a/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp >+++ b/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp >@@ -319,10 +319,6 @@ void GraphicsContext::drawFocusRing(const Vector<FloatRect>& rects, float width, > { > } > >-void GraphicsContext::updateDocumentMarkerResources() >-{ >-} >- > void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style) > { > } >diff --git a/Source/WebCore/platform/ios/wak/WKGraphics.mm b/Source/WebCore/platform/ios/wak/WKGraphics.mm >index 68eb6dee7b6c72cdde79cbac91f6e25f701a4608..dfc6e0ee35f7f8f49fcd609302b74d31c960beda 100644 >--- a/Source/WebCore/platform/ios/wak/WKGraphics.mm >+++ b/Source/WebCore/platform/ios/wak/WKGraphics.mm >@@ -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,28 +51,12 @@ static inline void _FillRectsUsingOperation(CGContextRef context, const CGRect* > 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); >- 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)); >+ if (aRect.size.width > 0 && aRect.size.height > 0) >+ _FillRectsUsingOperation(context, &aRect, 1, kCGCompositeCopy); > CGContextRestoreGState(context); > } > } >@@ -94,83 +73,4 @@ CGContextRef WKGetCurrentGraphicsContext(void) > 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) >diff --git a/Source/WebCore/platform/ios/wak/WKGraphicsInternal.h b/Source/WebCore/platform/ios/wak/WKGraphicsInternal.h >deleted file mode 100644 >index 3fed476f22c051519da02fd51217ef6df423f84b..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/ios/wak/WKGraphicsInternal.h >+++ /dev/null >@@ -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 >diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp >index 5eac74abd21b116a73f504c25c2c193b02145ba8..0a784ccc34af01db106486fbc7735133a504c6d4 100644 >--- a/Source/WebCore/rendering/InlineTextBox.cpp >+++ b/Source/WebCore/rendering/InlineTextBox.cpp >@@ -726,7 +726,7 @@ void InlineTextBox::paintPlatformDocumentMarker(GraphicsContext& context, const > 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)); >diff --git a/Source/WebCore/rendering/RenderThemeCocoa.h b/Source/WebCore/rendering/RenderThemeCocoa.h >index 30151d848ee45cf85d8894113142e07229be1c4c..c2830fe8adcad51e12d431bd6afe133499db333b 100644 >--- a/Source/WebCore/rendering/RenderThemeCocoa.h >+++ b/Source/WebCore/rendering/RenderThemeCocoa.h >@@ -36,6 +36,8 @@ namespace WebCore { > > 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; >diff --git a/Source/WebCore/rendering/RenderThemeCocoa.mm b/Source/WebCore/rendering/RenderThemeCocoa.mm >index df2c731d0896761d27742dd93ee6e1313ddfd291..a6178047a1b2e39fe20f1b9ac263ae2ee45e9fac 100644 >--- a/Source/WebCore/rendering/RenderThemeCocoa.mm >+++ b/Source/WebCore/rendering/RenderThemeCocoa.mm >@@ -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 @@ SOFT_LINK_MAY_FAIL(PassKit, PKDrawApplePayButton, void, (CGContextRef context, C > #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; >diff --git a/Source/WebCore/rendering/RenderThemeMac.h b/Source/WebCore/rendering/RenderThemeMac.h >index d98de3a959916c8faa354dede51998f88d8b0e9c..ba79bdac7297b31b46a6bf4d5d37215aa39839fb 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.h >+++ b/Source/WebCore/rendering/RenderThemeMac.h >@@ -174,8 +174,6 @@ private: > 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: >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 1009c21f8205976fd19d54785c1d18cdcb0862f9..ee433170e2d7a2770305b442bceb4eda2c18d772 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -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 @@ bool RenderThemeMac::paintAttachment(const RenderObject& renderer, const PaintIn > > #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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188828
:
347731
|
347733
|
347746
|
347809
| 347972