WebKit-https.git
5 years agoAdd an option to select the results form the graphics benchmark
commit-queue@webkit.org [Mon, 30 Nov 2015 22:15:27 +0000 (22:15 +0000)]
Add an option to select the results form the graphics benchmark
https://bugs.webkit.org/show_bug.cgi?id=151666

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-11-30
Reviewed by Ryosuke Niwa.

We need an easy way to select the graphics benchmark results table such
that when it is copied to the clipboard, rich text format is set to the
clipboard.

* Animometer/runner/animometer.html: Add a new button to select the results table or JSON.

* Animometer/runner/resources/animometer.js:
(window.sectionsManager._sectionDataElement): Selects the container <data> element.
(window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
(window.sectionsManager.showTestName): Replace a literal string with a string table entry.
(window.sectionsManager.selectData): Selects the container <data> element in a selection.
(window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
(window.benchmarkController.selectResults): Selects the results table.
(window.benchmarkController.showJSON): Function rename.
(window.benchmarkController.selectJSON): Selects the contents of the results JSON.
(window.benchmarkController.showJson): Deleted.

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

5 years agoMarking fast/forms/state-restore-per-form.html as a flaky timeout on mac-wk2
ryanhaddad@apple.com [Mon, 30 Nov 2015 22:15:18 +0000 (22:15 +0000)]
Marking fast/forms/state-restore-per-form.html as a flaky timeout on mac-wk2
https://bugs.webkit.org/show_bug.cgi?id=150542

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 years ago[JSC] Simplify the loop that remove useless Air instructions
benjamin@webkit.org [Mon, 30 Nov 2015 21:56:56 +0000 (21:56 +0000)]
[JSC] Simplify the loop that remove useless Air instructions
https://bugs.webkit.org/show_bug.cgi?id=151652

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-11-30
Reviewed by Andreas Kling.

* b3/air/AirEliminateDeadCode.cpp:
(JSC::B3::Air::eliminateDeadCode):
Use Vector's removeAllMatching() instead of custom code.

It is likely faster too since we remove few values and Vector
is good at doing that.

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

5 years agoModern IDB: Correct handling of cursors finishing iteration.
beidson@apple.com [Mon, 30 Nov 2015 21:51:06 +0000 (21:51 +0000)]
Modern IDB: Correct handling of cursors finishing iteration.
https://bugs.webkit.org/show_bug.cgi?id=151664

Reviewed by Andy Estes.

Source/WebCore:

No new tests (At least one previously failing test now passes).

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::setGetResult):

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::putOrAdd):

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoGet rid of the legacy swipe shadow style
timothy_horton@apple.com [Mon, 30 Nov 2015 21:50:04 +0000 (21:50 +0000)]
Get rid of the legacy swipe shadow style
https://bugs.webkit.org/show_bug.cgi?id=151671

Reviewed by Anders Carlsson.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Deleted.
(WebKit::ViewGestureController::handleSwipeGesture): Deleted.
(WebKit::ViewGestureController::removeSwipeSnapshot): Deleted.
It is no longer needed.

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

5 years agoUnify font-variant-* with font-variant shorthand
mmaxfield@apple.com [Mon, 30 Nov 2015 21:20:32 +0000 (21:20 +0000)]
Unify font-variant-* with font-variant shorthand
https://bugs.webkit.org/show_bug.cgi?id=149773

Reviewed by Darin Adler.

Source/WebCore:

This patch makes font-variant a shorthand for the following properties:
font-variant-ligatures
font-variant-position
font-variant-caps
font-variant-numeric
font-variant-alternates
font-variant-east-asian

This is consistent with the CSS Fonts Level 3 spec.

This patch also migrates the "font" longhand to use the font-variant-caps
property.

Test: fast/text/font-variant-shorthand.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
(WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
font-variant computed style.
(WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
the font shorthand.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
of the new shorthand property).
* css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFont):
(WebCore::CSSParser::parseSystemFont):
(WebCore::CSSParser::parseFontVariantLigatures):
(WebCore::CSSParser::parseFontVariantNumeric):
(WebCore::CSSParser::parseFontVariantEastAsian):
(WebCore::CSSParser::parseFontVariant):
(WebCore::isValidKeywordPropertyAndValue): Deleted.
(WebCore::isKeywordPropertyID): Deleted.
* css/CSSParser.h:
* css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
* css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
FontVariantEastAsian type.
(WebCore::applyValueFontVariantLigatures):
(WebCore::applyValueFontVariantNumeric):
(WebCore::applyValueFontVariantEastAsian):
* css/StyleProperties.cpp: Update to use the more specific property.
(WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
(WebCore::StyleProperties::fontValue):
(WebCore::StyleProperties::asText):
* css/StyleResolver.cpp: Ditto.
(WebCore::StyleResolver::isValidCueStyleProperty):
* editing/EditingStyle.cpp: Ditto.
* editing/cocoa/HTMLConverter.mm: Ditto.
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):
* editing/ios/EditorIOS.mm: Ditto.
(WebCore::Editor::removeUnchangeableStyles):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto.
(WebCore::CanvasRenderingContext2D::font):
(WebCore::CanvasRenderingContext2D::setFont):
* platform/graphics/FontCache.h: Removing duplicate cache key value.
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
(WebCore::FontCascade::glyphDataForCharacter):
* platform/graphics/FontCascade.h: Ditto.
(WebCore::FontCascade::isSmallCaps):
* platform/graphics/FontDescription.cpp: Ditto.
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h: Ditto.
(WebCore::FontCascadeDescription::equalForTextAutoSizing):
(WebCore::FontDescription::smallCaps): Deleted.
(WebCore::FontDescription::setSmallCaps): Deleted.
(WebCore::FontDescription::setIsSmallCaps): Deleted.
(WebCore::FontDescription::operator==): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
(WebCore::computeFeatureSettingsFromVariants):
* platform/text/TextFlags.h: Ditto.
(WebCore::FontVariantSettings::operator==):
* rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
(WebCore::RenderText::widthFromCache):

LayoutTests:

Update tests. Also temporarily skip existing font-features tests until
https://bugs.webkit.org/show_bug.cgi?id=149774 is fixed.

* css3/font-variant-parsing-expected.txt:
* css3/font-variant-parsing.html:
* fast/css/font-property-priority-expected.txt:
* fast/css/font-shorthand-expected.txt:
* fast/css/parsing-font-variant-ligatures-expected.txt:
* fast/css/parsing-font-variant-ligatures.html:
* fast/inspector-support/style-expected.txt:
* fast/text/font-variant-shorthand-expected.txt: Added.
* fast/text/font-variant-shorthand.html: Added.
* platform/mac/TestExpectations:
* platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.txt:

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

5 years agoPerf dashboard should extend baseline and target to the future
rniwa@webkit.org [Mon, 30 Nov 2015 21:12:43 +0000 (21:12 +0000)]
Perf dashboard should extend baseline and target to the future
https://bugs.webkit.org/show_bug.cgi?id=151511

Reviewed by Darin Adler.

* public/v2/data.js:
(RunsData.prototype.timeSeriesByCommitTime): Added extendToFuture as an argument.
(RunsData.prototype.timeSeriesByBuildTime): Ditto.
(RunsData.prototype._timeSeriesByTimeInternal): Ditto.
(TimeSeries): Add a new point to the end if extendToFuture is set and the series is not empty.
* public/v2/manifest.js:
(App.Manifest._formatFetchedData): Set extendToFuture to true for baselines and targets.

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

5 years agoPerf dashboard should always show comparison to baseline and target even if one is...
rniwa@webkit.org [Mon, 30 Nov 2015 21:09:42 +0000 (21:09 +0000)]
Perf dashboard should always show comparison to baseline and target even if one is missing
https://bugs.webkit.org/show_bug.cgi?id=151510

Reviewed by Darin Adler.

Show the comparison status against the baseline when baseline is present but target is missing.

To make the code more readable, this patch splits the logic into three cases:
1. Both baseline and target are present
2. Only baseline is present
3. Only target is present

Also extracted a helper function to construct the label.

* public/v2/app.js:
(.labelForDiff): Added.
(App.Pane.computeStatus):

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

5 years agoB3 should be be clever about choosing which child to reuse for result in two-operand...
fpizlo@apple.com [Mon, 30 Nov 2015 21:05:25 +0000 (21:05 +0000)]
B3 should be be clever about choosing which child to reuse for result in two-operand commutative operations
https://bugs.webkit.org/show_bug.cgi?id=151321

Reviewed by Geoffrey Garen.

When lowering a commutative operation to a two-operand instruction, you have a choice of which
child value to move into the result tmp. For example we might have:

    @x = Add(@y, @z)

Assuming no three-operand add is available, we could either lower it to this:

    Move %y, %x
    Add %z, %x

or to this:

    Move %z, %x
    Add %y, %x

Which is better depends on the likelihood of coalescing with %x. If it's more likely that %y will
coalesce with %x, then we want to use the first form. Otherwise, we should use the second form.

This implements two heuristics for selecting the right form, and makes those heuristics reusable
within the B3->Air lowering by abstracting it as preferRightForResult(). For non-commutative
operations we must use the first form, so the first form is the default. The heuristics are:

- If the right child has only one user, then use the second form instead. This is profitable because
  that means that @z dies at the Add, so using the second form means that the Move will be coalesced
  away.

- If one of the children is a Phi that this operation (the Add in this case) flows into via some
  Upsilon - possibly transitively through other Phis - then use the form that cases a Move on that
  child. This overrides everything else, and is meant to optimize variables that accumulate in a
  loop.

This required adding a reusable PhiChildren analysis, so I wrote one. It has an API that is mostly
based on iterators, and a higher-level API for looking at transitive children that is based on
functors.

I was originally implementing this for completeness, but when looking at how it interacted with
imaging-gaussian-blur, I realized the need for some heuristic for the loop-accumulator case. This
helps a lot on that benchmark. This widens the overall lead that B3 has on imaging-gaussian-blur, but
steady-state runs that exclude compile latency still show a slight deficit. That will most likely get
fixed by https://bugs.webkit.org/show_bug.cgi?id=151174.

No new tests because the commutativity appears to be covered by existing tests, and anyway, there are
no correctness implications to commuting a commutative operation.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::LowerToAir):
(JSC::B3::Air::LowerToAir::canBeInternal):
(JSC::B3::Air::LowerToAir::appendUnOp):
(JSC::B3::Air::LowerToAir::preferRightForResult):
(JSC::B3::Air::LowerToAir::appendBinOp):
(JSC::B3::Air::LowerToAir::lower):
* b3/B3PhiChildren.cpp: Added.
(JSC::B3::PhiChildren::PhiChildren):
(JSC::B3::PhiChildren::~PhiChildren):
* b3/B3PhiChildren.h: Added.
(JSC::B3::PhiChildren::ValueCollection::ValueCollection):
(JSC::B3::PhiChildren::ValueCollection::size):
(JSC::B3::PhiChildren::ValueCollection::at):
(JSC::B3::PhiChildren::ValueCollection::operator[]):
(JSC::B3::PhiChildren::ValueCollection::contains):
(JSC::B3::PhiChildren::ValueCollection::iterator::iterator):
(JSC::B3::PhiChildren::ValueCollection::iterator::operator*):
(JSC::B3::PhiChildren::ValueCollection::iterator::operator++):
(JSC::B3::PhiChildren::ValueCollection::iterator::operator==):
(JSC::B3::PhiChildren::ValueCollection::iterator::operator!=):
(JSC::B3::PhiChildren::ValueCollection::begin):
(JSC::B3::PhiChildren::ValueCollection::end):
(JSC::B3::PhiChildren::UpsilonCollection::UpsilonCollection):
(JSC::B3::PhiChildren::UpsilonCollection::size):
(JSC::B3::PhiChildren::UpsilonCollection::at):
(JSC::B3::PhiChildren::UpsilonCollection::operator[]):
(JSC::B3::PhiChildren::UpsilonCollection::contains):
(JSC::B3::PhiChildren::UpsilonCollection::begin):
(JSC::B3::PhiChildren::UpsilonCollection::end):
(JSC::B3::PhiChildren::UpsilonCollection::values):
(JSC::B3::PhiChildren::UpsilonCollection::forAllTransitiveIncomingValues):
(JSC::B3::PhiChildren::UpsilonCollection::transitivelyUses):
(JSC::B3::PhiChildren::at):
(JSC::B3::PhiChildren::operator[]):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::Procedure):
* b3/B3Procedure.h:
* b3/B3UseCounts.cpp:
(JSC::B3::UseCounts::UseCounts):
* b3/B3UseCounts.h:
(JSC::B3::UseCounts::numUses):
(JSC::B3::UseCounts::numUsingInstructions):
(JSC::B3::UseCounts::operator[]): Deleted.

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

5 years agoREGRESSION(r192812): This change seems to have broken the iOS builds (Requested by...
fpizlo@apple.com [Mon, 30 Nov 2015 20:45:03 +0000 (20:45 +0000)]
REGRESSION(r192812): This change seems to have broken the iOS builds (Requested by ryanhaddad on #webkit).
https://bugs.webkit.org/show_bug.cgi?id=151669

Unreviewed, fix build.

* dfg/DFGCommon.h:

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

5 years agoimplement op_get_rest_length so that we can allocate the rest array with the right...
sbarati@apple.com [Mon, 30 Nov 2015 20:36:54 +0000 (20:36 +0000)]
implement op_get_rest_length so that we can allocate the rest array with the right size from the start
https://bugs.webkit.org/show_bug.cgi?id=151467

Reviewed by Geoffrey Garen and Mark Lam.

This patch implements op_get_rest_length which returns the length
that the rest parameter array will be. We're implementing this because
it might be a constant value in the presence of inlining in the DFG.
We will take advantage of this optimization opportunity in a future patch:
https://bugs.webkit.org/show_bug.cgi?id=151454
to emit better code for op_copy_rest.

op_get_rest_length has two operands:
1) a destination
2) A constant indicating the number of parameters to skip when copying the rest array.

op_get_rest_length lowers to a JSConstant node when we're inlined
and not a varargs call (in this case, we statically know the arguments
length). When that condition isn't met, we lower op_get_rest_length to
GetRestArray. GetRestArray produces its result as an int32.

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitNewArray):
(JSC::BytecodeGenerator::emitNewArrayWithSize):
(JSC::BytecodeGenerator::emitNewFunction):
(JSC::BytecodeGenerator::emitExpectedFunctionSnippet):
(JSC::BytecodeGenerator::emitRestParameter):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::RestParameterNode::emit):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGNode.h:
(JSC::DFG::Node::numberOfArgumentsToSkip):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCopyRest):
(JSC::DFG::SpeculativeJIT::compileGetRestLength):
(JSC::DFG::SpeculativeJIT::compileNotifyWrite):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCopyRest):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetRestLength):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewObject):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_copy_rest):
(JSC::JIT::emit_op_get_rest_length):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

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

5 years agoModern IDB: After versionchange transactions abort, fire onerror on the original...
beidson@apple.com [Mon, 30 Nov 2015 20:12:07 +0000 (20:12 +0000)]
Modern IDB: After versionchange transactions abort, fire onerror on the original IDBOpenDBRequest.
https://bugs.webkit.org/show_bug.cgi?id=151648

