WebKit-https.git
4 years agoSome event handler fixes
darin@apple.com [Wed, 11 Mar 2015 02:21:20 +0000 (02:21 +0000)]
Some event handler fixes
https://bugs.webkit.org/show_bug.cgi?id=142474

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript): Call clearException.
I spotted the fact it was missing by auditing all the calls to JSC::call.

Source/WebCore:

* bindings/scripts/CodeGenerator.pm:
(GenerateConditionalStringFromAttributeValue): Improved the algorithm here to
handle combinations of & and | in conditional expressions; that's coming up when
combining conditionals for includes in NavigatorContentUtils.idl.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToImplIncludes): Removed the rudimentary attempt to split and merge
conditionals involving | here; instead we rely on the rules in the
GenerateConditionalStringFromAttributeValue to handle this.
(GenerateImplementation): Passed new "conditional" argument to JSValueToNative.
(GenerateParametersCheck): Pass "conditional" argument to AddToImplIncludes and
JSValueToNative.
(JSValueToNative): Changed to take "conditional" as an argument, since getting
it from the signature won't work for a method parameter.
(WriteData): Merge duplicates based on the result of the
GenerateConditionalStringFromAttributeValue function rather than on the values
passed into that function, since that function converts conditionals into a
canonical form and can make two strings equal that don't start out that way.

* bindings/scripts/CodeGeneratorObjC.pm:
(SkipAttribute): Added code to guarantee we won't make Objective-C bindings
for event handlers. We will rename EventListener to EventHandler in a
subsequent patch.

* bindings/scripts/test/JS/JSTestInterface.cpp: Updated for a progression caused
by the better logic for conditional includes.

* bindings/scripts/test/JS/JSTestObj.cpp: Updated for change to the test below.
* bindings/scripts/test/TestObj.idl: Added test of an event handler attribute.

* dom/Document.idl: Removed unneeded language #if around event handler
attributes. Removed all the commented out event handler attributes.
Sorted event handler attributes into a single section rather than separating
"standard" from "extensions". Sorted the conditional event handler attributes
into paragraphs at the bottom. We will probably make them all unconditional
in a subsequent patch.

* dom/Element.idl: Removed unneeded language #if around event handler
attributes. Removed all the commented out event handler attributes.
Moved event handler attributes here from all derived element classes to
match the approach from the HTML standard. Also resorted the attributes
as in Document above.

* html/HTMLBodyElement.idl: Removed unneeded language #if around event handler
attributes. Removed all the commented out event handler attributes.
Sorted event handler attributes into a single section rather than separating
"standard" from "overrides".

* html/HTMLElement.cpp:
(WebCore::HTMLElement::populateEventNameForAttributeLocalNameMap):
Added a few missing attribute names, and re-sorted a bit. Moved any from
element subclasses here.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::parseAttribute): Moved code to handle
oncomplete and oncompleteerror to Element and HTMLElement.
* html/HTMLFormElement.idl: Ditto.

* html/HTMLFrameSetElement.idl: Removed #if and resorted as above.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute): Moved code to handle
onsearch to HTMLElement.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): Moved code to handle
all the event handler attributes to HTMLElement.
(WebCore::HTMLMediaElement::updateCaptionContainer): Removed a redundant
if statement I noticed while auditing all calls to JSC::call.
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Added clearException.
I noticed this was missing because a flawed earlier version of my patch was
causing the script to fail, leaving an exception behind that caused an
assertion later. So I audited all calls to JSC::call looking for this mistake.

* html/HTMLMediaElement.idl: Moved all the event handlers from here to
Element. Also changed everything possible to use Conditional instead of #if.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Added
clearException. Noticed it was missing while auditing all calls to JSC::call.

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute): Moved event handler code to
HTMLElement.

* html/HTMLVideoElement.idl: Moved event handler to Element.idl and use
Conditional instead of #if.

* page/DOMWindow.idl: Use Conditional instead of #if and tidy up the event
handlers section.

* svg/svgattrs.in: Remove six unused attribute names. Presumably used in
some older scheme to implement event handlers but no longer used at all.

LayoutTests:

* fast/dom/event-handler-attributes-expected.txt: Updated for new tests and to
expect more tests to pass.

* fast/dom/event-handler-attributes.html: Added testing of event handlers on
non-HTML, non-SVG elements, and on SVG elements. Also removed
webkitpresentationmodechanged from the test, for now at least.

* fast/events/event-attribute-expected.txt: Updated to expect more tests to pass.

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

4 years agoFunctions should have initialization precedence over arguments.
mmirman@apple.com [Wed, 11 Mar 2015 00:33:03 +0000 (00:33 +0000)]
Functions should have initialization precedence over arguments.
https://bugs.webkit.org/show_bug.cgi?id=142550
rdar://problem/19702564

Reviewed by Geoffrey Garen.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeCapturedVariable):
* tests/stress/initialize_functions_after_arguments.js: Added.

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

4 years agoCSS scroll-snap-destination and scroll-snap-coordinate are not honoring position...
bfulgham@apple.com [Tue, 10 Mar 2015 23:19:38 +0000 (23:19 +0000)]
CSS scroll-snap-destination and scroll-snap-coordinate are not honoring position values
https://bugs.webkit.org/show_bug.cgi?id=142411

Reviewed by Simon Fraser.

Source/WebCore:

Tested by css3/scroll-snap/scroll-snap-position-values.html.

Revise the CSSParser to recognize that scroll-snap-coordinates and scroll-snap-destination
may be specified as positions, therefore allowing 'top', 'bottom', and 'center' for the Y axis,
and 'left', 'right', and 'center' for the X axis.

Correct implementation to support calculated values for Scroll Snap Point markup. This required the
Scroll Snap Point-specific LengthRepeat class to change its internal representation from a CSSPrimitiveValue
to a regular CSSValue.

Add tests that these position labels, as well as combinations with percentages and pixel offsets
are parsed properly.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::scrollSnapDestination): Switch from 'percentageOrZoomAdjustedValue' to 'zoomAdjustedPixelValueForLength'
when working with Length values. This is necessary to allow calculated results to be based on the proper default
page dimensions.
(WebCore::scrollSnapPoints): Ditto.
(WebCore::scrollSnapCoordinates): Ditto.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseScrollSnapPositions): Consolidated code for dealing with snap point
positions.
(WebCore::CSSParser::parseScrollSnapDestination): Revise to call new helper function.
(WebCore::CSSParser::parseScrollSnapCoordinate): Ditto.
(WebCore::CSSParser::parseFillPositionX): Rename as parsePositionX.
(WebCore::CSSParser::parseFillPositionY): Rename as parsePositionY.
(WebCore::CSSParser::parseFillProperty): Update to call renamed parsePosition{X|Y} methods.
(WebCore::CSSParser::parseTransformOrigin): Ditto.
(WebCore::CSSParser::parsePerspectiveOrigin): Ditto.
* css/CSSParser.h:
* css/LengthRepeat.h: Revise class to use a CSSValue, rather than a CSSPrimitiveValue, so that we can represent
repeat values as calculations.

LayoutTests:

Add a test for <position> types in scroll snap operations. Also update the test expectations
for computed styles now that double-precision math is being used for calculated values.

* css3/scroll-snap/scroll-snap-position-values-expected.txt: Added.
* css3/scroll-snap/scroll-snap-position-values.html: Added.
* css3/scroll-snap/scroll-snap-property-computed-style-expected.txt: Updated
* css3/scroll-snap/scroll-snap-property-computed-style.js: Updated

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

4 years agoAdd support for more emoji with variation.
enrica@apple.com [Tue, 10 Mar 2015 23:12:53 +0000 (23:12 +0000)]
Add support for more emoji with variation.
https://bugs.webkit.org/show_bug.cgi?id=142548
rdar://problem/20105008

Reviewed by Tim Horton.

Source/WebCore:

Update ICU rules to support new emoji with variation.

Test: editing/selection/extend-by-character-007.html

* platform/text/TextBreakIterator.cpp:
(WebCore::cursorMovementIterator):

LayoutTests:

* editing/selection/extend-by-character-007-expected.txt: Added.
* editing/selection/extend-by-character-007.html: Added.

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

4 years agoEden collections should trigger sweep of MarkedBlocks containing new objects.
akling@apple.com [Tue, 10 Mar 2015 22:59:10 +0000 (22:59 +0000)]
Eden collections should trigger sweep of MarkedBlocks containing new objects.
<https://webkit.org/b/142538>

Reviewed by Geoffrey Garen.

Take a snapshot of all MarkedBlocks with new objects as part of Eden collections,
and append that to the IncrementalSweeper's working set.

This ensures that we run destructors for objects that were discovered to be garbage during
Eden collections, instead of delaying their teardown until the next full collection,
or the next allocation cycle for their block.

* heap/Heap.cpp:
(JSC::Heap::snapshotMarkedSpace): For Eden collections, snapshot the list of MarkedBlocks
that contain new objects, since those are the only ones we're interested in.
Also use Vector::resizeToFit() to allocate the snapshot for full collections, since we know
the final size we need up front.

(JSC::Heap::notifyIncrementalSweeper): For Eden collections, tell the IncrementalSweeper
to add the block snapshot (taken earlier) to its existing set of blocks instead of replacing
it entirely. This allows Eden collections and incremental sweeping to occur interleaved with
each other without missing destruction opportunities.

* heap/IncrementalSweeper.h:
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::doSweep):
(JSC::IncrementalSweeper::sweepNextBlock): Change the way we iterate over the sweeper's
work list: instead of keeping an index for the next block, just pop from the end of the list.
This allows us to add new blocks and deduplicate the list without disturbing iteration.

(JSC::IncrementalSweeper::startSweeping): Make this take a Vector<MarkedBlock>&& so we can
pass ownership of this Vector efficiently from Heap to IncrementalSweeper.

(JSC::IncrementalSweeper::addBlocksAndContinueSweeping): Added. This is used by Eden
collections to add a set of MarkedBlocks with new objects to the sweeper's existing
working set and kick the timer.

* heap/MarkedSpace.h:
(JSC::MarkedSpace::blocksWithNewObjects): Expose the list of MarkedBlocks with new objects.

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

4 years agoFix warning about loading insecure content from secure webkit.org/blog
commit-queue@webkit.org [Tue, 10 Mar 2015 22:39:40 +0000 (22:39 +0000)]
Fix warning about loading insecure content from secure webkit.org/blog
https://bugs.webkit.org/show_bug.cgi?id=142545

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-10
Reviewed by Mark Rowe.

* blog/wp-content/themes/webkit/footer.php:
Use an "https" URL for the subresource, instead of "http".

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

4 years agoUse unsigned for HashSet size.
commit-queue@webkit.org [Tue, 10 Mar 2015 21:54:21 +0000 (21:54 +0000)]
Use unsigned for HashSet size.
https://bugs.webkit.org/show_bug.cgi?id=142518

Patch by Alex Christensen <achristensen@webkit.org> on 2015-03-10
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* dfg/DFGAvailabilityMap.cpp:
(JSC::DFG::AvailabilityMap::prune):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* heap/MarkedBlockSet.h:
(JSC::MarkedBlockSet::remove):
* runtime/WeakMapData.h:

Source/WebCore:

* Modules/websockets/WebSocketDeflateFramer.cpp:
(WebCore::WebSocketExtensionDeflateFrame::processResponse):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::checkForDuplicate):
(WebCore::CloneSerializer::writeConstantPoolIndex):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner):
* loader/ResourceLoadScheduler.h:
* platform/graphics/Font.cpp:
(WebCore::Font::systemFallbackFontForCharacter):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontDataIfNeeded):
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/FontCache.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getSystemFontFallbackForCharacters):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::similarFont):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::shouldAutoActivateFontIfNeeded):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::similarFont):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::FlexBoxIterator::next):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::computeOverflowFromCells):

Source/WTF:

* wtf/HashCountedSet.h:
(WTF::Traits>::size):
(WTF::Traits>::capacity):
* wtf/HashMap.h:
(WTF::X>::size):
(WTF::X>::capacity):
* wtf/HashSet.h:
(WTF::V>::size):
(WTF::V>::capacity):
* wtf/HashTable.h:
(WTF::HashTable::Stats::recordCollisionAtCount):
(WTF::HashTable::Stats::dumpStats):
(WTF::HashTable::size):
(WTF::HashTable::capacity):
(WTF::KeyTraits>::deallocateTable):
(WTF::KeyTraits>::checkTableConsistencyExceptSize):
* wtf/HashTraits.h:
* wtf/ListHashSet.h:
(WTF::U>::size):
(WTF::U>::capacity):

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::testInitialCapacity):
* TestWebKitAPI/Tests/WTF/ListHashSet.cpp:
(TestWebKitAPI::TEST):

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

4 years ago[Mac] Refactor media controls code
eric.carlson@apple.com [Tue, 10 Mar 2015 21:26:36 +0000 (21:26 +0000)]
[Mac] Refactor media controls code
https://bugs.webkit.org/show_bug.cgi?id=142455

Reviewed by Dean Jackson.

Source/WebCore:

