WebKit-https.git
4 years agoProgress towards CMake on Mac.
achristensen@apple.com [Sat, 14 Mar 2015 02:57:54 +0000 (02:57 +0000)]
Progress towards CMake on Mac.
https://bugs.webkit.org/show_bug.cgi?id=142680

Reviewed by Gyuyoung Kim.

.:

* CMakeLists.txt:
* Source/PlatformMac.cmake: Added stub.
* Source/cmake/OptionsMac.cmake:
Change defines to get CMake working.

Source/bmalloc:

* CMakeLists.txt:
* PlatformMac.cmake:
Added Zone.cpp to Mac CMake builds.

Source/JavaScriptCore:

* PlatformMac.cmake:
Generate TracingDtrace.h based on project.pbxproj.

Source/WebCore:

* PlatformMac.cmake:
Added new include directories and removed old source files.

Source/WebKit:

* CMakeLists.txt: Added.

Source/WebKit2:

* PlatformMac.cmake: Added.

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

4 years agoObject allocation sinking phase shouldn't re-decorate previously sunken allocations...
fpizlo@apple.com [Sat, 14 Mar 2015 02:50:36 +0000 (02:50 +0000)]
Object allocation sinking phase shouldn't re-decorate previously sunken allocations on each fixpoint operation
https://bugs.webkit.org/show_bug.cgi?id=142686

Reviewed by Oliver Hunt.

Just because promoteHeapAccess() notifies us of an effect to a heap location in a node doesn't
mean that we should handle it as if it was for one of our sinking candidates. Instead we should
prune based on m_sinkCandidates.

This fixes a benign bug where we would generate a lot of repeated IR for some pathological
tests.

* dfg/DFGObjectAllocationSinkingPhase.cpp:
(JSC::DFG::ObjectAllocationSinkingPhase::promoteSunkenFields):

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

4 years agoUnreviewed, rolling out r181483.
commit-queue@webkit.org [Sat, 14 Mar 2015 02:50:28 +0000 (02:50 +0000)]
Unreviewed, rolling out r181483.
https://bugs.webkit.org/show_bug.cgi?id=142688

Caused use-after-free on many tests (Requested by ap on
#webkit).

Reverted changeset:

"Allow clients to selectively disable plug-ins"
https://bugs.webkit.org/show_bug.cgi?id=142506
http://trac.webkit.org/changeset/181483

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

4 years agoCache glyph widths to GlyphPages
antti@apple.com [Sat, 14 Mar 2015 01:10:53 +0000 (01:10 +0000)]
Cache glyph widths to GlyphPages
https://bugs.webkit.org/show_bug.cgi?id=142028

Reviewed by Andreas Kling.

Currently we have a separate cache in Font for glyph widths. In practice we always need
the widths so we can just cache them in GlyphPages. This simplifies the code and removes
a per-character hash lookup from WidthIterator.

* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::initCharWidths):
(WebCore::Font::platformGlyphInit):
(WebCore::createAndFillGlyphPage):
(WebCore::Font::computeWidthForGlyph):

    Rename to make it clear this doesn't cache.

(WebCore::GlyphPage::setGlyphDataForIndex):

    Initialize the width.
    This could go to GlyphPage.cpp if we had one.

* platform/graphics/Font.h:
(WebCore::Font::glyphZeroWidth):
(WebCore::Font::isZeroWidthSpaceGlyph):
(WebCore::Font::zeroGlyph): Deleted.
(WebCore::Font::setZeroGlyph): Deleted.
(WebCore::Font::widthForGlyph): Deleted.
* platform/graphics/FontCascade.cpp:
(WebCore::offsetToMiddleOfGlyph):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForCharacter):
* platform/graphics/GlyphPage.h:
(WebCore::GlyphData::GlyphData):

    Return width too as part of GlyphData.

(WebCore::GlyphPage::glyphDataForIndex):
(WebCore::GlyphPage::setGlyphDataForCharacter):
(WebCore::GlyphPage::setGlyphDataForIndex):
(WebCore::GlyphPage::GlyphPage):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):

    No need to lookup width separately now.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::advanceForGlyph):
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::missingGlyphForFont):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::initializeFont):

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

4 years ago[Mac] Enable WIRELESS_PLAYBACK_TARGET
eric.carlson@apple.com [Sat, 14 Mar 2015 00:52:06 +0000 (00:52 +0000)]
[Mac] Enable WIRELESS_PLAYBACK_TARGET
https://bugs.webkit.org/show_bug.cgi?id=142635

Reviewed by Darin Adler.

* Configurations/FeatureDefines.xcconfig:

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

4 years agoClass constructor should throw TypeError when "called"
rniwa@webkit.org [Fri, 13 Mar 2015 23:01:51 +0000 (23:01 +0000)]
Class constructor should throw TypeError when "called"
https://bugs.webkit.org/show_bug.cgi?id=142566

Reviewed by Michael Saboff.

Source/JavaScriptCore:

Added ConstructorKind::None to denote code that doesn't belong to an ES6 class.
This allows BytecodeGenerator to emit code to throw TypeError when generating code block
to call ES6 class constructors.

Most of changes are about increasing the number of bits to store ConstructorKind from one
bit to two bits.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::needsActivation):
(JSC::ExecutableInfo::usesEval):
(JSC::ExecutableInfo::isStrictMode):
(JSC::ExecutableInfo::isConstructor):
(JSC::ExecutableInfo::isBuiltinFunction):
(JSC::ExecutableInfo::constructorKind):
(JSC::UnlinkedFunctionExecutable::constructorKind):
(JSC::UnlinkedCodeBlock::constructorKind):
(JSC::UnlinkedFunctionExecutable::constructorKindIsDerived): Deleted.
(JSC::UnlinkedCodeBlock::constructorKindIsDerived): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate): Don't emit bytecode when we had already emitted code
to throw TypeError.
(JSC::BytecodeGenerator::BytecodeGenerator): Emit code to throw TypeError when generating
code to call.
(JSC::BytecodeGenerator::emitReturn):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::constructorKind):
(JSC::BytecodeGenerator::constructorKindIsDerived): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::ThisNode::emitBytecode):
(JSC::FunctionCallValueNode::emitBytecode):
* parser/Nodes.cpp:
(JSC::FunctionBodyNode::FunctionBodyNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo): Renamed the incoming function argument to
ownerClassKind. Set constructorKind to Base or Derived only if we're parsing a constructor.
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass): Don't parse static methods using MethodMode since that
would result in BytecodeGenerator erroneously treating static method named "constructor" as
a class constructor.
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parsePrimaryExpression):
* parser/Parser.h:
* parser/ParserModes.h:
* runtime/Executable.h:
(JSC::EvalExecutable::executableInfo):
(JSC::ProgramExecutable::executableInfo):

LayoutTests:

Added tests for calling class constructors.

* TestExpectations: Skipped the test since ES6 class syntax isn't enabled by default.
* js/class-syntax-call-expected.txt: Added.
* js/class-syntax-call.html: Added.
* js/script-tests/class-syntax-call.js: Added.

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

4 years agoFix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
commit-queue@webkit.org [Fri, 13 Mar 2015 22:30:36 +0000 (22:30 +0000)]
Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
https://bugs.webkit.org/show_bug.cgi?id=142678

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-03-13
Reviewed by Eric Carlson.

Add the missing 'n' in "fullscreen".

* platform/spi/ios/AVKitSPI.h:

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

4 years agoSites that use a device-width viewport but don't have enough height to fill the view...
timothy_horton@apple.com [Fri, 13 Mar 2015 21:07:06 +0000 (21:07 +0000)]
Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
https://bugs.webkit.org/show_bug.cgi?id=142664
<rdar://problem/18859470>

Reviewed by Benjamin Poulain.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
(WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
Split shouldIgnoreScalingConstraints into one for each dimension.

(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
Don't force the initial and minimum scales to cover the whole view if the
page claims to want to lay out to device width but then lays out too big.
This will allow pages that misbehave in this way to scale down further
than they previously could, but will result in a region of empty background
color being exposed at the initial/minimum scale.

(WebCore::ViewportConfiguration::description):
Update the logging to show each dimension separately.

* page/ViewportConfiguration.h:

* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
Now that the WKContentView can (without pinching) be smaller than the unobscured
region of the WKWebView, we need to take that into account when deciding where
to retarget scrolling.

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

4 years agoDFG::PutStackSinkingPhase should eliminate GetStacks that have an obviously known...
fpizlo@apple.com [Fri, 13 Mar 2015 20:18:08 +0000 (20:18 +0000)]
DFG::PutStackSinkingPhase should eliminate GetStacks that have an obviously known source
https://bugs.webkit.org/show_bug.cgi?id=141624

Reviewed by Oliver Hunt.

This was an obvious omission from the original PutStackSinkingPhase. Previously, we would treat
GetStacks conservatively and assume that the stack slot escaped. That's pretty dumb, since a
GetStack is a local load of the stack. This change makes GetStack a no-op from the standpoint of
this phase's deferral analysis. At the end we either keep the GetStack (if there was no concrete
deferral) or we replace it with an identity over the value that would have been stored by the
deferred PutStack. Note that this might be a Phi that the phase creates, so this is strictly
stronger than what GCSE could do.

This is probably not a speed-up now, but it will be very useful for the varargs simplification
done in bug 141174.

* dfg/DFGPutStackSinkingPhase.cpp:

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

4 years agoProhibit GC while sweeping
ggaren@apple.com [Fri, 13 Mar 2015 20:14:39 +0000 (20:14 +0000)]
Prohibit GC while sweeping
https://bugs.webkit.org/show_bug.cgi?id=142638

Reviewed by Andreas Kling.

I noticed in https://bugs.webkit.org/show_bug.cgi?id=142636 that a GC
could trigger a sweep which could trigger another GC. Yo Dawg.

I tried to figure out whether this could cause problems or not and it
made me cross-eyed.

(Some clients like to report extra memory cost during deallocation as a
way to indicate that the GC now owns something exclusively. It's
arguably a bug to communicate with the GC in this way, but we shouldn't
do crazy when this happens.)

This patch makes explicit the fact that we don't allow GC while sweeping.

Usually, sweeping implicitly defers GC by virtue of happening during
allocation. But not always.

* heap/Heap.cpp:
(JSC::Heap::collectAllGarbage): Defer GC while sweeping due to an
explicit GC request.

(JSC::Heap::didFinishCollection): Make sure that zombifying sweep
defers GC by not returning to the non-GC state until we're all done.

* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::sweepNextBlock): Defer GC while sweeping due
to a timer.

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

4 years agoReplace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
mark.lam@apple.com [Fri, 13 Mar 2015 20:04:29 +0000 (20:04 +0000)]
Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
<https://webkit.org/b/142674>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

* API/JSValue.mm:
(handerForStructTag):
* API/JSWrapperMap.mm:
* dfg/DFGCommon.cpp:
(JSC::DFG::startCrashing):
(JSC::DFG::isCrashing):
- Changed to use a StaticSpinLock since that's what this code was trying to do
  anyway.
* heap/CopiedBlock.h:
(JSC::CopiedBlock::CopiedBlock):
* heap/CopiedSpace.cpp:
(JSC::CopiedSpace::CopiedSpace):
* heap/CopiedSpace.h:
* heap/GCThreadSharedData.cpp:
(JSC::GCThreadSharedData::GCThreadSharedData):
* heap/GCThreadSharedData.h:
* heap/ListableHandler.h:
(JSC::ListableHandler::List::List):
* parser/SourceProvider.cpp:
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::addDatabaseToAtExit):
(JSC::Profiler::Database::removeDatabaseFromAtExit):
(JSC::Profiler::Database::removeFirstAtExitDatabase):

Source/WebCore:

No new tests because there is no new functionality. This is a refactoring effort.

* bindings/objc/WebScriptObject.mm:
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow initWithLayer:]):
(-[WAKWindow initWithFrame:]):

Source/WebKit2:

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::EventDispatcher):
* WebProcess/WebPage/EventDispatcher.h:
* WebProcess/WebPage/ViewUpdateDispatcher.cpp:
(WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
* WebProcess/WebPage/ViewUpdateDispatcher.h:

Source/WTF:

We no longer use TCMalloc in our code, and we now have C++11.  This replaces the
TCMalloc_SpinLock with a new WTF::SpinLock based on WTF::Atomic (which is a
wrapper around std::atomic).

Note that there is a StaticSpinLock and a SpinLock:

1. StaticSpinLock is an alias for SpinLockBase, and its initialization relies on
   static / global std:atomic being automatically initialized to 0 at compile time.
   Hence, StaticSpinLock should only be used for statics / globals (including
   static members of classes / structs).

2. SpinLock is derived from SpinLockBase, and adds a default constructor to
   initialize its internal atomic value to 0.  Because SpinLock has a constructor,
   it cannot be used for statics / globals.  Objects that want to embed a spin
   lock as an instance field should use SpinLock so that it is initialized properly.
   std::atomic will not automatically initialize instance fields to 0.  Hence,
   StaticSpinLock will not work correctly as instance fields of a class / struct.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/MetaAllocator.cpp:
(WTF::MetaAllocator::~MetaAllocator):
(WTF::MetaAllocator::MetaAllocator):
* wtf/MetaAllocator.h:
* wtf/SpinLock.h: Added.
(WTF::SpinLockBase::lock):
(WTF::SpinLockBase::unlock):
(WTF::SpinLockBase::isLocked):
(WTF::SpinLockBase::slowLock):
(WTF::SpinLock::SpinLock):
* wtf/TCSpinLock.h: Removed.
* wtf/text/AtomicString.cpp:

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

4 years agoAX: Provide API for assistive tech to ignore DOM key event handlers
commit-queue@webkit.org [Fri, 13 Mar 2015 19:24:01 +0000 (19:24 +0000)]
AX: Provide API for assistive tech to ignore DOM key event handlers
https://bugs.webkit.org/show_bug.cgi?id=142059

Patch by Doug Russell <d_russell@apple.com> on 2015-03-13
Reviewed by Beth Dakin.

Assistive technology applications on the desktop are heavily dependent on keyboard navigation being reliable. This is greatly hindered by sites that handle key events without updating keyboard selection and then consume the event. It is important for assistive technology apps to allow users to decide to ignore these handlers that are incorrect for their purposes.

This can be fixed by exposing, via a new accessibility attribute, a way to decide, for a given WebCore::Frame, to pre-empt DOM dispatch and instead let accessibility caret browsing take place.

Source/WebCore:

Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
(WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
* dom/Element.cpp:
(WebCore::Element::dispatchKeyEvent):
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
(WebCore::handleKeyboardSelectionMovement):
(WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
* page/EventHandler.h:
* page/Settings.in:

LayoutTests:

* accessibility/parent-delete-expected.txt:
* platform/mac/accessibility/document-attributes-expected.txt:
* platform/mac/accessibility/prevent-keyboard-event-dispatch-expected.txt: Added.
* platform/mac/accessibility/prevent-keyboard-event-dispatch.html: Added.

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

4 years agoAllow clients to selectively disable plug-ins
conrad_shultz@apple.com [Fri, 13 Mar 2015 18:58:32 +0000 (18:58 +0000)]
Allow clients to selectively disable plug-ins
https://bugs.webkit.org/show_bug.cgi?id=142506

Reviewed by Anders Carlsson.

Source/WebCore:

Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
from the page). As part of this:

1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
   set of plug-ins.

2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
   down the stack.

3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
   a concrete implementation thereof in WebPlatformStrategies in WebKit2.

4) Add messaging infrastructure to allow clients to set and clear plug-in policies.

While currently only used in a very limited manner, the new declarative plug-in policies are written generically
so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
Update to reflect function rename.

* loader/SubframeLoader.cpp:
(WebCore::findPluginMIMETypeFromURL):
Adopt getWebVisibleMimesAndPluginIndices().
(WebCore::logPluginRequest):
Update to reflect function rename.
(WebCore::SubframeLoader::shouldUsePlugin):
Ditto.

* platform/PlatformStrategies.h:
Export platformStrategies(), since it is now used in WebProcess.cpp.

* plugins/DOMMimeType.cpp:
(WebCore::DOMMimeType::type):
(WebCore::DOMMimeType::description):
(WebCore::DOMMimeType::mimeClassInfo):
Adopt getWebVisibleMimesAndPluginIndices().
(WebCore::DOMMimeType::enabledPlugin):
Ditto.

* plugins/DOMMimeType.h:
Don't return references in a few places where it is no longer safe to do so.
(WebCore::DOMMimeType::mimeClassInfo): Deleted.

* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::length):
Adopt getWebVisibleMimesAndPluginIndices().
(WebCore::DOMMimeTypeArray::item):
Ditto.
(WebCore::DOMMimeTypeArray::canGetItemsForName):
Ditto.
(WebCore::DOMMimeTypeArray::namedItem):
Ditto.