Reviewed by Andy Estes.

Source/WebCore:

No new tests. Covered by at least one existing failing test which now passes, and many
other tests updated to fix their incorrect behavior.

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::transaction):
(WebCore::IDBClient::IDBDatabase::willAbortTransaction):
(WebCore::IDBClient::IDBDatabase::didAbortTransaction):

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::notifyDidAbort):
(WebCore::IDBClient::IDBTransaction::didAbort):
(WebCore::IDBClient::IDBTransaction::didCommit):
* Modules/indexeddb/client/IDBTransactionImpl.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/modern/abort-requests-cancelled-expected.txt:
* storage/indexeddb/modern/abort-requests-cancelled.html:
* storage/indexeddb/modern/aborted-put-expected.txt:
* storage/indexeddb/modern/aborted-put.html:
* storage/indexeddb/modern/createobjectstore-basic-expected.txt:
* storage/indexeddb/modern/createobjectstore-basic.html:
* storage/indexeddb/modern/deleteindex-2-expected.txt:
* storage/indexeddb/modern/deleteindex-2.html:
* storage/indexeddb/modern/deleteobjectstore-1-expected.txt:
* storage/indexeddb/modern/deleteobjectstore-1.html:
* storage/indexeddb/modern/idbdatabase-transaction-failures-expected.txt:
* storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt:
* storage/indexeddb/modern/versionchange-abort-then-reopen.html:

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

5 years agoMacroAssembler needs an API for disabling scratch registers
fpizlo@apple.com [Mon, 30 Nov 2015 20:07:18 +0000 (20:07 +0000)]
MacroAssembler needs an API for disabling scratch registers
https://bugs.webkit.org/show_bug.cgi?id=151010

Reviewed by Saam Barati and Michael Saboff.

This adds two scope classes, DisallowMacroScratchRegisterUsage and
AllowMacroScratchRegisterUsage. The default is that the scratch registers are enabled. Air
disables them before generation.

Henceforth the pattern inside B3 stackmap generator callbacks will be that you can only use
AllowMacroScratchRegisterUsage if you've either supplied the scratch register as a clobbered
register and arranged for all of the stackmap values to be late uses, or you're writing a test
and you're OK with it being fragile with respect to scratch registers. The latter holds in most
of testb3.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/AbstractMacroAssembler.h:
(JSC::optimizeForX86):
(JSC::AbstractMacroAssembler::setTempRegisterValid):
* assembler/AllowMacroScratchRegisterUsage.h: Added.
(JSC::AllowMacroScratchRegisterUsage::AllowMacroScratchRegisterUsage):
(JSC::AllowMacroScratchRegisterUsage::~AllowMacroScratchRegisterUsage):
* assembler/DisallowMacroScratchRegisterUsage.h: Added.
(JSC::DisallowMacroScratchRegisterUsage::DisallowMacroScratchRegisterUsage):
(JSC::DisallowMacroScratchRegisterUsage::~DisallowMacroScratchRegisterUsage):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::scratchRegister):
(JSC::MacroAssemblerX86Common::loadDouble):
(JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::add32):
(JSC::MacroAssemblerX86_64::and32):
(JSC::MacroAssemblerX86_64::or32):
(JSC::MacroAssemblerX86_64::sub32):
(JSC::MacroAssemblerX86_64::load8):
(JSC::MacroAssemblerX86_64::addDouble):
(JSC::MacroAssemblerX86_64::convertInt32ToDouble):
(JSC::MacroAssemblerX86_64::store32):
(JSC::MacroAssemblerX86_64::store8):
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType):
(JSC::MacroAssemblerX86_64::call):
(JSC::MacroAssemblerX86_64::jump):
(JSC::MacroAssemblerX86_64::tailRecursiveCall):
(JSC::MacroAssemblerX86_64::makeTailRecursiveCall):
(JSC::MacroAssemblerX86_64::branchAdd32):
(JSC::MacroAssemblerX86_64::add64):
(JSC::MacroAssemblerX86_64::addPtrNoFlags):
(JSC::MacroAssemblerX86_64::and64):
(JSC::MacroAssemblerX86_64::lshift64):
(JSC::MacroAssemblerX86_64::or64):
(JSC::MacroAssemblerX86_64::sub64):
(JSC::MacroAssemblerX86_64::store64):
(JSC::MacroAssemblerX86_64::store64WithAddressOffsetPatch):
(JSC::MacroAssemblerX86_64::branch64):
(JSC::MacroAssemblerX86_64::branchPtr):
(JSC::MacroAssemblerX86_64::branchTest64):
(JSC::MacroAssemblerX86_64::test64):
(JSC::MacroAssemblerX86_64::branchPtrWithPatch):
(JSC::MacroAssemblerX86_64::branch32WithPatch):
(JSC::MacroAssemblerX86_64::storePtrWithPatch):
(JSC::MacroAssemblerX86_64::branch8):
(JSC::MacroAssemblerX86_64::branchTest8):
(JSC::MacroAssemblerX86_64::convertInt64ToDouble):
(JSC::MacroAssemblerX86_64::readCallTarget):
(JSC::MacroAssemblerX86_64::haveScratchRegisterForBlinding):
(JSC::MacroAssemblerX86_64::scratchRegisterForBlinding):
(JSC::MacroAssemblerX86_64::canJumpReplacePatchableBranchPtrWithPatch):
(JSC::MacroAssemblerX86_64::canJumpReplacePatchableBranch32WithPatch):
(JSC::MacroAssemblerX86_64::revertJumpReplacementToPatchableBranchPtrWithPatch):
(JSC::MacroAssemblerX86_64::revertJumpReplacementToPatchableBranch32WithPatch):
(JSC::MacroAssemblerX86_64::revertJumpReplacementToBranchPtrWithPatch):
(JSC::MacroAssemblerX86_64::repatchCall):
(JSC::MacroAssemblerX86_64::add64AndSetFlags):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::generate):
* b3/testb3.cpp:
(JSC::B3::testSimplePatchpoint):
(JSC::B3::testSimplePatchpointWithoutOuputClobbersGPArgs):
(JSC::B3::testSimplePatchpointWithOuputClobbersGPArgs):
(JSC::B3::testSimplePatchpointWithoutOuputClobbersFPArgs):
(JSC::B3::testSimplePatchpointWithOuputClobbersFPArgs):
(JSC::B3::testPatchpointCallArg):
(JSC::B3::testPatchpointFixedRegister):
(JSC::B3::testPatchpointAny):
(JSC::B3::testPatchpointAnyImm):
(JSC::B3::testSimpleCheck):
(JSC::B3::testCheckLessThan):
(JSC::B3::testCheckMegaCombo):
(JSC::B3::testCheckAddImm):
(JSC::B3::testCheckAddImmCommute):
(JSC::B3::testCheckAddImmSomeRegister):
(JSC::B3::testCheckAdd):
(JSC::B3::testCheckAdd64):
(JSC::B3::testCheckAddFoldFail):
(JSC::B3::testCheckSubImm):
(JSC::B3::testCheckSubBadImm):
(JSC::B3::testCheckSub):
(JSC::B3::testCheckSub64):
(JSC::B3::testCheckSubFoldFail):
(JSC::B3::testCheckNeg):
(JSC::B3::testCheckNeg64):
(JSC::B3::testCheckMul):
(JSC::B3::testCheckMulMemory):
(JSC::B3::testCheckMul2):
(JSC::B3::testCheckMul64):
(JSC::B3::testCheckMulFoldFail):
(JSC::B3::genericTestCompare):
* dfg/DFGCommon.h:
* jit/GPRInfo.h:
(JSC::GPRInfo::toRegister):
(JSC::GPRInfo::reservedRegisters):

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

5 years ago[iOS] Option-up and Option-down should scroll a little less than a full page
timothy_horton@apple.com [Mon, 30 Nov 2015 19:52:46 +0000 (19:52 +0000)]
[iOS] Option-up and Option-down should scroll a little less than a full page
https://bugs.webkit.org/show_bug.cgi?id=151538
<rdar://problem/23642675>

Reviewed by Simon Fraser.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _scrollOffsetForEvent:]):
(-[WKContentView _interpretKeyEvent:isCharEvent:]):
Clean up the code a little, and adjust so that we *always* use pageStep
instead of just scrolling by the unobscured rect when scrolling by a page.
Previously, we did for the spacebar, but not for option-up and option-down.

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

5 years agolocation.origin is undefined in a web worker
cdumez@apple.com [Mon, 30 Nov 2015 19:27:26 +0000 (19:27 +0000)]
location.origin is undefined in a web worker
https://bugs.webkit.org/show_bug.cgi?id=151614

Reviewed by Darin Adler.

Source/WebCore:

Expose location.origin to web workers, as per:
https://html.spec.whatwg.org/multipage/workers.html#workerlocation

This behavior is consistent with the behavior of Firefox and Chrome.

Test: fast/workers/worker-location.html

* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::origin):
* workers/WorkerLocation.h:
* workers/WorkerLocation.idl:

LayoutTests:

Update existing layout test to confirm the existence of location.origin when in a
WorkerGlobalScope.

* fast/workers/resources/worker-location.js:
* fast/workers/worker-location-expected.txt:

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

5 years agoWeb Inspector: using "Reload Web Inspector" when docked breaks dock-specific styles
bburg@apple.com [Mon, 30 Nov 2015 19:25:12 +0000 (19:25 +0000)]
Web Inspector: using "Reload Web Inspector" when docked breaks dock-specific styles
https://bugs.webkit.org/show_bug.cgi?id=151642

Reviewed by Timothy Hatcher.

After a frontend loads, explicitly tell it about the current dock
state. This is necessary for force-reloading the inspector, since
the dock state isn't sent from UIProcess in this case.

* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::frontendLoaded):
(WebKit::WebInspectorUI::setDockingUnavailable):
* WebProcess/WebPage/WebInspectorUI.h:

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

5 years agoMake ProcessModel always MultipleSecondaryProcesses
achristensen@apple.com [Mon, 30 Nov 2015 19:11:09 +0000 (19:11 +0000)]
Make ProcessModel always MultipleSecondaryProcesses
https://bugs.webkit.org/show_bug.cgi?id=151662

Reviewed by Antti Koivisto.

Source/WebKit2:

Single WebProcess behavior can still be achieved by setting the maximum number of WebProcesses to 1.

* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKContextSetUsesNetworkProcess):
(WKContextSetProcessModel):
(WKContextGetProcessModel):
(WKGraphicsContextGetCGContext):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKAPICast.h:
(WebKit::toAPI):
(WebKit::toFontSmoothingLevel):
(WebKit::toProcessModel): Deleted.
* UIProcess/API/C/WKContext.cpp:
(WKContextGetCacheModel):
(WKContextSetMaximumNumberOfProcesses):
(WKContextSetProcessModel): Deleted.
(WKContextGetProcessModel): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup initWithInjectedBundleURL:]):
* UIProcess/API/Cocoa/WKProcessPool.mm:
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::cacheModel):
(EwkContext::setProcessModel):
(EwkContext::processModel):
(EwkContext::clearResourceCache):
(EwkContext::jsGlobalContext):
(ewk_context_message_from_extensions_callback_set):
(ewk_context_process_model_set):
(ewk_context_process_model_get):
(ewk_context_tls_error_policy_get):
(toWKProcessModel): Deleted.
(toEwkProcessModel): Deleted.
* UIProcess/API/gtk/WebKitWebContext.cpp:
* UIProcess/ProcessModel.h: Removed.
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::shouldTerminate):
(WebKit::WebCookieManagerProxy::refWebContextSupplement):
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectorProcessPool):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::create):
(WebKit::WebProcessPool::setDownloadClient):
(WebKit::WebProcessPool::setMaximumNumberOfProcesses):
(WebKit::WebProcessPool::processDidCachePage):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::postMessageToInjectedBundle):
(WebKit::WebProcessPool::requestWebContentStatistics):
(WebKit::WebProcessPool::requestNetworkingStatistics):
(WebKit::WebProcessPool::setProcessModel): Deleted.
(WebKit::WebProcessPool::ensureSharedWebProcess): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary):
(WebKit::WebProcessPool::sendToOneProcess):
* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):

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

5 years ago[WK2][Cache] We should not speculatively revalidate transient resources
cdumez@apple.com [Mon, 30 Nov 2015 19:06:15 +0000 (19:06 +0000)]
[WK2][Cache] We should not speculatively revalidate transient resources
https://bugs.webkit.org/show_bug.cgi?id=151402
<rdar://problem/23092196>

Reviewed by Antti Koivisto.

We should not speculatively revalidate transient resources. This patch
adds a simple and conservative algorithm to detect that a subresource is
transient and then ignores those when doing the speculative revalidation.

The algorithm is question marks as transient all subresources that are
not common to the 2 last loads of a main resource.

This is not perfect as I see the number of non-speculative revalidations
going up to 11-12 from 9 in the context of the warm PLT. However, it is
best to be conservative at first and we can improve this later.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::~PendingFrameLoad):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresource):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markLoadAsCompleted):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::setExistingSubresourcesEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
(WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve): Deleted.
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
(WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
(WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
(WebKit::NetworkCache::SubresourcesEntry::updateSubresourceKeys):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourcesEntry::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::SubresourcesEntry::subresources):

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

5 years agoModern IDB: Support updating cursor values when the object store uses inline keys.
beidson@apple.com [Mon, 30 Nov 2015 19:05:05 +0000 (19:05 +0000)]
Modern IDB: Support updating cursor values when the object store uses inline keys.
https://bugs.webkit.org/show_bug.cgi?id=151647

Reviewed by Andy Estes.

Source/WebCore:

No new tests (At least two previously failing tests now pass and are unskipped).

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::update): Use putForCursorUpdate() instead of put()

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::add):
(WebCore::IDBClient::IDBObjectStore::put):
(WebCore::IDBClient::IDBObjectStore::putForCursorUpdate): Use the flag to skip the inline-key check.
(WebCore::IDBClient::IDBObjectStore::putOrAdd): Add a flag to skip the inline-key check.
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years ago[Mac] Add font service permission to the sandbox profile
bfulgham@apple.com [Mon, 30 Nov 2015 18:46:13 +0000 (18:46 +0000)]
[Mac] Add font service permission to the sandbox profile
https://bugs.webkit.org/show_bug.cgi?id=151509
<rdar://problem/23508753>

Reviewed by Anders Carlsson.

Update the sandbox profile for Mac WebKit to allow access to the
"com.apple.fonts" service.

* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
* WebProcess/com.apple.WebProcess.sb.in:

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

5 years agoWeb Inspector: delete-by-word and similar shortcuts should add text to the WebCore...
bburg@apple.com [Mon, 30 Nov 2015 18:26:56 +0000 (18:26 +0000)]
Web Inspector: delete-by-word and similar shortcuts should add text to the WebCore kill ring
https://bugs.webkit.org/show_bug.cgi?id=151312

Reviewed by Darin Adler.

Add support for other kill ring-eligible keybindinsg, such as
deleting by word, group, or line forwards and backwards.

* UserInterface/Controllers/CodeMirrorTextKillController.js:
(WebInspector.CodeMirrorTextKillController):
(WebInspector.CodeMirrorTextKillController.prototype._handleTextKillCommand): Renamed from _handleKillLine.

    Parameterize the function so it can handle any keybinding and
    command. Take a kill ring insertion mode argument, too.

