Add WebVisitedLinkStore::removeVisitedLink and use it on iOS
https://bugs.webkit.org/show_bug.cgi?id=139111

Reviewed by Sam Weinig.

* WebCoreSupport/WebVisitedLinkStore.h:
* WebCoreSupport/WebVisitedLinkStore.mm:
(WebVisitedLinkStore::removeVisitedLink):
* WebView/WebView.mm:
(-[WebView removeVisitedLink:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Switch over to the visited link store from the WebViewGroup
https://bugs.webkit.org/show_bug.cgi?id=139112

Reviewed by Sam Weinig.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView setGroupName:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a test failure.

* History/WebHistory.mm:
(+[WebHistory _setVisitedLinkTrackingEnabled:]):
Call through to the visited link store.

(+[WebHistory _removeAllVisitedLinks]):
Ditto.

* WebCoreSupport/WebVisitedLinkStore.mm:
(WebVisitedLinkStore::isLinkVisited):
Make sure to populate visited links.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Drop support for the EFL 1.7
https://bugs.webkit.org/show_bug.cgi?id=139114

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/EFLHelpers.cmake: Removed.
* Source/cmake/FindEcore.cmake: Removed.
* Source/cmake/FindEdje.cmake: Removed.
* Source/cmake/FindEet.cmake: Removed.
* Source/cmake/FindEeze.cmake: Removed.
* Source/cmake/FindEfreet.cmake: Removed.
* Source/cmake/FindEina.cmake: Removed.
* Source/cmake/FindElementary.cmake: Removed.
* Source/cmake/FindEvas.cmake: Removed.
* Source/cmake/OptionsEfl.cmake:

Source/WTF:

* wtf/efl/EflTypedefs.h: Removed old definitions which EFL 1.7 used.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Add eldbus to the library list
https://bugs.webkit.org/show_bug.cgi?id=139120

Reviewed by Gyuyoung Kim.

Fix undefined reference errors for eldbus APIs.

* PlatformEfl.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r176566.
https://bugs.webkit.org/show_bug.cgi?id=139124

It broke the GTK performance tests. (Requested by clopez on
#webkit).

Reverted changeset:

"[GTK] Use GMainLoopSource in WebKitTestRunner"
https://bugs.webkit.org/show_bug.cgi?id=138831
http://trac.webkit.org/changeset/176566

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make sure range based iteration of Vector<> still receives bounds checking
https://bugs.webkit.org/show_bug.cgi?id=138821

Reviewed by Mark Lam.

Source/JavaScriptCore:

There are a few uses of begin()/end() that explicitly require pointers,
so we use getPtr() to extract the underlying pointer generically.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::visitChildren):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitComplexPopScopes):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::emitSwitchIntJump):
* ftl/FTLAbbreviations.h:
(JSC::FTL::mdNode):
(JSC::FTL::buildCall):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* parser/Parser.h:
(JSC::Scope::Scope):
* profiler/ProfileNode.cpp:
(JSC::ProfileNode::debugPrintRecursively):
* runtime/JSArray.cpp:
(JSC::JSArray::setLengthWithArrayStorage):
(JSC::JSArray::sortCompactedVector):
* tools/ProfileTreeNode.h:
(JSC::ProfileTreeNode::dumpInternal):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::matchCharacterClass):

Source/WebCore:

There are a few uses of begin()/end() that explicitly require pointers,
so we use getPtr() to extract the underlying pointer generically.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::deserializeString):
* editing/TextIterator.cpp:
(WebCore::SearchBuffer::isBadMatch):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::buildSelectionHighlight):
* platform/graphics/SegmentedFontData.cpp:
(WebCore::SegmentedFontData::fontDataForCharacter):
(WebCore::SegmentedFontData::containsCharacter):
(WebCore::SegmentedFontData::isLoading):
* platform/graphics/WOFFFileFormat.cpp:
(WebCore::convertWOFFToSfnt):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
* rendering/style/GridResolvedPosition.cpp:
(WebCore::firstNamedGridLineBeforePosition):
(WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
* svg/SVGFontElement.cpp:
(WebCore::kerningForPairOfStringsAndGlyphs):
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::append):
* xml/XPathNodeSet.h:
(WebCore::XPath::NodeSet::begin):
(WebCore::XPath::NodeSet::end):

