Tweak and tighten SVG font converter
https://bugs.webkit.org/show_bug.cgi?id=136956

Reviewed by Myles Maxfield.

Source/WebCore:

* svg/SVGToOTFFontConversion.cpp: Fixed copyright date.
(WebCore::overwrite32): Changed to use normal subscripting for clarity.
(WebCore::overwrite16): Added.
(WebCore::SVGToOTFFontConverter::GlyphData::GlyphData): Added a move
to make constructing each GlyphData less expensive.
(WebCore::SVGToOTFFontConverter::KerningData): Removed the < operator
since it the struct contains more than what we want to sort it by, so it's
not elegant to build the sorting rule into the struct.
(WebCore::SVGToOTFFontConverter): Removed "k" prefix from some constants.
Replaced many function templates with non-template functions. Changed
key type for m_codepointToIndexMap to UChar32.
(WebCore::integralLog2): Tweaked formatting.
(WebCore::SVGToOTFFontConverter::appendCMAPTable): Removed a stray
cast that doesn't have any effect. Use the Glyph type to index m_glyphs.
(WebCore::SVGToOTFFontConverter::appendHEADTable): Append the magic
number in a more straightforward way.
(WebCore::clampTo): Tweak formatting of the template function.
(WebCore::SVGToOTFFontConverter::appendHHEATable): Made some minor
style changes and improved some comments.
(WebCore::SVGToOTFFontConverter::appendOS2Table): Made some minor
style changes and tightened up code that did parsing a bit, removing the
dynamically allocated array for the fixed length Panose number.
Also use first and last instead of hand-coded versions of those.
(WebCore::appendValidCFFString): Renamed.
(WebCore::SVGToOTFFontConverter::appendCFFTable): Made various tweaks,
including more specific of null for the "no weight" value instead of
either empty or null.
(WebCore::SVGToOTFFontConverter::appendVORGTable): Simplified some of
the numeric parsing, since toInt is guaranteed to return 0 when it also
would return "false" for ok. Also got rid of a local vector and instead
just fixed up the size of the table afterward.
(WebCore::SVGToOTFFontConverter::appendVHEATable): Tweaked comment.
(WebCore::SVGToOTFFontConverter::addCodepointRanges): Use isValidKey
instead of a local hardcoded rule to check hash table key validity.
Check for zero in the result of get rather than using find on the HashMap.
(WebCore::SVGToOTFFontConverter::addCodepointRanges): Ditto.
(WebCore::SVGToOTFFontConverter::addGlyphNames): Ditto.
(WebCore::SVGToOTFFontConverter::addKerningPair): Added. Factored out from
appendKERNSubtable to reduce template bloat and improve clarity.
(WebCore::SVGToOTFFontConverter::appendKERNSubtable): Tweaked formatting.
Moved the bulk of the function into non-template function.
(WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable): Added.
Non-template part of appendKERNSubtable. Also changed std::sort to supply
custom comparison function rather than trying to use the < operator directly
on KerningData.
(WebCore::writeCFFEncodedNumber): Don't use powf just to multiply by
2^16. It's pretty easy to do that with plain old multiplication.
(WebCore::CFFBuilder::CFFBuilder): Renamed m_firstPoint to
m_hasBoundingBox.
(WebCore::CFFBuilder::boundingBox): Made this public and const and made
the rest of the class private.
(WebCore::CFFBuilder::updateBoundingBox): Used early return and revised
to use m_hasBoundingBox.
(WebCore::CFFBuilder::writePoint): Added. Used to keep the other
functions below smaller.
(WebCore::CFFBuilder::moveTo): Marked virtual and simplified using writePoint.
Might find a way to simplify even further by teaching writePoint about
the PathCoordinateMode.
(WebCore::CFFBuilder::lineTo): Ditto.
(WebCore::CFFBuilder::curveToCubic): Ditto. Also removed comment that said
the function could be faster. Not sure that's important to state like this.
(WebCore::SVGToOTFFontConverter::transcodeGlyphPaths): Changed into a
non-template function. Tweaked logic and formatting a bit.
(WebCore::SVGToOTFFontConverter::processGlyphElement): Changed into a
non-template function. Moved the code from appendGlyphData in here.
Use WTF::move so we don't copy the glyph paths when creating a GlyphData.
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Updated a bit for
function changes above. Changed code to use isValidKey to check if we can
add to m_codepointToIndexMap. Parse font-style rather than parsing
font-weight twice. Round weights instead of truncating them. Change rule
to "first wins" instead of "last wins" when there are multiple segments.
Removed one vague and non-helpful comment.
(WebCore::isFourByteAligned): Fixed minor formatting issue by making the
function non-abstract. No reason not to hard-code the number 3 when the
number four appears in the function name.
(WebCore::calculateChecksum): Removed unneeded comment about why the
checksum is little-endian; since this came from Windows documentation there
is no doubt that little-endian is correct, so we don't need a comment creating
fear, uncertainty, and doubt. If the checksum computation is wrong, it should
become obvious that we have a bad checksum. Also changed the for loop to use
its own loop variable instead of changing startingOffset, which is not logical.
(WebCore::SVGToOTFFontConverter::appendTable): Updated for name changes.
(WebCore::SVGToOTFFontConverter::convertSVGToOTFFont): Ditto. Also streamlined
the checksum code a little. The comment still is a little peculiar; I was
tempted to take it out.