* plugins/DOMPlugin.cpp:
(WebCore::DOMPlugin::pluginInfo):
Adopt getWebVisiblePlugins().
(WebCore::DOMPlugin::item):
Adopt getWebVisibleMimesAndPluginIndices().
(WebCore::DOMPlugin::canGetItemsForName):
Ditto.
(WebCore::DOMPlugin::namedItem):
Ditto.

* plugins/DOMPlugin.h:
(WebCore::DOMPlugin::pluginInfo): Deleted.

* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::length):
Adopt getWebVisiblePlugins().
(WebCore::DOMPluginArray::item):
Ditto.
(WebCore::DOMPluginArray::canGetItemsForName):
Ditto.
(WebCore::DOMPluginArray::namedItem):
Ditto.

* plugins/PluginData.cpp:
(WebCore::PluginData::PluginData):
Stash the passed-in Page and call initPlugins().
(WebCore::PluginData::getWebVisiblePlugins):
New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
(WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
limited to the web-visible plug-ins.
(WebCore::PluginData::supportsWebVisibleMimeType):
Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
(WebCore::PluginData::pluginInfoForWebVisibleMimeType):
Renamed from pluginInfoForMimeType(); ditto.
(WebCore::PluginData::pluginNameForWebVisibleMimeType):
Renamed from pluginNameForMimeType(); ditto.
(WebCore::PluginData::pluginFileForWebVisibleMimeType):
Renamed from pluginFileForMimeType(); ditto.
(WebCore::PluginData::initPlugins):
(WebCore::PluginData::supportsMimeType): Deleted.
(WebCore::PluginData::pluginInfoForMimeType): Deleted.
(WebCore::PluginData::pluginNameForMimeType): Deleted.
(WebCore::PluginData::pluginFileForMimeType): Deleted.

* plugins/PluginData.h:
Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
new members to PluginInfo for the clientLoadPolicy and bundle information.
(WebCore::PluginData::PluginData):
Replace some member functions with new ones that will hide plug-ins upon request from the client;
(WebCore::PluginData::mimes): Deleted.
(WebCore::PluginData::mimePluginIndices): Deleted.

* plugins/PluginStrategy.h:
Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.

* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PluginData>::encodeValue):
Remove now-obsolete code for handling MIME types and add a FIXME.
(JSC::DeserializedPluginData::DeserializedPluginData):
(JSC::EncodingTraits<PluginData>::decodeValue):
Ditto.
(JSC::EncodingTraits<PluginInfo>::encodeValue):
Handle the new members in PluginInfo.
(JSC::EncodingTraits<PluginInfo>::decodeValue):
Ditto.

* replay/WebInputs.json:
Teach Replay about PluginLoadClientPolicy.

Source/WebKit/mac:

Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
from the page). As part of this:

1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
   set of plug-ins.

2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
   down the stack.

3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
   a concrete implementation thereof in WebPlatformStrategies in WebKit2.

4) Add messaging infrastructure to allow clients to set and clear plug-in policies.

While currently only used in a very limited manner, the new declarative plug-in policies are written generically
so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.

* Plugins/WebBasePluginPackage.mm:
(-[WebBasePluginPackage getPluginInfoFromPLists]):
Set new members in PluginInfo.

* Plugins/WebNetscapePluginPackage.mm:
(-[WebNetscapePluginPackage getPluginInfoFromResources]):
Set new members in PluginInfo.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::getWebVisiblePluginInfo):
Override to wrap getPluginInfo().
(WebPlatformStrategies::setPluginLoadClientPolicy):
Override to do nothing.
(WebPlatformStrategies::clearPluginClientPolicies):
Ditto.

* WebView/WebFrame.mm:
(-[WebFrame _canProvideDocumentSource]):
Update to reflect function rename.

Source/WebKit/win:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::getWebVisiblePluginInfo):
Wrap getPluginInfo();

* WebView.cpp:
(WebView::canShowMIMEType):
Update to reflect function rename.

Source/WebKit2:

Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
from the page). As part of this:

1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
   set of plug-ins.

2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
   down the stack.

3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
   a concrete implementation thereof in WebPlatformStrategies in WebKit2.

4) Add messaging infrastructure to allow clients to set and clear plug-in policies.

While currently only used in a very limited manner, the new declarative plug-in policies are written generically
so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo):
Set new PluginInfo members.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PluginInfo>::encode):
Handle new PluginInfo members.
(IPC::ArgumentCoder<PluginInfo>::decode):
Ditto.

* Shared/WebProcessCreationParameters.h:
Declare a member to store client plug-in policies.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
Encode the policies.
(WebKit::WebProcessCreationParameters::decode):
Decode the policies.

* UIProcess/API/C/WKAPICast.h:
(WebKit::toWKPluginLoadClientPolicy):
Teach how to cast between WebCore and WebKit2 policy definitions.
(WebKit::toPluginLoadClientPolicy):
Ditto.

* UIProcess/API/C/WKPluginLoadPolicy.h:
Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.

* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextSetPluginLoadClientPolicy):
New function; wrap WebProcessPool::setPluginLoadClientPolicy().
(WKContextClearPluginClientPolicies):
New function; wrap WebProcessPool::clearPluginClientPolicies().

* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
Copy any client plug-in policies to the new process' creation parameters.
(WebKit::WebProcessPool::setPluginLoadClientPolicy):
Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
(WebKit::WebProcessPool::clearPluginClientPolicies):
Send ClearPluginClientPolicies to all processes and clear any stashed policy info.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::pluginInfo):
Set new PluginInfo member.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::pluginSupportsExtension):
Adopt getWebVisibleMimesAndPluginIndices().
(WebKit::WebFrameLoaderClient::objectContentType):
Update to reflect reflect function rename.

* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::getPluginInfo):
Pass the Page to populatePluginCache().
(WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
to block on the current page.
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
(WebKit::WebPlatformStrategies::clearPluginClientPolicies):
New member function; empty m_hostsToPluginIdentifierData.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
New member function; look up the most specific policy for the given plug-in and host.
(WebKit::WebPlatformStrategies::populatePluginCache):
If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
been populated since the Page, and therefore host, may change.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::canShowMIMEType):
Update to reflect function rename.

* WebProcess/WebProcess.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Enumerate and process the client plug-in policies in the creation parameters.
(WebKit::WebProcess::setPluginLoadClientPolicy):
New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
(WebKit::WebProcess::clearPluginClientPolicies):
New member function; wrap PluginStrategy::clearPluginClientPolicies().

* WebProcess/WebProcess.messages.in:
Add messages for setting and clearing policies.

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

4 years agoBytecodeGenerator needs to be re-entrant to support miranda functions
rniwa@webkit.org [Fri, 13 Mar 2015 18:19:43 +0000 (18:19 +0000)]
BytecodeGenerator needs to be re-entrant to support miranda functions
https://bugs.webkit.org/show_bug.cgi?id=142627

Reviewed by Filip Pizlo.

Made CodeCache::getGlobalCodeBlock and CodeCache::getFunctionExecutableFromGlobalCode re-entrant
by not keeping AddResult while invoking BytecodeGenerator::generate.

This is needed to support Miranda functions since they need to be lazily initialized.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:
(JSC::CodeCacheMap::findCacheAndUpdateAge): Extracted from add.
(JSC::CodeCacheMap::addCache): Extracted from add.
(JSC::CodeCacheMap::add): Deleted.

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

4 years agoIntroduce WTF::Atomic to wrap std::atomic for a friendlier CAS.
mark.lam@apple.com [Fri, 13 Mar 2015 18:02:40 +0000 (18:02 +0000)]
Introduce WTF::Atomic to wrap std::atomic for a friendlier CAS.
<https://webkit.org/b/142661>

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Changed CodeBlock, and the DFG's crashLock to use WTF::Atomic instead of
std::atomic.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitAggregate):
* bytecode/CodeBlock.h:
* dfg/DFGCommon.cpp:
(JSC::DFG::startCrashing):

Source/WTF:

The CAS functions provided by std::atomic takes a reference to the expected
value and modifies it if the CAS fails.  However, in a lot of our CAS usage,
we don't want the expected value to change.  The solution to this is to
provide a WTF::Atomic struct that wraps std::atomic, and provide CAS
methods that won't alter the expected value if the CAS fails.

The method names in WTF::Atomic are chosen to be identical to those
in std::atomic so that WTF::Atomic can be a simple drop in replacement
for std::atomic.

Also changed ByteSpinLock to use WTF::Atomic instead of std::atomic.

* wtf/Atomics.h:
(WTF::Atomic::load):
(WTF::Atomic::store):
(WTF::Atomic::compare_exchange_weak):
(WTF::Atomic::compare_exchange_strong):
* wtf/ByteSpinLock.h:
(WTF::ByteSpinLock::ByteSpinLock):
(WTF::ByteSpinLock::lock):

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

4 years agoXMLHttpRequests should not prevent a page from entering PageCache
cdumez@apple.com [Fri, 13 Mar 2015 17:58:50 +0000 (17:58 +0000)]
XMLHttpRequests should not prevent a page from entering PageCache
https://bugs.webkit.org/show_bug.cgi?id=142612
<rdar://problem/19923085>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Make XMLHttpRequest ActiveDOMObjects suspendable in most cases to
drastically improve the likelihood of pages using them to enter
PageCache. XMLHttpRequest used to be only suspendable when not
loading. After this patch, if the XMLHttpRequest is loading when
navigating away from the page, it will be aborted and the page
will enter the PageCache. Upon restoring the page from PageCache,
the XMLHttpRequests' error handlers will be executed to give them
a chance to reload if they want to.

Test: http/tests/navigation/page-cache-xhr.html

* history/PageCache.cpp:
(WebCore::logCanCacheFrameDecision):
(WebCore::PageCache::canCachePageContainingThisFrame):
Do not prevent a page to enter the page cache ff the main document has
an error that is a cancellation and all remaining subresource loaders
are for XHR. We extend the pre-existing mechanism used on iOS, which
allowed PageCaching if the remaining resource loads are for images.

* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable):
Mark XHR loaders as PageCache acceptable.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::isXMLHttpRequest):
* loader/DocumentThreadableLoader.h:
* loader/ThreadableLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::areAllClientsXMLHttpRequests):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::isXMLHttpRequest):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::XMLHttpRequest):
(WebCore::XMLHttpRequest::createRequest):
(WebCore::XMLHttpRequest::canSuspend):
Report that we can suspend XMLHttpRequests as long as the window load
event has already fired. If the window load event has not fired yet,
it would be unsafe to cancel the load in suspend() as it would
potentially cause arbitrary JS execution while suspending.

(WebCore::XMLHttpRequest::suspend):
If suspending for PageCache and the request is currently loading, abort
the load and mark that we should fire the error event upon restoring
from PageCache.

(WebCore::XMLHttpRequest::resume):
(WebCore::XMLHttpRequest::resumeTimerFired):
Upon resuming, fire the error event in a timer if the load was aborted
for suspending. We need to do this in a timer because we are not allowed
to execute arbitrary JS inside resume().

(WebCore::XMLHttpRequest::stop):
Add a assertion to make sure we are not firing event inside stop() as
this would potentially cause arbitrary JS execution and it would be
unsafe. It seems to me that our code is currently unsafe but the
assertion does not seem to be hit by our current layout tests. I am
adding the assertion as it would make it clear we have a bug and we
need to fix it.

* xml/XMLHttpRequest.h:

LayoutTests:

Add a tests to make sure that loading XMLHttpRequests do not prevent a
page from entering PageCache.

* http/tests/navigation/page-cache-xhr-expected.txt: Added.
* http/tests/navigation/page-cache-xhr.html: Added.
* http/tests/navigation/resources/page-cache-helper.html: Added.

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

4 years agoWebKit test infrastructure should automate the process of cloning W3C test suite...
youenn.fablet@crf.canon.fr [Fri, 13 Mar 2015 16:00:03 +0000 (16:00 +0000)]
WebKit test infrastructure should automate the process of cloning W3C test suite and importing tests from it
https://bugs.webkit.org/show_bug.cgi?id=134764

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

TestRepositories defines the git repositories used to import tests.
It defines for each repository the infrastructure paths to always import, the paths to skip and the revision to use.
ImportExpectartions defines the tests to import.

* resources/ImportExpectations: Added.
* resources/TestRepositories: Added.

Tools:

TestDownloader is introduced to download W3C tests from the official
W3C tests repositories (https://github.com/w3c/web-platform-tests.git
and https://github.com/w3c/csswg-test.git).
TestDownloader clones the repositories and checkouts revisions of the tests
defined in LayoutTests/imported/w3c/resources/TestRepositories.

Similarly to https://codereview.chromium.org/148173016,
TestDownloader copies part of the files based on the rules
defined in LayoutTests/imported/w3c/resources/ImportExpectations.

TestDownloader is used by TestImporter when no source directory is provided.

* Scripts/webkitpy/w3c/test_downloader.py: Added.
(TestDownloader):
(TestDownloader.default_options):
(TestDownloader.load_test_repositories):
(TestDownloader.__init__):
(TestDownloader.checkout_test_repository):
(TestDownloader._init_paths_from_expectations):
(TestDownloader._add_test_suite_paths):
(TestDownloader._empty_directory):
(TestDownloader.copy_tests):
(TestDownloader.download_tests):
* Scripts/webkitpy/w3c/test_importer.py:
(main):
(parse_args):
(TestImporter.__init__):
(TestImporter.do_import):
(TestImporter.test_downloader):
(TestImporter.find_importable_tests.should_keep_subdir):
(TestImporter.should_convert_test_harness_links):
(TestImporter.import_tests):
(TestImporter.write_import_log):

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

4 years agoUnreviewed Gardening 13th March.
commit-queue@webkit.org [Fri, 13 Mar 2015 13:50:48 +0000 (13:50 +0000)]
Unreviewed Gardening 13th March.
https://bugs.webkit.org/show_bug.cgi?id=142665

Unreviewed.

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

* platform/gtk/TestExpectations:
* platform/gtk/fast/borders/mixed-border-style2-expected.txt: Added. The result was missing.

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

4 years agoRebaseline accessibility/color-well.html
commit-queue@webkit.org [Fri, 13 Mar 2015 13:47:29 +0000 (13:47 +0000)]
Rebaseline accessibility/color-well.html
https://bugs.webkit.org/show_bug.cgi?id=141697

Patch by Marcos Chavarría Teijeiro <chavarria1991@gmail.com> on 2015-03-13
Reviewed by Chris Fleizach.

The revision (r179922) which makes this test fail, implements a color
picker for GTK+ platform. So now we have different accessibility
information for a color input and we could update the expected file.

TestExpectations has also been updated.

* platform/gtk/TestExpectations:
* platform/gtk/accessibility/color-well-expected.txt:

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

4 years agoUse UIDocumentMenuViewController to allow selection of files from
jhoneycutt@apple.com [Fri, 13 Mar 2015 08:08:56 +0000 (08:08 +0000)]
Use UIDocumentMenuViewController to allow selection of files from
iCloud Drive in WKFileUploadPanel

Part of <https://bugs.webkit.org/show_bug.cgi?id=142596> WebKit on
iOS should support file upload from iCloud Drive
<rdar://problem/12178991>

Reviewed by Andy Estes.

* Platform/spi/ios/UIKitSPI.h:
Include UIDocumentMenuViewController_Private.h if it exists. If not,
declare this new SPI.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(fallbackIconForFile):
Create a UIDocumentInteractionController for the file, and return a
thumbnail image from its smallest icon.

(iconForImageFile):
If we can get a UIImage from the file, create a thumbnail from it.
Otherwise, call fallbackIconForFile().

(iconForVideoFile):
Code moved from -[_WKVideoFileUploadItem displayImage].

(iconForFile):
Get the file's extension, and get the extension's preferred UTI. If the
UTI is an image type, call iconForImageFile(). If it's a video type,
call iconForVideoFile(). Otherwise, return the fallback icon.

(-[_WKFileUploadItem initWithFileURL:]):
Added an initializer that takes a file URL.

(-[_WKFileUploadItem fileURL]):
(-[_WKImageFileUploadItem initWithFileURL:originalImage:]):
(-[_WKVideoFileUploadItem displayImage]):
(WKFileUploadPanel):
Inherit from UIDocumentPickerDelegate and UIDocumentMenuDelegate. Add
an ivar for the document menu controller.

(-[WKFileUploadPanel dealloc]):
(-[WKFileUploadPanel presentWithParameters:resultListener:]):
If instances of UIDocumentMenuViewController respond to
-_setIgnoreApplicationEntitlementForImport:, meaning we can disable the
assertion that the current app has the iCloud Documents entitlement,
then show the document picker menu. Otherwise, show the current source
selection UI. The runtime check will be removed when a newer UIKit is
available.

(UTIsForMIMETypes):
Return the UTIs for the <input> element's "accept" attribute's MIME
type list.

(-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
Call UTIsForMIMETypes(). Fall back to available source types for this
picker type.

(-[WKFileUploadPanel _documentPickerMenuMediaTypes]):
Call UTIsForMIMETypes(). Fall back to the all-encompassing
"public.item" UTI.

(-[WKFileUploadPanel _photoLibraryButtonLabel]):
(-[WKFileUploadPanel _cameraButtonLabel]):
Factored out of -_showMediaSourceSelectionSheet. Return the
appropriate label for the camera button, based on whether it can take a
photo or video, or return nil if the camera is not available.

(-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
Changed to use -_cameraButtonLabel and
-_presentForCurrentInterfaceIdiom:.

(-[WKFileUploadPanel _showDocumentPickerMenu]):
Create a UIDocumentMenuViewController, and populate it with options to
open the photo library or take a picture or video. If iCloud Drive or
other document sources are available, they will be added automatically.

(-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]):
(-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
(-[WKFileUploadPanel documentMenuWasCancelled:]):
(-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
(-[WKFileUploadPanel documentPickerWasCancelled:]):
(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):

(-[_WKImageFileUploadItem initWithFilePath:originalImage:]): Deleted.
(-[_WKImageFileUploadItem fileURL]): Deleted.
(-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): Deleted.
(-[_WKVideoFileUploadItem fileURL]): Deleted.

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

4 years agoFix Debug build error 'comparison is always true due to limited range of data type...
commit-queue@webkit.org [Fri, 13 Mar 2015 07:52:39 +0000 (07:52 +0000)]
Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]'
https://bugs.webkit.org/show_bug.cgi?id=142652

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-03-13
Reviewed by Csaba Osztrogonác.

No new tests, no behavior changes.

Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more.

* css/CSSPrimitiveValue.cpp:
(WebCore::propertyName):
* css/makeprop.pl:

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

4 years agoUnreviewed GTK+ Gardening
commit-queue@webkit.org [Fri, 13 Mar 2015 07:18:22 +0000 (07:18 +0000)]
Unreviewed GTK+ Gardening
https://bugs.webkit.org/show_bug.cgi?id=142620

Rebaseline the missing test result

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-03-13

* platform/gtk/fast/borders/mixed-border-style2-expected.png: Added.
* platform/gtk/fast/css/css2-system-fonts-expected.txt: Added.
* platform/gtk/fast/text/tatechuyoko-expected.txt: Added.

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

4 years agoChange the DFG crashLock to use std::atomic.
mark.lam@apple.com [Fri, 13 Mar 2015 03:02:16 +0000 (03:02 +0000)]
Change the DFG crashLock to use std::atomic.
<https://webkit.org/b/142649>

Reviewed by Filip Pizlo.

* dfg/DFGCommon.cpp:
(JSC::DFG::startCrashing):
(JSC::DFG::isCrashing):

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

4 years agoRemove DrawingBuffer
commit-queue@webkit.org [Fri, 13 Mar 2015 02:01:42 +0000 (02:01 +0000)]
Remove DrawingBuffer
https://bugs.webkit.org/show_bug.cgi?id=142641

Patch by Zan Dobersek <zdobersek@igalia.com> on 2015-03-12
Reviewed by Darin Adler.

Remove the DrawingBuffer class. Objects of this type were only held in the
WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the
Chromium port, with the relevant code removed in r147888. Since then, the
m_drawingBuffer member variable has always been null.

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyTexImage2D):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::copyTexImage2D):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::initializeNewContext):
(WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
(WebCore::WebGLRenderingContextBase::markContextChanged):
(WebCore::WebGLRenderingContextBase::clearIfComposited):
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
(WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
(WebCore::WebGLRenderingContextBase::reshape):
(WebCore::WebGLRenderingContextBase::drawingBufferWidth):
(WebCore::WebGLRenderingContextBase::drawingBufferHeight):
(WebCore::WebGLRenderingContextBase::activeTexture):
(WebCore::WebGLRenderingContextBase::bindFramebuffer):
(WebCore::WebGLRenderingContextBase::bindTexture):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::deleteFramebuffer):
(WebCore::WebGLRenderingContextBase::disable):
(WebCore::WebGLRenderingContextBase::enable):
(WebCore::WebGLRenderingContextBase::getContextAttributes):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth):
(WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted.
(WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted.
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cairo/DrawingBufferCairo.cpp: Removed.
* platform/graphics/gpu/DrawingBuffer.cpp: Removed.
* platform/graphics/gpu/DrawingBuffer.h: Removed.
* platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
(WebCore::GraphicsContext3D::paintRenderingResultsToImageData):

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

4 years agoBytecode liveness analysis should have more lambdas and fewer sets
fpizlo@apple.com [Fri, 13 Mar 2015 01:57:59 +0000 (01:57 +0000)]
Bytecode liveness analysis should have more lambdas and fewer sets
https://bugs.webkit.org/show_bug.cgi?id=142647

Reviewed by Mark Lam.

Source/JavaScriptCore:

In bug 141174 I'll need to identify all of the bytecode kill sites. This requires hooking into
the bytecode analysis' stepOverFunction method, except in such a way that we observe uses that
are not in outs. This refactors stepOverFunction so that you can pass it use/def functors that
can either be used to propagate outs (as we do right now) or to additionally detect kills or
whatever else.

In order to achieve this, the liveness analysis was moved off of maintaining uses/defs
bitvectors. This wasn't helping the abstraction and was probably inefficient. The new code
should be a bit faster since we don't have to clear uses/defs bitvectors on each instruction. On
the other hand, being able to intercept each use means that our code for exception handlers is
no longer a bitwise-merge; it requires finding set bits. Fortunately, this code only kicks in
for instructions inside a try, and its performance is O(live at catch), so that's probably not
bad.

* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::indexForOperand):
(JSC::stepOverInstruction):
(JSC::computeLocalLivenessForBytecodeOffset):
(JSC::BytecodeLivenessAnalysis::computeFullLiveness):
(JSC::setForOperand): Deleted.
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:

Source/WTF:

Add a method for iterating each set bit in a FastBitVector. Uses a functor as a callback since
this allows for a more efficient algorithm.

* wtf/FastBitVector.h:
(WTF::FastBitVector::forEachSetBit):

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

4 years ago"this" should be in TDZ until super is called in the constructor of a derived class
rniwa@webkit.org [Fri, 13 Mar 2015 01:11:15 +0000 (01:11 +0000)]
"this" should be in TDZ until super is called in the constructor of a derived class
https://bugs.webkit.org/show_bug.cgi?id=142527

Reviewed by Mark Hahnenberg.

DFG and FTL implementations co-authored by Filip Pizlo.

In ES6 class syntax, "this" register must be in the "temporal dead zone" (TDZ) and throw ReferenceError until
super() is called inside the constructor of a derived class.

Added op_check_tdz, a new OP code, which throws a reference error when the first operand is an empty value
to all tiers of JIT and LLint. The op code throws in the slow path on the basis that a TDZ error should be
a programming error and not a part of the programs' normal control flow. In DFG, this op code is represented
by a no-op must-generate node CheckNotEmpty modeled after CheckCell.

Also made the constructor of a derived class assign the empty value to "this" register rather than undefined
so that ThisNode can emit the op_check_tdz to check the initialized-ness of "this" in such a constructor.

* bytecode/BytecodeList.json: Added op_check_tdz.
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset): Ditto.
(JSC::computeDefsForBytecodeOffset): Ditto.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode): Ditto.
* bytecode/ExitKind.cpp:
(JSC::exitKindToString): Added TDZFailure.
* bytecode/ExitKind.h: Ditto.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator): Assign the empty value to "this" register to indicate it's in TDZ.
(JSC::BytecodeGenerator::emitTDZCheck): Added.
(JSC::BytecodeGenerator::emitReturn): Emit the TDZ check since "this" can still be in TDZ if super() was never
called. e.g. class B extends A { constructor() { } }
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ThisNode::emitBytecode): Always emit the TDZ check if we're inside the constructor of a derived class.
We can't omit this check even if the result was ignored per spec.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Previously, empty value could never appear
in a local variable. This is no longer true so generalize this code. Also added the support for CheckNotEmpty.
Like CheckCell, we phantomize this DFG node in the constant folding phase if the type of the operand is already
found to be not empty. Otherwise filter out SpecEmpty.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock): Added op_check_tdz.
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel): op_check_tdz can be compiled and inlined.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize): CheckNotEmpty doesn't read or write values.
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants): Convert CheckNotEmpty to a phantom if non-emptiness had already
been proven for the operand prior to this node.
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC): CheckNotEmpty does not trigger GC.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): CheckNotEmpty is a no-op in the fixup phase.
* dfg/DFGNodeType.h: CheckNotEmpty cannot be removed even if the result was ignored. See ThisNode::emitBytecode.
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate): CheckNotEmpty doesn't return any value.
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute): CheckNotEmpty doesn't load from heap so it's safe.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Speculative the operand to be not empty. OSR exit if the speculation fails.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Ditto.
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile): CheckNotEmpty can be compiled in FTL.
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode): Calls compileCheckNotEmpty for CheckNotEmpty.
(JSC::FTL::LowerDFGToLLVM::compileCheckNotEmpty): OSR exit with "TDZFailure" if the operand is not empty.
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass): Added op_check_tdz.
(JSC::JIT::privateCompileSlowCases): Ditto.
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_check_tdz): Implements op_check_tdz in Baseline JIT.
(JSC::JIT::emitSlow_op_check_tdz): Ditto.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_check_tdz): Ditto.
(JSC::JIT::emitSlow_op_check_tdz): Ditto.
* llint/LowLevelInterpreter32_64.asm: Implements op_check_tdz in LLint.
* llint/LowLevelInterpreter64.asm: Ditto.
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL): Throws a reference error for op_check_tdz. Shared by LLint and Baseline JIT.
* runtime/CommonSlowPaths.h:
* tests/stress/class-syntax-no-loop-tdz.js: Added.
* tests/stress/class-syntax-no-tdz-in-catch.js: Added.
* tests/stress/class-syntax-no-tdz-in-conditional.js: Added.
* tests/stress/class-syntax-no-tdz-in-loop-no-inline-super.js: Added.
* tests/stress/class-syntax-no-tdz-in-loop.js: Added.
* tests/stress/class-syntax-no-tdz.js: Added.
* tests/stress/class-syntax-tdz-in-catch.js: Added.
* tests/stress/class-syntax-tdz-in-conditional.js: Added.
* tests/stress/class-syntax-tdz-in-loop.js: Added.
* tests/stress/class-syntax-tdz.js: Added.

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