(WebInspector.CodeMirrorTextKillController.prototype._handleTextChange):

    Add some special casing for changes received from Delete Line
    (Cmd-D) so the right text is added to the kill ring. Thread the
    kill ring insertion mode to the frontend host call.

(WebInspector.CodeMirrorTextKillController.prototype._handleKillLine): Deleted.

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

5 years agoModern IDB: Resolve flaky GC-vs-wrapper issue with IDBOpenDBRequest.
beidson@apple.com [Mon, 30 Nov 2015 18:24:25 +0000 (18:24 +0000)]
Modern IDB: Resolve flaky GC-vs-wrapper issue with IDBOpenDBRequest.
https://bugs.webkit.org/show_bug.cgi?id=151645

Reviewed by Andy Estes.

No new tests (Resolves flakiness with hundreds of existing IDB tests).

Do to improper management of the m_hasPendingActivity flag on IDBRequestImpl,
the request wrapper for an IDBOpenDBRequest might be garbage collected in between the
onUpgradeNeeded event and onSuccess event.

This manifested as flakiness in many tests, some more than others.

I tried to write a targeted 100% reproducible case manually forcing GC, but could not get
the timing right.

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h:

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::dispatchEvent):
(WebCore::IDBClient::IDBRequest::willIterateCursor):
* Modules/indexeddb/client/IDBRequestImpl.h:
(WebCore::IDBClient::IDBRequest::isOpenDBRequest):

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

5 years ago[WinCairo][MediaFoundation] Implement seek.
peavo@outlook.com [Mon, 30 Nov 2015 18:22:31 +0000 (18:22 +0000)]
[WinCairo][MediaFoundation] Implement seek.
https://bugs.webkit.org/show_bug.cgi?id=151609

Reviewed by Alex Christensen.

The methods maxTimeSeekable() and buffered() needs to be implemented.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
(WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
(WebCore::MediaPlayerPrivateMediaFoundation::readyState):
(WebCore::MediaPlayerPrivateMediaFoundation::maxTimeSeekable):
(WebCore::MediaPlayerPrivateMediaFoundation::buffered):
(WebCore::MediaPlayerPrivateMediaFoundation::didLoadingProgress):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime):
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::maxTimeLoaded):

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

5 years agoReverted r192769. It broke run-minibrowser, and made MiniBrowser.app not usable as...
aestes@apple.com [Mon, 30 Nov 2015 18:21:50 +0000 (18:21 +0000)]
Reverted r192769. It broke run-minibrowser, and made MiniBrowser.app not usable as a standalone bundle.

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

5 years agoModern IDB: openCursor() fix resulting in at least 4 more passing tests.
beidson@apple.com [Mon, 30 Nov 2015 18:21:16 +0000 (18:21 +0000)]
Modern IDB: openCursor() fix resulting in at least 4 more passing tests.
https://bugs.webkit.org/show_bug.cgi?id=151630

Reviewed by Andy Estes.

Source/WebCore:

No new tests (At least 4 failing tests now pass, and 9 other incorrect tests updated).

* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::isolatedCopy):
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::IDBGetResult):
(WebCore::IDBGetResult::isDefined):

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): If the IDBGetResult is undefined,
  do not expose the cursor as the result property of the IDBRequest.

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/modern/cursor-2-expected.txt:
* storage/indexeddb/modern/cursor-2.html:
* storage/indexeddb/modern/cursor-3-expected.txt:
* storage/indexeddb/modern/cursor-3.html:
* storage/indexeddb/modern/cursor-4-expected.txt:
* storage/indexeddb/modern/cursor-4.html:
* storage/indexeddb/modern/deleteindex-1-expected.txt:
* storage/indexeddb/modern/deleteindex-1.html:
* storage/indexeddb/modern/deleteindex-2-expected.txt:
* storage/indexeddb/modern/deleteindex-2.html:
* storage/indexeddb/modern/index-4-expected.txt:
* storage/indexeddb/modern/index-4.html:
* storage/indexeddb/modern/index-cursor-1-expected.txt:
* storage/indexeddb/modern/index-cursor-1.html:
* storage/indexeddb/modern/index-cursor-2-expected.txt:
* storage/indexeddb/modern/index-cursor-2.html:
* storage/indexeddb/modern/index-cursor-3-expected.txt:
* storage/indexeddb/modern/index-cursor-3.html:

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

5 years ago2015-11-30 Ryan Haddad <ryanhaddad@apple.com>
ryanhaddad@apple.com [Mon, 30 Nov 2015 18:15:02 +0000 (18:15 +0000)]
2015-11-30  Ryan Haddad  <ryanhaddad@apple.com>

        Marking http/tests/cache/disk-cache/disk-cache-request-max-stale.html as flaky on Yosemite WK2
        https://bugs.webkit.org/show_bug.cgi?id=143159

        Unreviewed test gardening.

        * platform/mac-wk2/TestExpectations:

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

5 years agoModern IDB: Support keyPath injection into object store records.
beidson@apple.com [Mon, 30 Nov 2015 18:11:34 +0000 (18:11 +0000)]
Modern IDB: Support keyPath injection into object store records.
https://bugs.webkit.org/show_bug.cgi?id=151640

Reviewed by Andy Estes.

Source/WebCore:

No new tests (At least one existing failure now passes and is unskipped,
while many other existing failures are now closer to passing).

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Use the new UniqueIDBDatabase VM/ExecState.
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto
(WebCore::IDBServer::indexVM): Deleted.
(WebCore::IDBServer::indexGlobalExec): Deleted.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): If appropriate, inject the key that will be used into
  the value before storing the record.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

Add modern JSValue/ExecState& version of some binding utilities, for use today and in preparation of getting
rid of the DOMRequestState and Deprecated::ScriptValue versions later:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyToJSValue):
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::deserializeIDBValueData):
(WebCore::deserializeIDBValueDataToJSValue):
* bindings/js/IDBBindingUtilities.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years ago[Content Filtering] Avoid creating a ContentFilter when loading the empty document
aestes@apple.com [Mon, 30 Nov 2015 18:06:23 +0000 (18:06 +0000)]
[Content Filtering] Avoid creating a ContentFilter when loading the empty document
https://bugs.webkit.org/show_bug.cgi?id=151615

Reviewed by Daniel Bates.

It's expensive to create the first ContentFilter since two frameworks must be soft-linked. There's no reason to
pay this cost if we're just loading the empty document.

No new tests. It's not possible to write a test that would fail without this change since ContentFilter is not
notified of empty document loads.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Don't initialize m_contentFilter until we know we aren't
loading the empty document.
(WebCore::DocumentLoader::DocumentLoader):

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

5 years agoMake usesNetworkProcess always true
achristensen@apple.com [Mon, 30 Nov 2015 17:49:15 +0000 (17:49 +0000)]
Make usesNetworkProcess always true
https://bugs.webkit.org/show_bug.cgi?id=151580

Reviewed by Darin Adler.

Source/WebKit2:

* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKInspectorToggleJavaScriptProfiling):
(WKContextSetUsesNetworkProcess):
(WKGraphicsContextGetCGContext):
* Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(WebKit::CustomProtocolManager::initializeConnection):
(WebKit::CustomProtocolManager::initialize):
* Shared/Network/CustomProtocols/CustomProtocolManager.h:
* Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
(WebKit::CustomProtocolManager::initialize):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetJavaScriptGarbageCollectorTimerEnabled):
(WKContextUseTestingNetworkSession):
(WKContextSetUsesNetworkProcess): Deleted.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup initWithInjectedBundleURL:]):
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::setProcessModel):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::updateProcessSuppressionState):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::cancel):
(WebKit::DownloadProxy::invalidate):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::m_processSuppressionDisabledForPageCounter):
(WebKit::WebProcessPool::networkingProcessConnection):
(WebKit::WebProcessPool::languageChanged):
(WebKit::WebProcessPool::textCheckerStateChanged):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::download):
(WebKit::WebProcessPool::resumeDownload):
(WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
(WebKit::WebProcessPool::setCacheModel):
(WebKit::WebProcessPool::createDownloadProxy):
(WebKit::WebProcessPool::addMessageReceiver):
(WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost):
(WebKit::WebProcessPool::setHTTPPipeliningEnabled):
(WebKit::WebProcessPool::requestNetworkingStatistics):
(WebKit::WebProcessPool::setUsesNetworkProcess): Deleted.
(WebKit::WebProcessPool::usesNetworkProcess): Deleted.
* UIProcess/WebProcessPool.h:
(WebKit::WebProcessPool::sendToNetworkingProcess):
(WebKit::WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::canTerminateChildProcess):
(WebKit::WebProcessProxy::updateTextCheckerState):
(WebKit::WebProcessProxy::didSaveToPageCache):
(WebKit::WebProcessProxy::didSetAssertionState):
(WebKit::WebProcessProxy::createDownloadProxy): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/efl/WebProcessPoolEfl.cpp:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::setIgnoreTLSErrors):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::blobSize):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):
(WebKit::WebPlatformStrategies::resourceLoadScheduler):
(WebKit::WebPlatformStrategies::loadResourceSynchronously):
(WebKit::WebPlatformStrategies::createPingHandle):
(WebKit::WebPlatformStrategies::createBlobRegistry):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
(WebKit::WebFrame::source):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::WebProcess::initializeConnection):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::destroyPrivateBrowsingSession):
(WebKit::WebProcess::pluginProcessConnectionManager):
(WebKit::WebProcess::shouldTerminate):
(WebKit::WebProcess::setInjectedBundleParameters):
(WebKit::WebProcess::networkConnection):
(WebKit::WebProcess::setEnhancedAccessibility):
(WebKit::WebProcess::prefetchDNS):
(WebKit::WebProcess::didCreateDownload): Deleted.
(WebKit::WebProcess::didDestroyDownload): Deleted.
(WebKit::WebProcess::downloadProxyConnection): Deleted.
(WebKit::WebProcess::downloadsAuthenticationManager): Deleted.
(WebKit::WebProcess::downloadManager): Deleted.
(WebKit::WebProcess::usesNetworkProcess): Deleted.
(WebKit::WebProcess::downloadRequest): Deleted.
(WebKit::WebProcess::resumeDownload): Deleted.
(WebKit::WebProcess::cancelDownload): Deleted.
* WebProcess/WebProcess.h:
(WebKit::WebProcess::textCheckerState):
(WebKit::WebProcess::eventDispatcher):
* WebProcess/WebProcess.messages.in:
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::WebProcess::platformClearResourceCaches):
(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):
(WebKit::getCacheDiskFreeSize): Deleted.
(WebKit::setSoupSessionAcceptLanguage): Deleted.
(WebKit::languageChanged): Deleted.
(WebKit::WebProcess::setIgnoreTLSErrors): Deleted.
(WebKit::WebProcess::allowSpecificHTTPSCertificateForHost): Deleted.

Tools:

* TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):

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

5 years ago[ARM64] stress/op_div.js is failing on some divide by 0 cases.
mark.lam@apple.com [Mon, 30 Nov 2015 16:56:27 +0000 (16:56 +0000)]
[ARM64] stress/op_div.js is failing on some divide by 0 cases.
https://bugs.webkit.org/show_bug.cgi?id=151515

Reviewed by Saam Barati.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithDiv):
- Added a check for the divide by zero case.
* tests/stress/op_div.js:
- Un-skipped the test.

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

5 years agoUnreviewed. Skip GTK+ test /webkit2/WebKitWebView/editable/editable in Debug.
carlosgc@webkit.org [Mon, 30 Nov 2015 14:21:06 +0000 (14:21 +0000)]
Unreviewed. Skip GTK+ test /webkit2/WebKitWebView/editable/editable in Debug.

Add a way to skip unit tests only for Debug or Release builds and
skipt the test /webkit2/WebKitWebView/editable/editable only for Debug.

* Scripts/run-gtk-tests:
(SkippedTest):
(SkippedTest.__init__):
(SkippedTest.__str__):
(SkippedTest.skip_entire_suite):
(SkippedTest.skip_for_build_type):
(TestRunner):
(TestRunner.__init__):

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

5 years agoUnreviewed. Fix a crash in GTK+ test /webkit2/WebKitWebView/custom-charset.
carlosgc@webkit.org [Mon, 30 Nov 2015 11:26:21 +0000 (11:26 +0000)]
Unreviewed. Fix a crash in GTK+ test /webkit2/WebKitWebView/custom-charset.

It's an assert hit because we are reloading a view loaded with
HTML data which is not supported. Use loadURI instead.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewCustomCharset):

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

5 years ago[GTK] UI process crash when the screensaver DBus proxy is being created while the...
carlosgc@webkit.org [Mon, 30 Nov 2015 09:39:49 +0000 (09:39 +0000)]
[GTK] UI process crash when the screensaver DBus proxy is being created while the web view is destroyed
https://bugs.webkit.org/show_bug.cgi?id=151653

Reviewed by Martin Robinson.

We correctly cancel the proxy creation, but when the async ready
callback is called, the view could be destroyed already. In that
case g_dbus_proxy_new_for_bus_finish() will return nullptr and
fail with cancelled error, but we are using the passed web view
without checking first if the creation failed or not.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(screenSaverProxyCreatedCallback):

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

5 years ago[GLIB] Remove GMainLoopSource and GThreadSafeMainLoopSource
carlosgc@webkit.org [Mon, 30 Nov 2015 08:05:51 +0000 (08:05 +0000)]
[GLIB] Remove GMainLoopSource and GThreadSafeMainLoopSource
https://bugs.webkit.org/show_bug.cgi?id=151633

Reviewed by Csaba Osztrogonác.

Source/WTF:

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* wtf/PlatformEfl.cmake:
* wtf/PlatformGTK.cmake:
* wtf/glib/GMainLoopSource.cpp: Removed.
* wtf/glib/GMainLoopSource.h: Removed.
* wtf/glib/GThreadSafeMainLoopSource.cpp: Removed.
* wtf/glib/GThreadSafeMainLoopSource.h: Removed.

Tools:

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WTF/glib/GMainLoopSource.cpp: Removed.

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

5 years agoWeb Inspector: Add context menu item to Reload the Inspector
bburg@apple.com [Mon, 30 Nov 2015 00:56:22 +0000 (00:56 +0000)]
Web Inspector: Add context menu item to Reload the Inspector
https://bugs.webkit.org/show_bug.cgi?id=141742

Reviewed by Timothy Hatcher.

Add a global context menu and global shortcut (Cmd-Opt-Shift-R) to
reload the Web Inspector frontend without closing the browser.

This should make it possible to more quickly fix typos, small nits,
etc. without having to relaunch. It might also make state
restoration bugs more visible in engineering builds, since there
is hardly any delay between seeing the old and reloaded frontends.

Note that this functionality reloads scripts from the configuration's
build directory, so you still need to "build" WebInspectorUI to ensure
that any changed files are properly minified and staged.

* UserInterface/Base/Main.js:
(WebInspector.unlocalizedString):

    Added. Make it obvious when strings are intentionally not localized.

(WebInspector._contextMenuRequested):

    If the "Show Debug UI" setting is available and true, add
    a global "Reload Web Inspector" menu item to every context
    menu. Otherwise, don't eagerly create a context menu.