Tools:

I was investigating behavior of String::toInt, String::toDouble, and
String::toFloat for various failure cases, and decided to start some
unit tests for those functions here.

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST): Addded a first small bit of StringToInt and
StringToDouble testing.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Revert "Support for :enabled selector on Anchor & Area elements"
https://bugs.webkit.org/show_bug.cgi?id=134826

Reviewed by Darin Adler.

Source/WebCore:

HTML spec has been modified [1] to disable support for :enabled CSS
selector on Anchor, Area & Link elements, after discussion on W3C
Bugzilla [2].

This reverts r171671.

[1] https://html5.org/r/8818
[2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=26622

* css/SelectorCheckerTestFunctions.h:
(WebCore::isEnabled):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):

LayoutTests:

These layout tests are no longer correct after changes to the :enabled
CSS selector specification.

* fast/css/css-selector-enabled-links-expected.txt: Removed.
* fast/css/css-selector-enabled-links.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make is<>() / downcast<>() work for HTMLDocument and its subclasses
https://bugs.webkit.org/show_bug.cgi?id=137169

Reviewed by Darin Adler.

Source/WebCore:

Make is<>() / downcast<>() work for HTMLDocument and its subclasses by
using the SPECIALIZE_TYPE_TRAITS_*() macro. Drop the DOCUMENT_TYPE_CASTS()
macro as it is no longer needed.

No new tests, no behavior change.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::processHttpEquiv):
(WebCore::eventTargetElementForDocument):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::insertedInto):
(WebCore::Element::removedFrom):
(WebCore::Element::updateName):
(WebCore::Element::updateId):
* html/HTMLDocument.h:
(WebCore::isHTMLDocument):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::matchesReadWritePseudoClass):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/ImageDocument.cpp:
(WebCore::ImageDocumentParser::document):
* html/ImageDocument.h:
(WebCore::isImageDocument):
* html/MediaDocument.h:
(WebCore::isMediaDocument):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
* html/PluginDocument.h:
(WebCore::isPluginDocument):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* page/DragController.cpp:
(WebCore::DragController::operationForLoad):
* page/FrameView.cpp:
(WebCore::determineLayerFlushThrottleState):

Source/WebKit/win:

Use is<>() / downcast<>() for HTMLDocument and its subclasses.

* DOMHTMLClasses.cpp:
(DOMHTMLDocument::URL):
(DOMHTMLDocument::body):
(DOMHTMLDocument::forms):

Source/WebKit2:

Use is<>() / downcast<>() for HTMLDocument and its subclasses.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::pdfDocumentForPrintingFrame):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Missing changes from r174049
https://bugs.webkit.org/show_bug.cgi?id=137206

Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-09-29
Reviewed by Darin Adler.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h:

LayoutTests:

* js/number-constructor-expected.txt:
* js/script-tests/number-constructor.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove remaining uses of NODE_TYPE_CASTS() from html/
https://bugs.webkit.org/show_bug.cgi?id=137172

Reviewed by Darin Adler.

Remove remaining uses of NODE_TYPE_CASTS() from html/ and use the new
SPECIALIZE_TYPE_TRAITS_*() macro instead so that is<>() / downcast<>()
works for those types.

No new tests, no behavior change.