4 years agoREGRESSION(r180726): Removing an empty line at the end of textarea clears the entire...
rniwa@webkit.org [Fri, 13 Mar 2015 00:57:10 +0000 (00:57 +0000)]
REGRESSION(r180726): Removing an empty line at the end of textarea clears the entire texture
https://bugs.webkit.org/show_bug.cgi?id=142646

Reviewed by Darin Adler.

Source/WebCore:

The bug was caused by TypingCommand::deleteKeyPressed erroneously determining the editable root to be empty because
Position::atStartOfTree returns true when it's anchored at a BR that is immediately below the root editable element.

Fixed the bug by replacing the use of the deprecated atFirstEditingPositionForNode by a code that understands modern
position types such as PositionIsBeforeAnchor in atStartOfTree and atEndOfTree. These two functions will no longer
return true when anchored before or after BR after this patch.

Test: editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html

* dom/Position.cpp:
(WebCore::Position::atStartOfTree):
(WebCore::Position::atEndOfTree):

LayoutTests:

Added a regression test for deleting empty lines at the end of a textarea element.

* editing/deleting/delete-empty-line-breaks-at-end-of-textarea-expected.txt: Added.
* editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html: Added.

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

4 years agoDisable Yarr JIT for ARMv7k
msaboff@apple.com [Fri, 13 Mar 2015 00:40:46 +0000 (00:40 +0000)]
Disable Yarr JIT for ARMv7k
https://bugs.webkit.org/show_bug.cgi?id=142645

Reviewed by Oliver Hunt.

Make the setting of ENABLE_YARR_JIT match ENABLE_JIT for ARMv7k.

* wtf/Platform.h:

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

4 years agoChange WTF::ByteSpinLock to use std::atomic.
mark.lam@apple.com [Fri, 13 Mar 2015 00:20:18 +0000 (00:20 +0000)]
Change WTF::ByteSpinLock to use std::atomic.
<https://webkit.org/b/142644>

Reviewed by Filip Pizlo.

* wtf/ByteSpinLock.h:
(WTF::ByteSpinLock::ByteSpinLock):
(WTF::ByteSpinLock::lock):
(WTF::ByteSpinLock::unlock):
(WTF::ByteSpinLock::isHeld):

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

4 years ago[Win] Unreviewed build fix (part 2).
bfulgham@apple.com [Thu, 12 Mar 2015 23:54:08 +0000 (23:54 +0000)]
[Win] Unreviewed build fix (part 2).

* ANGLE.vcxproj/libGLESv2Common.props: Missed a directory separator.

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

4 years ago[Win] Unreviewed build fix for some DirectX SDK Installs
bfulgham@apple.com [Thu, 12 Mar 2015 23:47:00 +0000 (23:47 +0000)]
[Win] Unreviewed build fix for some DirectX SDK Installs

* ANGLE.vcxproj/libGLESv2Common.props: Correct path for Lib and
Include paths based on problems others have had building WebKit
under different Windows and DirectX revisions.

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

4 years agoIntegrate MapData into JSMap and JSSet
utatane.tea@gmail.com [Thu, 12 Mar 2015 22:57:13 +0000 (22:57 +0000)]
Integrate MapData into JSMap and JSSet
https://bugs.webkit.org/show_bug.cgi?id=142556

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch integrates MapData into JSMap and JSSet.
This removes 2 object allocation per one JSMap / JSSet.

MapDataImpl is specialized into MapData and SetData.
In the case of SetData, it does not have the dummy values
previously stored in the MapDataImpl. So the storage size of SetData
becomes the half of the previous implementation.

And now MapData and SetData are completely integrated into JSMap and JSSet,
these structures are not exposed to the other code even in WebCore world.

And at the same time, this patch fixes missing destroy functions
in JSMapIterator and JSSetIterator.
They are needed because MapData::const_iterator is a non-trivial destructor.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/JSMap.cpp:
(JSC::JSMap::destroy):
(JSC::JSMap::visitChildren):
(JSC::JSMap::copyBackingStore):
(JSC::JSMap::has):
(JSC::JSMap::size):
(JSC::JSMap::get):
(JSC::JSMap::set):
(JSC::JSMap::clear):
(JSC::JSMap::remove):
(JSC::JSMap::finishCreation): Deleted.
* runtime/JSMap.h:
(JSC::JSMap::Entry::key):
(JSC::JSMap::Entry::value):
(JSC::JSMap::Entry::visitChildren):
(JSC::JSMap::Entry::setKey):
(JSC::JSMap::Entry::setKeyWithoutWriteBarrier):
(JSC::JSMap::Entry::setValue):
(JSC::JSMap::Entry::clear):
(JSC::JSMap::begin):
(JSC::JSMap::end):
(JSC::JSMap::JSMap):
(JSC::JSMap::mapData): Deleted.
* runtime/JSMapIterator.cpp:
(JSC::JSMapIterator::finishCreation):
(JSC::JSMapIterator::destroy):
(JSC::JSMapIterator::visitChildren):
* runtime/JSMapIterator.h:
(JSC::JSMapIterator::JSMapIterator):
* runtime/JSSet.cpp:
(JSC::JSSet::destroy):
(JSC::JSSet::visitChildren):
(JSC::JSSet::copyBackingStore):
(JSC::JSSet::has):
(JSC::JSSet::size):
(JSC::JSSet::add):
(JSC::JSSet::clear):
(JSC::JSSet::remove):
(JSC::JSSet::finishCreation): Deleted.
* runtime/JSSet.h:
(JSC::JSSet::Entry::key):
(JSC::JSSet::Entry::value):
(JSC::JSSet::Entry::visitChildren):
(JSC::JSSet::Entry::setKey):
(JSC::JSSet::Entry::setKeyWithoutWriteBarrier):
(JSC::JSSet::Entry::setValue):
(JSC::JSSet::Entry::clear):
(JSC::JSSet::begin):
(JSC::JSSet::end):
(JSC::JSSet::JSSet):
(JSC::JSSet::mapData): Deleted.
* runtime/JSSetIterator.cpp:
(JSC::JSSetIterator::finishCreation):
(JSC::JSSetIterator::visitChildren):
(JSC::JSSetIterator::destroy):
* runtime/JSSetIterator.h:
(JSC::JSSetIterator::JSSetIterator):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/MapData.h:
(JSC::MapDataImpl::const_iterator::key):
(JSC::MapDataImpl::const_iterator::value):
(JSC::MapDataImpl::size):
(JSC::MapDataImpl<Entry>::MapDataImpl):
(JSC::MapDataImpl<Entry>::clear):
(JSC::MapDataImpl<Entry>::KeyType::KeyType):
(JSC::MapDataImpl<Entry>::const_iterator::internalIncrement):
(JSC::MapDataImpl<Entry>::const_iterator::ensureSlot):
(JSC::MapDataImpl<Entry>::const_iterator::const_iterator):
(JSC::MapDataImpl<Entry>::const_iterator::~const_iterator):
(JSC::MapDataImpl<Entry>::const_iterator::operator):
(JSC::=):
(JSC::MapData::const_iterator::key): Deleted.
(JSC::MapData::const_iterator::value): Deleted.
(JSC::MapData::create): Deleted.
(JSC::MapData::createStructure): Deleted.
(JSC::MapData::size): Deleted.
(JSC::MapData::clear): Deleted.
(JSC::MapData::KeyType::KeyType): Deleted.
(JSC::MapData::const_iterator::internalIncrement): Deleted.
(JSC::MapData::const_iterator::ensureSlot): Deleted.
(JSC::MapData::const_iterator::const_iterator): Deleted.
(JSC::MapData::const_iterator::~const_iterator): Deleted.
(JSC::MapData::const_iterator::operator*): Deleted.
(JSC::MapData::const_iterator::end): Deleted.
(JSC::MapData::const_iterator::operator!=): Deleted.
(JSC::MapData::const_iterator::operator==): Deleted.
* runtime/MapDataInlines.h: Renamed from Source/JavaScriptCore/runtime/MapData.cpp.
(JSC::MapDataImpl<Entry>::find):
(JSC::MapDataImpl<Entry>::contains):
(JSC::MapDataImpl<Entry>::add):
(JSC::MapDataImpl<Entry>::set):
(JSC::MapDataImpl<Entry>::get):
(JSC::MapDataImpl<Entry>::remove):
(JSC::MapDataImpl<Entry>::replaceAndPackBackingStore):
(JSC::MapDataImpl<Entry>::replaceBackingStore):
(JSC::MapDataImpl<Entry>::ensureSpaceForAppend):
(JSC::MapDataImpl<Entry>::visitChildren):
(JSC::MapDataImpl<Entry>::copyBackingStore):
* runtime/MapPrototype.cpp:
(JSC::getMap):
(JSC::mapProtoFuncClear):
(JSC::mapProtoFuncDelete):
(JSC::mapProtoFuncForEach):
(JSC::mapProtoFuncGet):
(JSC::mapProtoFuncHas):
(JSC::mapProtoFuncSet):
(JSC::mapProtoFuncSize):
(JSC::getMapData): Deleted.
* runtime/SetPrototype.cpp:
(JSC::getSet):
(JSC::setProtoFuncAdd):
(JSC::setProtoFuncClear):
(JSC::setProtoFuncDelete):
(JSC::setProtoFuncForEach):
(JSC::setProtoFuncHas):
(JSC::setProtoFuncSize):
(JSC::getMapData): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Source/WebCore:

Now Set has SetData and it's different from MapData.
And MapData/SetData are completely integrated into JSSet and JSMap.
Structured-cloning algorithm need to be aware of these changes.
And in the case of JSSet, since JSSet doesn't need dummy value for construction,
Structured-cloning only serialize the keys in JSSet.

* ForwardingHeaders/runtime/MapDataInlines.h: Added.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::consumeCollectionDataTerminationIfPossible):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible): Deleted.

LayoutTests:

Test structure-clone implementation that becomes aware of the difference between Map and Set.

* fast/storage/serialized-script-value.html:

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

4 years agoAssertion failure in bmalloc::LargeObject::validateSelf on Mavericks Debug layout...
ggaren@apple.com [Thu, 12 Mar 2015 22:50:11 +0000 (22:50 +0000)]
Assertion failure in bmalloc::LargeObject::validateSelf on Mavericks Debug layout test bot
https://bugs.webkit.org/show_bug.cgi?id=142642

Reviewed by Michael Saboff.

The typical backtrace to this crash shows the main thread trying to
realloc a large string while a DFG compiler thread tries to
free a large vector buffer.

I believe that this is a race condition -- at least in debug builds --
since the main thread will try to validate its object's neighbors
without holding a lock, even though those neighbors might be in the
midst of changing.

In general, there may be sneaky times when it is valid to look at an
object's metadata without holding the heap lock, but it is best not to
do so unless we have a really really good reason to.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::reallocate): Take a lock before reading the metadata
for this object, since we generally require any access to shared heap
metadata to take a lock.

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

4 years agoUse std::atomic for CodeBlock::m_visitAggregateHasBeenCalled.
mark.lam@apple.com [Thu, 12 Mar 2015 22:14:32 +0000 (22:14 +0000)]
Use std::atomic for CodeBlock::m_visitAggregateHasBeenCalled.
<https://webkit.org/b/142640>

Reviewed by Mark Hahnenberg.

We used to spin our own compare and swap on a uint8_t.  Now that we can
use C++11, let's use std::atomic instead.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitAggregate):
- The CAS here needs std::memory_order_acquire ordering because it
  requires lock acquisition semantics to visit the CodeBlock.

* bytecode/CodeBlock.h:
(JSC::CodeBlockSet::mark):
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::clearMarksForFullCollection):
(JSC::CodeBlockSet::clearMarksForEdenCollection):
- These can go with relaxed ordering because they are all done before
  the GC starts parallel marking.

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

4 years agoFinish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains...
mitz@apple.com [Thu, 12 Mar 2015 21:01:37 +0000 (21:01 +0000)]
Finish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure

Added back OS X bits that I couldn’t land initially in r181317 or had to remove in r181327.

* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
* platform/spi/cocoa/SecuritySPI.h:

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

4 years agoREGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
ggaren@apple.com [Thu, 12 Mar 2015 20:37:13 +0000 (20:37 +0000)]
REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
https://bugs.webkit.org/show_bug.cgi?id=142636

Reviewed by Mark Hahnenberg.

This was a pre-existing bug that I made a lot worse in
<https://trac.webkit.org/changeset/181411>.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): Compare size before
subtracting rather than subtracting and then comparing to zero. The
latter technique is not valid for unsigned integers, which will happily
underflow into giant numbers.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was
 technically correct, but I took the opportunity to clean it up a bit.
 There's no need to do two checks here, and it smells bad to check for
 a negative unsigned integer.

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

4 years agoWeb Inspector: Debugger sidebar should group global breakpoints together
jonowells@apple.com [Thu, 12 Mar 2015 20:32:29 +0000 (20:32 +0000)]
Web Inspector: Debugger sidebar should group global breakpoints together
https://bugs.webkit.org/show_bug.cgi?id=142607

Reviewed by Timothy Hatcher.

Update the DebuggerSidebarPanel class to hold global breakpoints such as "All Exceptions" in one container. This
will be the place future such breakpoints are added.

* Localizations/en.lproj/localizedStrings.js: Added string.
* UserInterface/Main.html: Small rearrangement.

* UserInterface/Views/DebuggerSidebarPanel.js: Change how exception breaking options are displayed.
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._treeElementSelected):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):

* UserInterface/Views/FolderTreeElement.js: Support additional classes for icons.
* UserInterface/Views/ResourceSidebarPanel.js: Change call to FolderTreeElement constructor.

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

4 years ago[Mavericks] Test snapshots are 1600x1200 on Retina devices
ap@apple.com [Thu, 12 Mar 2015 20:24:16 +0000 (20:24 +0000)]
[Mavericks] Test snapshots are 1600x1200 on Retina devices
https://bugs.webkit.org/show_bug.cgi?id=142630

Reviewed by Tim Horton.

* WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::windowSnapshotImage):
Removed an ifdef that disabled the fix on Mavericks.

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

4 years agoThese hidpi filter tests pass sometimes.
simon.fraser@apple.com [Thu, 12 Mar 2015 19:44:26 +0000 (19:44 +0000)]
These hidpi filter tests pass sometimes.

* platform/mac/TestExpectations:

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

4 years agoStop using single-include headers that are only available since GStreamer >= 1.2.
commit-queue@webkit.org [Thu, 12 Mar 2015 19:31:36 +0000 (19:31 +0000)]
Stop using single-include headers that are only available since GStreamer >= 1.2.

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