Source/WTF:

Add a new IndexedIterator struct to WTF that wraps a
Vector type and index to provide pointer like semantics
while still performing runtime bounds checking, even in
release builds. We store a simple index into the vector
which means that this iterator allows vector resizing
during iteration. If the vector is resized such that the
iterator is out of bounds, then any attempt to dereference
the iterator will crash safely. Any other errors, including
overflows, and over extending the iterator will likewise
crash.

For the purpose of retaining semantically equivalent
behaviour, the iterator can be moved to m_index == size()
as that is the standard "end" terminator for these types.
Attempting to dereference at that point will still crash
rather than perform an unsafe memory operation.

In order to maintain the validity of all the bounds checking,
we perform full integer range checking prior to any mutation
of the iterator location. If we detect an arithmetic overflow
we will crash rather than attempting to carry on.

By necessity there are many overrides for operator + and - as
we otherwise hit many different type promotion ambiguities when
performing arithmetic with iterators. These ambiguities are also
different for 32- vs. 64-bit, so duplicating the functions
and then forwarding to the core implementations that performed
the bounds checking and mutation seemed like the right call.

* WTF.xcodeproj/project.pbxproj:
* wtf/IndexedIterator.h: Added.
(WTF::IndexedIterator::IndexedIterator):
(WTF::IndexedIterator::operator->):
(WTF::IndexedIterator::operator*):
(WTF::IndexedIterator::get):
(WTF::IndexedIterator::operator++):
(WTF::IndexedIterator::operator--):
(WTF::IndexedIterator::operator UnspecifiedBoolType):
(WTF::IndexedIterator::operator+=):
(WTF::IndexedIterator::operator-=):
(WTF::IndexedIterator::operator+):
(WTF::IndexedIterator::operator-):
(WTF::IndexedIterator::operator=):
(WTF::IndexedIterator::operator==):
(WTF::IndexedIterator::operator!=):
(WTF::IndexedIterator::operator<):
(WTF::IndexedIterator::operator<=):
(WTF::IndexedIterator::operator>):
(WTF::IndexedIterator::operator>=):
(WTF::IndexedIterator::operator const_iterator):
(WTF::IndexedIterator::isSafeToCompare):
(WTF::IndexedIterator::unsafeGet):
(WTF::getPtr):
(WTF::operator-):
(WTF::operator==):
(WTF::operator!=):
(WTF::operator<=):
(WTF::operator>=):
(WTF::operator<):
(WTF::operator>):
(WTF::IndexedIteratorSelector::makeIterator):
(WTF::IndexedIteratorSelector::makeConstIterator):
* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):
* wtf/Vector.h:
(WTF::Vector::Vector):
(WTF::Vector::begin):
(WTF::Vector::end):
(WTF::OverflowHandler>::Vector):
(WTF::=):
(WTF::OverflowHandler>::fill):
(WTF::OverflowHandler>::expandCapacity):
(WTF::OverflowHandler>::tryExpandCapacity):
(WTF::OverflowHandler>::resize):
(WTF::OverflowHandler>::shrink):
(WTF::OverflowHandler>::grow):
(WTF::OverflowHandler>::reserveCapacity):
(WTF::OverflowHandler>::tryReserveCapacity):
(WTF::OverflowHandler>::shrinkCapacity):
(WTF::OverflowHandler>::append):
(WTF::OverflowHandler>::tryAppend):
(WTF::OverflowHandler>::appendSlowCase):
(WTF::OverflowHandler>::uncheckedAppend):
(WTF::OverflowHandler>::appendVector):
(WTF::OverflowHandler>::insert):
(WTF::OverflowHandler>::insertVector):
(WTF::OverflowHandler>::remove):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Transform StyleBuilderCustom into a class and mark it as a friend of RenderStyle
https://bugs.webkit.org/show_bug.cgi?id=138999