* css/SelectorCheckerTestFunctions.h:
(WebCore::matchesLangPseudoClass):
(WebCore::matchesFutureCuePseudoClass):
(WebCore::matchesPastCuePseudoClass):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement):
The new casting function found a bad cast from a StyledElement to VTTElement.
Those two types are unrelated as VTTElement inherits directly from Element.
Knowing that |element| in this method cannot be a VTTElement simplifies the
logic a bit.

* dom/NodeRenderingTraversal.cpp:
(WebCore::NodeRenderingTraversal::findFirstEnteringInsertionPoints):
(WebCore::NodeRenderingTraversal::findLastEnteringInsertionPoints):
(WebCore::NodeRenderingTraversal::traverseParent):
* html/HTMLLabelElement.cpp:
(WebCore::nodeAsSupportedLabelableElement):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElement):
* html/LabelableElement.h:
(WebCore::isLabelableElement):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::ensureInsertionPointList):
* html/shadow/InsertionPoint.h:
(WebCore::isInsertionPoint):
(WebCore::isActiveInsertionPoint):
(WebCore::parentNodeForDistribution):
* html/shadow/TextControlInnerElements.h:
(WebCore::isTextControlInnerTextElement):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree):
(WebCore::VTTCue::markFutureAndPastNodes):
* html/track/WebVTTElement.h:
(WebCore::isWebVTTElement):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):
* style/StyleResolveTree.cpp:
(WebCore::Style::attachRenderTree):
(WebCore::Style::detachChildren):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the new is<>() / downcast<>() for Text Nodes
https://bugs.webkit.org/show_bug.cgi?id=137188

Reviewed by Darin Adler.

Use the new is<>() / downcast<>() functions for Text Nodes instead of
isText() / toText().

Source/WebCore:

No new tests, no behavior change.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement):
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
* dom/Node.cpp:
(WebCore::Node::normalize):
* dom/Position.cpp:
(WebCore::Position::containerNode):
(WebCore::Position::containerText):
(WebCore::Position::isRenderedCharacter):
(WebCore::Position::leadingWhitespacePosition):
* dom/Range.cpp:
(WebCore::Range::insertNode):
(WebCore::Range::getBorderAndTextQuads):
* dom/Text.cpp:
(WebCore::earliestLogicallyAdjacentTextNode):
(WebCore::latestLogicallyAdjacentTextNode):
* dom/Text.h:
(WebCore::isText):
* dom/TextNodeTraversal.cpp:
(WebCore::TextNodeTraversal::contentsAsString):
* dom/TextNodeTraversal.h:
(WebCore::TextNodeTraversal::firstTextChildTemplate):
(WebCore::TextNodeTraversal::firstTextWithinTemplate):
(WebCore::TextNodeTraversal::traverseNextTextTemplate):
(WebCore::TextNodeTraversal::nextSibling):
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition):
(WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitTextAtEnd):
(WebCore::ApplyStyleCommand::splitTextElementAtEnd):
(WebCore::ApplyStyleCommand::joinChildTextNodes):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertNodeAt):
(WebCore::CompositeEditCommand::positionOutsideTabSpan):
(WebCore::CompositeEditCommand::canRebalance):
(WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
(WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
(WebCore::CompositeEditCommand::deleteInsignificantText):
(WebCore::CompositeEditCommand::removePlaceholderAt):
(WebCore::CompositeEditCommand::cleanupAfterDeletion):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::fixupWhitespace):
(WebCore::DeleteSelectionCommand::doApply):
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::insertTab):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendStartMarkup):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
(WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
(WebCore::ReplaceSelectionCommand::performTrivialReplace):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::SimplifiedBackwardsTextIterator::handleTextNode):
* editing/VisibleUnits.cpp:
(WebCore::startPositionForLine):
(WebCore::endPositionForLine):
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* editing/htmlediting.cpp:
(WebCore::lineBreakExistsAtPosition):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::renderedText):
(WebCore::replaceChildrenWithFragment):
(WebCore::replaceChildrenWithText):
* html/HTMLElement.cpp:
(WebCore::mergeWithNextTextNode):
(WebCore::HTMLElement::setOuterHTML):
(WebCore::HTMLElement::setOuterText):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent):
(WebCore::HTMLObjectElement::updateDocNamedItem):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::innerTextValue):
(WebCore::positionForIndex):
(WebCore::HTMLTextFormControlElement::indexForPosition):
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeValue):
* rendering/RenderCombineText.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges):
* rendering/RenderText.cpp:
(WebCore::RenderText::textNode):
* rendering/svg/RenderSVGInlineText.h:
* style/StyleResolveTree.cpp:
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
(WebCore::Style::attachChildren):
(WebCore::Style::attachDistributedChildren):
(WebCore::Style::detachDistributedChildren):
(WebCore::Style::detachChildren):
(WebCore::Style::resolveShadowTree):
(WebCore::Style::resolveTree):