Patch by Sebastian Dröge <sebastian@centricular.com> on 2015-03-12
Reviewed by Philippe Normand.

* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/ImageGStreamer.h:
Instead of using single-include headers for the GStreamer libraries,
directly include the headers we need. The single-include headers were
only added in 1.2, and this would be the only reason why we would
depend on 1.2.

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

4 years agoAdopt new API for keyboard event handling.
enrica@apple.com [Thu, 12 Mar 2015 19:26:20 +0000 (19:26 +0000)]
Adopt new API for keyboard event handling.
https://bugs.webkit.org/show_bug.cgi?id=142602
rdar://problem/19966087

Reviewed by Sam Weinig.

Adopts the new API.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didHandleKeyEvent:]):

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

4 years agoRemove isWK2 cruft from webkitdirs.pm after r170426
ossy@webkit.org [Thu, 12 Mar 2015 19:13:49 +0000 (19:13 +0000)]
Remove isWK2 cruft from webkitdirs.pm after r170426
https://bugs.webkit.org/show_bug.cgi?id=142618

Reviewed by Daniel Bates.

* Scripts/webkitdirs.pm:
(isWK2): Deleted.

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

4 years agotestRunner.setAlwaysAcceptCookies does not work with NetworkProcess
ap@apple.com [Thu, 12 Mar 2015 18:38:11 +0000 (18:38 +0000)]
testRunner.setAlwaysAcceptCookies does not work with NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=138687

Source/WebKit2:

Reviewed by Carlos Garcia Campos.

* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide
cookie accept policy when in testing mode. Also, update the policy in WebProcesses too,
as we still do some networking there.

* UIProcess/WebProcessPool.h:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAlwaysAcceptCookies): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:
Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process.

Tools:

Reviewed by Carlos Garcia Campos.

Always change cookie policy from UI process, as changing it from WebProcess doesn't
affect other processes.

The implementation is imperfect, because the change happens asynchronously, but I
don't expect it to be a problem in practice.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setAlwaysAcceptCookies):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

Unreviewed (only code changes were reviewed).

* platform/gtk/TestExpectations:
* platform/mac-wk2/TestExpectations:
Unskip tests that used to be affected.

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

4 years agoWKErrorDomain should be declared nonnull
andersca@apple.com [Thu, 12 Mar 2015 17:46:30 +0000 (17:46 +0000)]
WKErrorDomain should be declared nonnull
https://bugs.webkit.org/show_bug.cgi?id=142628

Reviewed by Antti Koivisto.

Add WK_ASSUME_NONNULL_BEGIN and WK_ASSUME_NONNULL_END so everything will be implicitly nonnull.

* UIProcess/API/Cocoa/WKError.h:

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

4 years agoPDFs don't snapshot properly in iOS Safari
commit-queue@webkit.org [Thu, 12 Mar 2015 17:27:26 +0000 (17:27 +0000)]
PDFs don't snapshot properly in iOS Safari
https://bugs.webkit.org/show_bug.cgi?id=142623

Patch by Ian Henderson <ian@ianhenderson.org> on 2015-03-12
Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
If we have a _customContentView, use UIView snapshotting instead of
trying to snapshot the web page.

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

4 years ago[Mac] Update AirPlay handling
eric.carlson@apple.com [Thu, 12 Mar 2015 17:18:31 +0000 (17:18 +0000)]
[Mac] Update AirPlay handling
https://bugs.webkit.org/show_bug.cgi?id=142541

Source/WebCore:

Unreviewed, respond to post-review comments.

* dom/Document.cpp:
(WebCore::Document::didChoosePlaybackTarget):
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::showPlaybackTargetPicker):
(WebCore::Page::didChoosePlaybackTarget):
(WebCore::Page::configurePlaybackTargetMonitoring):

Source/WebKit2:

Unreviewed, respond to post-review comments and add previously reviewed changes
missed by a bungled merge.

* Shared/mac/WebCoreArgumentCodersMac.mm:
* UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
(WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createPlaybackTargetPicker):
* UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
* UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
* WebProcess/com.apple.WebProcess.sb.in:

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

4 years agoClean up after JoePeck.
simon.fraser@apple.com [Thu, 12 Mar 2015 17:02:47 +0000 (17:02 +0000)]
Clean up after JoePeck.

* http/tests/security/contentSecurityPolicy/injected-inline-style-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/inline-style-allowed-while-cloning-objects-expected.txt:

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

4 years ago[EFL] Enable building EFL 1.13 with NEON support
ossy@webkit.org [Thu, 12 Mar 2015 16:55:13 +0000 (16:55 +0000)]
[EFL] Enable building EFL 1.13 with NEON support
https://bugs.webkit.org/show_bug.cgi?id=142619

Reviewed by Gyuyoung Kim.

* efl/jhbuild.modules:

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

4 years agoFix the !ENABLE(PICTURE_SIZES) build
ossy@webkit.org [Thu, 12 Mar 2015 16:40:15 +0000 (16:40 +0000)]
Fix the !ENABLE(PICTURE_SIZES) build
https://bugs.webkit.org/show_bug.cgi?id=142617

Reviewed by Darin Adler.

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):

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

4 years agoUnreviewed EFL gardening on 13th Mar.
commit-queue@webkit.org [Thu, 12 Mar 2015 16:10:30 +0000 (16:10 +0000)]
Unreviewed EFL gardening on 13th Mar.
https://bugs.webkit.org/show_bug.cgi?id=142624

Rebaseline the missing test result.

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-03-12

* platform/efl/TestExpectations:
* platform/efl/editing/inserting/before-after-input-element-expected.png: Added.
* platform/efl/editing/inserting/before-after-input-element-expected.txt: Added.
* platform/efl/fast/css/css2-system-fonts-expected.txt: Added.
* platform/efl/fast/text/tatechuyoko-expected.png: Added.
* platform/efl/fast/text/tatechuyoko-expected.txt: Added.

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

4 years agoWeb Inspector: Console Errors during provisional document loads get lost with "Clear...
commit-queue@webkit.org [Thu, 12 Mar 2015 16:10:00 +0000 (16:10 +0000)]
Web Inspector: Console Errors during provisional document loads get lost with "Clear Log on Reload"
https://bugs.webkit.org/show_bug.cgi?id=142603

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-12
Reviewed by Timothy Hatcher.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._messageAdded):
(WebInspector.LogContentView.prototype._provisionalLoadStarted):
Detect a provisional load has started to start save messages that come in at this time.

(WebInspector.LogContentView.prototype._sessionStarted):
Reappend provisional load messages if we auto-cleared.

(WebInspector.LogContentView.prototype._reappendProvisionalMessages):
(WebInspector.LogContentView.prototype._clearProvisionalState):
Helpers for dealing with the provisional loading state.

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

4 years ago[ARM][Linux] GC sometimes stuck in an infinite loop if parallel GC is enabled
ossy@webkit.org [Thu, 12 Mar 2015 14:50:21 +0000 (14:50 +0000)]
[ARM][Linux] GC sometimes stuck in an infinite loop if parallel GC is enabled
https://bugs.webkit.org/show_bug.cgi?id=141290

Reviewed by Carlos Garcia Campos.

* wtf/Platform.h: Enable parallel GC after r181319.

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

4 years ago[cmake] Fix the incremental build issue revealed by r181419
ossy@webkit.org [Thu, 12 Mar 2015 10:27:45 +0000 (10:27 +0000)]
[cmake] Fix the incremental build issue revealed by r181419
https://bugs.webkit.org/show_bug.cgi?id=142613

Reviewed by Carlos Garcia Campos.

* CMakeLists.txt:

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

4 years agoUnreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it...
joepeck@webkit.org [Thu, 12 Mar 2015 06:37:53 +0000 (06:37 +0000)]
Unreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it gets used.

Address ASSERT in LayoutTests/printing/page-format-data.html.

* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
In case the TextPosition gets used because it wasn't created by a parser,
zeros are more realistic values then beforeFirst.

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

4 years agoMedia element time no longer updates while scrubbing following r181279.
roger_fong@apple.com [Thu, 12 Mar 2015 05:00:59 +0000 (05:00 +0000)]
Media element time no longer updates while scrubbing following r181279.
https://bugs.webkit.org/show_bug.cgi?id=142606.
<rdar://problem/20131014>

Reviewed by Eric Carlson.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.handleWrapperMouseMove):
Update time as a result of a mouse move if we are scrubbing.

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

4 years ago[Win] Update test expectations after r181408.
bfulgham@apple.com [Thu, 12 Mar 2015 04:53:11 +0000 (04:53 +0000)]
[Win] Update test expectations after r181408.

Also update with more debug assertions.

* platform/win/TestExpectations:
* platform/win/fast/forms/input-auto-fill-button-expected.txt: Added.

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

4 years agoWeb Inspector: CSS parser errors in the console should include column numbers
joepeck@webkit.org [Thu, 12 Mar 2015 04:49:05 +0000 (04:49 +0000)]
Web Inspector: CSS parser errors in the console should include column numbers
https://bugs.webkit.org/show_bug.cgi?id=114313

Reviewed by Darin Adler.

Source/WebCore:

Test: inspector-protocol/console/warnings-errors.html

* css/CSSParser.h:
(WebCore::CSSParser::currentCharacterOffset):
Get the current character offset depending on the source type.
Add instance variables to track column position and start
line / column for inline stylesheets.

* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSheet):
Initialize new instance variables.

(WebCore::CSSParser::currentLocation):
Update to include column information for the token. Also, if we are on the
first line we may need to take into account a start column offset as well.

(WebCore::CSSParser::realLex):
Set the token's start column.
When bumping the line number, reset the column offset for the next
line with the next character.

(WebCore::CSSParser::syntaxError):
(WebCore::CSSParser::logError):
Include column information.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
(WebCore::StyleSheetContents::parseStringAtPosition):
Include column information.

* css/StyleSheetContents.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
(WebCore::InlineStyleSheetOwner::createSheet):
Save and use column information later on.

* dom/InlineStyleSheetOwner.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::ensureSourceData):
Updated parser signature needs starting column and no longer has optional parameters.

Source/WebInspectorUI:

* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._linkifyLocation):
Column numbers in console messages are also 1 based and should be adjusted.

LayoutTests:

Test errors in both external and inline CSS and Scripts to ensure they have
expected line:column information.

* inspector-protocol/console/warnings-errors-expected.txt: Added.
* inspector-protocol/console/warnings-errors.html: Added.
* inspector-protocol/resources/errors.css: Added.
* inspector-protocol/resources/errors.js: Added.

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

4 years agoRename the Mavericks result for input-auto-fill-button.html to use the
simon.fraser@apple.com [Thu, 12 Mar 2015 03:27:23 +0000 (03:27 +0000)]
Rename the Mavericks result for input-auto-fill-button.html to use the
correct name.

* platform/mac-mavericks/fast/forms/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/mac-mavericks/fast/forms/input-auto-fill-button.txt.

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

4 years agoCache traversal missing large entries
antti@apple.com [Thu, 12 Mar 2015 02:01:42 +0000 (02:01 +0000)]
Cache traversal missing large entries
https://bugs.webkit.org/show_bug.cgi?id=142601

Reviewed by Andreas Kling.

When traversing cache entries we only read the header data from disk. This didn't work
correctly for entries larger than the read size.

* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::read):

    Partial reads only receive one callback with 'done' set to true.
    Ensure we actually return data in this case.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::decodeEntryHeader):

    Add some logging.

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

4 years ago[Mac] Update AirPlay handling
eric.carlson@apple.com [Thu, 12 Mar 2015 01:54:06 +0000 (01:54 +0000)]
[Mac] Update AirPlay handling
https://bugs.webkit.org/show_bug.cgi?id=142541

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::showPlaybackTargetPicker):
(WebCore::Document::addPlaybackTargetPickerClient):
(WebCore::Document::removePlaybackTargetPickerClient):
(WebCore::Document::configurePlaybackTargetMonitoring):
(WebCore::Document::requiresPlaybackTargetRouteMonitoring):
(WebCore::Document::playbackTargetAvailabilityDidChange):
(WebCore::Document::didChoosePlaybackTarget):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument):
(WebCore::HTMLMediaElement::unregisterWithDocument):
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::HTMLMediaSession):
(WebCore::HTMLMediaSession::registerWithDocument):
(WebCore::HTMLMediaSession::unregisterWithDocument):
(WebCore::HTMLMediaSession::showPlaybackTargetPicker):
(WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
(WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::HTMLMediaSession::didChoosePlaybackTarget):
(WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
(WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring):
* html/HTMLMediaSession.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::didChoosePlaybackTarget):
(WebCore::Page::playbackTargetAvailabilityDidChange):
(WebCore::Page::configurePlaybackTargetMonitoring):
* page/Page.h:
(WebCore::Page::hasWirelessPlaybackTarget):
(WebCore::Page::playbackTarget):
* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::clientDataBufferingTimerFired):
(WebCore::MediaSession::wirelessRoutesAvailableDidChange): Deleted.
* platform/audio/MediaSession.h:
(WebCore::MediaSession::didChoosePlaybackTarget):
(WebCore::MediaSession::externalOutputDeviceAvailableDidChange):
(WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
(WebCore::MediaSessionClient::setWirelessPlaybackTarget):
* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Deleted.
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
(-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
* platform/graphics/AVPlaybackTarget.h: Added.
(WebCore::AVPlaybackTarget::~AVPlaybackTarget):
(WebCore::AVPlaybackTarget::AVPlaybackTarget):
(WebCore::AVPlaybackTarget::setDevicePickerContext):
(WebCore::AVPlaybackTarget::devicePickerContext):
* platform/graphics/AVPlaybackTargetPickerClient.h: Added.
(WebCore::AVPlaybackTargetPickerClient::~AVPlaybackTargetPickerClient):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setWirelessPlaybackTarget):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
* platform/graphics/avfoundation/AVPlaybackTargetMac.mm: Added.
(WebCore::AVPlaybackTarget::encode):
(WebCore::AVPlaybackTarget::decode):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

Source/WebKit2:

* Shared/WebCoreArgumentCoders.h:
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<AVPlaybackTarget>::encode):
(IPC::ArgumentCoder<AVPlaybackTarget>::decode):
* UIProcess/PageClient.h:
* UIProcess/WebAVPlaybackTargetPickerProxy.cpp: Added.
(WebKit::WebAVPlaybackTargetPickerProxy::WebAVPlaybackTargetPickerProxy):
(WebKit::WebAVPlaybackTargetPickerProxy::~WebAVPlaybackTargetPickerProxy):
(WebKit::WebAVPlaybackTargetPickerProxy::showPlaybackTargetPicker):
(WebKit::WebAVPlaybackTargetPickerProxy::startingMonitoringPlaybackTargets):
(WebKit::WebAVPlaybackTargetPickerProxy::stopMonitoringPlaybackTargets):
* UIProcess/WebAVPlaybackTargetPickerProxy.h: Added.
(WebKit::WebAVPlaybackTargetPickerProxy::Client::~Client):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::devicePickerProxy):
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::startingMonitoringPlaybackTargets):
(WebKit::WebPageProxy::stopMonitoringPlaybackTargets):
(WebKit::WebPageProxy::didChoosePlaybackTarget):
(WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createPlaybackTargetPicker):
* UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.h: Added.
* UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.mm: Added.
(WebKit::WebAVPlaybackTargetPickerProxyMac::create):
(WebKit::WebAVPlaybackTargetPickerProxyMac::WebAVPlaybackTargetPickerProxyMac):
(WebKit::WebAVPlaybackTargetPickerProxyMac::~WebAVPlaybackTargetPickerProxyMac):
(WebKit::WebAVPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired):
(WebKit::WebAVPlaybackTargetPickerProxyMac::availableDevicesDidChange):
(WebKit::WebAVPlaybackTargetPickerProxyMac::devicePicker):
(WebKit::WebAVPlaybackTargetPickerProxyMac::showPlaybackTargetPicker):
(WebKit::WebAVPlaybackTargetPickerProxyMac::currentDeviceDidChange):
(WebKit::WebAVPlaybackTargetPickerProxyMac::startingMonitoringPlaybackTargets):
(WebKit::WebAVPlaybackTargetPickerProxyMac::stopMonitoringPlaybackTargets):
(-[WebAVOutputDevicePickerMenuControllerHelper initWithCallback:]):
(-[WebAVOutputDevicePickerMenuControllerHelper clearCallback]):
(-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebAVPlaybackTargetPicker.cpp: Added.
(WebKit::WebAVPlaybackTargetPicker::WebAVPlaybackTargetPicker):
(WebKit::WebAVPlaybackTargetPicker::showPlaybackDevicePicker):
(WebKit::WebAVPlaybackTargetPicker::configureWireLessTargetMonitoring):
(WebKit::WebAVPlaybackTargetPicker::addClient):
(WebKit::WebAVPlaybackTargetPicker::removeClient):
(WebKit::WebAVPlaybackTargetPicker::didChoosePlaybackTarget):
(WebKit::WebAVPlaybackTargetPicker::playbackTargetAvailabilityDidChange):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::showPlaybackTargetPicker):
(WebKit::WebChromeClient::startingMonitoringPlaybackTargets):
(WebKit::WebChromeClient::stopMonitoringPlaybackTargets):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::playbackTargetSelected):
(WebKit::WebPage::playbackTargetAvailabilityDidChange):
* WebProcess/com.apple.WebProcess.sb.in:

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