No new tests, updated tests/media/hls/video-controls-live-stream-expected.txt.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller):
(Controller.prototype.addVideoListeners):
(Controller.prototype.removeVideoListeners):
(Controller.prototype.createControls):
(Controller.prototype.setControlsType):
(Controller.prototype.configureInlineControls):
(Controller.prototype.updateStatusDisplay):
(Controller.prototype.handlePanelMouseDown):
(Controller.prototype.showControls):
(Controller.prototype.hideControls):
(Controller.prototype.handleOptimizedFullscreenButtonClicked):
(Controller.prototype.currentPlaybackTargetIsWireless):
(Controller.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent):
(Controller.prototype.updateWirelessPlaybackStatus):
(Controller.prototype.updateWirelessTargetAvailable):
(Controller.prototype.handleWirelessPickerButtonClicked):
(Controller.prototype.handleWirelessPlaybackChange):
(Controller.prototype.handleWirelessTargetAvailableChange):
(Controller.prototype.setShouldListenForPlaybackTargetAvailabilityEvent):
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS):
(ControllerIOS.prototype.addVideoListeners):
(ControllerIOS.prototype.removeVideoListeners):
(ControllerIOS.prototype.createControls):
(ControllerIOS.prototype.setControlsType):
(ControllerIOS.prototype.configureInlineControls):
(ControllerIOS.prototype.showControls):
(ControllerIOS.prototype.handleWirelessPickerButtonTouchEnd):
(ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent):
(ControllerIOS.prototype.updateStatusDisplay):
(ControllerIOS.prototype.setShouldListenForPlaybackTargetAvailabilityEvent):
(ControllerIOS.prototype.currentPlaybackTargetIsWireless): Deleted.
(ControllerIOS.prototype.updateWirelessPlaybackStatus): Deleted.
(ControllerIOS.prototype.updateWirelessTargetAvailable): Deleted.
(ControllerIOS.prototype.hideControls): Deleted.
(ControllerIOS.prototype.handleWirelessPlaybackChange): Deleted.
(ControllerIOS.prototype.handleWirelessTargetAvailableChange): Deleted.

LayoutTests:

* platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt:

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

4 years ago[iOS] Add WebKitSystemInterface for iOS 8.2
dbates@webkit.org [Tue, 10 Mar 2015 21:17:39 +0000 (21:17 +0000)]
[iOS] Add WebKitSystemInterface for iOS 8.2
https://bugs.webkit.org/show_bug.cgi?id=142505

Rubber-stamped by Anders Carlsson.

Make copy-webkitlibraries-to-product-directory install libWebKitSystemInterfaceIOS{Device, Simulator}8.2.a.
I inadvertently forgot to add libWebKitSystemInterfaceIOS{Device, Simulator}8.2.a to script
copy-webkitlibraries-to-product-directory in r181286.

* Scripts/copy-webkitlibraries-to-product-directory:

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

4 years agoRemove PassRefPtr from svg/properties classes.
commit-queue@webkit.org [Tue, 10 Mar 2015 20:39:50 +0000 (20:39 +0000)]
Remove PassRefPtr from svg/properties classes.
https://bugs.webkit.org/show_bug.cgi?id=142063.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-03-10
Reviewed by Darin Adler.
Source/WebCore:

Remove PassRefPtr from svg/properties classes. All the return types and
the local variables should be RefPtr. If we are sure the pointer can't
be null, we use Ref instead.

* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
(WebCore::SVGMarkerElement::orientTypeAnimated):
* svg/SVGMarkerElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::lookupOrCreateDWrapper):
(WebCore::SVGPathElement::pathSegList):
(WebCore::SVGPathElement::animatedPathSegList):
* svg/SVGPathElement.h:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
(WebCore::SVGPolyElement::points):
(WebCore::SVGPolyElement::animatedPoints):
* svg/SVGPolyElement.h:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
(WebCore::SVGTextContentElement::textLengthAnimated):
* svg/SVGTextContentElement.h:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::transform):
(WebCore::SVGViewSpec::viewBoxAnimated):
(WebCore::SVGViewSpec::preserveAspectRatioAnimated):
(WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper):
(WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
* svg/SVGViewSpec.h:
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
(WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::create):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
(WebCore::SVGAnimatedPathSegListPropertyTearOff::create):
* svg/properties/SVGAnimatedProperty.h:
(WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
* svg/properties/SVGAnimatedPropertyMacros.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
(WebCore::SVGAnimatedPropertyTearOff::create):
* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(WebCore::SVGAnimatedStaticPropertyTearOff::create):
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
(WebCore::SVGAnimatedTransformListPropertyTearOff::create):
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::create):
(WebCore::SVGListPropertyTearOff::initialize):
(WebCore::SVGListPropertyTearOff::getItem):
(WebCore::SVGListPropertyTearOff::insertItemBefore):
(WebCore::SVGListPropertyTearOff::replaceItem):
(WebCore::SVGListPropertyTearOff::removeItem):
(WebCore::SVGListPropertyTearOff::appendItem):
* svg/properties/SVGPathSegListPropertyTearOff.cpp:
(WebCore::SVGPathSegListPropertyTearOff::getItem):
(WebCore::SVGPathSegListPropertyTearOff::replaceItem):
(WebCore::SVGPathSegListPropertyTearOff::removeItem):
* svg/properties/SVGPathSegListPropertyTearOff.h:
(WebCore::SVGPathSegListPropertyTearOff::create):
(WebCore::SVGPathSegListPropertyTearOff::initialize):
(WebCore::SVGPathSegListPropertyTearOff::insertItemBefore):
(WebCore::SVGPathSegListPropertyTearOff::appendItem):
* svg/properties/SVGPropertyInfo.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
(WebCore::SVGStaticListPropertyTearOff::create):
* svg/properties/SVGStaticPropertyTearOff.h:
(WebCore::SVGStaticPropertyTearOff::create):
* svg/properties/SVGTransformListPropertyTearOff.h:
(WebCore::SVGTransformListPropertyTearOff::create):
(WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
(WebCore::SVGTransformListPropertyTearOff::consolidate):

Source/WTF:

* wtf/Ref.h:
(WTF::static_reference_cast): Add a stat_cast function to Ref<>.

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

4 years agoUse std::numeric_limits<unsigned>::max() instead of (unsigned)-1.
mark.lam@apple.com [Tue, 10 Mar 2015 20:18:24 +0000 (20:18 +0000)]
Use std::numeric_limits<unsigned>::max() instead of (unsigned)-1.
<https://webkit.org/b/142539>

Reviewed by Benjamin Poulain.

* jit/JIT.cpp:
(JSC::JIT::JIT):
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::privateCompile):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITInlines.h:
(JSC::JIT::emitNakedCall):
(JSC::JIT::addSlowCase):
(JSC::JIT::addJump):
(JSC::JIT::emitJumpSlowToHot):
(JSC::JIT::emitGetVirtualRegister):
* jit/SlowPathCall.h:
(JSC::JITSlowPathCall::call):
* yarr/Yarr.h:

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

4 years agoFix the build
timothy_horton@apple.com [Tue, 10 Mar 2015 20:11:37 +0000 (20:11 +0000)]
Fix the build

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):

* History/WebHistory.mm:
(-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):

* Shared/Downloads/ios/DownloadIOS.mm:
(WebKit::Download::startWithHandle):
* UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
(-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):

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

4 years agoExtend URL filter's Term definition to support groups/subpatterns
benjamin@webkit.org [Tue, 10 Mar 2015 20:09:26 +0000 (20:09 +0000)]
Extend URL filter's Term definition to support groups/subpatterns
https://bugs.webkit.org/show_bug.cgi?id=142519

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-10
Reviewed by Alex Christensen.

Source/WebCore:

Pretty simple extension: Term is extended to support holding
a Vector of Term. The quantifier of the Term applies to its
Vector of term as a whole.

To avoid exposing too much internal in the API of Term, I moved
graph generation from GraphBuilder to Term.

Sinking a CharacterSet works as usual. Sinking a Group is done
by sinking each of its Terms one by one and then apply the quantifier
on the whole subgraph. This is done by recursively calling into
Term::generateGraph().

Since groups could be nested, the groups make a stack with the latest
open group on top.
When sinking a floating Term, it is sunk to the latest open group. If there is no open
group, we use the prefix tree and sink the whole subpattern to the graph.

* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::Term::Term):
(WebCore::ContentExtensions::Term::extendGroupSubpattern):
(WebCore::ContentExtensions::Term::generateGraph):
(WebCore::ContentExtensions::Term::operator==):
(WebCore::ContentExtensions::Term::hash):
(WebCore::ContentExtensions::Term::isUniversalTransition):
(WebCore::ContentExtensions::Term::generateSubgraphForAtom):
(WebCore::ContentExtensions::Term::destroy):
(WebCore::ContentExtensions::Term::Group::operator==):
(WebCore::ContentExtensions::Term::Group::hash):
(WebCore::ContentExtensions::GraphBuilder::finalize):
(WebCore::ContentExtensions::GraphBuilder::atomParenthesesSubpatternBegin):
(WebCore::ContentExtensions::GraphBuilder::atomParenthesesEnd):
(WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
(WebCore::ContentExtensions::Term::quantifier): Deleted.
(WebCore::ContentExtensions::Term::visitSimpleTransitions): Deleted.
(WebCore::ContentExtensions::GraphBuilder::addTransitions): Deleted.
(WebCore::ContentExtensions::GraphBuilder::sinkFloatingTerm): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::testURL):

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

4 years agoFix the Mac build with a newer compiler
timothy_horton@apple.com [Tue, 10 Mar 2015 19:36:28 +0000 (19:36 +0000)]
Fix the Mac build with a newer compiler

* Plugins/WebPluginController.mm:
(WebKit_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_):
(WebKit_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_):

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

4 years ago[Win] JSC Build Warnings Need to be Resolved.
mark.lam@apple.com [Tue, 10 Mar 2015 19:29:13 +0000 (19:29 +0000)]
[Win] JSC Build Warnings Need to be Resolved.
<https://webkit.org/b/142366>

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

Applied some benign changes to make the MSVC compiler happy.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::fillJSValue):
* runtime/BasicBlockLocation.cpp:
(JSC::BasicBlockLocation::getExecutedRanges):
* runtime/ControlFlowProfiler.cpp:
(JSC::ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted):

Source/WTF:

* wtf/Compiler.h:
- MSVC also does not have the CONSIDERS_UNREACHABLE_CODE quirk.

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

4 years agoUpgrade Map, Set and WeakMap constructor interface
utatane.tea@gmail.com [Tue, 10 Mar 2015 19:13:48 +0000 (19:13 +0000)]
Upgrade Map, Set and WeakMap constructor interface
https://bugs.webkit.org/show_bug.cgi?id=142348

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

In the latest ES6 spec, Map and Set constructors take initialization data sets
as iterable value. And iterate it and add the values into the constructed one.

This is breaking change because the old constructor interface is
already shipped in Safari 8.

* runtime/MapConstructor.cpp:
(JSC::callMap):
(JSC::constructMap):
(JSC::MapConstructor::getCallData):
* runtime/SetConstructor.cpp:
(JSC::callSet):
(JSC::constructSet):
* runtime/WeakMapConstructor.cpp:
(JSC::callWeakMap):
(JSC::constructWeakMap):
(JSC::WeakMapConstructor::getCallData):
* tests/stress/map-constructor-adder.js: Added.
* tests/stress/map-constructor.js: Added.
(testCallTypeError):
(testTypeError):
(for):
* tests/stress/set-constructor-adder.js: Added.
(Set.prototype.add):
* tests/stress/set-constructor.js: Added.
(for):
* tests/stress/weak-map-constructor-adder.js: Added.
* tests/stress/weak-map-constructor.js: Added.
(testCallTypeError):
(testTypeError):
(for):

LayoutTests:

Constructor semantics is changed.

* js/basic-map-expected.txt:
* js/basic-set-expected.txt:
* js/dom/basic-weakmap-expected.txt:
* js/script-tests/basic-map.js:
* js/script-tests/basic-set.js:
(set new):

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

4 years agoAdjustments to media control fonts.
roger_fong@apple.com [Tue, 10 Mar 2015 19:04:54 +0000 (19:04 +0000)]
Adjustments to media control fonts.
https://bugs.webkit.org/show_bug.cgi?id=142509.
<rdar://problem/20085228>
Reviewed by Darin Adler.
Use system font for controls. Adjust surrounding divs accordingly.
Apply subpixel antialiasing to all media control text.
* Modules/mediacontrols/mediaControlsApple.css:
(::-webkit-media-controls):
(audio::-webkit-media-controls-closed-captions-container .list):
(audio::-webkit-media-controls-status-display):
(audio::-webkit-media-controls-time-remaining-display):
(audio::-webkit-media-controls-current-time-display):
(audio::-webkit-media-controls-time-remaining-display.five-digit-time):
(audio::-webkit-media-controls-current-time-display.five-digit-time):
(audio::-webkit-media-controls-time-remaining-display.six-digit-time):
(audio::-webkit-media-controls-current-time-display.six-digit-time):

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

4 years agoWeb Inspector: Destructuring function parameters should show type information
saambarati1@gmail.com [Tue, 10 Mar 2015 18:47:04 +0000 (18:47 +0000)]
Web Inspector: Destructuring function parameters should show type information
https://bugs.webkit.org/show_bug.cgi?id=142233

Reviewed by Joseph Pecoraro.

JSC supports a function's formal parameter being a destructuring pattern,
and so should the type profiler in the Inspector. This was just an oversight
not to have this in bug 141215.

This patch also does a bit of refactoring to not have duplicate code
that traverses AST nodes in TypeTokenAnnotator and ScriptSyntaxTree.
Before, both of these classes were responsible for traversing the AST
in an identical way, this is bad. Now, ScriptSyntaxTree contains the
canonical implementation of how the AST should be traversed and which
AST nodes should be collected for type profiling. ScriptSyntaxTree will
pass this information back to TypeTokenAnnotator.

