Stop using PLATFORM(MAC) in WTF except where it means “OS X but not iOS”
https://bugs.webkit.org/show_bug.cgi?id=128089

Reviewed by Darin Adler.

Replaced all uses of PLATFORM(MAC) that weren’t accompanied by !PLATFORM(IOS) with
equivalent(*) tests that are more idiomatic and will not change once PLATFORM(MAC) changes to
be false when building for iOS.

* - One exception noted below.

* wtf/AutodrainedPool.h: Changed PLATFORM(MAC) to USE(FOUNDATION), because NSAutoreleasePool
is a Foundation class.

* wtf/CurrentTime.cpp:
(WTF::monotonicallyIncreasingTime): Changed PLATFORM(MAC) to OS(DARWIN), because Mach is
part of the Darwin kernel, but reordered such that the EFL and GLIB implementations continue
to take precedence regardless of the OS.

* wtf/MainThread.cpp: Changed PLATFORM(MAC) to OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK).
* wtf/MainThread.h: Ditto.

* wtf/Platform.h: Changed USE(CG) and USE(CA) to depend on COCOA, rather than MAC or IOS.
Ditto for USE(CFURLCACHE), HAVE(ACCESSIBILITY), USE(PROTECTION_SPACE_AUTH_CALLBACK),
USE(ACCESSIBILITY_CONTEXT_MENUS), USE(EXPORT_MACROS), USE(AVFOUNDATION),
USE(REQUEST_ANIMATION_FRAME_TIMER), USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR),
USE(CONTENT_FILTERING), USE(UNIFIED_TEXT_CHECKING), USE(MARKER_REMOVAL_UPON_EDITING),
USE(AUDIO_SESSION), USE(IOSURFACE), and ENABLE(CSS3_TEXT_DECORATION_SKIP_INK). Changed
PLATFORM(MAC) to OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK) in controlling various
JavaScriptCore or JavaScriptCore-dependent behaviors.

* wtf/RunLoop.h: Changed PLATFORM(MAC) to PLATFORM(COCOA).
* wtf/RunLoopTimerCF.cpp: Ditto.

* wtf/SchedulePair.h: Changed PLATFORM(MAC) to USE(FOUNDATION), since it was used to guard
usage of Foundation API.

* wtf/Threading.cpp: Added an explicit !PLATFORM(IOS) in a guard around something needed
only on OS X and Windows.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Obey "delete this" comments, including deleting String::characters and friends
https://bugs.webkit.org/show_bug.cgi?id=126865

Reviewed by Andreas Kling.

Source/WebCore:

* CMakeLists.txt: Deleted HTMLParserErrorCodes.cpp.
* GNUmakefile.list.am: Deleted HTMLParserErrorCodes.cpp/h, and HTMLParserQuirks.h.
* WebCore.vcxproj/WebCore.vcxproj: Deleted HTMLParserErrorCodes.cpp/h.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* html/HTMLParserErrorCodes.cpp: Removed.
* html/HTMLParserErrorCodes.h: Removed.
* html/HTMLParserQuirks.h: Removed.

* rendering/RenderText.h: Deleted the characters function, leaving behind the
deprecatedCharacters function.

Source/WTF:

* wtf/text/AtomicString.h: Deleted the characters function.
* wtf/text/StringBuilder.h: Deleted the characters function, leaving behind the
deprecatedCharacters function.
* wtf/text/StringImpl.h: Ditto.
* wtf/text/WTFString.h: Ditto. Also added a constructor that takes a StringImpl&,
helpful for later string refactoring.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix iOS build.

* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::parseToDateComponents):
Use deprecatedCharacters.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop using PLATFORM(MAC) in JavaScriptCore except where it means “OS X but not iOS”
https://bugs.webkit.org/show_bug.cgi?id=128098

Reviewed by Darin Adler.

* API/JSValueRef.cpp:
(JSValueUnprotect): Added an explicit !PLATFORM(IOS) in guards for the Evernote workaround,
which is only needed on OS X.

* API/tests/testapi.c:
(main): Changed PLATFORM(MAC) || PLATFORM(IOS) guards to OS(DARWIN), because they were
surrounding tests for code that is itself guarded by OS(DARWIN).

* runtime/Watchdog.h: Changed PLATFORM(MAC) to OS(DARWIN).

* tools/CodeProfiling.cpp:
(JSC::CodeProfiling::begin): Changed PLATFORM(MAC) to
OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK).
(JSC::CodeProfiling::end): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix wrong mix of fcntl commands and flags
https://bugs.webkit.org/show_bug.cgi?id=127842

Reviewed by Darin Adler.

We are mixing the commands to set file descriptor and file status
flags in a couple of fcntl() calls. FD_CLOEXEC must be set using
F_SETFD, and the access mode flags (O_RDONLY, O_WRONLY, O_RDWR)
with F_SETFL.

This combines patches by Guillem Jover and Sergio Correia.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::readBytesFromSocket):
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::createHandle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Correctly address Darin’s review comment on the last change.

* runtime/Watchdog.h: Changed an OS(DARWIN) guard around formerly PLATFORM(MAC)-only member
variables to the equivalent OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK).



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More iOS build fixing.

Source/WebCore: 

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::linkifyPhoneNumbers):
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot):

Source/WebKit/ios: 

* Misc/WebNSStringDrawing.mm:
(-[NSString __web_drawAtPoint:forWidth:withFont:ellipsis:letterSpacing:includeEmoji:measureOnly:renderedStringOut:drawUnderline:]):
(-[NSString __web_drawInRect:withFont:ellipsis:alignment:letterSpacing:lineSpacing:includeEmoji:truncationRect:measureOnly:renderedStringOut:drawUnderline:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderSVGResource::removeClientFromCache() should take RenderElement&.
<https://webkit.org/b/128097>

Text renderers never have resources associated with them.
This is yet another step towards enforcing that at compile-time
by making all the resource cache interfaces deal in RenderElement.

Also marked the RenderSVGResourceSolidColor class final.

Reviewed by Darin Adler.

* rendering/svg/RenderSVGResource.cpp:
(WebCore::removeFromCacheAndInvalidateDependencies):
(WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
* rendering/svg/RenderSVGResource.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::removeClientFromCache):
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::removeClientFromCache):
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::removeClientFromCache):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceMarker.cpp:
(WebCore::RenderSVGResourceMarker::removeClientFromCache):
* rendering/svg/RenderSVGResourceMarker.h:
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::removeClientFromCache):
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::removeClientFromCache):
* rendering/svg/RenderSVGResourcePattern.h:
* rendering/svg/RenderSVGResourceSolidColor.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::invalidateResourcesOfChildren):
(WebCore::SVGRenderSupport::layoutChildren):
* rendering/svg/SVGResources.cpp:
(WebCore::SVGResources::removeClientFromCache):
* rendering/svg/SVGResources.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163295 268f45cc-cd09-0410-ab3c-d52691b4dbfc