4 years agoMark compositing/backgrounds/background-image-with-negative-zindex.html as
simon.fraser@apple.com [Thu, 12 Mar 2015 01:10:40 +0000 (01:10 +0000)]
Mark compositing/backgrounds/background-image-with-negative-zindex.html as
an image failure, since r179871 was rolled out.

* platform/mac/TestExpectations:

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

4 years ago[Content Extensions] Add resource type and load type triggers.
commit-queue@webkit.org [Thu, 12 Mar 2015 01:03:43 +0000 (01:03 +0000)]
[Content Extensions] Add resource type and load type triggers.
https://bugs.webkit.org/show_bug.cgi?id=142422

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

Source/WebCore:

New API tests.

* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getTypeFlags):
(WebCore::ContentExtensions::loadTrigger):
* contentextensions/ContentExtensionRule.h:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL): Deleted.
* contentextensions/ContentExtensionsBackend.h:
* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendConditionalAction):
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
* contentextensions/DFABytecodeCompiler.h:
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
* contentextensions/DFABytecodeInterpreter.h:
* loader/ResourceLoadInfo.cpp: Added.
(WebCore::toResourceType):
(WebCore::readResourceType):
(WebCore::readLoadType):
(WebCore::ResourceLoadInfo::isThirdParty):
(WebCore::ResourceLoadInfo::getResourceFlags):
* loader/ResourceLoadInfo.h: Added.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/UserContentController.cpp:
(WebCore::UserContentController::actionsForResourceLoad):
(WebCore::UserContentController::actionsForURL): Deleted.
* page/UserContentController.h:

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::testRequest):
(TestWebKitAPI::mainDocumentRequest):
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::testURL): Deleted.

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

4 years agoFix the build.
timothy_horton@apple.com [Thu, 12 Mar 2015 00:38:04 +0000 (00:38 +0000)]
Fix the build.

* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordFromHitTestResult):
(WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventTripleClick):
(WebCore::EventHandler::handleMousePressEventSingleClick):

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

4 years ago"static" should not be a reserved keyword in non-strict mode even when ES6 class...
rniwa@webkit.org [Thu, 12 Mar 2015 00:35:28 +0000 (00:35 +0000)]
"static" should not be a reserved keyword in non-strict mode even when ES6 class is enabled
https://bugs.webkit.org/show_bug.cgi?id=142600

Reviewed by Mark Lam.

Make "static" RESERVED_IF_STRICT and manually detect it in parseClass.

No new tests. This is already checked by js/reserved-words.html and js/keywords-and-reserved_words.html

* parser/Keywords.table:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):
* parser/ParserTokens.h:

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

4 years ago<attachment> shouldn't use "user-select: all"
timothy_horton@apple.com [Thu, 12 Mar 2015 00:33:07 +0000 (00:33 +0000)]
<attachment> shouldn't use "user-select: all"
https://bugs.webkit.org/show_bug.cgi?id=142453

Reviewed by Darin Adler.

It turns out that "user-select: all" is rife with bugs; in lieu of fixing them
all (at least for now), let's not use "user-select: all" in the default stylesheet
for <attachment>. It's really overkill anyway, since <attachment> can't have children.
The only "user-select: all" behavior we actually want is select-on-click.
So, we'll implement that in a slightly different way.

Tests: fast/attachment/attachment-select-on-click-inside-user-select-all.html
       fast/attachment/attachment-select-on-click.html

* css/html.css:
(attachment):
No more "user-select: all".

(attachment:focus): Deleted.
We stopped using attachment focus a while back and forgot to remove this.

* dom/Node.h:
(WebCore::Node::shouldSelectOnMouseDown):
Add a virtual function that Node subclasses can override to indicate they
should be selected on mouse down.

* html/HTMLAttachmentElement.h:
Override the aforementioned virtual function; <attachment> should always
be selected on mouse down.

* page/EventHandler.cpp:
(WebCore::nodeToSelectOnMouseDownForNode):
Determine which node should be selected when a mousedown hits the given node.
If there's any "user-select: all", we go with the outermost "user-select: all".
Otherwise, we give the node a chance to say that it wants to be selected itself.

(WebCore::expandSelectionToRespectSelectOnMouseDown):
Rename this function, it's not just about "user-select: all" anymore.
Make use of nodeToSelectOnMouseDownForNode.

(WebCore::EventHandler::selectClosestWordFromHitTestResult):
(WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
(WebCore::EventHandler::handleMousePressEventTripleClick):
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::expandSelectionToRespectUserSelectAll): Deleted.
Adjust to the new names.

* fast/attachment/attachment-select-on-click-inside-user-select-all.html: Added.
* fast/attachment/attachment-select-on-click.html: Added.
* platform/mac/fast/attachment/attachment-select-on-click-expected.png: Added.
* platform/mac/fast/attachment/attachment-select-on-click-expected.txt: Added.
* platform/mac/fast/attachment/attachment-select-on-click-inside-user-select-all-expected.png: Added.
* platform/mac/fast/attachment/attachment-select-on-click-inside-user-select-all-expected.txt: Added.
* platform/mac-mavericks/fast/attachment/attachment-select-on-click-inside-user-select-all-expected.txt: Added.
* platform/mac-mavericks/fast/attachment/attachment-select-on-click-expected.txt: Added.
Add two tests. One, for the basic functionality of clicking on an
<attachment> to select it. The second, to test that clicking on an
<attachment> inside a larger "user-select: all" element still selects
the whole "user-select: all" element.

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

4 years agoUsers of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocate...
ggaren@apple.com [Thu, 12 Mar 2015 00:15:21 +0000 (00:15 +0000)]
Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
https://bugs.webkit.org/show_bug.cgi?id=142595

Reviewed by Andreas Kling.

Fixed this bug for canvas.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
required by our IDL generator.

(WebCore::HTMLCanvasElement::createImageBuffer): Use
reportExtraMemoryAllocated.

* html/HTMLCanvasElement.h:

* html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the
right way during GC. This will match our reportExtraMemoryAllocated
with a reportExtraMemoryVisited during GC.

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

4 years agoUpdate windows test results
mmirman@apple.com [Wed, 11 Mar 2015 23:52:45 +0000 (23:52 +0000)]
Update windows test results

Unreviewed followup to r181353

* platform/win/fast/events/event-attribute-expected.txt: update windows test results.

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

4 years agoA number of minor edits to the media controls on OSX.
roger_fong@apple.com [Wed, 11 Mar 2015 23:28:36 +0000 (23:28 +0000)]
A number of minor edits to the media controls on OSX.
https://bugs.webkit.org/show_bug.cgi?id=142551.
<rdar://problem/20114707>
Reviewed by Darin Adler.
This covers a slew of minor edits to the new media controls. They are as follows.
Small vertical placements adjustments to inline control elements.
Make sure buttons have no focus outlines.
Expand height of mute box that triggers the volume panel appearing.
Turn all button colors into an slightly transparent white.
Center status display text in fullscreen mode.
Lower position of captions container in fullscreen mode.
Show the controls on when done loading of the video an status display is hidden.
* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel):
(audio::-webkit-media-controls-panel button:focus):
(audio::-webkit-media-controls-rewind-button):
(audio::-webkit-media-controls-play-button):
(audio::-webkit-media-controls-play-button.paused):
(audio::-webkit-media-controls-panel .mute-box):
(video::-webkit-media-controls-volume-max-button):
(audio::-webkit-media-controls-panel .volume-box):
(video::-webkit-media-controls-volume-min-button):
(audio::-webkit-media-controls-wireless-playback-picker-button):
(audio::-webkit-media-controls-toggle-closed-captions-button):
(audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
(audio::-webkit-media-controls-fullscreen-button):
(audio::-webkit-media-controls-fullscreen-button.exit):
(audio::-webkit-media-controls-status-display):
(audio::-webkit-media-controls-time-remaining-display):
(video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
(video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
(video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
(video:-webkit-full-screen::-webkit-media-controls-play-button):
(video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
(video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
(video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
(video:-webkit-full-screen::-webkit-media-controls-status-display):
(video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
(audio::-webkit-media-controls-panel button:active): Deleted.
* Modules/mediacontrols/mediaControlsApple.js:

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

4 years agoUnreviewed, rolling out r179340 and r179344.
commit-queue@webkit.org [Wed, 11 Mar 2015 22:52:43 +0000 (22:52 +0000)]
Unreviewed, rolling out r179340 and r179344.
https://bugs.webkit.org/show_bug.cgi?id=142598

Caused images to stay alive forever when navigating away from
the page before they finish loading. (Requested by kling on
#webkit).

Reverted changesets:

"CachedImage: ensure clients overrides imageChanged instead of
notifyFinished"
https://bugs.webkit.org/show_bug.cgi?id=140722
http://trac.webkit.org/changeset/179340

"HTMLImageLoader: fix build failure on assert condition after
r179340"
https://bugs.webkit.org/show_bug.cgi?id=140722
http://trac.webkit.org/changeset/179344

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

4 years agoMany users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
ggaren@apple.com [Wed, 11 Mar 2015 22:32:19 +0000 (22:32 +0000)]
Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
https://bugs.webkit.org/show_bug.cgi?id=142593

Reviewed by Andreas Kling.

Adopt deprecatedReportExtraMemory as a short-term fix for runaway
memory growth in these cases where we have not adopted
reportExtraMemoryVisited.

Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.

Source/JavaScriptCore:

* API/JSBase.cpp:
(JSReportExtraMemoryCost):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::add):

Source/WebCore:

Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::reportExtraMemoryAllocated):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::toJS):
* bindings/js/JSImageDataCustom.cpp:
(WebCore::toJS):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper):
* dom/CollectionIndexCache.cpp:
(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::imageChanged):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::dropProtection):

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

4 years agoFix the build
mmaxfield@apple.com [Wed, 11 Mar 2015 22:23:45 +0000 (22:23 +0000)]
Fix the build

Unreviewed.

* Shared/Downloads/mac/DownloadMac.mm:
(WebKit::Download::start):
(WebKit::Download::resume):

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

4 years agoREGRESSION (r180985): contentfiltering/block-after-add-data.html crashes with GuardMalloc
aestes@apple.com [Wed, 11 Mar 2015 22:02:01 +0000 (22:02 +0000)]
REGRESSION (r180985): contentfiltering/block-after-add-data.html crashes with GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=142526

Reviewed by Darin Adler.

Source/WebCore:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::dataReceived): Don't delete m_contentFilter until after we're done using its replacement data.

LayoutTests:

* TestExpectations: Un-skipped contentfiltering/block-after-add-data.html.

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

4 years agoAllow adding a button in input elements for auto fill related functionality
weinig@apple.com [Wed, 11 Mar 2015 22:01:01 +0000 (22:01 +0000)]
Allow adding a button in input elements for auto fill related functionality
<rdar://problem/19782066>
https://bugs.webkit.org/show_bug.cgi?id=142564

Reviewed by Anders Carlsson.

Source/WebCore:

Test: fast/forms/input-auto-fill-button.html

- Adds a new button that can be shown in <input> elements - AutoFillButtonElement.
- Makes the spelling of AutoFill consistent throughout WebCore and WebKit (except
  where not feasible due to exported API/SPI).

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* css/html.css:
(input::-webkit-auto-fill-button):
(input::-webkit-auto-fill-button:hover):
(input::-webkit-auto-fill-button:active):
Add default style rules for the AutoFill button based on the ones
used for caps lock indicator.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::autoFillButtonElement):
(WebCore::HTMLInputElement::reset):
(WebCore::HTMLInputElement::setValueFromRenderer):
(WebCore::HTMLInputElement::setAutoFilled):
(WebCore::HTMLInputElement::setShowAutoFillButton):
(WebCore::HTMLInputElement::setAutofilled): Deleted.
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::isAutoFilled):
(WebCore::HTMLInputElement::showAutoFillButton):
(WebCore::HTMLInputElement::isAutofilled): Deleted.
Add new bit to represent whether the AutoFill button should be shown
or not. By default it is not shown, and the client must enable it.

* html/InputType.cpp:
(WebCore::InputType::updateAutoFillButton):
* html/InputType.h:
(WebCore::InputType::autoFillButtonElement):
Add new virtual methods for updating and accessing the AutoFill button.

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::autoFillButtonElement):
(WebCore::TextFieldInputType::destroyShadowSubtree):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::shouldDrawAutoFillButton):
(WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
(WebCore::TextFieldInputType::createContainer):
(WebCore::TextFieldInputType::createAutoFillButton):
(WebCore::TextFieldInputType::updateAutoFillButton):
* html/TextFieldInputType.h:
Add support for adding the AutoFill to the shadow DOM of textfields. The implementation
is slightly different than for the caps lock indicator, because I didn't want to force
the creation of a container for all <input> elements just in case an AutoFill button was
added. Instead, if an AutoFill button is added, the container is created on the fly and
the existing DOM is updated to move into it. Once a container is created, it is never
removed.

* html/shadow/AutoFillButtonElement.cpp: Added.
(WebCore::AutoFillButtonElement::create):
(WebCore::AutoFillButtonElement::AutoFillButtonElement):
(WebCore::AutoFillButtonElement::defaultEventHandler):
* html/shadow/AutoFillButtonElement.h: Added.
Add div subclass that swallows the click event and forwards it to the ChromeClient.

* page/ChromeClient.h:
Add handleAutoFillButtonClick client function to inform WebKit that the AutoFill
button was clicked.

* testing/Internals.cpp:
(WebCore::Internals::setAutofilled):
(WebCore::Internals::setShowAutoFillButton):
* testing/Internals.h:
* testing/Internals.idl:
Expose a new internals.setShowAutoFillButton() function to allow testing
of the AutoFill button from layout tests.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isValueAutofilled):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilled):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithControl):
Update for new spelling of AutoFill.