* UserInterface/Controllers/TypeTokenAnnotator.js:
(WebInspector.TypeTokenAnnotator.prototype._insertTypeToken):
(WebInspector.TypeTokenAnnotator.prototype._insertTypeTokensForEachNode): Deleted.
* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype.):
(WebInspector.ScriptSyntaxTree.prototype.updateTypes):
(WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
(WebInspector.ScriptSyntaxTree.prototype.gatherIdentifiersInVariableDeclaration): Deleted.

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

4 years agoToo large plugins are crashing.
rgabor@webkit.org [Tue, 10 Mar 2015 18:17:18 +0000 (18:17 +0000)]
Too large plugins are crashing.
https://bugs.webkit.org/show_bug.cgi?id=139856

Reviewed by Darin Adler.

Add layout test to cover this crash.

* plugins/large-plugin-crash-expected.txt: Added.
* plugins/large-plugin-crash.html: Added.

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

4 years agobmalloc: tryFastMalloc shouldn't crash
ggaren@apple.com [Tue, 10 Mar 2015 18:00:59 +0000 (18:00 +0000)]
bmalloc: tryFastMalloc shouldn't crash
https://bugs.webkit.org/show_bug.cgi?id=142443

Reviewed by Sam Weinig.

Rolling back in r181307 with a check for whether bmalloc is enabled, to
avoid crashes when running with ASan and GuardMalloc.

Source/bmalloc:

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate):
* bmalloc/Allocator.h:
* bmalloc/Cache.cpp:
(bmalloc::Cache::tryAllocateSlowCaseNullCache):
* bmalloc/Cache.h:
(bmalloc::Cache::tryAllocate):
* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateXLarge):
(bmalloc::Heap::tryAllocateXLarge):
* bmalloc/Heap.h:
* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate):
(bmalloc::vmAllocate):
* bmalloc/bmalloc.h:
(bmalloc::api::tryMalloc):
(bmalloc::api::realloc):
(bmalloc::api::free):

Source/WTF:

* wtf/FastMalloc.cpp:
(WTF::fastMalloc):
(WTF::fastRealloc):
(WTF::fastAlignedMalloc):
(WTF::tryFastMalloc):
(WTF::tryFastRealloc): Deleted.
* wtf/FastMalloc.h:

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

4 years agoFixed a crash in CertificateInfo::containsNonRootSHA1SignedCertificate when loading...
mitz@apple.com [Tue, 10 Mar 2015 17:55:21 +0000 (17:55 +0000)]
Fixed a crash in CertificateInfo::containsNonRootSHA1SignedCertificate when loading a non-HTTPS webapge.

Reviewed by Anders Carlsson.

* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Null-check the certificate chain.

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

4 years agoFixed the build.
mitz@apple.com [Tue, 10 Mar 2015 16:31:49 +0000 (16:31 +0000)]
Fixed the build.

* platform/spi/cocoa/SecuritySPI.h:

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

4 years agoGCC: CRASH() should be annotated with NORETURN
commit-queue@webkit.org [Tue, 10 Mar 2015 16:01:51 +0000 (16:01 +0000)]
GCC: CRASH() should be annotated with NORETURN
https://bugs.webkit.org/show_bug.cgi?id=142524

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-03-10
Reviewed by Anders Carlsson.

Source/JavaScriptCore:

Don't return from a NORETURN function. This used to avoid a warning from GCC, but now it
causes one.

* jsc.cpp:

Source/WTF:

Add COMPILER(GCC) to #ifdefs that already exist for Clang.

* wtf/Assertions.cpp:
* wtf/Assertions.h:

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

4 years agoSimple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextF...
zalan@apple.com [Tue, 10 Mar 2015 15:16:24 +0000 (15:16 +0000)]
Simple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextFragmentIterator::findNextNonWhitespacePosition().
https://bugs.webkit.org/show_bug.cgi?id=142344

Reviewed by Antti Koivisto.

This patch merges findNextBreakablePosition() and findNextNonWhitespacePosition() so that
the segment looping and position handling logic are no longer duplicated. It also unifies
the static next*() functions' signature.

No change in functionality.

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
(WebCore::SimpleLineLayout::nextBreakablePosition):
(WebCore::SimpleLineLayout::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition): Deleted.
(WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
(WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition): Deleted.
* rendering/SimpleLineLayoutTextFragmentIterator.h:

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

4 years ago[GTK] Contents not shown when entering AC mode unless the window is resized
carlosgc@webkit.org [Tue, 10 Mar 2015 13:38:31 +0000 (13:38 +0000)]
[GTK] Contents not shown when entering AC mode unless the window is resized
https://bugs.webkit.org/show_bug.cgi?id=142347

Reviewed by Žan Doberšek.

The problem is once again that we are now creating the redirected
X window in realize method. When entering AC mode we resize the
redirected window to the drawing area size. Since the size hasn't
changed from the drawing area point of view, the web process is
not notified. The WebProcess always uses the window size, instead
of the root layer size, to make sure it's in sync, see the comment
in LayerTreeHostGtk::compositeLayersToContext(). So, we need to
enforce a resize when we change the size of the redirected window
when entering AC mode.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseEnterAcceleratedCompositingMode):
* UIProcess/DrawingAreaProxyImpl.h:
(WebKit::DrawingAreaProxyImpl::forceResize):

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

4 years ago[GTK] GL_MAX_VARYING_FLOATS is not defined in OpenGL ES 2
carlosgc@webkit.org [Tue, 10 Mar 2015 13:26:35 +0000 (13:26 +0000)]
[GTK] GL_MAX_VARYING_FLOATS is not defined in OpenGL ES 2
https://bugs.webkit.org/show_bug.cgi?id=142529

Reviewed by Žan Doberšek.

Do not use GL_MAX_VARYING_FLOATS when platform is GTK+ and using
OpenGL ES 2.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking):

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

4 years agoUnreviewed. Fix GTK+ build with OpenGL ES 2 enabled.
carlosgc@webkit.org [Tue, 10 Mar 2015 13:23:40 +0000 (13:23 +0000)]
Unreviewed. Fix GTK+ build with OpenGL ES 2 enabled.

Remove USE(OPENGL) ifdef from GLContext.cpp, since there's nothing
specific to OpenGL in that file, and everything depending on
configure options is already protected by USE(GLX) and USE(EGL)
ifdefs. This is causing linking issues when building with OpenGL
ES 2, because the header doesn't have the ifdef, and the cpp file
is not compiled leaving all the interface undefined.

Patch by José Dapena Paz <jdapena@igalia.com> on 2015-03-10
Rubber-stamped by Carlos Garcia Campos.

* platform/graphics/GLContext.cpp:

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

4 years ago[GTK] Add a configure option to build with OpenGL ES 2
carlosgc@webkit.org [Tue, 10 Mar 2015 13:19:35 +0000 (13:19 +0000)]
[GTK] Add a configure option to build with OpenGL ES 2
https://bugs.webkit.org/show_bug.cgi?id=142498

Patch by Carlos Garcia Campos  <cgarcia@igalia.com> and José Dapena Paz <jdapena@igalia.com> on 2015-03-10
Reviewed by Martin Robinson.

.:

Add ENABLE_GLES2 option. It's disabled by default, but if passed
GLES2 is required and OpenGL is not even searched. Otherwise we
search for OpenGL as usual, using it only if present.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Build GLES or GL specific files depending on the build options.

* PlatformGTK.cmake:

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

4 years agoShrink the CSSPropertyID enum type
zandobersek@gmail.com [Tue, 10 Mar 2015 09:21:20 +0000 (09:21 +0000)]
Shrink the CSSPropertyID enum type
https://bugs.webkit.org/show_bug.cgi?id=142456

Reviewed by Sam Weinig.

Specify uint16_t as the base type for the CSSPropertyID enum.
This is enough to cover all of the CSS properties (429 at this moment,
with static_assert covering future changes). It halves the enum type size,
from 4 bytes to 2, reducing the size of various CSSPropertyID containers.

No new tests -- no change in behavior.

* css/CSSPrimitiveValue.cpp:
(WebCore::propertyName): Remove the unnecessary propertyID < 0 check.
* css/makeprop.pl:

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

4 years agoGardening: fix bleeding debug test bots.
mark.lam@apple.com [Tue, 10 Mar 2015 08:47:24 +0000 (08:47 +0000)]
Gardening: fix bleeding debug test bots.
https://webkit.org/b/142513>

Not reviewed.

The test needs to initialize WTF threading explicitly before using it.

* API/tests/CompareAndSwapTest.cpp:
(testCompareAndSwap):

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

4 years ago[cmake] Handle unused parameter warnings as build errors except in WebKit2
ossy@webkit.org [Tue, 10 Mar 2015 08:33:30 +0000 (08:33 +0000)]
[cmake] Handle unused parameter warnings as build errors except in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=142338

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/WebKitHelpers.cmake:

Source/WebKit2:

* CMakeLists.txt:

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

4 years agoSource/WebCore:
mitz@apple.com [Tue, 10 Mar 2015 07:34:06 +0000 (07:34 +0000)]
Source/WebCore:
WebCore part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
https://bugs.webkit.org/show_bug.cgi?id=142461

Reviewed by Sam Weinig.

* WebCore.xcodeproj/project.pbxproj: Added reference to SecuritySPI.h and sorted the
spi/cocoa group.

* platform/network/cf/CertificateInfo.h: Declared new member function
containsNonRootSHA1SignedCertificate.

* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Added. Checks if any but
the last certificate in the chain uses SHA-1 as its signature hash algorithm.

* platform/network/curl/CertificateInfo.h:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Added notImplemented
implementation.

* platform/network/soup/CertificateInfo.h:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Ditto.

* platform/spi/cocoa/SecuritySPI.h: Added.

Source/WebKit2:
WebKit2 part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
https://bugs.webkit.org/show_bug.cgi?id=142461

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]): Initialize
webPageConfiguration.treatsSHA1SignedCertificatesAsInsecure from the WKWebViewConfiguration.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
Added _treatsSHA1SignedCertificatesAsInsecure ivar.
(-[WKWebViewConfiguration copyWithZone:]): Copy _treatsSHA1SignedCertificatesAsInsecure.
(-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Added this getter.
(-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Added this setter.

* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared new
_treatsSHA1SignedCertificatesAsInsecure property.

* UIProcess/PageLoadState.cpp:
(WebKit::PageLoadState::didCommitLoad): Use new hasInsecureContent parameter to initialize
hasInsecureContent parameter in the uncommitted state.
* UIProcess/PageLoadState.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Initialize new m_treatsSHA1CertificatesAsInsecure
member variable from the WebPageConfiguration.
(WebKit::WebPageProxy::didCommitLoadForFrame): Pass true for the new hasInsecureContent to
PageLoadState::didCommitLoad if we are treating SHA1-signed certificates as insecure and
the certificate info contains a non-root SHA1-signed certificate.
* UIProcess/WebPageProxy.h: Added m_treatsSHA1CertificatesAsInsecure member variable.

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

4 years ago[WinCairo] Unreviewed build fix.
achristensen@apple.com [Tue, 10 Mar 2015 07:15:52 +0000 (07:15 +0000)]
[WinCairo] Unreviewed build fix.

* JavaScriptCore.vcxproj/testapi/testapiCommonCFLite.props:
Added directory containing config.h, like r181304.

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

4 years agoYet another build fix for Windows.
mark.lam@apple.com [Tue, 10 Mar 2015 06:56:28 +0000 (06:56 +0000)]
Yet another build fix for Windows.
https://webkit.org/b/142513>

Reviewed by Alex Christensen.

Looks like MSVC requires the function be explicitly declared in a header file
in order for it to be linkable from another file in the same project.  This is
strange, but it seems to make MSVC happy.

Also fixed a typo in testapi.vcxproj.filters.

* API/tests/CompareAndSwapTest.cpp:
* API/tests/CompareAndSwapTest.h: Added.
* API/tests/testapi.c:
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:

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

4 years agoSkip contentfiltering/block-after-add-data.html for now.
ap@apple.com [Tue, 10 Mar 2015 06:54:27 +0000 (06:54 +0000)]
Skip contentfiltering/block-after-add-data.html for now.
https://bugs.webkit.org/show_bug.cgi?id=142526

* TestExpectations:

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

4 years agoUnreviewed, rolling out r181307.
commit-queue@webkit.org [Tue, 10 Mar 2015 06:50:17 +0000 (06:50 +0000)]
Unreviewed, rolling out r181307.
https://bugs.webkit.org/show_bug.cgi?id=142525

Broke ASan tests (Requested by ap on #webkit).

Reverted changeset:

"bmalloc: tryFastMalloc shouldn't crash"
https://bugs.webkit.org/show_bug.cgi?id=142443
http://trac.webkit.org/changeset/181307

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

4 years ago[iOS] Sweep all collected objects on critical memory pressure
cdumez@apple.com [Tue, 10 Mar 2015 05:32:49 +0000 (05:32 +0000)]
[iOS] Sweep all collected objects on critical memory pressure
https://bugs.webkit.org/show_bug.cgi?id=142457
<rdar://problem/20044440>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

All fullSweep() API to IncrementalSweeper so that we can call it in the
memory pressure handler.

* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::fullSweep):
* heap/IncrementalSweeper.h:
(JSC::IncrementalSweeper::hasWork):

Source/WebCore:

Do a full sweep of objects marked for destruction on critical memory
pressure to free up memory.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):

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

4 years agoAnother build fix for Windows.
mark.lam@apple.com [Tue, 10 Mar 2015 04:41:29 +0000 (04:41 +0000)]
Another build fix for Windows.
https://webkit.org/b/142513>

Not reviewed.

* API/tests/CompareAndSwapTest.cpp:
- Added JS_EXPORT_PRIVATE attribute.

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

4 years agoBuild fix for Windows after r181305.
mark.lam@apple.com [Tue, 10 Mar 2015 04:21:42 +0000 (04:21 +0000)]
Build fix for Windows after r181305.
https://webkit.org/b/142513>

Reviewed by Alex Christensen.

Windows doesn't like pthreads anymore.  Changed test to use WTF threading.

* API/tests/CompareAndSwapTest.cpp:
(setBitThreadFunc):
(testCompareAndSwap):

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

4 years agobmalloc: tryFastMalloc shouldn't crash
ggaren@apple.com [Tue, 10 Mar 2015 04:10:15 +0000 (04:10 +0000)]
bmalloc: tryFastMalloc shouldn't crash
https://bugs.webkit.org/show_bug.cgi?id=142443

Reviewed by Darin Adler.

Source/bmalloc:

Added support for tryMalloc.

We assume that non-x-large allocations always succeed, and we crash
otherwise, since normal allocation failure will just cause the next
non-try allocation or internal metadata allocation to fail, and it's
hard and not really useful to keep limping along after that. But
extra-large allocations can meaningfully fail, and we can recover.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateXLarge):
(bmalloc::Heap::tryAllocateXLarge):
* bmalloc/Heap.h: Added support for non-crashy x-large allocation.

* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate):
(bmalloc::vmAllocate): Added support for non-crashy VM allocation.

* bmalloc/bmalloc.h:
(bmalloc::api::tryMalloc):
(bmalloc::api::realloc):
(bmalloc::api::free): Tried to clarify our behavior with some comments.
Unfortunately, calling what we do "malloc" is still not quite right, since
malloc returns null on failure and we don't.

Source/WTF:

* wtf/FastMalloc.cpp:
(WTF::fastMalloc):
(WTF::fastRealloc):
(WTF::fastAlignedMalloc): Don't check for null. bmalloc automatically
crashes on allocation failure, and we'd rather not pay for an extra check.

(WTF::tryFastMalloc): Added an opt-out API to return null rather than
crashing, since some clients need this.

(WTF::tryFastRealloc): Deleted. Unused.

* wtf/FastMalloc.h:

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

4 years agoWeb Inspector: Inline Error / Warning message for Issues
joepeck@webkit.org [Tue, 10 Mar 2015 03:01:01 +0000 (03:01 +0000)]
Web Inspector: Inline Error / Warning message for Issues
https://bugs.webkit.org/show_bug.cgi?id=142520

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and new files.

* UserInterface/Controllers/IssueManager.js:
(WebInspector.IssueManager.prototype.issueWasAdded):
* UserInterface/Models/IssueMessage.js:
(WebInspector.IssueMessage):
(WebInspector.IssueMessage.prototype.get columnNumber):
* UserInterface/Protocol/ConsoleObserver.js:
(WebInspector.ConsoleObserver.prototype.messageAdded):
Correctly pass the column number into IssueMessage.

* UserInterface/Models/LineWidget.js:
(WebInspector.LineWidget):
(WebInspector.LineWidget.prototype.get codeMirrorLineWidget):
(WebInspector.LineWidget.prototype.get widgetElement):
Create a new Model class for a LineWidget. The root element
should never change, but its children can be updated.

* UserInterface/Views/SourceCodeTextEditor.css:
(.source-code.text-editor .CodeMirror-linewidget):
Override styles so that widgets can overlap line content.

(.source-code.text-editor > .CodeMirror .issue-widget):
(.source-code.text-editor > .CodeMirror .issue-widget.inline):
Float issue widgets to the right side of the editor.

(.source-code.text-editor > .CodeMirror .issue-widget > .arrow):
(.source-code.text-editor > .CodeMirror .issue-widget.inline > .arrow):
Pure CSS arrow for widgets on the same line as their issue.

(.source-code.text-editor > .CodeMirror .issue-widget > .icon):
(.source-code.text-editor > .CodeMirror .issue-widget > .icon.icon-warning):
(.source-code.text-editor > .CodeMirror .issue-widget > .icon.icon-error):
Issue icon styles for the different issue types.

(.source-code.text-editor > .CodeMirror .issue-widget.warning):
(.source-code.text-editor > .CodeMirror .issue-widget.inline.warning):
(.source-code.text-editor > .CodeMirror .issue-widget.inline.warning > .arrow):
(.source-code.text-editor > .CodeMirror .issue-widget.error):
(.source-code.text-editor > .CodeMirror .issue-widget.inline.error):
(.source-code.text-editor > .CodeMirror .issue-widget.inline.error > .arrow):
Different colors for the different issue types.

(.source-code.text-editor > .CodeMirror .issue-widget > .text):
(.source-code.text-editor > .CodeMirror .issue-widget.inline > .text):
Text positioning when on the same line or when expanded.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._addIssue):
(WebInspector.SourceCodeTextEditor.prototype._iconClassNameForIssueLevel):
(WebInspector.SourceCodeTextEditor.prototype._updateIssueWidgetForIssues):
(WebInspector.SourceCodeTextEditor.prototype._isWidgetToggleable):
(WebInspector.SourceCodeTextEditor.prototype._handleWidgetClick):
Create widgets for issues.

(WebInspector.SourceCodeTextEditor.prototype._contentDidPopulate):
(WebInspector.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
(WebInspector.SourceCodeTextEditor.prototype._clearWidgets):
(WebInspector.SourceCodeTextEditor.prototype._reinsertAllIssues):
Update all widgets in certain cases.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.addStyleClassToLine):
This assertion is known to happen for issues added to an editor
before the content has loaded.

(WebInspector.TextEditor.prototype.createWidgetForLine):
Create a widget for a line.

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

4 years ago8-bit version of weakCompareAndSwap() can cause an infinite loop.
mark.lam@apple.com [Tue, 10 Mar 2015 02:18:24 +0000 (02:18 +0000)]
8-bit version of weakCompareAndSwap() can cause an infinite loop.
https://webkit.org/b/142513>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Added a test that exercises the 8-bit CAS from multiple threads.  The threads
will contend to set bits in a large array of bytes using the CAS function.

* API/tests/CompareAndSwapTest.cpp: Added.
(Bitmap::Bitmap):
(Bitmap::numBits):
(Bitmap::clearAll):
(Bitmap::concurrentTestAndSet):
(setBitThreadFunc):
(testCompareAndSwap):
* API/tests/testapi.c:
(main):
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WTF:

Presently, Bitmap::concurrentTestAndSet() uses the 8-bit version of
weakCompareAndSwap() (which compares and swaps an uint8_t value).
Bitmap::concurrentTestAndSet() has a loop that checks if a bit in the
byte of interest has been set.  If not, it will call the 8-bit CAS
function to set the bit.

Under the covers, for ARM, the 8-bit CAS function actually works with a
32-bit CAS.  The 8-bit CAS will first fetch the 32-bit value in memory
that should contain the 8-bit value, and check if it contains the
expected byte.  If the value in memory doesn't have the expected byte,
it will return early to its caller.  The expectation is that the caller
will reload the byte from memory and call the 8-bit CAS again.

Unfortunately, this code path that returns early does not have a
compiler fence.  Without a compiler fence, the C++ compiler can
optimize away the reloading of the expected byte value, leaving it
unchanged.  As a result, we'll have a infinite loop here that checks a
value that will never change, and the loop will not terminate until the
value changes.

The fix is to eliminate the early return check in the 8-bit CAS, and
have it always call down to the 32-bit CAS.  The 32-bit CAS has a
compiler fence which will prevent this issue.

* wtf/Atomics.h:
(WTF::weakCompareAndSwap):

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

4 years ago[Win] testapi project is unable to find the 'config.h' file.
bfulgham@apple.com [Tue, 10 Mar 2015 02:00:19 +0000 (02:00 +0000)]
[Win] testapi project is unable to find the 'config.h' file.

Rubberstamped by Mark Lam.

* JavaScriptCore.vcxproj/testapi/testapiCommon.props: Add JavaScriptCore source directory
to the include path.

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

4 years ago[Win] Rebaseline tests afer r181292.
bfulgham@apple.com [Tue, 10 Mar 2015 01:51:58 +0000 (01:51 +0000)]
[Win] Rebaseline tests afer r181292.

* platform/win/TestExpectations:
* platform/win/fast/forms/search-vertical-alignment-expected.txt:
* platform/win/fast/forms/textfield-overflow-by-value-update-expected.txt:

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

4 years ago[Content Filtering] Give ContentFilter subclasses private constructors, and make...
aestes@apple.com [Tue, 10 Mar 2015 01:38:49 +0000 (01:38 +0000)]
[Content Filtering] Give ContentFilter subclasses private constructors, and make them fast-allocated and non-copyable
https://bugs.webkit.org/show_bug.cgi?id=142515

Reviewed by Andreas Kling.

* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/ParentalControlsContentFilter.h:
* testing/MockContentFilter.h:

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

4 years ago[CG] Have Canvas use the IOSurfacePool
cdumez@apple.com [Tue, 10 Mar 2015 01:24:14 +0000 (01:24 +0000)]
[CG] Have Canvas use the IOSurfacePool
https://bugs.webkit.org/show_bug.cgi?id=142417
<rdar://problem/20044440>

Reviewed by Darin Adler.

PerformanceTests:

Lower the number of different canvas sizes from 1000 to 100 so that
the test does not require such a huge cache size. With 100, we now
get over 90% cache hit rate with the default IOSurfacePool size.

* Canvas/reuse.html:

Source/WebCore:

Have ImageBufferDataCG use the IOSurfacePool so that Canvas can
benefit from it. I see a ~75% progression on Canvas/reuse.html
performance test on my Macbook Pro with 1000 different canvas
sizes and ~110% progression with 100 different canvas sizes.

I also see a ~65% cache hit rate on the mobile version of
cnn.com.

Note that ImageData calls CGContextClearRect() after calling
IOSurface::create() so recycling IOSurfaces in this case should
be safe.

Performance test: Canvas/reuse.html

* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::baseTransform):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::context):
(WebCore::ImageBuffer::copyImage):
(WebCore::ImageBuffer::copyNativeImage):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::clip):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::~ImageBufferData):
(WebCore::ImageBufferData::getData):
(WebCore::ImageBufferData::putData):
(WebCore::ImageBufferData::ImageBufferData): Deleted.
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::surfaceFromPool):
(IOSurface::create):
(IOSurface::createFromSendRight):
(IOSurface::createFromImage):
(IOSurface::setContextSize):

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

4 years agoAssertion in ScrollController::processWheelEventForScrollSnapOnAxis when scrolling...
bfulgham@apple.com [Tue, 10 Mar 2015 01:00:15 +0000 (01:00 +0000)]
Assertion in ScrollController::processWheelEventForScrollSnapOnAxis when scrolling with mechanical wheel mouse
https://bugs.webkit.org/show_bug.cgi?id=142517

Reviewed by Simon Fraser.

* platform/cocoa/ScrollController.mm:
(WebCore::toWheelEventStatus): Recognize stateless mechanical wheel events.
(WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): If a mechanical wheel event is processed while
considering scroll snap logic, end any snap animations and clean up.
(WebCore::ScrollController::updateScrollSnapPoints): Don't begin tracking scroll snap state if there is not
scroll snap point defined in the markup.

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

4 years agoStale entries in WeakGCMaps are keeping tons of WeakBlocks alive unnecessarily.
akling@apple.com [Tue, 10 Mar 2015 00:09:39 +0000 (00:09 +0000)]
Stale entries in WeakGCMaps are keeping tons of WeakBlocks alive unnecessarily.
<https://webkit.org/b/142115>
<rdar://problem/19992268>

Reviewed by Geoffrey Garen.

Prune stale entries from WeakGCMaps as part of every full garbage collection.
This frees up tons of previously-stuck WeakBlocks that were only sitting around
with finalized handles waiting to die.

Note that WeakGCMaps register/unregister themselves with the GC heap in their
ctor/dtor, so creating one now requires passing the VM.

Average time spent in the PruningStaleEntriesFromWeakGCMaps GC phase appears
to be between 0.01ms and 0.3ms, though I've seen a few longer ones at ~1.2ms.
It seems somewhat excessive to do this on every Eden collection, so it's only
doing work in full collections for now.

Because the GC may now mutate WeakGCMap below object allocation, I've made it
so that the classic HashMap::add() optimization can't be used with WeakGCMap.
This caused intermittent test failures when originally landed due to having
an invalid iterator on the stack after add() inserted a new entry and we
proceeded to allocate the new object, triggering GC.

* API/JSWeakObjectMapRefInternal.h:
(OpaqueJSWeakObjectMap::create):
(OpaqueJSWeakObjectMap::OpaqueJSWeakObjectMap):
* API/JSWeakObjectMapRefPrivate.cpp:
* API/JSWrapperMap.mm:
(-[JSWrapperMap initWithContext:]):
(-[JSWrapperMap jsWrapperForObject:]): Pass VM to WeakGCMap constructor.

* JavaScriptCore.xcodeproj/project.pbxproj: Add WeakGCMapInlines.h and make
it project-private so WebCore clients can access it.

* heap/Heap.cpp:
(JSC::Heap::collect):
(JSC::Heap::pruneStaleEntriesFromWeakGCMaps): Added a new GC phase for pruning
stale entries from WeakGCMaps. This is only executed during full collections.

* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::registerWeakGCMap):
(JSC::Heap::unregisterWeakGCMap): Added a mechanism for WeakGCMaps to register
themselves with the Heap and provide a pruning callback.