* UserInterface/Debug/Bootstrap.js: Add Cmd-Opt-Shift-R shortcut.

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

5 years agoWeb Inspector: allow multiple UI components to add menu items upon getting a "context...
bburg@apple.com [Mon, 30 Nov 2015 00:39:08 +0000 (00:39 +0000)]
Web Inspector: allow multiple UI components to add menu items upon getting a "contextmenu" event
https://bugs.webkit.org/show_bug.cgi?id=151629

Reviewed by Timothy Hatcher.

The existing Context Menu system assumes that only one UI component
will need to provide context menu items. But in some scenarios, there
are multiple UI components that could provide relevant menu items. For
example, right-clicking on an DOM element in the console should show
menu items relevant to 1) the DOM element, 2) the console in general,
and 3) global menu items. Existing code shows menu items provided by
the first object that handles the event and calls ContextMenu.show().

This patch changes behavior so that a context menu can be built up
by multiple 'contextmenu' event handlers. A ContextMenu instance is
hidden on the 'contextmenu' event object; client code calls a
factory method that digs out this existing context menu or creates a
new one as needed. To actually show the context menu through the
InspectorFrontendHost methods, the top-level app controller adds a
bubbling listener for 'contextmenu' and shows the event's context
menu if one has been created.

Along the way, do some cleanup. Do s/var/let/, arrowize some functions,
use Array.{map,some}, and simplify some other code as a result.

No new tests yet, since we can't trigger context menu easily from
an inspector test. All affected context menus were manually verified.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.editBreakpoint): Deleted.
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.removeBreakpoint): Deleted.
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.toggleBreakpoint): Deleted.
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.toggleAutoContinue): Deleted.
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems.revealOriginalSourceCodeLocation): Deleted.
* UserInterface/Views/BreakpointTreeElement.js:
(WebInspector.BreakpointTreeElement.prototype.oncontextmenu):
* UserInterface/Views/CSSStyleDeclarationSection.js:
* UserInterface/Views/ContextMenu.js:
(WebInspector.ContextMenuItem.prototype._buildDescriptor):
(WebInspector.ContextMenuItem):
(WebInspector.ContextSubMenuItem.prototype.appendItem):
(WebInspector.ContextSubMenuItem.prototype.appendSubMenuItem):
(WebInspector.ContextSubMenuItem.prototype.appendCheckboxItem):
(WebInspector.ContextSubMenuItem.prototype._pushItem):
(WebInspector.ContextSubMenuItem.prototype._buildDescriptor):
(WebInspector.ContextSubMenuItem):
(WebInspector.ContextMenu.createFromEvent):
(WebInspector.ContextMenu.prototype.show):
(WebInspector.ContextMenu.prototype.handleEvent):
(WebInspector.ContextMenu.prototype._buildDescriptor):
* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype._contextMenuEventFired):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu.logElement):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu):
* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype._contextMenuInDataTable):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement.removeAllResourceBreakpoints): Deleted.
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineContextMenuTreeElement.toggleAllResourceBreakpoints): Deleted.
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._handleContextMenuEvent):
* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._contextMenuHandler):
(WebInspector.ObjectPreviewView):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._contextMenuHandler):
(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
(WebInspector.ObjectTreeBaseTreeElement):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
(WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.continueToLocation): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.addBreakpoint): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.revealInSidebar): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.removeBreakpoints): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.textEditorGutterContextMenu.toggleBreakpoints): Deleted.
* UserInterface/Views/TabBarItem.js:
(WebInspector.TabBarItem.prototype._handleContextMenuEvent):
(WebInspector.TabBarItem):
(WebInspector.TabBarItem.prototype._handleContextMenuEvent.closeTab): Deleted.
(WebInspector.TabBarItem.prototype._handleContextMenuEvent.closeOtherTabs): Deleted.
* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar):
(WebInspector.TimelineSidebarPanel.prototype._contextMenuNavigationBarOrStatusBar.toggleReplayInterface): Deleted.
* UserInterface/Views/Toolbar.js:
(WebInspector.Toolbar.prototype._handleContextMenuEvent):
* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem.prototype._handleContextMenuEvent):

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

5 years agoBrowser does not fall back to SVG attribute value when CSS style value is invalid...
commit-queue@webkit.org [Sun, 29 Nov 2015 22:03:18 +0000 (22:03 +0000)]
Browser does not fall back to SVG attribute value when CSS style value is invalid or not supported
https://bugs.webkit.org/show_bug.cgi?id=147932

Patch by Antoine Quint <graouts@apple.com> on 2015-11-29
Reviewed by Dean Jackson.

Source/WebCore:

Instead of returning an SVGPaint object of type SVG_PAINTTYPE_UNKNOWN when we encounter an SVG paint
value that cannot be parsed, we now return `nullptr` which will cause that value to be ignored and
let another paint value in the cascade be used instead. This is the same approach used for SVGColor.
Since we're removing the only call site for `SVGPaint::createUnknown()`, we remove that function entirely.

Tests: svg/css/invalid-color-cascade.svg
       svg/css/invalid-paint-cascade.svg

* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGPaint):
* svg/SVGPaint.h:
(WebCore::SVGPaint::createUnknown): Deleted.

LayoutTests:

Testing that we correctly fall back to the presentation attribute for SVGPaint and SVGColor values
specified with an invalid keyword in a `style` attribute. We also update the expected output for
svg/css/svg-attribute-parser-mode.html which is now in line with values returned by Firefox and
Chrome, where we correctly use the default value instead of null objects, which was definitely
an error.

* svg/css/invalid-color-cascade-expected.svg: Added.
* svg/css/invalid-color-cascade.svg: Added.
* svg/css/invalid-paint-cascade-expected.svg: Added.
* svg/css/invalid-paint-cascade.svg: Added.
* svg/css/script-tests/svg-attribute-parser-mode.js:
* svg/css/svg-attribute-parser-mode-expected.txt:

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

5 years agoUse SVGTransform::SVGTransformType instead of an unsigned short
simon.fraser@apple.com [Sun, 29 Nov 2015 18:47:08 +0000 (18:47 +0000)]
Use SVGTransform::SVGTransformType instead of an unsigned short
https://bugs.webkit.org/show_bug.cgi?id=151637

Reviewed by Brady Eidson.

Make 'type' more strongly typed.

* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformValue):
(WebCore::parseAndSkipType):
(WebCore::SVGTransformable::parseTransformType):
(WebCore::SVGTransformable::parseTransformAttribute):
* svg/SVGTransformable.h:

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

5 years agoStop unnecessarily copying WKWebViewConfiguration in a few places
timothy_horton@apple.com [Sat, 28 Nov 2015 21:30:06 +0000 (21:30 +0000)]
Stop unnecessarily copying WKWebViewConfiguration in a few places
https://bugs.webkit.org/show_bug.cgi?id=151639

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView dealloc]):
(-[WKWebView _contentProviderRegistry]):
(-[WKWebView _selectionGranularity]):
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _stopAssistingKeyboard]):
Looking at allocation traces I noticed that we were making way more
WKWebViewConfigurations than made sense; looking at backtraces I found
a few internal callers of -[WKWebView configuration], which copies the
configuration. There's no reason for these internal callers to make
such a copy, though.

I'm not exactly sure what the usual approach is here, but I added
getters so WKContentViewInteraction and PageClientImplIOS can get to
the values they're looking for without using the configuration property.

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

5 years agoWeb Inspector: Styles sidebar placeholder is misaligned
commit-queue@webkit.org [Sat, 28 Nov 2015 08:53:43 +0000 (08:53 +0000)]
Web Inspector: Styles sidebar placeholder is misaligned
https://bugs.webkit.org/show_bug.cgi?id=151638

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2015-11-28
Reviewed by Brian Burg.

* UserInterface/Views/CSSStyleDeclarationTextEditor.css:
(.css-style-text-editor > .CodeMirror .CodeMirror-placeholder):

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

5 years agoWeb Inspector: REGRESSION: "Duplicate Selector" context menu item doesn't work
commit-queue@webkit.org [Sat, 28 Nov 2015 08:51:13 +0000 (08:51 +0000)]
Web Inspector: REGRESSION: "Duplicate Selector" context menu item doesn't work
https://bugs.webkit.org/show_bug.cgi?id=151628

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2015-11-28
Reviewed by Brian Burg.

Merged the two "add rule" functions inside DOMNodeStyles to create a
new rule with the given selector and use the generated best selector
for that node otherwise. This also preserves all fallbacks across all
functions for creating new CSS rules.

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.addEmptyRule): Deleted.
(WebInspector.DOMNodeStyles.prototype.addRuleWithSelector): Deleted.
(WebInspector.DOMNodeStyles.prototype.addRule):
Creates a new CSS rule using either the provided selector or the best
selector for the current node.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleContextMenuEvent):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WebInspector.VisualStyleSelectorSection.prototype._addNewRule):

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

5 years agoModern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
beidson@apple.com [Fri, 27 Nov 2015 17:50:54 +0000 (17:50 +0000)]
Modern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
https://bugs.webkit.org/show_bug.cgi?id=151627

Reviewed by Alexey Proskuryakov.

Source/WebCore:

No new tests (No change in behavior).

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/IDBGetResult.cpp: Added.
(WebCore::IDBGetResult::dataFromBuffer):
(WebCore::IDBGetResult::isolatedCopy):
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::IDBGetResult):
(WebCore::IDBGetResult::valueBuffer):
(WebCore::IDBGetResult::keyData):
(WebCore::IDBGetResult::primaryKeyData):
(WebCore::IDBGetResult::keyPath):
(WebCore::IDBGetResult::setValueBuffer):
(WebCore::IDBGetResult::setKeyData):
(WebCore::IDBGetResult::setPrimaryKeyData):
(WebCore::IDBGetResult::setKeyPath):
(WebCore::IDBGetResult::dataFromBuffer): Deleted.
(WebCore::IDBGetResult::isolatedCopy): Deleted.

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::setGetResult):
* Modules/indexeddb/client/IDBCursorImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):

* Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
(WebCore::GetOperation::perform):

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/MemoryCursor.h:

* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::currentData):

* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):

* platform/CrossThreadCopier.h:

Source/WebKit2:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::getRecordFromBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:

* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getIndexRecord):

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<IDBGetResult>::encode):
(IPC::ArgumentCoder<IDBGetResult>::decode):
* Shared/WebCoreArgumentCoders.h:

* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

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

5 years ago[GTK] Remove the remaining uses of GMainLoopSource
carlosgc@webkit.org [Fri, 27 Nov 2015 16:54:45 +0000 (16:54 +0000)]
[GTK] Remove the remaining uses of GMainLoopSource
https://bugs.webkit.org/show_bug.cgi?id=151632

Reviewed by Žan Doberšek.

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
(_WebKitWebViewBasePrivate::clearRedirectedWindowSoonTimerFired):
(webkitWebViewBaseClearRedirectedWindowSoon):
(webkitWebViewBaseEnterAcceleratedCompositingMode):

Tools:

* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(testWebViewSyncRequestOnMaxConns):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::TestRunner):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/InjectedBundle/gtk/TestRunnerGtk.cpp:
(WTR::TestRunner::invalidateWaitToDumpWatchdogTimer):
(WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::timeoutSource):
(WTR::TestController::notifyDone):
(WTR::TestController::platformRunUntil):

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

5 years ago[cmake] Add testb3 to the build system
ossy@webkit.org [Fri, 27 Nov 2015 14:16:31 +0000 (14:16 +0000)]
[cmake] Add testb3 to the build system
https://bugs.webkit.org/show_bug.cgi?id=151619

Reviewed by Gyuyoung Kim.

Source/JavaScriptCore:

* shell/CMakeLists.txt:

Tools:

* Scripts/build-jsc:

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

5 years ago[jhbuild] Fix pixman build with clang
ossy@webkit.org [Fri, 27 Nov 2015 13:56:20 +0000 (13:56 +0000)]
[jhbuild] Fix pixman build with clang
https://bugs.webkit.org/show_bug.cgi?id=151441

Reviewed by Carlos Garcia Campos.

* efl/jhbuild.modules:
* gtk/jhbuild.modules:

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

5 years agoFix build warning in bignum.cc
ossy@webkit.org [Fri, 27 Nov 2015 13:24:16 +0000 (13:24 +0000)]
Fix build warning in bignum.cc
https://bugs.webkit.org/show_bug.cgi?id=150797

Reviewed by Geoffrey Garen.

* wtf/dtoa/bignum.cc:

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

5 years agoUse mark pragmas only if it is supported
ossy@webkit.org [Fri, 27 Nov 2015 13:01:54 +0000 (13:01 +0000)]
Use mark pragmas only if it is supported
https://bugs.webkit.org/show_bug.cgi?id=151621

Reviewed by Mark Lam.

* b3/air/AirIteratedRegisterCoalescing.cpp:

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

5 years agoFix the ENABLE(B3_JIT) build with GCC in B3Procedure.h
ossy@webkit.org [Fri, 27 Nov 2015 13:01:22 +0000 (13:01 +0000)]
Fix the ENABLE(B3_JIT) build with GCC in B3Procedure.h
https://bugs.webkit.org/show_bug.cgi?id=151620

Reviewed by Mark Lam.

* b3/B3Procedure.h:

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

5 years ago[cmake] Add new B3 source files to the build system
ossy@webkit.org [Fri, 27 Nov 2015 12:59:34 +0000 (12:59 +0000)]
[cmake] Add new B3 source files to the build system
https://bugs.webkit.org/show_bug.cgi?id=151618

Reviewed by Gyuyoung Kim.

* CMakeLists.txt:

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

5 years ago[GTK] Do not use the WebCore garbage collector timer
carlosgc@webkit.org [Fri, 27 Nov 2015 08:37:44 +0000 (08:37 +0000)]
[GTK] Do not use the WebCore garbage collector timer
https://bugs.webkit.org/show_bug.cgi?id=151623

Reviewed by Martin Robinson.

Now that garbage collector timers have been implemented in
JavaScriptCore for glib, we don't need to use another Timer in WebCore.

* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectSoon):
(WebCore::GCController::garbageCollectNowIfNotDoneRecently):

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

5 years agoExtract prependToEnvironmentVariableList
ddkilzer@apple.com [Thu, 26 Nov 2015 16:43:22 +0000 (16:43 +0000)]
Extract prependToEnvironmentVariableList
<http://webkit.org/b/151536>

Reviewed by Daniel Bates.

Tests: webkitdirs_unittest/appendToEnvironmentVariableList.pl
       webkitdirs_unittest/prependToEnvironmentVariableList.pl

* Scripts/webkitdirs.pm: Export appendToEnvironmentVariableList
and prependToEnvironmentVariableList.
(appendToEnvironmentVariableList): Simplify variable name.
Switch to use $Config{path_sep}.
(prependToEnvironmentVariableList): Add new method.
(setupMacWebKitEnvironment): Switch to use
prependToEnvironmentVariableList().
(setupIOSWebKitEnvironment): Ditto.

* Scripts/webkitperl/webkitdirs_unittest/appendToEnvironmentVariableList.pl: Added.
* Scripts/webkitperl/webkitdirs_unittest/prependToEnvironmentVariableList.pl: Added.

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