Source/WebKit/mac:

* DOM/WebDOMOperations.mm:
(-[DOMHTMLInputElement _setAutofilled:]):
Update for consistent spelling of AutoFill.

Source/WebKit2:

- Adds new SPI to respond to clicks on the AutoFill button (both bundle and UIProcess).
- Adds new SPI to enable/disable the display of the AutoFill button on an element.
- Adds new SPI to get the bounds of the AutoFill button.
- Updates spelling of AutoFill to be consistent.

* UIProcess/API/APIUIClient.h:
(API::UIClient::didClickAutoFillButton):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleAutoFillButtonClick):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
(API::InjectedBundle::PageUIClient::didClickAutoFillButton):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::didClickAutoFillButton):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::handleAutoFillButtonClick):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
Pipe the didClickAutoFillButton to the SPI layer.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]):
(-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]):
Update for new spelling of AutoFill.

* WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleGetHTMLInputElementAutoFilled):
(WKBundleNodeHandleSetHTMLInputElementAutoFilled):
Added. Replaces WKBundleNodeHandleGetHTMLInputElementAutofilled/WKBundleNodeHandleSetHTMLInputElementAutofilled
which are now deprecated due to inconsistent spelling of AutoFill.

(WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled):
(WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled):
(WKBundleNodeHandleGetHTMLInputElementAutoFillButtonBounds):
Added.

(WKBundleNodeHandleGetHTMLInputElementAutofilled):
(WKBundleNodeHandleSetHTMLInputElementAutofilled):
Deprecated.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::getOrCreate):
(WebKit::InjectedBundleNodeHandle::create):
(WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
(WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
(WebKit::InjectedBundleNodeHandle::coreNode):
(WebKit::InjectedBundleNodeHandle::document):
(WebKit::InjectedBundleNodeHandle::elementBounds):
(WebKit::InjectedBundleNodeHandle::renderRect):
(WebKit::InjectedBundleNodeHandle::renderedImage):
(WebKit::InjectedBundleNodeHandle::visibleRange):
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
(WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled):
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
(WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled):
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
(WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
(WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
(WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
(WebKit::InjectedBundleNodeHandle::isTextField):
(WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
(WebKit::InjectedBundleNodeHandle::documentFrame):
(WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
(WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
(WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutofilled): Deleted.
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutofilled): Deleted.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
Fix-up InjectedBundleNodeHandle to store its underlying Node in a Ref, rather than a RefPtr.
Add helpers to implement the new SPI for WKBundleNodeHandleRef.

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):
Update for new callback.

LayoutTests:

* fast/forms/input-auto-fill-button-expected.txt: Added.
* fast/forms/input-auto-fill-button.html: Added.

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

4 years agoRefactored the JSC::Heap extra cost API for clarity and to make some known bugs more...
ggaren@apple.com [Wed, 11 Mar 2015 21:29:57 +0000 (21:29 +0000)]
Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
https://bugs.webkit.org/show_bug.cgi?id=142589

Reviewed by Andreas Kling.

Source/JavaScriptCore:

* API/JSBase.cpp:
(JSReportExtraMemoryCost): Added a FIXME to annotate a known bug.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitAggregate):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setJITCode): Updated for rename.

* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::reportExtraMemoryAllocatedSlowCase):
(JSC::Heap::deprecatedReportExtraMemorySlowCase): Renamed our reporting
APIs to clarify their relationship to each other: One must report extra
memory at the time of allocation, and at the time the GC visits it.

(JSC::Heap::extraMemorySize):
(JSC::Heap::size):
(JSC::Heap::capacity):
(JSC::Heap::sizeAfterCollect):
(JSC::Heap::willStartCollection): Updated for renames. Added explicit
API for deprecated users who can't use our best API.

(JSC::Heap::reportExtraMemoryCostSlowCase): Deleted.
(JSC::Heap::extraSize): Deleted.

* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::reportExtraMemoryAllocated):
(JSC::Heap::reportExtraMemoryVisited):
(JSC::Heap::deprecatedReportExtraMemory):
(JSC::Heap::reportExtraMemoryCost): Deleted. Ditto.

* heap/SlotVisitor.h:
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::reportExtraMemoryVisited):
(JSC::SlotVisitor::reportExtraMemoryUsage): Deleted. Moved this
functionality into the Heap since it's pretty detailed in its access
to the heap.

* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Updated for
renames.

* runtime/JSString.cpp:
(JSC::JSString::visitChildren):
(JSC::JSRopeString::resolveRopeToAtomicString):
(JSC::JSRopeString::resolveRope):
* runtime/JSString.h:
(JSC::JSString::finishCreation): Updated for renames.

* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::add): Added FIXME.

* runtime/WeakMapData.cpp:
(JSC::WeakMapData::visitChildren): Updated for rename.

Source/WebCore:

Updated for renames to JSC extra cost APIs.

Added FIXMEs to our 10 use cases that are currently wrong, including
canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferInternal):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::reportExtraMemoryAllocated):
(WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.
* Modules/mediasource/SourceBuffer.h:
* bindings/js/JSDocumentCustom.cpp:
(WebCore::toJS):
* bindings/js/JSImageDataCustom.cpp:
(WebCore::toJS):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* dom/CollectionIndexCache.cpp:
(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
(WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.
* dom/CollectionIndexCache.h:
(WebCore::Iterator>::computeNodeCountUpdatingListCache):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLCollection.h:
(WebCore::CollectionNamedElementCache::didPopulate):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::imageChanged):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::dropProtection):

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

4 years agoAdd basic support for BOL and EOL assertions to the URL Filter parser
benjamin@webkit.org [Wed, 11 Mar 2015 21:08:51 +0000 (21:08 +0000)]
Add basic support for BOL and EOL assertions to the URL Filter parser
https://bugs.webkit.org/show_bug.cgi?id=142568

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

Source/WebCore:

This patch adds heavily restricted support for BOL and EOL to the URL filter parser.

Both assertions must be the first/last term of their pattern. Any advanced combination
results in a parsing error.

The BOL assertion is easy to represent: currently, any pattern starts at the beginning
of a line and the NFA are generated accordingly.

I had two options to represent the EOL assertion:
1) Add a new special transition on EOL.
2) Add a new vector of actions to the states, conditional to the EOL input.

I picked the first option to avoid growing every state by a vector
that would be empty in the vast majority of cases.

On the matching side, the interpreter was modified to support transitions on '\0'.
DFABytecodeInstruction::CheckValue now stops when running on a character after
the end of the string.

DFABytecodeInstruction::Jump gets two fixes: First we now account for the index
to avoid going past the end of the input. Second, stop on '\0' too... the reason
is that the unconditional jump is only used for fallback edges of the DFA, fallback
edge are not supposed to accept '\0'.

* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::printTransitions):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
* contentextensions/DFANode.h:
* contentextensions/NFA.cpp:
(WebCore::ContentExtensions::NFA::addTransition):
(WebCore::ContentExtensions::NFA::addEpsilonTransition):
(WebCore::ContentExtensions::printTransitions):
* contentextensions/NFANode.h:
* contentextensions/NFAToDFA.cpp:
(WebCore::ContentExtensions::populateTransitions):
(WebCore::ContentExtensions::NFAToDFA::convert):
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::Term::Term):
(WebCore::ContentExtensions::Term::isEndOfLineAssertion):
(WebCore::ContentExtensions::GraphBuilder::assertionBOL):
(WebCore::ContentExtensions::GraphBuilder::assertionEOL):
(WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):

Tools:

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

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

4 years agoCalling super() in a base class results in a crash
rniwa@webkit.org [Wed, 11 Mar 2015 21:03:24 +0000 (21:03 +0000)]
Calling super() in a base class results in a crash
https://bugs.webkit.org/show_bug.cgi?id=142563

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

The bug was caused by BytecodeGenerator trying to generate "super" expression inside the constructor of a base class.
Disallow that by keeping track of whether "super" has been used in the current scope or not (needsSuperBinding flag)
and then throwing a syntax error in parseFunctionInfo if it was used and the current scope wasn't the constructor of
a derived class.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo): Don't allow super() or super.foo outside the constructor of a derived class.
(JSC::Parser<LexerType>::parseClass): Pass in the constructor kind to parseGetterSetter.
(JSC::Parser<LexerType>::parseGetterSetter): Ditto to parseFunctionInfo.
(JSC::Parser<LexerType>::parseMemberExpression): Set needsSuperBinding flag true on the containing scope.
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::needsSuperBinding): Added.
(JSC::Scope::setNeedsSuperBinding): Added.

LayoutTests:

Added more test cases to an existing test.

* js/class-syntax-super-expected.txt:
* js/script-tests/class-syntax-super.js:

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

4 years ago[Mac] Update fullscreen placeholder UI to use Vibrancy.
jer.noble@apple.com [Wed, 11 Mar 2015 20:27:42 +0000 (20:27 +0000)]
[Mac] Update fullscreen placeholder UI to use Vibrancy.
https://bugs.webkit.org/show_bug.cgi?id=142586

Reviewed by Eric Carlson.

Update the fullscreen placeholder with a translucent vibrant appearance
using NSVisualEffectView. Since NSVisuaEffectView is only available for
OS X 10.10 and above, wrap the new implementation in a version check and
retain the old implementation.

Drive-by: Update the strings for the placeholder view with new HI guidance
as well.

* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::clickToExitFullScreenText):
* platform/mac/WebCoreFullScreenPlaceholderView.h:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
(-[WebCoreFullScreenPlaceholderView setExitWarningVisible:]):

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

4 years agosvg/animations/smil-leak-*.svg tests are flaky.
said@apple.com [Wed, 11 Mar 2015 20:08:26 +0000 (20:08 +0000)]
svg/animations/smil-leak-*.svg tests are flaky.
https://bugs.webkit.org/show_bug.cgi?id=114280

Unreviewed.

Some svg tests were flaky on mac only but they became flaky on all ports
after r181345. They pass locally and on EWS but not on bots. Mark them to
be flaky on all ports till we figure out the problem with these tests.

* TestExpectations:
* platform/mac/TestExpectations:

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

4 years agoMake it possible to zoom on pages that claim to lay out to device size and then fail...
timothy_horton@apple.com [Wed, 11 Mar 2015 19:16:20 +0000 (19:16 +0000)]
Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
https://bugs.webkit.org/show_bug.cgi?id=142549

Reviewed by Simon Fraser.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
Rename m_ignoreScalingConstraints to m_canIgnoreScalingConstraints,
because it being true does not guarantee that we will ignore scaling constraints,
but it being false does guarantee that we won't.

(WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
Ignore scaling constraints if the page:
    a) claimed to want to lay out to device-width and then laid out too wide
    b) claimed to want to lay out to device-height and then laid out too tall
    c) claimed to want to lay out with initialScale=1 and then laid out too wide

(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
(WebCore::ViewportConfiguration::allowsUserScaling):
Call shouldIgnoreScalingConstraints() instead of looking at the local, so we can
have some more logic here (as above).

(WebCore::ViewportConfiguration::description):
Dump whether we're ignoring scaling constraints.

(WebCore::ViewportConfiguration::dump):
Use WTFLogAlways so that the output goes to various other logging mechanisms
instead of just stderr.

* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
(WebCore::ViewportConfiguration::setIgnoreScalingConstraints): Deleted.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Flip the pref on by default.

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

4 years ago[GTK] Add support for handling TLS errors to MiniBrowser
carlosgc@webkit.org [Wed, 11 Mar 2015 19:14:20 +0000 (19:14 +0000)]
[GTK] Add support for handling TLS errors to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=142576

Reviewed by Sergio Villar Senin.

It's useful for testing TLS errors handling itself, but also to
allow ignoring TLS errors when testing.

* MiniBrowser/gtk/BrowserWindow.c:
(webViewLoadFailedWithTLSerrors):
(browserWindowConstructed):

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

4 years agoUse out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlo...
mmaxfield@apple.com [Wed, 11 Mar 2015 18:22:06 +0000 (18:22 +0000)]
Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
https://bugs.webkit.org/show_bug.cgi?id=142569

Reviewed by David Hyatt.

Source/WebCore:

Currently, RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline() return -1 to mean
that its baseline should be skipped. Instead of using this sentinel value, this patch changes the
return type from int to Optional<int>.

No new tests because there is no behavior change.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::baselinePosition):
(WebCore::RenderBlock::firstLineBaseline):
(WebCore::RenderBlock::inlineBlockBaseline):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline):
(WebCore::RenderBlockFlow::inlineBlockBaseline):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.h:
(WebCore::RenderBox::firstLineBaseline):
(WebCore::RenderBox::inlineBlockBaseline):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::baselinePosition):
(WebCore::RenderFlexibleBox::firstLineBaseline):
(WebCore::RenderFlexibleBox::inlineBlockBaseline):
(WebCore::RenderFlexibleBox::marginBoxAscentForChild):
* rendering/RenderFlexibleBox.h:
* rendering/RenderMenuList.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::cellAbove):
(WebCore::RenderTable::cellBelow):
(WebCore::RenderTable::cellBefore):
(WebCore::RenderTable::cellAfter):
(WebCore::RenderTable::firstLineBlock):
(WebCore::RenderTable::baselinePosition):
(WebCore::RenderTable::inlineBlockBaseline):
(WebCore::RenderTable::firstLineBaseline):
* rendering/RenderTable.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::cellBaselinePosition):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::firstLineBaseline):
* rendering/RenderTableSection.h:
* rendering/RenderTextControl.h:
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::baselinePosition):
(WebCore::RenderMathMLTable::firstLineBaseline):
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::firstLineBaseline):
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::firstLineBaseline):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::firstLineBaseline):
(WebCore::RenderMathMLRoot::layout):
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layout):
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layout):
(WebCore::RenderMathMLScripts::firstLineBaseline):
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.cpp:
(WebCore::RenderMathMLSpace::firstLineBaseline):
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::firstLineBaseline):
* rendering/mathml/RenderMathMLUnderOver.h:

Source/WTF:

Provide a callback to Optional::valueOrCompute() which is evaluated only if necessary.

* wtf/Optional.h:
(WTF::Optional::valueOrCompute):

Tools:

Test Optional::valueOrCompute().

* TestWebKitAPI/Tests/WTF/Optional.cpp:
(TestWebKitAPI::TEST):

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

4 years ago<attachment>s should be created when dropping files onto contentEditable areas
timothy_horton@apple.com [Wed, 11 Mar 2015 18:21:05 +0000 (18:21 +0000)]
<attachment>s should be created when dropping files onto contentEditable areas
https://bugs.webkit.org/show_bug.cgi?id=142494
<rdar://problem/19982553>

Reviewed by Anders Carlsson.

Covered by existing tests.

* editing/mac/EditorMac.mm:
(WebCore::Editor::WebContentReader::readFilenames):
Instead of inserting the dropped URLs as strings, make an <attachment>
for each.

* editing/pasteboard/drag-files-to-editable-element-expected.txt:
* editing/pasteboard/drag-files-to-editable-element.html:
Update the test to expect <attachment>s instead of filenames.

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

4 years agoOptimize offsetWidth and offsetHeight to avoid doing layouts.
hyatt@apple.com [Wed, 11 Mar 2015 18:13:45 +0000 (18:13 +0000)]
Optimize offsetWidth and offsetHeight to avoid doing layouts.
https://bugs.webkit.org/show_bug.cgi?id=142544

Reviewed by Beth Dakin.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
* dom/Document.h:
Added a new method that only updates layout if it determines that the desired dimensions are out
of date.

* dom/Element.cpp:
(WebCore::Element::offsetWidth):
(WebCore::Element::offsetHeight):
Patch offsetWidth and offsetHeight to call the new method rather than updateLayoutIgnorePendingStylesheets.

LayoutTests:

* fast/images/repaint-subrect-grid.html:
Patch this test to use the window.internals update layout method rather than
relying on document.body.offsetWidth.

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

4 years ago[GTK] Add an option to enable MiniBrowser for non developer builds and always install it
carlosgc@webkit.org [Wed, 11 Mar 2015 18:08:39 +0000 (18:08 +0000)]
[GTK] Add an option to enable MiniBrowser for non developer builds and always install it
https://bugs.webkit.org/show_bug.cgi?id=126688

Reviewed by Gustavo Noronha Silva.

.:

Add ENABLE_MINIBROWSER option, enabled by default for development
builds and disabled for production builds unless explicilty enabled.

* Source/cmake/OptionsGTK.cmake:

Tools:

* CMakeLists.txt: Build testing tools only for developer builds,
but MiniBrowser when ENABLE_MINIBROWSER option is ON.
* MiniBrowser/gtk/CMakeLists.txt: Only add
-DWEBKIT_INJECTED_BUNDLE_PATH to the build for developer builds,
and add a rule to install the MiniBrowser.
* MiniBrowser/gtk/main.c:
(main): Only set WEBKIT_INJECTED_BUNDLE_PATH env var for developer
builds.

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

4 years agoAdd some DateMath tests to TestWebKitAPI
bfulgham@apple.com [Wed, 11 Mar 2015 17:49:04 +0000 (17:49 +0000)]
Add some DateMath tests to TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=142565

Reviewed by Alexey Proskuryakov.

* TestWebKitAPI/CMakeLists.txt: Add new DateMath.cpp file.
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj: Ditto.
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters: Ditto.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto."
* TestWebKitAPI/Tests/WTF/DateMath.cpp: Added.

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

4 years ago[GTK] Do not look for child processes in the UI process binary path
carlosgc@webkit.org [Wed, 11 Mar 2015 17:47:38 +0000 (17:47 +0000)]
[GTK] Do not look for child processes in the UI process binary path
https://bugs.webkit.org/show_bug.cgi?id=135752

Reviewed by Gustavo Noronha Silva.

.:

* Source/cmake/OptionsGTK.cmake: Add -DDEVELOPMENT_BUILD=1 to the
build for development builds.

Source/WebKit2:

It's only useful for internal tools and tests, but never when
installed, since we don't install the processes in the bin dir but
in the libexec dir.

* Shared/gtk/ProcessExecutablePathGtk.cpp:
(WebKit::findWebKitProcess): Only look or the executables in the
UI process binary path or WEBKIT_EXEC_PATH for development builds.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(injectedBundleDirectory): Only check
WEBKIT_INJECTED_BUNDLE_PATH env var for development builds.

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

4 years ago[Win] Test gardening after r181260
mmaxfield@apple.com [Wed, 11 Mar 2015 16:38:30 +0000 (16:38 +0000)]
[Win] Test gardening after r181260

Unreviewed.

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

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

4 years agoTest gardening after r181278
mmaxfield@apple.com [Wed, 11 Mar 2015 16:31:53 +0000 (16:31 +0000)]
Test gardening after r181278

Unreviewed.

Until Windows adopts the SVG -> OTF Converter, we should mark this test as Mac-only.

* platform/mac/svg/fonts/resources/svg-font-general.svg: Renamed from LayoutTests/svg/fonts/resources/svg-font-general.svg.
* platform/mac/svg/fonts/svg-font-general-expected.html: Renamed from LayoutTests/svg/fonts/svg-font-general-expected.html.
* platform/mac/svg/fonts/svg-font-general.html: Renamed from LayoutTests/svg/fonts/svg-font-general.html.

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

4 years agoUnreviewed, rolling out r181367.
commit-queue@webkit.org [Wed, 11 Mar 2015 15:58:13 +0000 (15:58 +0000)]
Unreviewed, rolling out r181367.
https://bugs.webkit.org/show_bug.cgi?id=142581

Caused crashes on the debug bots (Requested by cdumez on
#webkit).

Reverted changeset:

"Web Inspector: CSS parser errors in the console should
include column numbers"
https://bugs.webkit.org/show_bug.cgi?id=114313
http://trac.webkit.org/changeset/181367

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

4 years agoWeb Inspector: Reload after Global Search results in empty Resources Sidebar.
commit-queue@webkit.org [Wed, 11 Mar 2015 14:52:04 +0000 (14:52 +0000)]
Web Inspector: Reload after Global Search results in empty Resources Sidebar.
https://bugs.webkit.org/show_bug.cgi?id=142572

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-11
Reviewed by Timothy Hatcher.

If you reload when the search content tree outline is showing, break out
to show the resource tree outline.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._showResourcesContentTreeOutline):
(WebInspector.ResourceSidebarPanel.prototype._showSearchContentTreeOutline):

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

4 years agoInline block children do not have correct baselines if their children are also block...
mmaxfield@apple.com [Wed, 11 Mar 2015 14:41:01 +0000 (14:41 +0000)]
Inline block children do not have correct baselines if their children are also block elements
https://bugs.webkit.org/show_bug.cgi?id=142559

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2015-03-11
Reviewed by Darin Adler.

Source/WebCore:

Perform the same computation on child block elements as child inline elements.

Test: fast/text/baseline-inline-block-block-children.html

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

LayoutTests:

* fast/text/baseline-inline-block-block-children-expected.html: Added.
* fast/text/baseline-inline-block-block-children.html: Added.

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

4 years agoWeb Inspector: SearchResultTreeElement.representedObject is missing a saveIdentityToC...
commit-queue@webkit.org [Wed, 11 Mar 2015 14:09:29 +0000 (14:09 +0000)]
Web Inspector: SearchResultTreeElement.representedObject is missing a saveIdentityToCookie implementation
https://bugs.webkit.org/show_bug.cgi?id=134698

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-11
Reviewed by Timothy Hatcher.

This will restore selection of a global search tree element if you
close and reopen the inspector in such a case.

* UserInterface/Models/DOMSearchMatchObject.js:
(WebInspector.DOMSearchMatchObject.prototype.get resource):
(WebInspector.DOMSearchMatchObject.titleForDOMNode):
Cookie has the resource URL, DOM Node title, and text range.

* UserInterface/Models/SourceCodeSearchMatchObject.js:
(WebInspector.SourceCodeSearchMatchObject.prototype.get sourceCodeTextRange):
Cookie has the source code URL and text range.

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

4 years ago[CMake][GStreamer] Building EFL or GTK with ENABLE_VIDEO and without ENABLE_WEB_AUDIO...
clopez@igalia.com [Wed, 11 Mar 2015 14:00:15 +0000 (14:00 +0000)]
[CMake][GStreamer] Building EFL or GTK with ENABLE_VIDEO and without ENABLE_WEB_AUDIO is broken.
https://bugs.webkit.org/show_bug.cgi?id=142577

Reviewed by Carlos Garcia Campos.

No new tests, this is a build fix.

* PlatformEfl.cmake: Include GSTREAMER_AUDIO_LIBRARIES on the link step both for ENABLE_VIDEO and ENABLE_WEB_AUDIO.
* PlatformGTK.cmake: Idem.

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 11 Mar 2015 08:44:12 +0000 (08:44 +0000)]
Versioning.

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

4 years agoRename MediaStreamCenter to RealtimeMediaSourceCenter
philn@webkit.org [Wed, 11 Mar 2015 08:10:07 +0000 (08:10 +0000)]
Rename MediaStreamCenter to RealtimeMediaSourceCenter
https://bugs.webkit.org/show_bug.cgi?id=142535

Reviewed by Eric Carlson.

As per bug title, rename MediaStreamCenter to
RealtimeMediaSourceCenter, this class manages
RealtimeMediaSources, not MediaStreams. Some un-needed includes of
the header were also removed.

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

4 years agoRemove unnecessary create() factory functions
gyuyoung.kim@samsung.com [Wed, 11 Mar 2015 07:10:08 +0000 (07:10 +0000)]
Remove unnecessary create() factory functions
https://bugs.webkit.org/show_bug.cgi?id=142558

Reviewed by Darin Adler.

create() function which just returns new instance can be replaced with std::make_unique<>.

No new tests, no behavior changes.

* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
* crypto/keys/CryptoKeyAES.cpp:
(WebCore::CryptoKeyAES::exportData):
* crypto/keys/CryptoKeyDataOctetSequence.h:
* crypto/keys/CryptoKeyHMAC.cpp:
(WebCore::CryptoKeyHMAC::exportData):
* crypto/keys/CryptoKeySerializationRaw.cpp:
(WebCore::CryptoKeySerializationRaw::keyData):
* platform/audio/mac/CARingBuffer.cpp:
(WebCore::CARingBuffer::create): Deleted.
* platform/audio/mac/CARingBuffer.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::prepare):
* testing/Internals.cpp:
(WebCore::Internals::queueMicroTask):
* testing/MicroTaskTest.cpp:
(WebCore::MicroTaskTest::create): Deleted.
* testing/MicroTaskTest.h:
(WebCore::MicroTaskTest::MicroTaskTest):

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

4 years agoWeb Inspector: CSS parser errors in the console should include column numbers
commit-queue@webkit.org [Wed, 11 Mar 2015 06:11:10 +0000 (06:11 +0000)]
Web Inspector: CSS parser errors in the console should include column numbers
https://bugs.webkit.org/show_bug.cgi?id=114313

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

Source/WebCore:

Test: inspector-protocol/console/warnings-errors.html

* css/CSSParser.h:
(WebCore::CSSParser::currentCharacterOffset):
Get the current character offset depending on the source type.
Add instance variables to track column position and start
line / column for inline stylesheets.

* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSheet):
Initialize new instance variables.

(WebCore::CSSParser::currentLocation):
Update to include column information. Also, if we are on the first line
we may need to take into account a start column offset as well.

(WebCore::CSSParser::realLex):
When bumping the line number, reset the column offset for the next
line with the next character.

(WebCore::CSSParser::syntaxError):
(WebCore::CSSParser::logError):
Include column information.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
(WebCore::StyleSheetContents::parseStringAtLineAndColumn):
Include column information.

* css/StyleSheetContents.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
(WebCore::InlineStyleSheetOwner::createSheet):
Save and use column information later on.

* dom/InlineStyleSheetOwner.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::ensureSourceData):
Updated parser signature needs starting column and no longer has optional parameters.

Source/WebInspectorUI:

* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._linkifyLocation):
Column numbers in console messages are also 1 based and should be adjusted.

LayoutTests:

Test errors in both external and inline CSS and Scripts to ensure they have
expected line:column information.

* inspector-protocol/console/warnings-errors-expected.txt: Added.
* inspector-protocol/console/warnings-errors.html: Added.
* inspector-protocol/resources/errors.css: Added.
* inspector-protocol/resources/errors.js: Added.

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

4 years agoTry to fix the GTK build.
darin@apple.com [Wed, 11 Mar 2015 05:56:24 +0000 (05:56 +0000)]
Try to fix the GTK build.

* html/HTMLVideoElement.idl: Work around gobject bindings generator limitation
by putting in a LANGUAGE_GOBJECT conditional.

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

4 years agoUnreviewed EFL gardening on 10th Mar.
gyuyoung.kim@samsung.com [Wed, 11 Mar 2015 05:30:43 +0000 (05:30 +0000)]
Unreviewed EFL gardening on 10th Mar.

Mark smil-leak-foo tests, 3 tests of fast/css to failure.

* platform/efl/TestExpectations:

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

4 years agoAdd interface to delete disk cache entries
antti@apple.com [Wed, 11 Mar 2015 04:08:53 +0000 (04:08 +0000)]
Add interface to delete disk cache entries
https://bugs.webkit.org/show_bug.cgi?id=142546

Reviewed by Anders Carlsson.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::remove):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::remove):

    Move deletion to a serial queue so we can't create large number of threads.

(WebKit::NetworkCache::Storage::dispatchReadOperation):
(WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
(WebKit::NetworkCache::Storage::removeEntry): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::deleteQueue):

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