* runtime/PrototypeMap.h:
(JSC::PrototypeMap::PrototypeMap):
* runtime/Structure.cpp:
(JSC::StructureTransitionTable::add): Pass VM to WeakGCMap constructor.

* runtime/JSCInlines.h: Add "WeakGCMapInlines.h"

* runtime/JSGlobalObject.cpp: Include "WeakGCMapInlines.h" so this builds.

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/PrototypeMap.cpp:
(JSC::PrototypeMap::addPrototype):
(JSC::PrototypeMap::emptyObjectStructureForPrototype): Remove HashMap add()
optimization since it's not safe in the GC-managed WeakGCMap world.

* runtime/VM.cpp:
(JSC::VM::VM): Pass VM to WeakGCMap constructor.

* runtime/WeakGCMap.h:
(JSC::WeakGCMap::set):
(JSC::WeakGCMap::add):
(JSC::WeakGCMap::WeakGCMap): Deleted.
(JSC::WeakGCMap::gcMap): Deleted.
(JSC::WeakGCMap::gcMapIfNeeded): Deleted.
* runtime/WeakGCMapInlines.h: Added.
(JSC::WeakGCMap::WeakGCMap):
(JSC::WeakGCMap::~WeakGCMap):
(JSC::WeakGCMap::pruneStaleEntries): Moved ctor, dtor and pruning callback
to WeakGCMapInlines.h to fix interdependent header issues. Removed code that
prunes WeakGCMap at certain growth milestones and instead rely on the GC
callback for housekeeping.

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

4 years agoSupport extends and super keywords
rniwa@webkit.org [Mon, 9 Mar 2015 23:47:06 +0000 (23:47 +0000)]
Support extends and super keywords
https://bugs.webkit.org/show_bug.cgi?id=142200

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Added the support for ES6 class syntax inheritance.

Added ConstructorKind as well as boolean flags indicating the constructor kind to
various classes in UnlinkedCodeBlock as well as AST nodes.

Each method stores the associated class as its homeObjectPrivateName. This value is used to
make super calls.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):

* bytecode/UnlinkedCodeBlock.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::UnlinkedFunctionExecutable::constructorKindIsDerived): Added.
(JSC::UnlinkedCodeBlock::constructorKindIsDerived): Added.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator): Don't emit op_create_this in a derived class
as the object is allocated by the highest base class's constructor. Also set "this" to null
and store the original value in m_newTargetRegister. "this" is supposed to be in TDZ but
that will be implemented in a separate patch.
(JSC::BytecodeGenerator::emitReturn): Allow "undefined" to be returned from a derived class.
In a derived class's constructor, not returning "undefined" or an object results in a type
error instead of "this" being returned.
(JSC::BytecodeGenerator::emitThrowTypeError): Added.

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::constructorKindIsDerived): Added.
(JSC::BytecodeGenerator::newTarget): Added.

* bytecompiler/NodesCodegen.cpp:
(JSC::SuperNode::emitBytecode): Added. Emits the code to obtain the callee's parent class.
(JSC::emitSuperBaseForCallee): Added. Emits the code to obtain the parent class's prototype.
(JSC::emitPutHomeObject): Added.
(JSC::PropertyListNode::emitBytecode): Stores the home object when adding methods.
(JSC::PropertyListNode::emitPutConstantProperty): Ditto.
(JSC::BracketAccessorNode::emitBytecode): Added the support for super['foo'].
(JSC::DotAccessorNode::emitBytecode): Added the support for super.foo.
(JSC::FunctionCallValueNode::emitBytecode): Added the support for super().
(JSC::FunctionCallBracketNode::emitBytecode): Added the support for super['foo']().
(JSC::FunctionCallDotNode::emitBytecode): Added the support for super.foo().
(JSC::DeleteBracketNode::emitBytecode): Forbid "delete super.foo".
(JSC::DeleteDotNode::emitBytecode): Forbid "delete super['foo']".
(JSC::ClassExprNode::emitBytecode): Added the support for "classHeritage". This is the main
logic for inheritance. When a class B inherits from a class A, set B.__proto__ to A and set
B.prototype.__proto__ to A.prototype. Throw exceptions when either A or A.__proto__ is not
an object.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::superExpr): Added.

* parser/NodeConstructors.h:
(JSC::SuperNode::SuperNode): Added.

* parser/Nodes.cpp:
(JSC::FunctionBodyNode::FunctionBodyNode):

* parser/Nodes.h:
(JSC::ExpressionNode::isSuperNode):
(JSC::PropertyNode::type):
(JSC::PropertyNode::needsSuperBinding):

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionInfo): Throw a parser error if super() is used outside
of class constructors.
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass): ConstructorKind is "derived" if and only if the parent
class is specified in the declaration / expression.
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression): Added the support for "super()", "super.foo",
and "super['foo']". Throw a semantic error if "super" appears by itself.

* parser/Parser.h:
(JSC::Scope::Scope): Added m_hasDirectSuper. This variable keeps track of the use of "super()"
so that parseFunctionInfo can spit an error if it's used outside of class constructors.
(JSC::Scope::hasDirectSuper): Added.
(JSC::Scope::setHasDirectSuper): Added.

* parser/ParserModes.h:
(JSC::ConstructorKind): Added.

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::superExpr): Added.

* runtime/CommonIdentifiers.h: Added homeObjectPrivateName.

* runtime/Executable.h:
(JSC::EvalExecutable::executableInfo):
(JSC::ProgramExecutable::executableInfo):

LayoutTests:

Added tests for "extends" and "super" keywords.

* TestExpectations:
* js/class-syntax-extends-expected.txt: Added.
* js/class-syntax-extends.html: Added.
* js/class-syntax-super-expected.txt: Added.
* js/class-syntax-super.html: Added.
* js/script-tests/class-syntax-extends.js: Added.
* js/script-tests/class-syntax-super.js: Added.

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

4 years agoREGRESSION(r176978): Inline-blocks with overflowing contents have ascents that are...
mmaxfield@apple.com [Mon, 9 Mar 2015 23:43:34 +0000 (23:43 +0000)]
REGRESSION(r176978): Inline-blocks with overflowing contents have ascents that are too large
https://bugs.webkit.org/show_bug.cgi?id=141783

Reviewed by David Hyatt.

Source/WebCore:

When we have an inline-block element, and we want to find its baseline (to lay out other
elements on the same line) we loop through the element's children and ask them what their
baselines are. The children use the location of the top of their last line to compute this
value. However, if the child has overflow-y, this might not be the correct calculation.

This behavior is in the spec: "The baseline of an 'inline-block' is the baseline of its last
line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow'
property has a computed value other than 'visible', in which case the baseline is the bottom
margin edge."
    -- http://www.w3.org/TR/CSS21/visudet.html#leading

However, we believe that a better policy is, when overflow is not "visible," to place the
baseline at the bottom of the block if the contents overflowed in the Y direction, and to place
it at the bottom of the last line if the contents did not overflow in the Y direction. This is
partially consistent with previous behavior, and isn't too far from the spec to cause too many
breakages.

Test: fast/css/inline-block-tricky-baselines.html
      fast/text/baseline-inline-block.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineBlockBaseline):

LayoutTests:

Update expected results.

* css3/flexbox/child-overflow-expected.html:
* css3/flexbox/child-overflow.html:
* fast/css/inline-block-tricky-baselines-expected.html: Added.
* fast/css/inline-block-tricky-baselines.html: Added.
* fast/forms/textfield-overflow-by-value-update-expected.txt:
* fast/text/baseline-inline-block-expected.html: Added.
* fast/text/baseline-inline-block.html: Added.
* platform/mac/fast/forms/search-vertical-alignment-expected.txt:

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

4 years ago[Content Filtering] Add tests
aestes@apple.com [Mon, 9 Mar 2015 23:39:05 +0000 (23:39 +0000)]
[Content Filtering] Add tests
https://bugs.webkit.org/show_bug.cgi?id=142475

Reviewed by Andreas Kling.

Source/WebCore:

Added a mock content filter that can be configured by window.internals. A test can control whether the filter
is enabled, what to display when a page is blocked, at what point the allow/block decision is made, and what
decision to make.

Added tests to cover allowing and blocking content at each decision point.

Tests: contentfiltering/allow-after-add-data.html
       contentfiltering/allow-after-finished-adding-data.html
       contentfiltering/allow-after-response.html
       contentfiltering/block-after-add-data.html
       contentfiltering/block-after-finished-adding-data.html
       contentfiltering/block-after-response.html

* DerivedSources.make: Added MockContentFilterSettings.idl.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMockContentFilterSettingsCustom.cpp: Added.
(WebCore::JSMockContentFilterSettings::decisionPoint): Returned the decision point's JSValue.
(WebCore::JSMockContentFilterSettings::setDecisionPoint): Set the decision point; threw an exception for invalid values.
(WebCore::JSMockContentFilterSettings::decision): Returned the decision's JSValue.
(WebCore::JSMockContentFilterSettings::setDecision): Set the decision; threw an exception for invalid values.
* platform/ContentFilter.cpp:
(WebCore::ContentFilter::types): Renamed from contentFilterTypes.
(WebCore::ContentFilter::createIfNeeded):
(WebCore::contentFilterType): Deleted.
(WebCore::contentFilterTypes): Deleted.
* platform/ContentFilter.h:
(WebCore::ContentFilter::addType): Used to register a new content filter type.
(WebCore::ContentFilter::type): Renamed from contentFilterType.
* platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NE_FILTER_SOURCE to here.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Called MockContentFilterSettings::reset().
(WebCore::Internals::Internals): Called MockContentFilter::ensureInstalled().
(WebCore::Internals::mockContentFilterSettings): Returned a reference to MockContentFilterSettings::singleton().
* testing/Internals.h:
* testing/Internals.idl: Added attribute mockContentFilterSettings.
* testing/MockContentFilter.cpp: Added.
(WebCore::MockContentFilter::ensureInstalled): Called MockContentFilter::addType().
(WebCore::MockContentFilter::canHandleResponse): Returned whether MockContentFilterSettings is enabled.
(WebCore::MockContentFilter::create): Returned a new MockContentFilter.
(WebCore::MockContentFilter::MockContentFilter): Called maybeDetermineStatus().
(WebCore::MockContentFilter::addData): Copied data into m_replacementData and called maybeDetermineStatus().
(WebCore::MockContentFilter::finishedAddingData): Called maybeDetermineStatus().
(WebCore::MockContentFilter::needsMoreData): Returned whether m_status equals NeedsMoreData.
(WebCore::MockContentFilter::didBlockData): Returned whether m_status equals Blocked.
(WebCore::MockContentFilter::getReplacementData): Returned a pointer to the start of m_replacementData.
(WebCore::MockContentFilter::unblockHandler): Returned an empty ContentFilterUnblockHandler.
(WebCore::MockContentFilter::maybeDetermineStatus): If m_status is NeedsMoreData and the current decision point
equals MockContentFilterSettings's decision point, set m_status according to MockContentFilterSettings's
decision. If m_status becomes Blocked, clear the original page data from m_replacementData and copy
MockContentFilterSettings's blocked string instead.
* testing/MockContentFilter.h: Copied from Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
* testing/MockContentFilterSettings.cpp: Copied from Source/WebCore/platform/ContentFilter.h.
(WebCore::MockContentFilterSettings::singleton):
(WebCore::MockContentFilterSettings::reset): Reset settings to their initial values.
(WebCore::MockContentFilterSettings::MockContentFilterSettings):
* testing/MockContentFilterSettings.h: Copied from Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
(WebCore::MockContentFilterSettings::ref): Added an empty implementation to make the bindings think this is RefCounted.
(WebCore::MockContentFilterSettings::deref): Ditto.
(WebCore::MockContentFilterSettings::enabled):
(WebCore::MockContentFilterSettings::setEnabled):
(WebCore::MockContentFilterSettings::blockedString):
(WebCore::MockContentFilterSettings::setBlockedString):
(WebCore::MockContentFilterSettings::decisionPoint):
(WebCore::MockContentFilterSettings::setDecisionPoint):
(WebCore::MockContentFilterSettings::decision):
(WebCore::MockContentFilterSettings::setDecision):
* testing/MockContentFilterSettings.idl: Copied from Source/WebCore/platform/ContentFilter.h.

LayoutTests:

* contentfiltering/allow-after-add-data-expected.html: Added.
* contentfiltering/allow-after-add-data.html: Added.
* contentfiltering/allow-after-finished-adding-data-expected.html: Added.
* contentfiltering/allow-after-finished-adding-data.html: Added.
* contentfiltering/allow-after-response-expected.html: Added.
* contentfiltering/allow-after-response.html: Added.
* contentfiltering/block-after-add-data-expected.html: Added.
* contentfiltering/block-after-add-data.html: Added.
* contentfiltering/block-after-finished-adding-data-expected.html: Added.
* contentfiltering/block-after-finished-adding-data.html: Added.
* contentfiltering/block-after-response-expected.html: Added.
* contentfiltering/block-after-response.html: Added.

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

4 years agoSimple line layout should not be limited to RenderText.
zalan@apple.com [Mon, 9 Mar 2015 23:30:35 +0000 (23:30 +0000)]
Simple line layout should not be limited to RenderText.
https://bugs.webkit.org/show_bug.cgi?id=142504

Reviewed by Antti Koivisto.

This is in transition to support br element.

No change in functionality.