5 years ago[GLIB] Implement garbage collector timers
carlosgc@webkit.org [Thu, 26 Nov 2015 13:52:45 +0000 (13:52 +0000)]
[GLIB] Implement garbage collector timers
https://bugs.webkit.org/show_bug.cgi?id=151391

Reviewed by Žan Doberšek.

Add GLib implementation using GSource.

* heap/EdenGCActivityCallback.cpp:
* heap/FullGCActivityCallback.cpp:
* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::GCActivityCallback::scheduleTimer):
(JSC::GCActivityCallback::cancelTimer):
* heap/GCActivityCallback.h:
* heap/Heap.cpp:
(JSC::Heap::Heap):
* heap/HeapTimer.cpp:
(JSC::HeapTimer::HeapTimer):
(JSC::HeapTimer::~HeapTimer):
(JSC::HeapTimer::timerDidFire):
* heap/HeapTimer.h:
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::IncrementalSweeper):
(JSC::IncrementalSweeper::scheduleTimer):
(JSC::IncrementalSweeper::cancelTimer):
* heap/IncrementalSweeper.h:

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

5 years ago[Content Filtering] Crash in DocumentLoader::notifyFinished() when allowing a media...
aestes@apple.com [Thu, 26 Nov 2015 07:08:43 +0000 (07:08 +0000)]
[Content Filtering] Crash in DocumentLoader::notifyFinished() when allowing a media document to load
https://bugs.webkit.org/show_bug.cgi?id=151433
rdar://problem/23506594

Reviewed by Alexey Proskuryakov.

Source/WebCore:

When the main resource of a media document commits, WebKit cancels its load since the plug-in or media engine
will do its own loading. If content filtering is enabled, and the filter waits allow the load until the entire
resource is downloaded, then ContentFilter will attempt to call DocumentLoader::notifyFinished() immediately
after delivering the buffered resource data to DocumentLoader. However, delivering the data will have nulled out
DocumentLoader's m_mainResource when the load was cancelled, leading to a crash in notifyFinished().

To resolve this, add a new Stopped state to ContentFilter. Set this state if DocumentLoader clears its main
resource or detaches from its frame. If ContentFilter is in the Stopped state after calling
DocumentLoader::dataReceived(), do not proceed to call DocumentLoader::notifyFinished().

Test: contentfiltering/allow-media-document.html

* loader/ContentFilter.cpp:
(WebCore::ContentFilter::stopFilteringMainResource): Set m_state to Stopped. If m_mainResource is non-null,
removed ContentFilter as a client and set m_mainResource to null.
(WebCore::ContentFilter::notifyFinished): Stopped calling DocumentLoader::notifyFinished() if m_state is Stopped
after calling DocumentLoader::dataReceived().
* loader/ContentFilter.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame): Called ContentFilter::stopFilteringMainResource() instead of setting
m_contentFilter to null.
(WebCore::DocumentLoader::clearMainResource): Ditto.

LayoutTests:

* contentfiltering/allow-media-document-expected.txt: Added.
* contentfiltering/allow-media-document.html: Added.
* contentfiltering/resources/test.mp4: Added.

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

5 years agoWeb Inspector: save Inspector's breakpoints to localStorage whenever they are modified
bburg@apple.com [Wed, 25 Nov 2015 20:53:51 +0000 (20:53 +0000)]
Web Inspector: save Inspector's breakpoints to localStorage whenever they are modified
https://bugs.webkit.org/show_bug.cgi?id=151581

Reviewed by Timothy Hatcher.

Serialize all breakpoints to the "breakpoints" Setting in local storage
whenever any breakpoint model object is added, removed, or modified.

Remove the old listener that attempted to save breakpoints on the
pagehide event. It did not fire in important scenarios like exiting
the browser via Cmd-Q or killing the process via Ctrl-C / SIGKILL.

This is not expected to be a performance problem because most people
do not keep thousands of breakpoints active, and breakpoints are not
set very often. If it's a problem, we can mitigate it with coalescing.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.addBreakpoint):
(WebInspector.DebuggerManager.prototype.removeBreakpoint):
(WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
(WebInspector.DebuggerManager.prototype._saveBreakpoints):
(WebInspector.DebuggerManager.prototype._inspectorClosing): Deleted.

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

5 years agoChecks for buffer-overflows when reading characters from textRun
mmaxfield@apple.com [Wed, 25 Nov 2015 19:04:03 +0000 (19:04 +0000)]
Checks for buffer-overflows when reading characters from textRun
https://bugs.webkit.org/show_bug.cgi?id=151055
<rdar://problem/23251789>

Patch by Pranjal Jumde <pjumde@apple.com> on 2015-11-25
Reviewed by Myles C. Maxfield.

Source/WebCore:

Prevents an off by one error when adding the last font data to the GlyphBuffer.

* Source/WebCore/platform/graphics/WidthIterator.cpp:
* Source/WebCore/platform/graphics/FontCascade.cpp:

LayoutTests:

* dom/html/level1/core/151055_asan.html:
* dom/html/level1/core/151055_asan-expected.txt:

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

5 years agoTeach MiniBrowser how to enable the mock content filter
aestes@apple.com [Wed, 25 Nov 2015 08:48:36 +0000 (08:48 +0000)]
Teach MiniBrowser how to enable the mock content filter
https://bugs.webkit.org/show_bug.cgi?id=151540

Reviewed by Andreas Kling.

Source/WebCore:

Moved the implementation of MockContentFilterEnabler from TestWebKitAPI to here, renamed it to
WebMockContentFilterEnabler, and made it compatible with the legacy Objective-C runtime. Renamed Decision and
DecisionPoint to WebMockContentFilterDecision and WebMockContentFilterDecisionPoint, and changed them from enum
classes to CF_ENUMs so that they can be used by both C++ and Objective-C source files.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::decisionPoint):
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::decision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::unblockRequestDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
(WebCore::toJSValue): Deleted.
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::willSendRequest):
(WebCore::MockContentFilter::responseReceived):
(WebCore::MockContentFilter::addData):
(WebCore::MockContentFilter::finishedAddingData):
(WebCore::MockContentFilter::unblockHandler):
(WebCore::MockContentFilter::maybeDetermineStatus):
* testing/MockContentFilter.h:
* testing/MockContentFilterEnabler.h: Added.
* testing/MockContentFilterEnabler.mm: Added.
(-[WebMockContentFilterEnabler initWithDecision:decisionPoint:blockedString:]):
(-[WebMockContentFilterEnabler initWithCoder:]):
(-[WebMockContentFilterEnabler encodeWithCoder:]):
(-[WebMockContentFilterEnabler enable]):
(-[WebMockContentFilterEnabler dealloc]):
(+[WebMockContentFilterEnabler supportsSecureCoding]):
(-[WebMockContentFilterEnabler copyWithZone:]):
* testing/MockContentFilterSettings.h:
(WebCore::MockContentFilterSettings::decisionPoint):
(WebCore::MockContentFilterSettings::setDecisionPoint):
(WebCore::MockContentFilterSettings::decision):
(WebCore::MockContentFilterSettings::setDecision):
(WebCore::MockContentFilterSettings::unblockRequestDecision):
(WebCore::MockContentFilterSettings::setUnblockRequestDecision):

Tools:

* MiniBrowser/Configurations/Base.xcconfig: Added WebCoreTestSupport and WTF to HEADER_SEARCH_PATHS.
* MiniBrowser/Configurations/MiniBrowser.xcconfig: Linked against libWebCoreTestSupport.
* MiniBrowser/Configurations/MiniBrowserBundle.xcconfig: Ditto.
* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Added blocked-page.html.
* MiniBrowser/MiniBrowserWebProcessPlugIn.m:
(-[MiniBrowserWebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Observed the WebMockContentFilterEnabler key path.
(-[MiniBrowserWebProcessPlugIn dealloc]):
(-[MiniBrowserWebProcessPlugIn observeValueForKeyPath:ofObject:change:context:]): Stored the value in _contentFilterEnabler.
* MiniBrowser/blocked-page.html: Added.
* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration): Created a _WKProcessPoolConfiguration with MiniBrowser.wkbundle as the injected bundle.
* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:
(+[BrowserWindowController contentFilteringBlockedString]): Returned an NSString containing blocked-page.html.
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]): Added [self _contentFilteringMenuItem] to the Settings menu.
(-[SettingsController validateMenuItem:]): Validated the new menu items. Disabled Decision and Decision Point items if filtering is disabled.
(-[SettingsController _contentFilteringMenuItem]): Returned a new Content Filtering menu item with a submenu.
(-[SettingsController toggleContentFilteringEnabled:]): Toggled ContentFilteringEnabledKey.
(-[SettingsController contentFilteringEnabled]): Returned value of ContentFilteringEnabledKey.
(-[SettingsController setContentFilteringDecision:]): Set ContentFilterDecisionKey and called -[BrowserAppDelegate didChangeSettings].
(-[SettingsController contentFilteringDecision]): Returned the value of ContentFilterDecisionKey as a WebMockContentFilterDecision.
Defaulted to WebMockContentFilterDecisionAllow if the value is invalid.
(-[SettingsController setContentFilteringDecisionPoint:]): Set ContentFilterDecisionPointKey and called -[BrowserAppDelegate didChangeSettings].
(-[SettingsController contentFilteringDecisionPoint]): Returned the value of ContentFilterDecisionPointKey as a WebMockContentFilterDecisionPoint.
Defaulted to WebMockContentFilterDecisionPointAfterWillSendRequest if the value is invalid.
* MiniBrowser/mac/WK1BrowserWindowController.h:
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController dealloc]):
(-[WK1BrowserWindowController didChangeSettings]): Created a WebMockContentFilterEnabler with the current settings and stored it in _contentFilterEnabler.
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]): Created a WebMockContentFilterEnabler and set it as the object for the eponymous bundle parameter.
* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig: Linked against libWebCoreTestSupport.
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
(configurationWithContentFilterSettings): Converted to use WebMockContentFilterEnabler, WebMockContentFilterDecision, and WebMockContentFilterDecisionPoint.
(TEST): Ditto.
(downloadTest): Ditto.
(+[MockContentFilterEnabler supportsSecureCoding]): Deleted.
(-[MockContentFilterEnabler copyWithZone:]): Deleted.
(-[MockContentFilterEnabler initWithCoder:]): Deleted.
(-[MockContentFilterEnabler initWithDecision:decisionPoint:]): Deleted.
(-[MockContentFilterEnabler encodeWithCoder:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm:
(-[ContentFilteringPlugIn webProcessPlugIn:initializeWithObject:]): Converted to use WebMockContentFilterEnabler.
(-[ContentFilteringPlugIn dealloc]): Ditto.
(-[ContentFilteringPlugIn observeValueForKeyPath:ofObject:change:context:]): Ditto.
(+[MockContentFilterEnabler supportsSecureCoding]): Deleted.
(-[MockContentFilterEnabler copyWithZone:]): Deleted.
(-[MockContentFilterEnabler initWithCoder:]): Deleted.
(-[MockContentFilterEnabler dealloc]): Deleted.
(-[MockContentFilterEnabler encodeWithCoder:]): Deleted.

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

5 years ago[JSC] support Computed Property Names in destructuring Patterns
commit-queue@webkit.org [Wed, 25 Nov 2015 01:43:14 +0000 (01:43 +0000)]
[JSC] support Computed Property Names in destructuring Patterns
https://bugs.webkit.org/show_bug.cgi?id=151494

Patch by Caitlin Potter <caitp@igalia.com> on 2015-11-24
Reviewed by Saam Barati.

Add support for computed property names in destructuring BindingPatterns
and AssignmentPatterns.

Productions BindingProperty(1) and AssignmentProperty(2) allow for any valid
PropertName(3), including ComputedPropertyName(4)

1: http://tc39.github.io/ecma262/#prod-BindingProperty
2: http://tc39.github.io/ecma262/#prod-AssignmentProperty
3: http://tc39.github.io/ecma262/#prod-PropertyName
4: http://tc39.github.io/ecma262/#prod-ComputedPropertyName

* bytecompiler/NodesCodegen.cpp:
(JSC::ObjectPatternNode::bindValue):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::appendObjectPatternEntry):
* parser/Nodes.h:
(JSC::ObjectPatternNode::appendEntry):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseDestructuringPattern):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::operatorStackPop):
* tests/es6.yaml:
* tests/es6/destructuring_assignment_computed_properties.js: Added.
(test):
(test.computeName):
(test.loadValue):
(test.out.get a):
(test.out.set a):
(test.out.get b):
(test.out.set b):
(test.out.get c):
(test.out.set c):
(test.get var):

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

5 years agoREGRESSION(r192053): MiniBrowser doesn't exit when clicking on the close-window button
gyuyoung.kim@webkit.org [Wed, 25 Nov 2015 00:20:42 +0000 (00:20 +0000)]
REGRESSION(r192053): MiniBrowser doesn't exit when clicking on the close-window button
https://bugs.webkit.org/show_bug.cgi?id=151567

Reviewed by Darin Adler.

* MiniBrowser/efl/main.c: Call window_close() instead of ewk_view_try_close().
(on_window_deletion):

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

5 years agoUnreviewed, rolling out r192536, r192722, and r192743.
commit-queue@webkit.org [Tue, 24 Nov 2015 21:37:37 +0000 (21:37 +0000)]
Unreviewed, rolling out r192536, r192722, and r192743.
https://bugs.webkit.org/show_bug.cgi?id=151593

Still causing trouble. (Requested by kling on #webkit).

Reverted changesets:

"[JSC] JSPropertyNameEnumerator could be destructorless."
https://bugs.webkit.org/show_bug.cgi?id=151242
http://trac.webkit.org/changeset/192536

"REGRESSION(r192536): Null pointer dereference in
JSPropertyNameEnumerator::visitChildren()."
https://bugs.webkit.org/show_bug.cgi?id=151495
http://trac.webkit.org/changeset/192722

"REGRESSION(r192536): Null pointer dereference in
JSPropertyNameEnumerator::visitChildren()."
https://bugs.webkit.org/show_bug.cgi?id=151495
http://trac.webkit.org/changeset/192743

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

5 years ago[Streams API] Implement pipeTo method in readable Stream
calvaris@igalia.com [Tue, 24 Nov 2015 18:47:19 +0000 (18:47 +0000)]
[Streams API] Implement pipeTo method in readable Stream
https://bugs.webkit.org/show_bug.cgi?id=151588

Reviewed by Darin Adler.

Source/WebCore:

Implemented pipeTo method according to the reference implementation in the spec as the spec is not written
yet. It can be found at https://github.com/whatwg/streams/blob/632b26a05f3106650b1ec91239ad5b012e6c64af/reference-implementation/lib/readable-stream.js#L75.

Tests: streams/pipe-to.html
       streams/reference-implementation/brand-checks.html
       streams/reference-implementation/pipe-through.html
       streams/reference-implementation/pipe-to.html
       streams/reference-implementation/pipe-to-options.html
       streams/reference-implementation/readable-stream-templated

* Modules/streams/ReadableStream.js:
(doPipe): Internal function of pipeTo.
(closeDest): Internal function of pipeTo.
(abortDest): Internal function of pipeTo.
(pipeTo): Implemented as per spec with some other internal functions as helpers.

LayoutTests:

Test "Piping to a writable stream that does not consume the writes fast enough exerts backpressure on the
source" was moved to its own file because it causes timing issues.

* streams/reference-implementation/pipe-to.html: Moved "Piping to a writable stream that does not consume the
writes fast enough exerts backpressure on the source" test to its own file.
* streams/pipe-to.html: Added with "Piping to a writable stream that does not consume the writes fast enough
exerts backpressure on the source" test.
* streams/reference-implementation/brand-checks.html: Fixed issue with the creation of a ReadableStreamReader.
* streams/pipe-to-expected.txt:
* streams/reference-implementation/brand-checks-expected.txt:
* streams/reference-implementation/pipe-through-expected.txt:
* streams/reference-implementation/pipe-to-expected.txt:
* streams/reference-implementation/pipe-to-options-expected.txt:
* streams/reference-implementation/readable-stream-templated-expected.txt: Expectations.
* platform/mac/TestExpectations:
* platform/win/TestExpectations: Flagged pipe-to test because of webkit.org/b/147933.

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

5 years agoWeb Inspector: Cmd-1 to Cmd-9 shortcuts should select tabs by ordinal
bburg@apple.com [Tue, 24 Nov 2015 18:22:03 +0000 (18:22 +0000)]
Web Inspector: Cmd-1 to Cmd-9 shortcuts should select tabs by ordinal
https://bugs.webkit.org/show_bug.cgi?id=151577

Reviewed by Timothy Hatcher.

The shortcuts only work if a tab at the specified ordinal exists.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):

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