Reviewed by Sam Weinig.

Transform StyleBuilderCustom into a class and mark it as a friend of
RenderStyle. This is needed because some of the StyleBuilderCustom
functions need to access RenderStyle's private API.

No new tests, no behavior change.

* css/StyleBuilderCustom.h:
  Move functions from StyleBuilderFunctions namespace to
  StyleBuilderCustom class.

* css/makeprop.pl:
  Use StyleBuilderCustom scope instead of StyleBuilderFunctions for
  custom implementation.

* rendering/style/RenderStyle.h:
  Mark StyleBuilderCustom class as a friend, similarly to what was
  already done for DeprecatedStyleBuilder and StyleResolver.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Unset timestamps of trackbuffers during Reset Parser State algorithm.
https://bugs.webkit.org/show_bug.cgi?id=139075.

Patch by Bartlomiej Gajda <b.gajda@samsung.com> on 2014-12-01
Reviewed by Jer Noble.

Source/WebCore:

Specification requires from us to unset timestamps for trackBuffers
during abort() method.

Test: media/media-source/media-source-append-nonsync-sample-after-abort.html

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::abort):
* Modules/mediasource/SourceBuffer.h:

LayoutTests:

Specification requires from us to unset timestamps for trackBuffers during abort() method.
Tests appendBuffer() with first sync sample, then aborts after a few more samples, and emits
a few more non-sync samples, so they should be dropped, as trackBuffer will have
needRandomAccessFlag set.

* media/media-source/media-source-append-nonsync-sample-after-abort-expected.txt: Added.
* media/media-source/media-source-append-nonsync-sample-after-abort.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: DOMExceptions do not show the error message string in Pause Reason section
https://bugs.webkit.org/show_bug.cgi?id=138988

Reviewed by Timothy Hatcher.

Source/WebCore:

* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::type):
Give all DOM Exception types the "error" RemoteObject subtype.

LayoutTests:

* inspector/debugger/command-line-api-exception-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176595 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Crash in WebInspectorClient::hideHighlight when page is destroyed
https://bugs.webkit.org/show_bug.cgi?id=139136

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-12-01
Reviewed by Simon Fraser.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::hideHighlight):
Speculatively fix by null-checking the main frame which
can be null during page destruction.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove old site specific quirks code that was added in 2009
https://bugs.webkit.org/show_bug.cgi?id=139141

Reviewed by Antti Koivisto.

Source/WebCore:

* platform/network/NetworkingContext.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::start):

Source/WebKit/mac:

* WebCoreSupport/WebFrameNetworkingContext.h:
* WebCoreSupport/WebFrameNetworkingContext.mm:
(WebFrameNetworkingContext::needsSiteSpecificQuirks): Deleted.

Source/WebKit2:

* NetworkProcess/RemoteNetworkingContext.h:
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::needsSiteSpecificQuirks): Deleted.
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::needsSiteSpecificQuirks): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement yellow highlight for WebKit1 data detectors
https://bugs.webkit.org/show_bug.cgi?id=138956
<rdar://problem/18992185>