* rendering/RenderText.cpp:
(WebCore::RenderText::absoluteRects):
(WebCore::RenderText::absoluteQuadsClippedToEllipsis):
(WebCore::RenderText::absoluteQuads):
(WebCore::RenderText::firstRunLocation):
(WebCore::RenderText::linesBoundingBox):
(WebCore::RenderText::caretMinOffset):
(WebCore::RenderText::caretMaxOffset):
(WebCore::RenderText::containsCaretOffset):
* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::FlowContents::segmentForRenderer):
* rendering/SimpleLineLayoutFlowContents.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::computeBoundingBox):
(WebCore::SimpleLineLayout::computeFirstRunLocation):
(WebCore::SimpleLineLayout::collectAbsoluteRects):
(WebCore::SimpleLineLayout::collectAbsoluteQuads):
(WebCore::SimpleLineLayout::computeTextBoundingBox): Deleted.
(WebCore::SimpleLineLayout::computeTextFirstRunLocation): Deleted.
(WebCore::SimpleLineLayout::collectTextAbsoluteRects): Deleted.
(WebCore::SimpleLineLayout::collectTextAbsoluteQuads): Deleted.
* rendering/SimpleLineLayoutFunctions.h:
(WebCore::SimpleLineLayout::findCaretMinimumOffset):
(WebCore::SimpleLineLayout::findCaretMaximumOffset):
(WebCore::SimpleLineLayout::containsCaretOffset):
(WebCore::SimpleLineLayout::findTextCaretMinimumOffset): Deleted.
(WebCore::SimpleLineLayout::findTextCaretMaximumOffset): Deleted.
(WebCore::SimpleLineLayout::containsTextCaretOffset): Deleted.
* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::text):
(WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
* rendering/SimpleLineLayoutResolver.h:
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):

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

4 years ago[iOS] Add WebKitSystemInterface for iOS 8.2
commit-queue@webkit.org [Mon, 9 Mar 2015 22:34:47 +0000 (22:34 +0000)]
[iOS] Add WebKitSystemInterface for iOS 8.2
https://bugs.webkit.org/show_bug.cgi?id=142505

Patch by Daniel Bates <dabates@apple.com> on 2015-03-09
Reviewed by Andy Estes.

* libWebKitSystemInterfaceIOSDevice8.2.a: Added.
* libWebKitSystemInterfaceIOSSimulator8.2.a: Added.

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

4 years agosvg/custom/svg-fonts-without-missing-glyph.xhtml fails after fonts/font-fallback...
mmaxfield@apple.com [Mon, 9 Mar 2015 22:09:34 +0000 (22:09 +0000)]
svg/custom/svg-fonts-without-missing-glyph.xhtml fails after fonts/font-fallback-prefers-pictographs.html
https://bugs.webkit.org/show_bug.cgi?id=142470

Reviewed by Anders Carlsson.

Source/WebCore:

After each test, reset all internal settings.

Covered by svg/custom/svg-fonts-without-missing-glyph.xhtml

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:

LayoutTests:

* platform/mac/TestExpectations:

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

4 years agoUnreviewed, rolling out r181268.
commit-queue@webkit.org [Mon, 9 Mar 2015 22:08:36 +0000 (22:08 +0000)]
Unreviewed, rolling out r181268.
https://bugs.webkit.org/show_bug.cgi?id=142508

Broke tests (Requested by ap on #webkit).

Reverted changeset:

"Simple line layout: Merge
TextFragmentIterator::findNextBreakablePosition() and
TextFragmentIterator::findNextNonWhitespacePosition()."
https://bugs.webkit.org/show_bug.cgi?id=142344
http://trac.webkit.org/changeset/181268

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

4 years agoCSS JIT: add aliases between :nth-child()/:nth-last-child() and :first-child/:last...
benjamin@webkit.org [Mon, 9 Mar 2015 21:10:37 +0000 (21:10 +0000)]
CSS JIT: add aliases between :nth-child()/:nth-last-child() and :first-child/:last-child
https://bugs.webkit.org/show_bug.cgi?id=142472

Reviewed by Andreas Kling.

Source/WebCore:

The pseudo class :first-child has weaker tree marking than :nth-child(1).
This patch aliases :nth-child(1) to :first-child in the CSS JIT to take
advantage of that.

The strength of :last-child and :nth-last-child(1) are pretty much identical
but :last-child is a bit simpler so I changed it too. It is also easier
to handle both the same.

Tests: fast/selectors/nth-child-matching-first-on-root.html
       fast/selectors/nth-child-matching-first.html
       fast/selectors/nth-last-child-matching-first-on-root.html
       fast/selectors/nth-last-child-matching-first.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addNthChildType):
(WebCore::SelectorCompiler::addPseudoClassType):

LayoutTests:

* fast/selectors/nth-child-matching-first-expected.txt: Added.
* fast/selectors/nth-child-matching-first-on-root-expected.txt: Added.
* fast/selectors/nth-child-matching-first-on-root.html: Added.
* fast/selectors/nth-child-matching-first.html: Added.
* fast/selectors/nth-last-child-matching-first-expected.txt: Added.
* fast/selectors/nth-last-child-matching-first-on-root-expected.txt: Added.
* fast/selectors/nth-last-child-matching-first-on-root.html: Added.
* fast/selectors/nth-last-child-matching-first.html: Added.

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

4 years agoMerge TrivialAtom and CharacterSet into a Term abstraction, prepare Term for composition
benjamin@webkit.org [Mon, 9 Mar 2015 21:07:19 +0000 (21:07 +0000)]
Merge TrivialAtom and CharacterSet into a Term abstraction, prepare Term for composition
https://bugs.webkit.org/show_bug.cgi?id=142429

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-09
Reviewed by Darin Adler.

This patch merges CharacterSet and Trivial atom into a new class: Term. A Term is
a combination of an Atom and one Quantifier.

With term being the basic block, we can use the PrefixTree for any construct,
greatly reducing the size of the NFA graph.

Term is built on top of an union holding the Atom storage. This is done in preparation
for more complicated Atoms like a disjunction.

Everything else is pretty much the same. BuildMode is gone since we use the prefix
tree for everything. FloatingAtomType is gone, a TrivialAtom is now represented
by a single character CharacterSet (or two for case insensitive).

* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::parseRuleList):
* contentextensions/NFA.cpp:
(WebCore::ContentExtensions::NFA::addRuleId):
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::Term::Term):
(WebCore::ContentExtensions::Term::~Term):
(WebCore::ContentExtensions::Term::isValid):
(WebCore::ContentExtensions::Term::addCharacter):
(WebCore::ContentExtensions::Term::quantify):
(WebCore::ContentExtensions::Term::quantifier):
(WebCore::ContentExtensions::Term::isUniversalTransition):
(WebCore::ContentExtensions::Term::visitSimpleTransitions):
(WebCore::ContentExtensions::Term::operator=):
(WebCore::ContentExtensions::Term::operator==):
(WebCore::ContentExtensions::Term::hash):
(WebCore::ContentExtensions::Term::isEmptyValue):
(WebCore::ContentExtensions::Term::isDeletedValue):
(WebCore::ContentExtensions::Term::destroy):
(WebCore::ContentExtensions::Term::CharacterSet::operator==):
(WebCore::ContentExtensions::Term::CharacterSet::hash):
(WebCore::ContentExtensions::TermHash::hash):
(WebCore::ContentExtensions::TermHash::equal):
(WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
(WebCore::ContentExtensions::GraphBuilder::finalize):
(WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
(WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
(WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
(WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
(WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
(WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
(WebCore::ContentExtensions::GraphBuilder::addTransitions):
(WebCore::ContentExtensions::GraphBuilder::sinkFloatingTerm):
(WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
(WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
(WebCore::ContentExtensions::URLFilterParser::~URLFilterParser):
(WebCore::ContentExtensions::URLFilterParser::addPattern):
(WebCore::ContentExtensions::trivialAtomFromASCIICharacter): Deleted.
(WebCore::ContentExtensions::quantifyTrivialAtom): Deleted.
(WebCore::ContentExtensions::trivialAtomQuantifier): Deleted.
(WebCore::ContentExtensions::trivialAtomForNewlineClassIDBuiltin): Deleted.
(WebCore::ContentExtensions::GraphBuilder::sinkAtom): Deleted.
(WebCore::ContentExtensions::GraphBuilder::generateTransition): Deleted.
(WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom): Deleted.
(WebCore::ContentExtensions::GraphBuilder::sinkCharacterSet): Deleted.
(WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary): Deleted.
* contentextensions/URLFilterParser.h:

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

4 years agoFix the !ENABLE(WEBGL) build after r180609
ossy@webkit.org [Mon, 9 Mar 2015 20:51:51 +0000 (20:51 +0000)]
Fix the !ENABLE(WEBGL) build after r180609
https://bugs.webkit.org/show_bug.cgi?id=142057

Reviewed by Darin Adler.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::forceContextLost):

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

4 years agoAdd an option to run-webkit-tests to override the LayoutTests/ directory
jer.noble@apple.com [Mon, 9 Mar 2015 20:51:38 +0000 (20:51 +0000)]
Add an option to run-webkit-tests to override the LayoutTests/ directory
https://bugs.webkit.org/show_bug.cgi?id=142418

Reviewed by David Kilzer.

Add an arugment to run-webkit-tests which, when set, overrides the port's default LayoutTests
directory. The base port will parse the options during initialization and store the override
location if present. layout_tests_dir() will return this overridden location if set.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/base.py:
(Port.__init__):
(Port.layout_tests_dir):

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

4 years agoOnly call showControls if controls are hidden.
roger_fong@apple.com [Mon, 9 Mar 2015 20:22:15 +0000 (20:22 +0000)]
Only call showControls if controls are hidden.
https://bugs.webkit.org/show_bug.cgi?id=142496.
<rdar://problem/20083732>
Reviewed by Dean Jackson.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handleWrapperMouseMove):
(Controller.prototype.controlsAreHidden):
Controls are hidden if the ‘show’ class name is not present,
not if the ‘hidden’ class name is.

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

4 years agoWork around a Cocoa font parsing bug
mmaxfield@apple.com [Mon, 9 Mar 2015 19:58:37 +0000 (19:58 +0000)]
Work around a Cocoa font parsing bug
https://bugs.webkit.org/show_bug.cgi?id=142446
Source/WebCore:

<rdar://problem/20086223>

Reviewed by Simon Fraser.

Work around a bug in Cocoa regarding font parsing.

* svg/SVGToOTFFontConversion.cpp:

LayoutTests:

Reviewed by Simon Fraser.

Adding a few extra tests for bits of SVG fonts that could use some more tests.

* svg/fonts/resources/svg-font-general.svg: Updated and moved from svg-font-horiz-origin-font.svg
* svg/fonts/svg-font-general.html: Updated and moved from svg-font-horiz-origin.html
* svg/fonts/svg-font-general-expected.html: Updated and moved from svg-font-horiz-origin-expected.html

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

4 years ago[SVG -> OTF Converter] x-height cannot be specified
mmaxfield@apple.com [Mon, 9 Mar 2015 19:39:12 +0000 (19:39 +0000)]
[SVG -> OTF Converter] x-height cannot be specified
https://bugs.webkit.org/show_bug.cgi?id=142465

Reviewed by Simon Fraser.

For all non-system fonts, OS X disregards the font's reported x-height. Therefore,
it is impossible to satisfy this test.

* fast/css/ex-unit-with-no-x-height-expected.txt: Removed.
* fast/css/ex-unit-with-no-x-height.html: Removed.
* platform/mac/TestExpectations:

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

4 years agoUnreviewed GTK+ Gardening
commit-queue@webkit.org [Mon, 9 Mar 2015 19:19:36 +0000 (19:19 +0000)]
Unreviewed GTK+ Gardening

https://bugs.webkit.org/show_bug.cgi?id=142499

Patch by Marcos Chavarría Teijeiro <chavarria1991@gmail.com> on 2015-03-09

* platform/gtk/TestExpectations:

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

4 years ago[CMake] Enable WorkQueue tests for CMake ports
commit-queue@webkit.org [Mon, 9 Mar 2015 19:02:23 +0000 (19:02 +0000)]
[CMake] Enable WorkQueue tests for CMake ports
https://bugs.webkit.org/show_bug.cgi?id=142473

Patch by Martin Robinson <mrobinson@igalia.com> on 2015-03-09
Reviewed by Darin Adler.

* TestWebKitAPI/CMakeLists.txt: Add the WorkQueue tests source file to
the list of source files.
* Tools/TestWebKitAPI/PlatformEfl.cmake: Add the DispatchQueueEfl directory
to the list of include directories for EFL.

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

4 years agoFix the build after r181153
ossy@webkit.org [Mon, 9 Mar 2015 19:01:08 +0000 (19:01 +0000)]
Fix the build after r181153
https://bugs.webkit.org/show_bug.cgi?id=142497

Reviewed by Philippe Normand.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load):

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

4 years ago[iOS] Fix build when compiling with dead code stripping disabled
ddkilzer@apple.com [Mon, 9 Mar 2015 18:58:31 +0000 (18:58 +0000)]
[iOS] Fix build when compiling with dead code stripping disabled
<http://webkit.org/b/142467>

Reviewed by Simon Fraser.

Source/WebKit/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::save): Add missing method.

Source/WebKit/mac:

* Configurations/WebKitLegacy.xcconfig:
(EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*]): Disable mig code
generation and compilation for out-of-process plugin support.
This was never used on iOS.

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

4 years agobmalloc: tryFastMalloc shouldn't crash
ggaren@apple.com [Mon, 9 Mar 2015 18:43:08 +0000 (18:43 +0000)]
bmalloc: tryFastMalloc shouldn't crash
https://bugs.webkit.org/show_bug.cgi?id=142443

Reviewed by Anders Carlsson.

Part 1: Stop using tryFastRealloc.

* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::resize): Deleted.
* Shared/ShareableBitmap.h: Removed the resize function because it has
no clients.

* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::updateBackingStore): Changed to allocate a new
backing store instead of resizing the old one. This has three advantages:

(1) Might be more memory-efficient, since you don't have to keep the old
one around while allocating the new one.

(2) Avoids the overhead of realloc() copying the contents of the old
backing store even though we only want uninitialized memory.

(3) Makes resize failure consistent with initial allocation failure.
Previously, while initial allocation failure would set the backing store
to null, resize failure would keep the old wrong backing store and then
tell it not to paint. Now, resize failure also sets the backing store to
null.

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

4 years ago[EFL] Move DispatchQueue to WTF
commit-queue@webkit.org [Mon, 9 Mar 2015 17:49:17 +0000 (17:49 +0000)]
[EFL] Move DispatchQueue to WTF
https://bugs.webkit.org/show_bug.cgi?id=142493

Patch by Martin Robinson <mrobinson@igalia.com> on 2015-03-09
Reviewed by Csaba Osztrogonác.

Source/WebKit2:

* PlatformEfl.cmake: Remove DispatchQueue from the source list.

Source/WTF:

* wtf/PlatformEfl.cmake: Add DispatchQueue to the source list.
* wtf/efl/DispatchQueueEfl.cpp: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.cpp.
* wtf/efl/DispatchQueueEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueEfl.h.
* wtf/efl/DispatchQueueWorkItemEfl.h: Renamed from Source/WebKit2/Platform/efl/DispatchQueueWorkItemEfl.h.

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

4 years agoUnreviewed. Re-add CSS property that was unintentionally removed in r180893
roger_fong@apple.com [Mon, 9 Mar 2015 17:35:02 +0000 (17:35 +0000)]
Unreviewed. Re-add CSS property that was unintentionally removed in r180893
<rdar://problem/20083715>
* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel):

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

4 years agoSimple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextF...
zalan@apple.com [Mon, 9 Mar 2015 17:09:52 +0000 (17:09 +0000)]
Simple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextFragmentIterator::findNextNonWhitespacePosition().
https://bugs.webkit.org/show_bug.cgi?id=142344

Reviewed by Antti Koivisto.

This patch merges findNextBreakablePosition() and findNextNonWhitespacePosition() so that
the segment looping and position handling logic are no longer duplicated. It also unifies
the static next*() functions' signature.

No change in functionality.

* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
(WebCore::SimpleLineLayout::nextBreakablePosition):
(WebCore::SimpleLineLayout::nextNonWhitespacePosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
(WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition): Deleted.
(WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
(WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition): Deleted.
* rendering/SimpleLineLayoutTextFragmentIterator.h:

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

4 years agoAttempt to fix timeouts on iOS Simulator layout tests
ddkilzer@apple.com [Mon, 9 Mar 2015 14:27:51 +0000 (14:27 +0000)]
Attempt to fix timeouts on iOS Simulator layout tests

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.setup_test_run): Most layout test runs on iOS
Simulator end after the first 50 tests time out.  Some analysis
this past weekend shows that the 'Booted' status in the output
of `xcrun simctl list` is not sufficient (and watching the test
run shows that SpringBoard hasn't fully started to the point
where it's displaying icons on the home screen).  The workaround
until we have a better fix is to add an arbitrary timeout to let
SpringBoard finish launching.  In practice, 15 seconds is
probably enough, but 30 seconds should nearly always work.

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

4 years agoUnreviewed. Add myself as a committer.
peavo@outlook.com [Mon, 9 Mar 2015 13:57:00 +0000 (13:57 +0000)]
Unreviewed. Add myself as a committer.

* Scripts/webkitpy/common/config/contributors.json:

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

4 years agoAttempt to fix WTF_WorkQueue.TwoQueues timeout test failure
ddkilzer@apple.com [Mon, 9 Mar 2015 12:57:11 +0000 (12:57 +0000)]
Attempt to fix WTF_WorkQueue.TwoQueues timeout test failure

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST): Change delay from 50ns to 50ms, and add
an expectation that will fail if we hit the race condition.
This test is inherently racy and will deadlock if the first job
for queue2 takes the mutex lock before the second job for
queue1.

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

4 years agoReadableStreamJSSource should use JSC::Strong UnspecifiedBoolType operator
youenn.fablet@crf.canon.fr [Mon, 9 Mar 2015 11:36:14 +0000 (11:36 +0000)]
ReadableStreamJSSource should use JSC::Strong UnspecifiedBoolType operator
https://bugs.webkit.org/show_bug.cgi?id=142397

Reviewed by Benjamin Poulain.

No behavior change. Current tests cover the changes.

* bindings/js/ReadableStreamJSSource.cpp:
* bindings/js/ReadableStreamJSSource.h:

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

4 years agoUnreviewed EFL gardening on 9th Mar.
gyuyoung.kim@samsung.com [Mon, 9 Mar 2015 11:31:50 +0000 (11:31 +0000)]
Unreviewed EFL gardening on 9th Mar.

Mark svg/text/select-textLength-spacingAndGlyphs-foo.html to failure.
Update new failling tests to existing bugs.

* platform/efl/TestExpectations:

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

4 years agoReadableStream does not not need to pass itself as callback parameter
youenn.fablet@crf.canon.fr [Mon, 9 Mar 2015 11:31:47 +0000 (11:31 +0000)]
ReadableStream does not not need to pass itself as callback parameter
https://bugs.webkit.org/show_bug.cgi?id=142399

Reviewed by Darin Adler.

No change in behavior.

* Modules/streams/ReadableStream.h: Remove ReadableStream parameter from SuccessCallback definition.
* bindings/js/JSReadableStreamCustom.cpp:
(WebCore::JSReadableStream::ready): Capture JSReadableStream instance instead.
(WebCore::JSReadableStream::closed): Capture JSReadableStream instance instead.

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

4 years agoLast test gardening after r177774 (for reals this time)
mmaxfield@apple.com [Mon, 9 Mar 2015 05:32:06 +0000 (05:32 +0000)]
Last test gardening after r177774 (for reals this time)
https://bugs.webkit.org/show_bug.cgi?id=139968

Unreviewed.

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-03-08

* platform/mac/TestExpectations:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-1-expected.txt:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-2-expected.txt:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-3-expected.txt:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-squeeze-4-expected.txt:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-1-expected.txt:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-2-expected.txt:
* platform/mac/svg/text/select-textLength-spacingAndGlyphs-stretch-3-expected.txt:
* svg/text/select-textLength-spacingAndGlyphs-squeeze-1.svg:
* svg/text/select-textLength-spacingAndGlyphs-squeeze-2.svg:
* svg/text/select-textLength-spacingAndGlyphs-squeeze-3.svg:
* svg/text/select-textLength-spacingAndGlyphs-squeeze-4.svg:
* svg/text/select-textLength-spacingAndGlyphs-stretch-1.svg:
* svg/text/select-textLength-spacingAndGlyphs-stretch-2.svg:
* svg/text/select-textLength-spacingAndGlyphs-stretch-3.svg:

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

4 years ago[iOS Media] Video buffer progress missing on iPhones
dino@apple.com [Mon, 9 Mar 2015 04:55:11 +0000 (04:55 +0000)]
[iOS Media] Video buffer progress missing on iPhones
https://bugs.webkit.org/show_bug.cgi?id=142462

Reviewed by Eric Carlson.

Source/WebCore:

The fullscreen controller on the iPhone idiom was using
the media duration as its maximum loaded time, meaning the
download progress was missing (it looked like everything
was already downloaded). The fix is to calculate
what the maximum buffered time is from the HTMLMediaElement,
and send that to the fullscreen controller.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.drawTimelineBackground): While implementing
the native function I noticed that the JS controls forgot that
the buffered time ranges are ordered, and thus they don't need
to search through the array. The last range will be the highest.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::maxBufferedTime): New helper function
to calculate the highest buffered time in the media source.
* html/HTMLMediaElement.h:

* platform/ios/WebVideoFullscreenInterface.h: New setBufferedTime method.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setDuration): No longer set
the loadedTimeRanges.
(WebVideoFullscreenInterfaceAVKit::setBufferedTime): Calculate a normalized
value of the maximum loaded/buffered time, and tell the platform controller
to show that range.

* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::updateForEventName): Send the maximum
buffered time.

Source/WebKit2:

Coordinate the SetBufferedTime message between the Web and UI
processes.

* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: New message SetBufferedTime.
* WebProcess/ios/WebVideoFullscreenManager.h:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::setBufferedTime):

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

4 years agoFix the tests for the new double-child descendant in css-set-selector-text
benjamin@webkit.org [Mon, 9 Mar 2015 04:25:04 +0000 (04:25 +0000)]
Fix the tests for the new double-child descendant in css-set-selector-text
https://bugs.webkit.org/show_bug.cgi?id=141882

Reviewed by Andreas Kling.

In 178592, I copied the rules from css-selector-text.html without removing
the declarations.

Kudos to Dhi Aurrahman for catching this.

* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:

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

4 years ago[Win] WTF::WorkQueue does not balance ref/deref properly
bfulgham@apple.com [Mon, 9 Mar 2015 04:15:42 +0000 (04:15 +0000)]
[Win] WTF::WorkQueue does not balance ref/deref properly
https://bugs.webkit.org/show_bug.cgi?id=142471

Reviewed by Antti Koivisto.

Source/WTF:

Make sure we deref the count when we execute a function in the
WorkQueue.

* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::performWorkOnRegisteredWorkThread):

Tools:

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST): Check that the refcount is correct.

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

4 years agoCrash in WebCore::NotificationCenter::stop()
cdumez@apple.com [Mon, 9 Mar 2015 02:55:30 +0000 (02:55 +0000)]
Crash in WebCore::NotificationCenter::stop()
https://bugs.webkit.org/show_bug.cgi?id=142444
<rdar://problem/20082520>

Reviewed by Darin Adler.

Rework the patch in r181219 so that we do not need a Ref<NotificationCenter> protector
in NotificationCenter::stop(). Instead, we put the client in a local variable and null
out m_client *before* calling NotificationClient::clearNotifications().

No new tests, already covered by:
http/tests/notifications/event-listener-crash.html

* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::stop):

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

4 years agoDo not show passing test result on output of EFL layout test
gyuyoung.kim@samsung.com [Mon, 9 Mar 2015 02:07:38 +0000 (02:07 +0000)]
Do not show passing test result on output of EFL layout test
https://bugs.webkit.org/show_bug.cgi?id=142380

Reviewed by Darin Adler.

To show passing tests has caused inconvenience when we detect problem tests
in output of layout test. So this patch applies '--debug-rwt-logging' except for EFL port
in order not to show passing tests in the output of EFL layout test.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunWebKitTests.start):

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

4 years agoUnreviewed build fix.
bfulgham@apple.com [Mon, 9 Mar 2015 01:58:35 +0000 (01:58 +0000)]
Unreviewed build fix.

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST): Remove two unused variables.

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

4 years agoChange bug number for svg/custom/svg-fonts-without-missing-glyph.xhtml
mmaxfield@apple.com [Mon, 9 Mar 2015 01:44:11 +0000 (01:44 +0000)]
Change bug number for svg/custom/svg-fonts-without-missing-glyph.xhtml

Unreviewed.

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-03-08

* platform/mac/TestExpectations:

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

4 years ago[Content Extensions] Add scaffolding for the WKUserContentExtensionStore
weinig@apple.com [Mon, 9 Mar 2015 01:30:05 +0000 (01:30 +0000)]
[Content Extensions] Add scaffolding for the WKUserContentExtensionStore
https://bugs.webkit.org/show_bug.cgi?id=142464

Reviewed by Dan Bernstein.

* Shared/API/APIObject.h:
Add a UserContentExtensionStore type and move the UserContentExtension type into the correct section (UIProcess).

* Shared/API/c/WKBase.h:
Add the WKUserContentExtensionStoreRef C-SPI type.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
Add allocation support for UserContentExtensionStore (and UserContentExtension while we are there, it will be
needed shortly).

* UIProcess/API/APIUserContentExtensionStore.cpp: Added.
(API::UserContentExtensionStore::UserContentExtensionStore):
(API::UserContentExtensionStore::~UserContentExtensionStore):
* UIProcess/API/APIUserContentExtensionStore.h: Added.
Stub out the UserContentExtensionStore.

* UIProcess/API/C/WKAPICast.h:
Add casting for the UserContentExtensionStore.

* UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: Added.
(WKUserContentExtensionStoreGetTypeID):
* UIProcess/API/C/WKUserContentExtensionStoreRef.h: Added.
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: Added.
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: Added.
(-[_WKUserContentExtensionStore init]):
(-[_WKUserContentExtensionStore dealloc]):
(-[_WKUserContentExtensionStore _apiObject]):
* UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: Added.
(WebKit::wrapper):
Stub out SPI for the UserContentExtensionStore.

* WebKit2.xcodeproj/project.pbxproj:
* CMakeLists.txt:
Add new files.

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

4 years agoAX: Expose a frame's accessible name through WK2 C SPI
weinig@apple.com [Mon, 9 Mar 2015 01:17:05 +0000 (01:17 +0000)]
AX: Expose a frame's accessible name through WK2 C SPI
<rdar://problem/19653068>
https://bugs.webkit.org/show_bug.cgi?id=142468

Reviewed by Dan Bernstein.

* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameSetAccessibleName):
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setAccessibleName):
* WebProcess/WebPage/WebFrame.h:
Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:].

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