5 years agoREGRESSION (r190983): Non-element, non-text nodes should not be distributed to slots
antti@apple.com [Tue, 24 Nov 2015 12:40:57 +0000 (12:40 +0000)]
REGRESSION (r190983): Non-element, non-text nodes should not be distributed to slots
https://bugs.webkit.org/show_bug.cgi?id=151566
rdar://problem/23430177

Reviewed by Zalan Bujtas.

Source/WebCore:

We don't invalidate slot assignments except for text or element children. Fix by not
not assigning other nodes to slots as it is not useful.

Test: fast/html/details-comment-crash.html

* dom/SlotAssignment.cpp:
(WebCore::slotNameFromSlotAttribute):
(WebCore::SlotAssignment::findAssignedSlot):
(WebCore::SlotAssignment::assignSlots):

LayoutTests:

* fast/html/details-comment-crash-expected.html: Added.
* fast/html/details-comment-crash.html: Added.

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

5 years ago[Win] Implement methods to get and set inner html.
peavo@outlook.com [Tue, 24 Nov 2015 08:37:31 +0000 (08:37 +0000)]
[Win] Implement methods to get and set inner html.
https://bugs.webkit.org/show_bug.cgi?id=151569

Reviewed by Alex Christensen.

* DOMHTMLClasses.cpp:
(DOMHTMLElement::innerHTML):
(DOMHTMLElement::setInnerHTML):
(DOMHTMLElement::innerText):

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

5 years ago[GTK] Use the network process unconditionally
carlosgc@webkit.org [Tue, 24 Nov 2015 08:01:35 +0000 (08:01 +0000)]
[GTK] Use the network process unconditionally
https://bugs.webkit.org/show_bug.cgi?id=151541

Reviewed by Alex Christensen.

Source/WebKit2:

Make the shared secondary process model become multiple secondary
process model with a limit of 1 web process. Use the same options
when creating a context with legacy configuration (unit tests and
inspector proxy).

* NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):
(webkit_web_context_set_process_model):
(webkit_web_context_get_process_model):
(webkit_web_context_set_web_process_count_limit):
(webkit_web_context_get_web_process_count_limit):
(toWebKitProcessModel): Deleted.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::setIgnoreTLSErrors):
(WebKit::WebProcessPool::platformInitializeWebProcess):

Tools:

Fix TestInspectorServer test. Do not assume we already have the
title we want when the page has been loaded, since the title is
changed afterwards. So, check if the title has already been set,
and if not wait for it.

* TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp:
(openRemoteDebuggingSession):

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

5 years agoUnreviewed, rolling out r192716 and r192717.
commit-queue@webkit.org [Tue, 24 Nov 2015 07:13:03 +0000 (07:13 +0000)]
Unreviewed, rolling out r192716 and r192717.
https://bugs.webkit.org/show_bug.cgi?id=151582

The patch was incorrect. We always need at least one data
point in each configuration (Requested by rniwa on #webkit).

Reverted changesets:

"Perf dashboard's should not include results more than 366
days old in JSON"
https://bugs.webkit.org/show_bug.cgi?id=151529
http://trac.webkit.org/changeset/192716

"Build fix for old version of PHP."
http://trac.webkit.org/changeset/192717

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

5 years agoUnreviewed, fix the Mac CMake build after r192793.
bburg@apple.com [Tue, 24 Nov 2015 07:12:19 +0000 (07:12 +0000)]
Unreviewed, fix the Mac CMake build after r192793.

* PlatformMac.cmake:

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

5 years agoHardening against CSSSelector double frees
ddkilzer@apple.com [Tue, 24 Nov 2015 03:30:03 +0000 (03:30 +0000)]
Hardening against CSSSelector double frees
<http://webkit.org/b/56124>
<rdar://problem/9119036>

Reviewed by Antti Koivisto.

Add some security assertions to catch this issue if it ever
happens in Debug builds, and make changes in
CSSSelector::~CSSSelector() and
CSSSelectorList::deleteSelectors() to prevent obvious issues if
they're ever called twice in Release builds.

No new tests because we don't know how to reproduce this.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector): Initialize
m_destructorHasBeenCalled.
* css/CSSSelector.h:
(WebCore::CSSSelector::m_destructorHasBeenCalled): Add bitfield.
(WebCore::CSSSelector::CSSSelector): Initialize
m_destructorHasBeenCalled.
(WebCore::CSSSelector::~CSSSelector): Add security assertion
that this is never called twice.  Clear out any fields that
would have caused us to dereference an object twice.

* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::deleteSelectors): Clear
m_selectorArray when freeing the memory to which it was
pointing.  This prevents re-entrancy issues or calling this
method twice on the same thread.  Also restructure the for()
loop to prevent calling CSSSelector::isLastInSelectorList()
after CSSSelector::~CSSSelector() has been called (via CRBug
241892).

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

5 years agoWeb Inspector: Add a keyboard shortcut to restore the default zoom level
bburg@apple.com [Tue, 24 Nov 2015 02:53:28 +0000 (02:53 +0000)]
Web Inspector: Add a keyboard shortcut to restore the default zoom level
https://bugs.webkit.org/show_bug.cgi?id=151237

Reviewed by Timothy Hatcher.

The Cmd-0 shortcut matches the keybindings of Safari and other browsers.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):

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

5 years agoWeb Inspector: inspector settings should not be shared between different inspection...
bburg@apple.com [Tue, 24 Nov 2015 02:49:51 +0000 (02:49 +0000)]
Web Inspector: inspector settings should not be shared between different inspection levels
https://bugs.webkit.org/show_bug.cgi?id=151151

Reviewed by Timothy Hatcher.

Source/WebCore:

InspectorController and InspectorFrontendClient should know how to compute their
inspection levels, so that this level can be exposed to the Inspector frontend for
preference disambiguation by inspection level.

 - A Page with normal web content has an inspection level of 0.
 - The first Web Inspector has an inspection level of 1.
 - The second Web Inspector that inspects the Inspector has an inspection level of 2.
 - And so forth...

For local frontend clients (WK1 and the ProtocolTestStub), the inspection level of
a Page computed as follows:

- If the page's inspector controller has no frontend client, then the Page
is normal web content (level 0).
- If the page's inspector controller has a frontend client, ask for its inspection level.
A frontend client looks at the inspection level reported by inspected page's inspector
controller and increments by one to account for the crossed inspection boundary.

No new tests, this is blocked by test infrastructure fixes (https://webkit.org/b/151573).

* inspector/InspectorController.cpp:
(WebCore::InspectorController::inspectionLevel): Added.
(WebCore::InspectorController::hasInspectorFrontendClient): Deleted.
* inspector/InspectorController.h:
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::canAttachWindow): Check inspectionLevel().
(WebCore::InspectorFrontendClientLocal::inspectionLevel): Added.
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::inspectionLevel): Added.
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::populate): Check inspectionLevel().

Source/WebInspectorUI:

It's really annoying to have shared settings between Inspector^1 and Inspector^2, because
they are not designed to respond to external changes to local storage keys. As a result,
the two inspectors seemingly have different settings while both are open, but the settings
clobber each other depending on which inspector is closed first. On the next inspector
being opened, it has settings that reflect whichever inspector closed last.

To fix this, alter the local storage key prefix to incude the inspection level when it is
greater than 1 (i.e., inspecting the inspector). The storage prefix becomes
"com.apple.WebInspector-${inspectionLevel}." in this case.
This is backwards-compatible for normal Inspector, who keeps the same storage prefix.

Alternate approaches that were considered and abandoned:

 - Use separate WKWebSiteDataStores for each inspection level. This API (as it currently is)
does not support multiple on-disk storage locations. We don't want to add an entirely new
Library directory for each inspector level, and sharing a single location doesn't fix the
shared-settings bug. Changing storage location would lose all existing Inspector settings.

 - Sync settings between multiple open Inspectors. This would be catastrophic, as changing
the active tab on one inspector would immediately propagate to the other open inspectors.

* UserInterface/Models/Setting.js:
(WebInspector.Setting):
* UserInterface/Protocol/InspectorFrontendHostStub.js:
(window.InspectorFrontendHost.WebInspector.InspectorFrontendHostStub.prototype.inspectionLevel):

Source/WebKit2:

In WebKit2, we already track the inspection level of WebPages in order to give inspectors
different page groups. Send the inspection level to WebInspectorUI WebProcess when
establishing a connection from the UIProcess. Use this number in the FrontendClient.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::inspectionLevel): Renamed from inspectorLevel to be consistent.
(WebKit::WebInspectorProxy::inspectorPageGroupIdentifier):
(WebKit::WebInspectorProxy::didRelaunchInspectorPageProcess):
(WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::inspectorLevel): Deleted.
* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::updateInspectorWindowTitle):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.messages.in:

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

5 years agoWeb Inspector: use Cmd-Option-L and Cmd-Option-R for toggling navigation and details...
bburg@apple.com [Tue, 24 Nov 2015 02:43:36 +0000 (02:43 +0000)]
Web Inspector: use Cmd-Option-L and Cmd-Option-R for toggling navigation and details sidebars
https://bugs.webkit.org/show_bug.cgi?id=151572

Reviewed by Timothy Hatcher.

The previous shortcuts were Cmd-0 and Cmd-Option-0, but these didn't match Safari's
sidebar shortcuts and conflict with Cmd-0 as the cross-browser way to reset page zoom.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):

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

5 years agoREGRESSION(r188206): [EFL] Missing to adjust scrollbar size to ewk_view_contents_size...
gyuyoung.kim@webkit.org [Tue, 24 Nov 2015 01:17:50 +0000 (01:17 +0000)]
REGRESSION(r188206): [EFL] Missing to adjust scrollbar size to ewk_view_contents_size_get API test
https://bugs.webkit.org/show_bug.cgi?id=148735

Reviewed by Csaba Osztrogonác.

r189256 missed to adjust scrollbar size to other tests in ewk_view_contents_size_get() API test.
In this case we need to apply scrollbar size to both width and height unlike previous fix. Because
horizontal scrollbar is also shown since device pixel ratio(= 2.0) is adjusted.

* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

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

5 years agoWeb Inspector: RemoteInspector should track targets and connections for remote automation
bburg@apple.com [Mon, 23 Nov 2015 23:51:48 +0000 (23:51 +0000)]
Web Inspector: RemoteInspector should track targets and connections for remote automation
https://bugs.webkit.org/show_bug.cgi?id=151042

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Refactor RemoteInspector so it can be used to send listings of different target types.
First, rename Debuggable to RemoteInspectionTarget, and pull things not specific to
remote inspection into the base class RemoteControllableTarget and its Connection class.

Add a new RemoteControllableTarget called RemoteAutomationTarget, used by UIProcess
to support remote UI automation via webinspectord. On the protocol side, this target
uses a new WIRTypeKey called WIRTypeAutomation to distiguish the listing from
Web and JavaScript listings and avoid inventing a new listing mechanism.

* API/JSContextRef.cpp:
(JSGlobalContextGetDebuggerRunLoop):
(JSGlobalContextSetDebuggerRunLoop):
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/InspectorFrontendChannel.h:
* inspector/remote/RemoteAutomationTarget.cpp: Added.
(Inspector::RemoteAutomationTarget::setAutomationAllowed): Added.
* inspector/remote/RemoteAutomationTarget.h: Added.
* inspector/remote/RemoteConnectionToTarget.h: Renamed from Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.h.
(Inspector::RemoteTargetBlock::RemoteTargetBlock):
(Inspector::RemoteTargetBlock::~RemoteTargetBlock):
(Inspector::RemoteTargetBlock::operator=):
(Inspector::RemoteTargetBlock::operator()):
* inspector/remote/RemoteConnectionToTarget.mm: Renamed from Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggableConnection.mm.
(Inspector::RemoteTargetHandleRunSourceGlobal):
(Inspector::RemoteTargetQueueTaskOnGlobalQueue):
(Inspector::RemoteTargetInitializeGlobalQueue):
(Inspector::RemoteTargetHandleRunSourceWithInfo):
(Inspector::RemoteConnectionToTarget::RemoteConnectionToTarget):
(Inspector::RemoteConnectionToTarget::~RemoteConnectionToTarget):
(Inspector::RemoteConnectionToTarget::destination):
(Inspector::RemoteConnectionToTarget::connectionIdentifier):
(Inspector::RemoteConnectionToTarget::dispatchAsyncOnTarget):
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::targetClosed):
(Inspector::RemoteConnectionToTarget::close):
(Inspector::RemoteConnectionToTarget::sendMessageToTarget):
(Inspector::RemoteConnectionToTarget::sendMessageToFrontend):
(Inspector::RemoteConnectionToTarget::setupRunLoop):
(Inspector::RemoteConnectionToTarget::teardownRunLoop):
(Inspector::RemoteConnectionToTarget::queueTaskOnPrivateRunLoop):
* inspector/remote/RemoteControllableTarget.cpp: Added.
(Inspector::RemoteControllableTarget::~RemoteControllableTarget):
(Inspector::RemoteControllableTarget::init):
(Inspector::RemoteControllableTarget::update):
* inspector/remote/RemoteControllableTarget.h: Added.
* inspector/remote/RemoteInspectionTarget.cpp: Renamed from Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.cpp.
(Inspector::RemoteInspectionTarget::remoteControlAllowed):
(Inspector::RemoteInspectionTarget::setRemoteDebuggingAllowed):
(Inspector::RemoteInspectionTarget::pauseWaitingForAutomaticInspection):
(Inspector::RemoteInspectionTarget::unpauseForInitializedInspector):
* inspector/remote/RemoteInspectionTarget.h: Renamed from Source/JavaScriptCore/inspector/remote/RemoteInspectorDebuggable.h.
(isType):
* inspector/remote/RemoteInspector.h:

    Code to manage Debuggables now works with RemoteControllableTargets and doesn't
    care whether the target is for Inspection or Automation. Listing data with target-
    and type-specific information are captured when clients call into RemoteInspector
    since that's the easiest time to gather this information on the right thread.
    Use the is<> / downcast<> machinery when we need a concrete Target type.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::nextAvailableIdentifier):