Source/WebKit2:

* WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
(-[WKDOMText data]):
(-[WKDOMText setData:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the new is<>() / downcast<>() for ShadowRoot and StyledElement
https://bugs.webkit.org/show_bug.cgi?id=137199

Reviewed by Darin Adler.

Use the new is<>() / downcast<>() for ShadowRoot and StyledElement and
move towards getting rid of the NODE_TYPE_CASTS() macro.

No new tests, no behavior change.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAllRules):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::initElement):
(WebCore::StyleResolver::State::initForStyleResolve):
(WebCore::StyleResolver::locateCousinList):
(WebCore::StyleResolver::findSiblingForStyleSharing):
* dom/Attr.cpp:
(WebCore::Attr::style):
* dom/Element.cpp:
(WebCore::Element::removeAttribute):
* dom/EventDispatcher.cpp:
(WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
(WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
(WebCore::eventTargetRespectingTargetRules):
(WebCore::EventPath::EventPath):
* dom/Node.cpp:
(WebCore::Node::containingShadowRoot):
(WebCore::Node::parentOrShadowHostElement):
(WebCore::Node::showNodePathForThis):
* dom/NodeRenderingTraversal.cpp:
(WebCore::NodeRenderingTraversal::traverseParent):
* dom/ShadowRoot.h:
(WebCore::isShadowRoot):
(WebCore::Node::shadowRoot):
(WebCore::Node::parentOrShadowHostNode):
* dom/StyledElement.h:
(WebCore::StyledElement::presentationAttributeStyle):
(WebCore::isStyledElement):
* dom/Text.cpp:
(WebCore::isSVGShadowText):
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedElement):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::wrappingStyleForSerialization):
* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToElement):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
* editing/cocoa/HTMLConverter.mm:
(HTMLConverterCaches::inlineStylePropertyForElement):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendElement):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* page/DragController.cpp:
(WebCore::asFileInput):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::owner):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
* svg/SVGElement.cpp:
(WebCore::SVGElement::title):
* testing/Internals.cpp:
(WebCore::Internals::shadowRoot):
(WebCore::Internals::shadowRootType):
(WebCore::Internals::includerFor):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] D3D11 is not used by default.
https://bugs.webkit.org/show_bug.cgi?id=137215

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-09-29
Reviewed by Alex Christensen.

ANGLE_DEFAULT_D3D11 needs to be defined for D3D11 to be used as default.

* ANGLE.vcxproj/libGLESv2Common.props:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Remove obsolete playbackTargetAvailabilityChanged methods
https://bugs.webkit.org/show_bug.cgi?id=137179

Reviewed by Darin Adler.

No new tests, this just removes unused code.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerPlaybackTargetAvailabilityChanged): Deleted.
* html/HTMLMediaElement.h:

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::playbackTargetAvailabilityChanged): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerPlaybackTargetAvailabilityChanged): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Add basic support for link navigation in WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=137182

Reviewed by Tim Horton.

Teach WKPDFView to navigate to URLs when PDF link annotations are tapped.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Sent Messages::WebPage::NavigateToURLWithSimulatedClick.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKPDFView.h:
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _clearPages]): Removed self as the UIPDFAnnotationControllerDelegate.
(-[WKPDFView _revalidateViews]): Added self as the UIPDFAnnotationControllerDelegate.
(-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Retrieved the URL from the touched annotation,
computed the touched point relative to the WKPDFView and to the screen, and called
navigateToURLWithSimulatedClick() after a 200 ms delay in order to show a soon-to-be-added tap highlight
(this value matches the delay in UIWebPDFView).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToURLWithSimulatedClick): Created a fake single-click MouseEvent and called
FrameLoader::urlSelected(). Creating a mouse event ensures that the navigation appears as a
NavigationTypeLinkClicked in navigation policy delegates.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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