4 years agoJITThunks keeps finalized Weaks around, pinning WeakBlocks.
akling@apple.com [Sun, 8 Mar 2015 23:58:40 +0000 (23:58 +0000)]
JITThunks keeps finalized Weaks around, pinning WeakBlocks.
<https://webkit.org/b/142454>

Reviewed by Darin Adler.

Make JITThunks a WeakHandleOwner so it can keep its host function map free of stale entries.
This fixes an issue I was seeing where a bunch of WeakBlocks stuck around with nothing but
finalized Weak<NativeExecutable> entries.

* jit/JITThunks.h:
* jit/JITThunks.cpp:
(JSC::JITThunks::finalize): Make JITThunks inherit from WeakHandleOwner so it can receive
a callback when the NativeExecutables get garbage collected.

(JSC::JITThunks::hostFunctionStub): Pass 'this' as the handle owner when creating Weaks.

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

4 years agoAdd some WorkQueue tests to TestWebKitAPI
bfulgham@apple.com [Sun, 8 Mar 2015 23:55:10 +0000 (23:55 +0000)]
Add some WorkQueue tests to TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=142447

Reviewed by Sam Weinig.

* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/WorkQueue.cpp: Added.
(TestWebKitAPI::simpleTest):
(TestWebKitAPI::longTest):
(TestWebKitAPI::thirdTest):
(TestWebKitAPI::finishedTests):
(TestWebKitAPI::TEST):
(TestWebKitAPI::longTest2):

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

4 years agoBuiltinExecutables keeps finalized Weaks around, pinning WeakBlocks.
akling@apple.com [Sun, 8 Mar 2015 23:47:25 +0000 (23:47 +0000)]
BuiltinExecutables keeps finalized Weaks around, pinning WeakBlocks.
<https://webkit.org/b/142460>

Reviewed by Geoffrey Garen.

Make BuiltinExecutables a WeakHandleOwner so it can clear out its respective Weak members
if and when their pointees get garbage collected.

This fixes an issue I've seen locally where a WeakBlock is pinned down by a single one of
these Weak<BuiltinExecutables>.

* builtins/BuiltinExecutables.h: Make BuiltinExecutables inherit from WeakHandleOwner.

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::finalize): Clear out the relevant member pointer when it's been
garbage collected. We use the WeakImpl's "context" field to pass the address of the member.

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

4 years agoDon't call RenderLayerCompositor::needsToBeComposited() so many times
simon.fraser@apple.com [Sun, 8 Mar 2015 23:39:16 +0000 (23:39 +0000)]
Don't call RenderLayerCompositor::needsToBeComposited() so many times
https://bugs.webkit.org/show_bug.cgi?id=142441

Reviewed by Brent Fulgham.

Save one call to needsToBeComposited() per RenderLayer while rebuilding compositing
layers, and a call to isRunningAcceleratedTransformAnimation() in some cases.

computeCompositingRequirements() already knows if the layer will be composited, so
pass that to updateBacking() in the form of a "yes/no/don't" know enum. However,
since updateBacking() no longer calls needsToBeComposited(), we need to call
requiresCompositingForPosition() to get the viewportConstrainedNotCompositedReason flags.

isRunningAcceleratedTransformAnimation() will only be true for a layer which has a
direct compositing reason, so only call isRunningAcceleratedTransformAnimation()
in that case.

* rendering/RenderLayerCompositor.cpp:
(WebCore::rendererForCompositingTests):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::requiresCompositingLayer): Use references.
(WebCore::RenderLayerCompositor::reasonsForCompositing): Use references.
* rendering/RenderLayerCompositor.h:

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

4 years ago[Content Extensions] Pass compiled content extensions as read-only shared memory...
weinig@apple.com [Sun, 8 Mar 2015 21:32:50 +0000 (21:32 +0000)]
[Content Extensions] Pass compiled content extensions as read-only shared memory rather than copying them
https://bugs.webkit.org/show_bug.cgi?id=142458

Reviewed by Dan Bernstein.

* Shared/WebCompiledContentExtensionData.cpp:
(WebKit::WebCompiledContentExtensionData::encode):
(WebKit::WebCompiledContentExtensionData::decode):
* Shared/WebCompiledContentExtensionData.h:
(WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
Store the compiled data as a SharedMemory block with offset/size pairs for the
bytecode and actions. While the bytecode offset is currently always 0, this won't
be the case when we map these in from files due to metadata that will be placed
at the top of the files.

* Shared/WebCompiledContentExtension.h:
* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
Temporary creation helper. In subsequent patches, this will be removed and replaced
by always passing in shared/mapped data.

(WebKit::WebCompiledContentExtension::create):
(WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
(WebKit::WebCompiledContentExtension::bytecode):
(WebKit::WebCompiledContentExtension::bytecodeLength):
(WebKit::WebCompiledContentExtension::actions):
(WebKit::WebCompiledContentExtension::actionsLength):
Convert to work with the new WebCompiledContentExtension format.

* UIProcess/API/C/WKUserContentFilterRef.cpp:
(WKUserContentFilterCreate):
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter initWithName:serializedRules:]):
Switch to using WebCompiledContentExtension::createFromCompiledContentExtensionData().

* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::addUserContentExtensions):
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::addUserContentExtension):
Update to pass the WebCompiledContentExtensionData directly to the WebCompiledContentExtension.

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

4 years agoIn RenderLayerCompositor, track layer bounds and the haveComputedBounds flag together...
simon.fraser@apple.com [Sun, 8 Mar 2015 17:02:16 +0000 (17:02 +0000)]
In RenderLayerCompositor, track layer bounds and the haveComputedBounds flag together in a struct
https://bugs.webkit.org/show_bug.cgi?id=142449

Reviewed by Brent Fulgham.

Rather than tracking 'layerBounds' and 'haveComputedBounds' separately, group them together
in an OverlapExtent struct and add a function to compute the bounds, which removes
a copy of this code. OverlapExtent will be extended in a future patch.

No behavior change.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Allow const access to
the geometryMap, used by computeExtent().
(WebCore::RenderLayerCompositor::computeExtent):
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
* rendering/RenderLayerCompositor.h:

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

4 years ago[iOS] Gardening to skip new tests, rebaseline existing tests
ddkilzer@apple.com [Sun, 8 Mar 2015 10:27:57 +0000 (10:27 +0000)]
[iOS] Gardening to skip new tests, rebaseline existing tests

* platform/ios-simulator-wk1/TestExpectations:
- Mark test as flakey.

* platform/ios-simulator-wk2/fast/css/text-overflow-input-expected.txt: Remove.
* platform/ios-simulator-wk2/fast/forms/input-disabled-color-expected.txt: Remove.
* platform/ios-simulator-wk2/fast/forms/input-text-word-wrap-expected.txt: Remove.
* platform/ios-simulator-wk2/fast/forms/minWidthPercent-expected.txt: Remove.
- Superceded by new platform/ios-simulator results.

* platform/ios-simulator/TestExpectations:
- Skip two tests that will always time out on iOS.
- Mark two tests as ImageOnlyFailure that fail consistently.

* platform/ios-simulator/compositing/media-controls-bar-appearance-expected.txt: Add.
- Add result for new test from r180965.

* platform/ios-simulator/fast/attachment/attachment-label-highlight-expected.txt: Add.
* platform/ios-simulator/fast/attachment/attachment-progress-expected.txt: Add.
* platform/ios-simulator/fast/attachment/attachment-subtitle-expected.txt: Add.
* platform/ios-simulator/fast/attachment/attachment-title-expected.txt: Add.
- Add results for new attachment tests.

* platform/ios-simulator/fast/css/text-overflow-input-expected.txt: Update.
* platform/ios-simulator/fast/forms/input-disabled-color-expected.txt: Update.
* platform/ios-simulator/fast/forms/input-text-scroll-left-on-blur-expected.txt: Update.
* platform/ios-simulator/fast/forms/input-text-word-wrap-expected.txt: Update.
* platform/ios-simulator/fast/forms/minWidthPercent-expected.txt: Update.
* platform/ios-simulator/tables/mozilla/bugs/bug59354-expected.txt: Update.
* platform/ios-simulator/tables/mozilla/bugs/bug96334-expected.txt: Update.
* platform/ios-simulator/tables/mozilla/other/move_row-expected.txt: Update.
- Rebaseline after other bug fixes like r180815.

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

4 years agoRemove willDestroyFrame in WKBundlePageLoaderClient
carlosgc@webkit.org [Sun, 8 Mar 2015 08:10:24 +0000 (08:10 +0000)]
Remove willDestroyFrame in WKBundlePageLoaderClient
https://bugs.webkit.org/show_bug.cgi?id=142389

Reviewed by Anders Carlsson.

Source/WebKit2:

I added willDestroyFrame in r154540 but I realized recently that
it has never actually worked. Adding the callback to
WKBundlePageLoaderClient was the first mistake, since frames are
handled by WebProcess and DidDestroyFrame message is indeed a
WebProcessProxy not a WebPageProxy one. Second mistake was calling
the callback from WebFrameLoaderClient::frameLoaderDestroyed(),
since at that point the frame has already been detached from the
page and so WebFrame::page() always returns nullptr. So, this in
fact dead code and since r180211 nobody is using it.

* WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(webkitWebPageCreate): Use verion 6 instead of version 7 of loader client.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::willDestroyFrame): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::frameLoaderDestroyed):

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

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

4 years agoUnreviewed EFL gardening on 8th Mar.
gyuyoung.kim@samsung.com [Sun, 8 Mar 2015 06:51:22 +0000 (06:51 +0000)]
Unreviewed EFL gardening on 8th Mar.

Mark emphasis text test, writing mode test, whitespace test to failure.
Besides update new failure tests to existing bugs.

* platform/efl/TestExpectations:

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

4 years ago[Win] Revive WTF::WorkQueue on Windows
bfulgham@apple.com [Sun, 8 Mar 2015 04:57:54 +0000 (04:57 +0000)]
[Win] Revive WTF::WorkQueue on Windows
https://bugs.webkit.org/show_bug.cgi?id=142432

Reviewed by Darin Adler.

Revive the Windows implementation of WTF::WorkQueue.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* wtf/WorkQueue.h:
* wtf/win/WorkItemWin.cpp: Added.
* wtf/win/WorkItemWin.h: Added.
* wtf/win/WorkQueueWin.cpp: Added.

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

4 years agoCrash in WebCore::NotificationCenter::stop()
cdumez@apple.com [Sun, 8 Mar 2015 03:37:26 +0000 (03:37 +0000)]
Crash in WebCore::NotificationCenter::stop()
https://bugs.webkit.org/show_bug.cgi?id=142444
<rdar://problem/20082520>

Reviewed by Andreas Kling.

A use-after-free would sometimes cause us to crash in NotificationCenter::stop().
After investigation, it turns out that NotificationCenter::stop() calls
NotificationClient::clearNotifications() which will destroy the Notification
objects, all of which hold a strong reference to the NotificationCenter. If at
this point, only Notifications are ref'ing the NotificationCenter, this means
that the NotificationCenter will get destroyed right after the call to
NotificationClient::clearNotifications(). However, we reset m_client to null
after calling clearNotifications() and it causes us to crash in this case.

The issue is addressed by adding a Ref<NotificationCenter> protector in
NotificationCenter::stop() so that we make sure the NotificationCenter lives
at least until the end of the method execution.

I was able to consistently reproduce the crash by doing:
Tools/Scripts/run-webkit-tests -1 --debug --repeat-each=30 -g http/tests/notifications/event-listener-crash.html

No new tests, already covered by:
http/tests/notifications/event-listener-crash.html

* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::stop):

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

4 years agoTidy up RenderLayerCompositor's CompositingState
simon.fraser@apple.com [Sun, 8 Mar 2015 02:49:21 +0000 (02:49 +0000)]
Tidy up RenderLayerCompositor's CompositingState
https://bugs.webkit.org/show_bug.cgi?id=142445

Reviewed by Dan Bernstein.

Make CompositingState a private struct in RenderLayerCompositor.
Since it's a struct, remove the m_ prefix from its data members.

No behavior change.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::CompositingState::CompositingState):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::CompositingState::CompositingState): Deleted.
* rendering/RenderLayerCompositor.h:

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

4 years agoImprove the event handler test
darin@apple.com [Sun, 8 Mar 2015 02:14:22 +0000 (02:14 +0000)]
Improve the event handler test
https://bugs.webkit.org/show_bug.cgi?id=142439

Reviewed by Ryosuke Niwa.

* fast/dom/event-handler-attributes-expected.txt: Renamed from legacy-event-handler-attributes-expected.txt.
Also updated to reflect changes in the test.

* fast/dom/event-handler-attributes.html: Renamed from legacy-event-handler-attributes.html.
Fixed bug in the test that was making document event handler tests falsely report failure.
Removed testing of some HTMLMediaElement attributes that are conditionally present; this test
is intended to test only unconditionally available event handler attributes at this time.

* platform/win/fast/dom/legacy-event-handler-attributes-expected.txt: Removed. The conditional HTMLMediaElement
attributes are the reason the Windows-specific results were needed.

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

4 years agoUnindent EventTarget, EventListener, JSEventLister.h files
darin@apple.com [Sun, 8 Mar 2015 01:37:26 +0000 (01:37 +0000)]
Unindent EventTarget, EventListener, JSEventLister.h files
https://bugs.webkit.org/show_bug.cgi?id=142440

Reviewed by Alexey Proskuryakov.

* bindings/js/JSEventListener.h:
* dom/EventListener.h:
* dom/EventTarget.h:
Change indentation to match coding style rules.

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