Reviewed by Beth Dakin.

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::TextIndicator::TextIndicator):
* page/TextIndicator.h:
(WebCore::TextIndicator::selectionRectInScreenCoordinates):
(WebCore::TextIndicator::textBoundingRectInScreenCoordinates):
(WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
(WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
Store TextIndicator rects in screen coordinates, since that's what we
want anyway, and this makes it easier to share this code between the WebKits.

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
(WebCore::TextIndicatorWindow::setTextIndicator):
Avoid some rect conversion because the TextIndicator rects are already in screen coordinates.

* WebView/WebActionMenuController.h:
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController webView:willHandleMouseDown:]):
(-[WebActionMenuController webView:didHandleScrollWheel:]):
(-[WebActionMenuController prepareForMenu:withEvent:]):
(-[WebActionMenuController didCloseMenu:withEvent:]):
(-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WebActionMenuController _showTextIndicator]):
(-[WebActionMenuController _hideTextIndicator]):
(-[WebActionMenuController _dismissActionMenuPopovers]):
Copy the WebKit2 WKActionMenuController TextIndicator implementation
into WebActionMenuController. The only significant difference is
that we build the TextIndicator right at menu construction time
instead of in the Web process.

* WebView/WebHTMLView.mm:
(-[WebHTMLView scrollWheel:]):
Let the WebActionMenuController know that we're handling a scroll.

(-[WebHTMLView mouseDown:]):
Let the WebActionMenuController know that we're handling a mouseDown.

* WebView/WebView.mm:
(-[WebView _setTextIndicator:fadeOut:animationCompletionHandler:]):
(-[WebView _clearTextIndicator]):
(-[WebView _actionMenuController]):
(-[WebView _convertRectFromRootView:]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:
Keep a TextIndicatorWindow on WebView, just like WKView does.
Expose the WebActionMenuController on WebView (internally).

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
(WebKit::FindController::drawRect):
Adjust to the fact that TextIndicator keeps screen-relative rects.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/11358748> http/tests/multipart/multipart-wait-before-boundary.html fails on ML as of r115745

Looks like it no longer fails.

* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:
Removed it from test expectations.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Several JavaScriptCore date tests are flaky, because they expect time to be frozen during execution
https://bugs.webkit.org/show_bug.cgi?id=139138

Reviewed by Mark Lam.

Merged a fix by Bob Clary.

* tests/mozilla/ecma/Date/15.9.1.1-1.js:
* tests/mozilla/ecma/Date/15.9.1.1-2.js:
* tests/mozilla/ecma/Date/15.9.2.1.js:
* tests/mozilla/ecma/Date/15.9.2.2-1.js:
* tests/mozilla/ecma/Date/15.9.2.2-2.js:
* tests/mozilla/ecma/Date/15.9.2.2-3.js:
* tests/mozilla/ecma/Date/15.9.2.2-4.js:
* tests/mozilla/ecma/Date/15.9.2.2-5.js:
* tests/mozilla/ecma/Date/15.9.2.2-6.js:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
http tests should not use shared temporary files, part 3
https://bugs.webkit.org/show_bug.cgi?id=139135

Reviewed by Tim Horton.

Fix ping tests, using the same techniques as before.

* http/tests/navigation/image-load-in-unload-handler.html:
* http/tests/navigation/ping-cross-origin-from-https.html:
* http/tests/navigation/resources/check-ping.php:
* http/tests/navigation/resources/delete-ping.php:
* http/tests/navigation/resources/image-load-in-unload-handler-2.html: Copied from LayoutTests/http/tests/navigation/resources/ping-redirect.html.
* http/tests/navigation/resources/ping-file-path.php: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/resources/report-file-path.php.
* http/tests/navigation/resources/ping-redirect.html: Removed.
* http/tests/navigation/resources/save-Ping.php:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix 32-bit build.

* wtf/IndexedIterator.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Fix not always calling mediaPlayer seek.
https://bugs.webkit.org/show_bug.cgi?id=139139

Patch by Bartlomiej Gajda <b.gajda@samsung.com> on 2014-12-01
Reviewed by Jer Noble.

Original comment states that media source shall always be notified of seek if it's not closed.

No new tests needed.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekTimerFired):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Skip some animation tests that time out in iOS WebKit2

* platform/ios-simulator-wk2/TestExpectations: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Update expected results for LayoutTests/crypto

* platform/ios-simulator/TestExpectations:

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