(Inspector::RemoteInspector::registerTarget): renamed from registerDebuggable.
(Inspector::RemoteInspector::unregisterTarget): renamed from unregisterDebuggable.
(Inspector::RemoteInspector::updateTarget): renamed from updateDebuggable.
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::stopInternal):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::listingForTarget):
(Inspector::RemoteInspector::listingForInspectionTarget):
(Inspector::RemoteInspector::listingForAutomationTarget):
(Inspector::RemoteInspector::pushListingsNow):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::receivedDataMessage):
(Inspector::RemoteInspector::receivedDidCloseMessage):
(Inspector::RemoteInspector::receivedGetListingMessage):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedConnectionDiedMessage):
(Inspector::RemoteInspector::RemoteInspector): Deleted.
(Inspector::RemoteInspector::registerDebuggable): Deleted.
(Inspector::RemoteInspector::unregisterDebuggable): Deleted.
(Inspector::RemoteInspector::updateDebuggable): Deleted.
(Inspector::RemoteInspector::updateDebuggableAutomaticInspectCandidate): Deleted.
(Inspector::RemoteInspector::sendMessageToRemoteFrontend): Deleted.
(Inspector::RemoteInspector::listingForDebuggable): Deleted.
(Inspector::RemoteInspector::pushListingNow): Deleted.
(Inspector::RemoteInspector::pushListingSoon): Deleted.
* inspector/remote/RemoteInspectorConstants.h:
* runtime/JSGlobalObjectDebuggable.cpp:
(JSC::JSGlobalObjectDebuggable::dispatchMessageFromRemote):
(JSC::JSGlobalObjectDebuggable::pauseWaitingForAutomaticInspection):
(JSC::JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend): Deleted.
* runtime/JSGlobalObjectDebuggable.h:

Source/WebCore:

Use the new RemoteControllableTarget API method names.

No new tests, no behavior change.

* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::dispatchMessageFromRemote):
(WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend): Deleted.
* page/PageDebuggable.h:

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

5 years agoModern IDB: Unskip all indexeddb/mozilla tests that pass.
beidson@apple.com [Mon, 23 Nov 2015 23:12:03 +0000 (23:12 +0000)]
Modern IDB: Unskip all indexeddb/mozilla tests that pass.
https://bugs.webkit.org/show_bug.cgi?id=151568
Source/WebCore:

Reviewed by Alex Christensen.

No new tests (Lots of skipped existing tests now pass).

* Modules/indexeddb/shared/IDBError.h:

LayoutTests:

Reviewed by Alex Christensen.

* platform/mac-wk1/TestExpectations:

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

5 years agoRename JavaScriptCore builtins files to match exposed object names
bburg@apple.com [Mon, 23 Nov 2015 22:10:05 +0000 (22:10 +0000)]
Rename JavaScriptCore builtins files to match exposed object names
https://bugs.webkit.org/show_bug.cgi?id=151549

Reviewed by Youenn Fablet.

As a subtask of unifying code generation for WebCore and JSC builtins, we need to get rid of
differences between builtins filenames (e.g., Promise.prototype.js) and the name of the
generated Builtin object (PromisePrototype).

If we don't do this, then both build systems need special hacks to normalize the object name
from the file name. It's easier to just normalize the filename.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/ArrayIteratorPrototype.js: Renamed from Source/JavaScriptCore/builtins/ArrayIterator.prototype.js.
* builtins/ArrayPrototype.js: Renamed from Source/JavaScriptCore/builtins/Array.prototype.js.
* builtins/FunctionPrototype.js: Renamed from Source/JavaScriptCore/builtins/Function.prototype.js.
* builtins/IteratorPrototype.js: Renamed from Source/JavaScriptCore/builtins/Iterator.prototype.js.
* builtins/PromiseOperations.js: Renamed from Source/JavaScriptCore/builtins/Operations.Promise.js.
* builtins/PromisePrototype.js: Renamed from Source/JavaScriptCore/builtins/Promise.prototype.js.
* builtins/StringIteratorPrototype.js: Renamed from Source/JavaScriptCore/builtins/StringIterator.prototype.js.
* builtins/TypedArrayPrototype.js: Renamed from Source/JavaScriptCore/builtins/TypedArray.prototype.js.

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

5 years agoAdd WebCore namespace for generated bindings for supplemental method calls
commit-queue@webkit.org [Mon, 23 Nov 2015 19:57:28 +0000 (19:57 +0000)]
Add WebCore namespace for generated bindings for supplemental method calls
https://bugs.webkit.org/show_bug.cgi?id=151431

Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2015-11-23
Reviewed by Alex Christensen.

Address build failures for generated supplemental method calls which are in the WebCore namespace.
The bindings are outside the WebCore namespace - so add WebCore namespace specifier where required.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
(GenerateParametersCheck):
* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
(WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::jsTestInterfaceSupplementalStr1):
(WebCore::jsTestInterfaceSupplementalStr2):
(WebCore::jsTestInterfaceSupplementalNode):
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceSupplementalStr2):
(WebCore::setJSTestInterfaceSupplementalNode):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
(WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
* bindings/scripts/test/ObjC/DOMTestInterface.mm:
(-[DOMTestInterface supplementalStr1]):
(-[DOMTestInterface supplementalStr2]):
(-[DOMTestInterface setSupplementalStr2:]):
(-[DOMTestInterface supplementalStr3]):
(-[DOMTestInterface setSupplementalStr3:]):
(-[DOMTestInterface supplementalNode]):
(-[DOMTestInterface setSupplementalNode:]):
(-[DOMTestInterface builtinAttribute]):
(-[DOMTestInterface setBuiltinAttribute:]):
(-[DOMTestInterface supplementalMethod1]):
(-[DOMTestInterface supplementalMethod2:objArg:]):
(-[DOMTestInterface supplementalMethod3]):
(-[DOMTestInterface supplementalMethod4]):
(-[DOMTestInterface builtinFunction]):

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

5 years agoModern IDB: When a transaction is aborted, call onerror handlers for all in-progress...
beidson@apple.com [Mon, 23 Nov 2015 19:48:50 +0000 (19:48 +0000)]
Modern IDB: When a transaction is aborted, call onerror handlers for all in-progress requests.
https://bugs.webkit.org/show_bug.cgi?id=151550

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/abort-requests-cancelled.html
      storage/indexeddb/modern/idbtransaction-objectstore-failures.html (with changes)
      storage/indexeddb/modern/index-5.html (with changes)
      Various (currently skipped) legacy IDB tests.

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::transaction):
(WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
(WebCore::IDBClient::IDBDatabase::didStartTransaction):
(WebCore::IDBClient::IDBDatabase::willCommitTransaction):
(WebCore::IDBClient::IDBDatabase::didCommitTransaction):
(WebCore::IDBClient::IDBDatabase::willAbortTransaction):
(WebCore::IDBClient::IDBDatabase::didAbortTransaction):
(WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::abort):
(WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer):
(WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
(WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
(WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
(WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
(WebCore::IDBClient::IDBTransaction::immediateAbort): Deleted.
(WebCore::IDBClient::IDBTransaction::abortOnServer): Deleted.
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):

* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::idbErrorName):
(WebCore::idbErrorDescription):
* Modules/indexeddb/shared/IDBError.h:

* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:

LayoutTests:

* storage/indexeddb/modern/abort-requests-cancelled-expected.txt: Added.
* storage/indexeddb/modern/abort-requests-cancelled.html: Added.
* storage/indexeddb/modern/idbtransaction-objectstore-failures-expected.txt:
* storage/indexeddb/modern/idbtransaction-objectstore-failures.html:
* storage/indexeddb/modern/index-5-expected.txt:
* storage/indexeddb/modern/index-5.html:

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

5 years agoModern IDB: Unskip storage/indexeddb/mozilla/global-data.html.
beidson@apple.com [Mon, 23 Nov 2015 19:41:05 +0000 (19:41 +0000)]
Modern IDB: Unskip storage/indexeddb/mozilla/global-data.html.
https://bugs.webkit.org/show_bug.cgi?id=151557

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Unskipping existing test storage/indexeddb/mozilla/global-data.html).

- Reworking some invalid ASSERTS
- Actually opening pending open-database-requests after a version change transaction completes
- Allow starting new transactions when the version change transaction has *started* finishing,
  but before it finishes finishing.

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::transaction):

* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):

* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded): Deleted.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoFix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=true
achristensen@apple.com [Mon, 23 Nov 2015 18:39:16 +0000 (18:39 +0000)]
Fix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=true
https://bugs.webkit.org/show_bug.cgi?id=151532

Reviewed by Benjamin Poulain.

Source/WebKit2:

* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::processPoolDestroyed):
(WebKit::WebGeolocationManagerProxy::processDidClose):
When a WebProcessPool is destroyed, only call stopUpdating if m_updateRequesters.clear()
stopped the updating, like we do in WebGeolocationManagerProxy::removeRequester.
Otherwise, call setEnableHighAccuracy if needed, also like we do in WebGeolocationManagerProxy::removeRequester.

Tools:

* TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:
(TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::eventsChanged):
(TestWebKitAPI::TEST):
(TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::eventsChanged):
(TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::GeolocationTransitionToHighAccuracyStateTracker): Deleted.
(TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::GeolocationTransitionToLowAccuracyStateTracker): Deleted.
Properly load about:blank in all WebViews to clean up.  Without this change, we had a
Geolocation provider stopping after its state tracker was destroyed with its stack frame,
so it was calling a function on a test object that had gone out of scope.
Also, call WKContextSetUsesNetworkProcess(context, true) to show what crash this fixed,
but that will become the default soon and that call will be removed.

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

5 years agoRemove DOMPromiseWithCallback
youenn.fablet@crf.canon.fr [Mon, 23 Nov 2015 18:31:58 +0000 (18:31 +0000)]
Remove DOMPromiseWithCallback
https://bugs.webkit.org/show_bug.cgi?id=151565

Reviewed by Eric Carlson.

DOMPromiseWithCallback is no longer used as WebCore JS built-ins are used to the cases where DOMPromiseWithCallback made sense.

No change in behavior.

* Modules/mediastream/MediaDevices.h: Moved from DOMPromiseWithCallback to DOMPromise since the API is now called by JS built-ins.
* bindings/js/JSDOMPromise.h:
(WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback): Deleted.
(WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback): Deleted.
(WebCore::Error>::resolve): Deleted.
(WebCore::Error>::reject): Deleted.
(WebCore::Error>::resolveEnd): Deleted.

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

5 years agoWeb Inspector: when inspecting the inspector, add the inspection level to the title bar
bburg@apple.com [Mon, 23 Nov 2015 17:00:34 +0000 (17:00 +0000)]
Web Inspector: when inspecting the inspector, add the inspection level to the title bar
https://bugs.webkit.org/show_bug.cgi?id=151555

Reviewed by Timothy Hatcher.

Source/WebCore:

* English.lproj/Localizable.strings: add new localized string for alternate inspector title.

Source/WebInspectorUI:

Drive-by update to remove some localization strings that are no longer used.

* Localizations/en.lproj/localizedStrings.js:

Source/WebKit2:

If the inspection level says we are inspecting an inspector, include the level
in the title bar to easily disambiguate it from the base level inspector.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::updateInspectorWindowTitle):

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

5 years ago[GStreamer] No need to assert the pipeline's bus presence in MediaPlayerPrivateGStrea...
zandobersek@gmail.com [Mon, 23 Nov 2015 13:38:49 +0000 (13:38 +0000)]
[GStreamer] No need to assert the pipeline's bus presence in MediaPlayerPrivateGStreamerBase dtor
https://bugs.webkit.org/show_bug.cgi?id=151558

Reviewed by Carlos Garcia Campos.

In the MediaPlayerPrivateGStreamerBase destructor, there's some leftover code
that acquires a reference to the GStreamer pipeline's bus object and then
just asserts that it's not null. Not very useful, so remove it.

Also use nullptr to null out the m_player member.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):

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

5 years agoREGRESSION(r192536): Null pointer dereference in JSPropertyNameEnumerator::visitChild...
akling@apple.com [Mon, 23 Nov 2015 12:44:24 +0000 (12:44 +0000)]
REGRESSION(r192536): Null pointer dereference in JSPropertyNameEnumerator::visitChildren().
<https://webkit.org/b/151495>

Reviewed by Mark Lam

The test I added when fixing this bug the first time caught another bug when
run on 32-bit: jsString() can also cause GC, so we have to make sure that
JSPropertyNameEnumerator::m_propertyNames is null until after the array it
points to has been populated.

Test: property-name-enumerator-gc-151495.js

* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::finishCreation):

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

5 years agoUnreviewed speculative buildfix after r192701.
ossy@webkit.org [Mon, 23 Nov 2015 11:25:13 +0000 (11:25 +0000)]
Unreviewed speculative buildfix after r192701.

* PlatformMac.cmake:

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

5 years agoASSERTION FAILED: freeSpace >= 0 in WebCore::RenderGrid::computeTrackSizesForDirection
svillar@igalia.com [Mon, 23 Nov 2015 09:03:30 +0000 (09:03 +0000)]
ASSERTION FAILED: freeSpace >= 0 in WebCore::RenderGrid::computeTrackSizesForDirection
https://bugs.webkit.org/show_bug.cgi?id=151254

Reviewed by Darin Adler.

Source/WebCore:

When in quirks mode, abnormally huge margins could lead to
negative computations of available logical sizes. We could add
an !document.inQuirksMode() check in the assertion but since
negative freeSpace values are valid (i.e. the condition is not
really part of the contract and everything will work as
expected) I've decided to simply remove it.

Test: fast/css-grid-layout/grid-quirks-mode-huge-margin-crash.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.

LayoutTests:

* fast/css-grid-layout/grid-quirks-mode-huge-margin-crash-expected.txt: Added.
* fast/css-grid-layout/grid-quirks-mode-huge-margin-crash.html: Added.

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

5 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.11.2 release.
carlosgc@webkit.org [Mon, 23 Nov 2015 08:47:39 +0000 (08:47 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.2 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:

* gtk/NEWS: Add release notes for 2.11.2.

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

5 years agorun-webkit-tests: http server for imported W3C tests doesn't work with --layout-tests...
ddkilzer@apple.com [Mon, 23 Nov 2015 04:02:48 +0000 (04:02 +0000)]
run-webkit-tests: http server for imported W3C tests doesn't work with --layout-tests-directory switch
<http://webkit.org/b/151542>

Reviewed by Daniel Bates.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(base_url): Use the Port object (already passed in) to give us
the path to the LayoutTests directory, which already checks for a
--layout-tests-directory command-line switch.
(WebPlatformTestServer.__init__): Remove layout_test_results_dir
argument since we can get this from the Port object already
passed in via Port.results_directory().  Also switch to use
Port.layout_tests_dir() to get the LayoutTests directory.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server_unittest.py:
(TestWebPlatformTestServer.test_custom_layout_tests_directory):
Add test case for custom LayoutTests directory.
(TestWebPlatformTestServer.test_previously_spawned_instance):
Update Port object to set mock results directory as if it was
set on the command-line.  Remove unneeded argument from
WebPlatformTestServer constructor.
(TestWebPlatformTestServer.test_corrupted_subserver_files): Ditto.

* Scripts/webkitpy/port/base.py:
(Port.to.start_web_platform_test_server): Remove unneeded
argument from WebPlatformTestServer constuctor.

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

5 years ago[GTK] [l10n] Updated Italian translation of WebKitGTK+
mcatanzaro@igalia.com [Sun, 22 Nov 2015 22:09:32 +0000 (22:09 +0000)]
[GTK] [l10n] Updated Italian translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=151543

Unreviewed.

Patch by Milo Casagrande <milo@milo.name> on 2015-11-22

* it.po:

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

5 years agoReverted r192734. It broke several Production builds.
aestes@apple.com [Sun, 22 Nov 2015 20:48:45 +0000 (20:48 +0000)]
Reverted r192734. It broke several Production builds.

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

5 years agoWeb Inspector: Clean up FolderizedTreeElement folder settings
mattbaker@apple.com [Sun, 22 Nov 2015 19:24:11 +0000 (19:24 +0000)]
Web Inspector: Clean up FolderizedTreeElement folder settings
https://bugs.webkit.org/show_bug.cgi?id=151539

Reviewed by Brian Burg.

The expanded state for each folder was stored as an external property on the folder
tree element. Now FolderizedTreeElement keeps a map of folders to settings.

* UserInterface/Views/FolderizedTreeElement.js:
(WebInspector.FolderizedTreeElement):
(WebInspector.FolderizedTreeElement.prototype.removeChildren):
(WebInspector.FolderizedTreeElement.prototype._parentTreeElementForRepresentedObject):
(WebInspector.FolderizedTreeElement.prototype._folderTreeElementExpandedStateChange):

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

5 years agoTeach MiniBrowser how to enable the mock content filter
aestes@apple.com [Sun, 22 Nov 2015 17:45:50 +0000 (17:45 +0000)]
Teach MiniBrowser how to enable the mock content filter
https://bugs.webkit.org/show_bug.cgi?id=151540

Reviewed by Andreas Kling.

Source/WebCore:

Moved the implementation of MockContentFilterEnabler from TestWebKitAPI to here, renamed it to
WebMockContentFilterEnabler, and made it compatible with the legacy Objective-C runtime. Renamed Decision and
DecisionPoint to WebMockContentFilterDecision and WebMockContentFilterDecisionPoint, and changed them from enum
classes to CF_ENUMs so that they can be used by both C++ and Objective-C source files.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::decisionPoint):
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::decision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::unblockRequestDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
(WebCore::toJSValue): Deleted.
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::willSendRequest):
(WebCore::MockContentFilter::responseReceived):
(WebCore::MockContentFilter::addData):
(WebCore::MockContentFilter::finishedAddingData):
(WebCore::MockContentFilter::unblockHandler):
(WebCore::MockContentFilter::maybeDetermineStatus):
* testing/MockContentFilter.h:
* testing/MockContentFilterEnabler.h: Added.
* testing/MockContentFilterEnabler.mm: Added.
(-[WebMockContentFilterEnabler initWithDecision:decisionPoint:blockedString:]):
(-[WebMockContentFilterEnabler initWithCoder:]):
(-[WebMockContentFilterEnabler encodeWithCoder:]):
(-[WebMockContentFilterEnabler enable]):
(-[WebMockContentFilterEnabler dealloc]):
(+[WebMockContentFilterEnabler supportsSecureCoding]):
(-[WebMockContentFilterEnabler copyWithZone:]):
* testing/MockContentFilterSettings.h:
(WebCore::MockContentFilterSettings::decisionPoint):
(WebCore::MockContentFilterSettings::setDecisionPoint):
(WebCore::MockContentFilterSettings::decision):
(WebCore::MockContentFilterSettings::setDecision):
(WebCore::MockContentFilterSettings::unblockRequestDecision):
(WebCore::MockContentFilterSettings::setUnblockRequestDecision):

Tools:

* MiniBrowser/Configurations/Base.xcconfig: Added WebCoreTestSupport and WTF to HEADER_SEARCH_PATHS.
* MiniBrowser/Configurations/MiniBrowser.xcconfig: Linked against libWebCoreTestSupport.
* MiniBrowser/Configurations/MiniBrowserBundle.xcconfig: Ditto.
* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Added blocked-page.html.
* MiniBrowser/MiniBrowserWebProcessPlugIn.m:
(-[MiniBrowserWebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Observed the WebMockContentFilterEnabler key path.
(-[MiniBrowserWebProcessPlugIn dealloc]):
(-[MiniBrowserWebProcessPlugIn observeValueForKeyPath:ofObject:change:context:]): Stored the value in _contentFilterEnabler.
* MiniBrowser/blocked-page.html: Added.
* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration): Created a _WKProcessPoolConfiguration with MiniBrowser.wkbundle as the injected bundle.
* MiniBrowser/mac/BrowserWindowController.h:
* MiniBrowser/mac/BrowserWindowController.m:
(+[BrowserWindowController contentFilteringBlockedString]): Returned an NSString containing blocked-page.html.
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]): Added [self _contentFilteringMenuItem] to the Settings menu.
(-[SettingsController validateMenuItem:]): Validated the new menu items. Disabled Decision and Decision Point items if filtering is disabled.
(-[SettingsController _contentFilteringMenuItem]): Returned a new Content Filtering menu item with a submenu.
(-[SettingsController toggleContentFilteringEnabled:]): Toggled ContentFilteringEnabledKey.
(-[SettingsController contentFilteringEnabled]): Returned value of ContentFilteringEnabledKey.
(-[SettingsController setContentFilteringDecision:]): Set ContentFilterDecisionKey and called -[BrowserAppDelegate didChangeSettings].
(-[SettingsController contentFilteringDecision]): Returned the value of ContentFilterDecisionKey as a WebMockContentFilterDecision.
Defaulted to WebMockContentFilterDecisionAllow if the value is invalid.
(-[SettingsController setContentFilteringDecisionPoint:]): Set ContentFilterDecisionPointKey and called -[BrowserAppDelegate didChangeSettings].
(-[SettingsController contentFilteringDecisionPoint]): Returned the value of ContentFilterDecisionPointKey as a WebMockContentFilterDecisionPoint.
Defaulted to WebMockContentFilterDecisionPointAfterWillSendRequest if the value is invalid.
* MiniBrowser/mac/WK1BrowserWindowController.h:
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController dealloc]):
(-[WK1BrowserWindowController didChangeSettings]): Created a WebMockContentFilterEnabler with the current settings and stored it in _contentFilterEnabler.
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]): Created a WebMockContentFilterEnabler and set it as the object for the eponymous bundle parameter.
* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig: Linked against libWebCoreTestSupport.
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm:
(configurationWithContentFilterSettings): Converted to use WebMockContentFilterEnabler, WebMockContentFilterDecision, and WebMockContentFilterDecisionPoint.
(TEST): Ditto.
(downloadTest): Ditto.
(+[MockContentFilterEnabler supportsSecureCoding]): Deleted.
(-[MockContentFilterEnabler copyWithZone:]): Deleted.
(-[MockContentFilterEnabler initWithCoder:]): Deleted.
(-[MockContentFilterEnabler initWithDecision:decisionPoint:]): Deleted.
(-[MockContentFilterEnabler encodeWithCoder:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFilteringPlugIn.mm:
(-[ContentFilteringPlugIn webProcessPlugIn:initializeWithObject:]): Converted to use WebMockContentFilterEnabler.
(-[ContentFilteringPlugIn dealloc]): Ditto.
(-[ContentFilteringPlugIn observeValueForKeyPath:ofObject:change:context:]): Ditto.
(+[MockContentFilterEnabler supportsSecureCoding]): Deleted.
(-[MockContentFilterEnabler copyWithZone:]): Deleted.
(-[MockContentFilterEnabler initWithCoder:]): Deleted.
(-[MockContentFilterEnabler dealloc]): Deleted.
(-[MockContentFilterEnabler encodeWithCoder:]): Deleted.

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

5 years agoAdd a test to make sure that font-variant: inherit works correctly.
mmaxfield@apple.com [Sun, 22 Nov 2015 17:19:38 +0000 (17:19 +0000)]
Add a test to make sure that font-variant: inherit works correctly.

Unreviewed.

* fast/text/font-variant-inherit-expected.html: Added.
* fast/text/font-variant-inherit.html: Added.

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

5 years agoFont selection should not consult font-variant property
mmaxfield@apple.com [Sun, 22 Nov 2015 17:06:35 +0000 (17:06 +0000)]
Font selection should not consult font-variant property
https://bugs.webkit.org/show_bug.cgi?id=151537

Reviewed by Simon Fraser.

Source/WebCore:

In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
font-feature-settings] do not affect font selection."

All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
are the only one who misbehaves. This patch aligns our behavior with the other
browsers.

Test: fast/text/font-selection-font-variant.html

* css/CSSFontSelector.cpp:
(WebCore::computeTraitsMask): Deleted.
(WebCore::compareFontFaces): Deleted.
(WebCore::CSSFontSelector::getFontFace): Deleted.
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::CSSParser): Deleted.
(WebCore::CSSParser::parseValue): Deleted.
(WebCore::CSSParser::parseDeclaration): Deleted.
(WebCore::CSSParser::clearProperties): Deleted.
(WebCore::CSSParser::parseFontVariant): Deleted.
(WebCore::CSSParser::createStyleRule): Deleted.
(WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
* css/CSSParser.h:
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::traitsMask): Deleted.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::traitsInFamilyEnumProc):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::toTraitsMask):
* platform/text/TextFlags.h:

LayoutTests:

* fast/text/font-selection-font-variant-expected.html: Added.
* fast/text/font-selection-font-variant.html: Added.

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

5 years agoUnreviewed, rolling out r192727.
carlosgc@webkit.org [Sun, 22 Nov 2015 10:48:48 +0000 (10:48 +0000)]
Unreviewed, rolling out r192727.

It made the selections transparent again and broke
/webkit2/WebKitWebView/snapshot

Reverted changeset:

"[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor,
et. al. should not clobber state of cached GtkStyleContexts"
https://bugs.webkit.org/show_bug.cgi?id=151533
http://trac.webkit.org/changeset/192727

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

5 years agoUnreviewed. Add missing inspector file to GTK+ compilation.
carlosgc@webkit.org [Sun, 22 Nov 2015 10:33:34 +0000 (10:33 +0000)]
Unreviewed. Add missing inspector file to GTK+ compilation.

* PlatformGTK.cmake:

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

5 years ago[GTK] Some unit tests fail when using the network process
carlosgc@webkit.org [Sun, 22 Nov 2015 09:00:45 +0000 (09:00 +0000)]
[GTK] Some unit tests fail when using the network process
https://bugs.webkit.org/show_bug.cgi?id=151490

Reviewed by Martin Robinson.

Run the soup server in a separate thread in TestResources test to
avoid deadlocks.

This fixes /webkit2/WebKitWebView/sync-request-on-max-conns and
/webkit2/WebKitWebResource/get-data when using the network process.

* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
(beforeAll): Create the WebKitTestServer with ServerRunInThread flag.
* TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp:
(WebKitTestServer::WebKitTestServer): When ServerRunInThread is
present, create a WorkQueue to run the server.
(WebKitTestServer::run): Run the server in the work queue if it
has been created.
* TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.h: Convert server
type into server options as flags.

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

5 years ago[GTK] ImageDiff should normalize the diff image
carlosgc@webkit.org [Sun, 22 Nov 2015 08:53:56 +0000 (08:53 +0000)]
[GTK] ImageDiff should normalize the diff image
https://bugs.webkit.org/show_bug.cgi?id=151261

Reviewed by Sergio Villar Senin.

* ImageDiff/gtk/ImageDiff.cpp:
(readPixbufFromStdin): Fix memory leak.
(differenceImageFromDifferenceBuffer): Normalize diff buffer.
(calculateDifference): Pass max distance to differenceImageFromDifferenceBuffer.

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

5 years ago[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not...
mcatanzaro@igalia.com [Sun, 22 Nov 2015 08:50:40 +0000 (08:50 +0000)]
[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
https://bugs.webkit.org/show_bug.cgi?id=151533

Reviewed by Carlos Garcia Campos.

platformActiveSelectionBackgroundColor(), platformInactiveSelectionBackgroundColor(), etc.
are const functions intended only to return a color used for painting, but since r174929
they also change the state of the cached style contexts we use for GTK_TYPE_ENTRY and
GTK_TYPE_TREE_VIEW. That's wrong; those style contexts should not have any state set. This
could cause theme colors returned by those GtkStyleContexts to change unexpectedly,
depending on whether the state is explicitly set before each use, or whether the theme
actually uses the states.

This didn't cause any regression only because every place using these style contexts
explicitly sets the state of the style contexts before use. In fact, the GtkTreeView style
context is not used anywhere else, and the GtkEntry style context is only used in
paintTextField, which does set the state before use (and then reverts it using
save/restore), so this cannot have broken anything in practice. But it's a landmine waiting
for the next programmer to trip it.

Fix this with a gtk_style_context_save()/gtk_style_context_restore() pair.

* rendering/RenderThemeGtk.cpp:
(WebCore::styleColor):

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

5 years agoTiny cleanup in ComplexTextController::collectComplexTextRuns()
mmaxfield@apple.com [Sat, 21 Nov 2015 23:06:46 +0000 (23:06 +0000)]
Tiny cleanup in ComplexTextController::collectComplexTextRuns()
https://bugs.webkit.org/show_bug.cgi?id=151534

Reviewed by Zalan Bujtas.

The isMissingGlyph boolean is completely unnecessary. Its entire
responsiblity is duplicated by the "font" pointer.

No new tests because there is no behavior change.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::collectComplexTextRuns):

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

5 years ago== Rolled over to ChangeLog-2015-11-21 ==
mcatanzaro@igalia.com [Sat, 21 Nov 2015 20:02:34 +0000 (20:02 +0000)]
== Rolled over to ChangeLog-2015-11-21 ==

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

5 years ago[GTK] Off-by-one error in getStyleContext()
mcatanzaro@igalia.com [Sat, 21 Nov 2015 17:00:00 +0000 (17:00 +0000)]
[GTK] Off-by-one error in getStyleContext()
https://bugs.webkit.org/show_bug.cgi?id=151524

Reviewed by Carlos Garcia Campos.

GtkWidgetPath* path = gtk_widget_path_new();
gtk_widget_path_append_type(path, widgetType);
// ...
gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_BUTTON);
gtk_widget_path_iter_add_class(path, 1, "text-button");

Only one widget type was appended to the widget path, so the maximum valid index is 0. This
code means to add both style classes to the first widget type in the widget path, so the
second call should use index 0 rather than index 1.

This caused no bug in practice, because when the index is invalid,
gtk_widget_path_iter_add_class() automatically changes the index to the last valid position
in the widget path -- in this case, 0. This is routinely done with -1 as a convention for
specifying the last position in the widget path.

* rendering/RenderThemeGtk.cpp:
(WebCore::getStyleContext):

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