WebKit-https.git
3 years agoWebKit should prevent push/replace state with username in URL.
beidson@apple.com [Fri, 15 Jul 2016 18:39:27 +0000 (18:39 +0000)]
WebKit should prevent push/replace state with username in URL.
<rdar://problem/27361737> and https://bugs.webkit.org/show_bug.cgi?id=159818

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/security/history-username-password.html

* page/History.cpp:
(WebCore::History::stateObjectAdded): Don't allow URLs with usernames/passwords.

LayoutTests:

* http/tests/security/history-username-password-expected.txt: Added.
* http/tests/security/history-username-password.html: Added.

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

3 years agoUnreviewed, rolling out r203266.
ryanhaddad@apple.com [Fri, 15 Jul 2016 18:33:32 +0000 (18:33 +0000)]
Unreviewed, rolling out r203266.

This change caused editing/deleting/delete-emoji.html to time
out on El Capitan, crash under GuardMalloc

Reverted changeset:

"Support new emoji group candidates"
https://bugs.webkit.org/show_bug.cgi?id=159755
http://trac.webkit.org/changeset/203266

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

3 years agoStack overflow error for deeply nested classes.
mark.lam@apple.com [Fri, 15 Jul 2016 18:31:29 +0000 (18:31 +0000)]
Stack overflow error for deeply nested classes.
https://bugs.webkit.org/show_bug.cgi?id=157086

Reviewed by Geoffrey Garen.

Changed the StructureStubClearingWatchpoint destructor to iteratively destruct
its chain of next StructureStubClearingWatchpoints instead of recursively doing
so.

The added deep-StructureStubClearingWatchpoint-destructor-recursion.js test
produces a crash before the fix is applied, but takes about 14 minutes to run.
Hence, it is skipped.

* bytecode/StructureStubClearingWatchpoint.cpp:
(JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint):
* tests/stress/deep-StructureStubClearingWatchpoint-destructor-recursion.js: Added.

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

3 years agoSource/WebCore:
fred.wang@free.fr [Fri, 15 Jul 2016 18:24:47 +0000 (18:24 +0000)]
Source/WebCore:
Move parsing of mfrac attributes into a MathMLFractionElement class
https://bugs.webkit.org/show_bug.cgi?id=159624

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-15
Reviewed by Brent Fulgham.

We move the parsing of mfrac attributes to a MathMLFractionElement class. This allows to
minimize the updates in RenderMathMLFraction and to remove the alignment members. Many of
the members in updateLayoutParameters are actually only used in layoutBlock and could be
removed in a follow-up patch. We also improve the resolution of negative line thickness value
since the MathML recommendation says it should be rounded up to the nearest valid
value (which is zero) instead of ignoring the attribute and using the line thickness.

No new tests, already covered by existing tests.

* CMakeLists.txt: Add MathMLFractionElement.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLFractionElement.cpp: Added.
(WebCore::MathMLFractionElement::MathMLFractionElement):
(WebCore::MathMLFractionElement::create):
(WebCore::MathMLFractionElement::lineThickness): Return the cached linethickness length,
parsing it again if it is dirty. This handles the special values "thin", "medium" and "thick"
or fallback to the general parseMathMLLength for MathML lengths.
(WebCore::MathMLFractionElement::cachedFractionAlignment): Return the cached alignment value,
parsing it again if it is dirty.
(WebCore::MathMLFractionElement::numeratorAlignment): Return the cached alignment.
(WebCore::MathMLFractionElement::denominatorAlignment): Ditto.
(WebCore::MathMLFractionElement::parseAttribute): Make attributes dirty.
(WebCore::MathMLFractionElement::createElementRenderer): Create a RenderMathMLFraction.
* mathml/MathMLFractionElement.h: Added.
* mathml/MathMLInlineContainerElement.cpp: We no longer need to handle fraction here.
(WebCore::MathMLInlineContainerElement::createElementRenderer):
* mathml/mathtags.in: Use MathMLFractionElement for mfrac.
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::updateLayoutParameters): New helper function to set the
layout parameters, replacing updateFromElement. We no longer parse and store the alignment
values here. We also change the resolution of negative values.
(WebCore::RenderMathMLFraction::horizontalOffset): Use the enum from MathMLFractionElement.
(WebCore::RenderMathMLFraction::layoutBlock): We call updateLayoutParameters instead of
updateFromElement. The numerator and denominator alignments are resolved here.
(WebCore::RenderMathMLFraction::parseAlignmentAttribute): Deleted. Parsing of alignment
attribute is now handled in MathMLFractionElement.
(WebCore::RenderMathMLFraction::updateFromElement): Deleted. Attribute changes are now
handled in MathMLFractionElement.
(WebCore::RenderMathMLFraction::styleDidChange): Deleted. Font changes are properly handled.
* rendering/mathml/RenderMathMLFraction.h: Update declarations.

LayoutTests:
Move parsing of mfrac attributes into a MathMLFractionElementClass
https://bugs.webkit.org/show_bug.cgi?id=159624

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-15
Reviewed by Brent Fulgham.

We update the expectation for negative linethickness. As indicated in the MathML
recommendation, it should be rounded up to the nearest valid value, which is 0.

* mathml/presentation/mfrac-linethickness2.html: Update the comment to reflect the new behavior.
* mathml/presentation/mfrac-linethickness2-expected.html: Use 0px as the reference for negative values.

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

3 years agoChanged the start page URL for WebKit Nightly builds.
jond@apple.com [Fri, 15 Jul 2016 18:06:17 +0000 (18:06 +0000)]
Changed the start page URL for WebKit Nightly builds.
https://bugs.webkit.org/show_bug.cgi?id=159816

Reviewed by Timothy Hatcher.

* WebKitLauncher/start.html:

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

3 years agoMerge InlineBidiResolver end-of-line Blink test case
bfulgham@apple.com [Fri, 15 Jul 2016 17:41:56 +0000 (17:41 +0000)]
Merge InlineBidiResolver end-of-line Blink test case
https://bugs.webkit.org/show_bug.cgi?id=126201
<rdar://problem/27331789>

Test case is from the Blink change (patch by <igor.o@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/d34ca9bbbdf71905d61aa45def30063311508a64>

* fast/text/international/bidi-crash-reached-end-of-line-expected.txt: Added.
* fast/text/international/bidi-crash-reached-end-of-line.html: Added.

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

3 years agoMerge Blink test case
bfulgham@apple.com [Fri, 15 Jul 2016 17:35:07 +0000 (17:35 +0000)]
Merge Blink test case
https://bugs.webkit.org/show_bug.cgi?id=123870

Patch is from the Blink change (patch by <morritaw@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/2abd63ccea97b1fcf25b337c76f12e6ad1bfc025>

* fast/dom/mutation-details-focus-expected.txt: Added.
* fast/dom/mutation-details-focus.html: Added.

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

3 years agoUpdating TestExpectations after r203267
ryanhaddad@apple.com [Fri, 15 Jul 2016 17:30:58 +0000 (17:30 +0000)]
Updating TestExpectations after r203267
https://bugs.webkit.org/show_bug.cgi?id=159817

Unreviewed test gardening.

* TestExpectations:

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

3 years agoCheck whether font is nonnull for GlyphData instead of calling GlyphData::isValid()
commit-queue@webkit.org [Fri, 15 Jul 2016 17:03:45 +0000 (17:03 +0000)]
Check whether font is nonnull for GlyphData instead of calling GlyphData::isValid()
https://bugs.webkit.org/show_bug.cgi?id=159783

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-15
Reviewed by Brent Fulgham.

GlyphData::isValid() returns true for GlyphData with null 'font' pointer when the 'glyph'
index is nonzero. This behavior is not expected by the MathML code and we have had crashes
in our test suite in the past on Windows (e.g. bug 140653). We thus replace the call to
GlyphData::isValid() with a stronger verification: Whether the 'font' pointer is nonzero.

No new tests, this only makes null pointer checks stronger.

* rendering/mathml/MathOperator.cpp:
(WebCore::boundsForGlyph):
(WebCore::advanceWidthForGlyph):
(WebCore::MathOperator::getBaseGlyph):
(WebCore::MathOperator::setSizeVariant):
(WebCore::MathOperator::fillWithVerticalExtensionGlyph):
(WebCore::MathOperator::fillWithHorizontalExtensionGlyph):
(WebCore::MathOperator::paintVerticalGlyphAssembly):
(WebCore::MathOperator::paintHorizontalGlyphAssembly):
(WebCore::MathOperator::paint):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::computePreferredLogicalWidths):
(WebCore::RenderMathMLToken::firstLineBaseline):
(WebCore::RenderMathMLToken::layoutBlock):
(WebCore::RenderMathMLToken::paint):
(WebCore::RenderMathMLToken::paintChildren):

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

3 years agoAdd DejaVu Math TeX Gyre to the list of math fonts.
commit-queue@webkit.org [Fri, 15 Jul 2016 16:51:56 +0000 (16:51 +0000)]
Add DejaVu Math TeX Gyre to the list of math fonts.
https://bugs.webkit.org/show_bug.cgi?id=159805

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-15
Reviewed by Brent Fulgham.

DejaVu 2.36 has a new math font that can be used for MathML rendering. Because this font is
likely to be installed on many systems (Linux, LibreOffice, etc) we include it in the default
list of font-families in mathml.css in order to increase the chance to find a math font.

No new tests, it only affects rendering when DejaVu Math TeX Gyre is installed on the system.

* css/mathml.css:
(math):

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

3 years agoImport more tests from the MathML in HTML5 test suite
commit-queue@webkit.org [Fri, 15 Jul 2016 16:48:17 +0000 (16:48 +0000)]
Import more tests from the MathML in HTML5 test suite
https://bugs.webkit.org/show_bug.cgi?id=159715

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-15
Reviewed by Brent Fulgham.

* imported/mathml-in-html5/fonts/math/lineheight5000-typolineheight2300.woff: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-5-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-5.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/spaces/space-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/spaces/space-1.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/spaces/space-2-expected.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/spaces/space-2.html: Added.
* imported/mathml-in-html5/mathml/relations/css-styling/color-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/css-styling/color-1.html: Added.
* imported/mathml-in-html5/mathml/relations/css-styling/visibility-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/css-styling/visibility-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/class-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/class-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/class-2-expected.txt: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/class-2.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/color-attributes-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/color-attributes-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/display-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/display-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/dynamic-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/dynamic-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/integration-point-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/integration-point-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/integration-point-2-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/integration-point-2.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/integration-point-3-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/integration-point-3.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/namespace-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/namespace-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/required-extensions-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/required-extensions-1.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/required-extensions-2-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/required-extensions-2.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/unique-identifier-2-expected.txt: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/unique-identifier-2.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/unique-identifier-3-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/html5-tree/unique-identifier-3.html: Added.
* imported/mathml-in-html5/mathml/relations/text-and-math/use-typo-metrics-1-expected.html: Added.
* imported/mathml-in-html5/mathml/relations/text-and-math/use-typo-metrics-1.html: Added.
* platform/ios-simulator/TestExpectations: Mark use-typo-metrics-1.html as failing.
* platform/mac/TestExpectations: Ditto.

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

3 years ago[MSE] Increase the SourceBuffer "fudge factor"
eric.carlson@apple.com [Fri, 15 Jul 2016 16:42:21 +0000 (16:42 +0000)]
[MSE] Increase the SourceBuffer "fudge factor"
https://bugs.webkit.org/show_bug.cgi?id=159813
<rdar://problem/27372033>

Reviewed by Jon Lee.
Source/WebCore:

Some media encoding/conversion pipelines are sloppy when doing sample time/timescale
math, and the error accumulation results in small gaps in the media timeline. r202641
increased the maximum allowable gap from 0.01 second to one 24fps frame, but it turns
out that at least one large provider has a significant amount of content encoded with
up to two 24fps frames.

No new tests, updated media/media-source/media-source-small-gap.html.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::currentTimeFudgeFactor): Increase maximum gap to 2002 / 24000 frames.

LayoutTests:

* media/media-source/media-source-small-gap-expected.txt:
* media/media-source/media-source-small-gap.html:

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

3 years agoFix expectations in test262.yaml
ossy@webkit.org [Fri, 15 Jul 2016 14:52:47 +0000 (14:52 +0000)]
Fix expectations in test262.yaml
https://bugs.webkit.org/show_bug.cgi?id=159810

Reviewed by Keith Miller.

* tests/test262.yaml:

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

3 years agoAdd final keyword to WebCore/svg classes
commit-queue@webkit.org [Fri, 15 Jul 2016 12:46:45 +0000 (12:46 +0000)]
Add final keyword to WebCore/svg classes
https://bugs.webkit.org/show_bug.cgi?id=159802

Patch by Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au> on 2016-07-15
Reviewed by Youenn Fablet.

Updated classes in the WebCore/svg directory to be marked as final where appropriate.

* svg/SVGException.h:
* svg/SVGLengthList.h:
* svg/SVGMatrix.h:
* svg/SVGNumberList.h:
* svg/SVGPaint.h:
* svg/SVGPathBuilder.h:
* svg/SVGPathByteStreamBuilder.h:
* svg/SVGPathByteStreamSource.h:
* svg/SVGPathSegArcAbs.h:
* svg/SVGPathSegArcRel.h:
* svg/SVGPathSegClosePath.h:
* svg/SVGPathSegCurvetoCubicAbs.h:
* svg/SVGPathSegCurvetoCubicRel.h:
* svg/SVGPathSegCurvetoCubicSmoothAbs.h:
* svg/SVGPathSegCurvetoCubicSmoothRel.h:
* svg/SVGPathSegCurvetoQuadraticAbs.h:
* svg/SVGPathSegCurvetoQuadraticRel.h:
* svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
* svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
* svg/SVGPathSegLinetoAbs.h:
* svg/SVGPathSegLinetoHorizontalAbs.h:
* svg/SVGPathSegLinetoHorizontalRel.h:
* svg/SVGPathSegLinetoRel.h:
* svg/SVGPathSegLinetoVerticalAbs.h:
* svg/SVGPathSegLinetoVerticalRel.h:
* svg/SVGPathSegListBuilder.h:
* svg/SVGPathSegListSource.h:
* svg/SVGPathSegMovetoAbs.h:
* svg/SVGPathSegMovetoRel.h:
* svg/SVGPathStringSource.h:
* svg/SVGPathTraversalStateBuilder.h:
* svg/SVGPointList.h:
* svg/SVGRenderingIntent.h:
* svg/SVGStringList.h:
* svg/SVGTRefElement.cpp:
* svg/SVGToOTFFontConversion.cpp:
* svg/SVGTransformList.h:
* svg/SVGUnitTypes.h:
* svg/SVGViewSpec.h:
* svg/SVGZoomEvent.h:
* svg/animation/SMILTimeContainer.h:
* svg/animation/SVGSMILElement.cpp:
* svg/graphics/filters/SVGFEImage.h:
* svg/graphics/filters/SVGFilter.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGMatrixTearOff.h:
* svg/properties/SVGPathSegListPropertyTearOff.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
* svg/properties/SVGStaticPropertyTearOff.h:
* svg/properties/SVGTransformListPropertyTearOff.h:

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

3 years agoUninitialized variable in DIBPixelData can cause a dangerous memory write
pvollan@apple.com [Fri, 15 Jul 2016 12:38:37 +0000 (12:38 +0000)]
Uninitialized variable in DIBPixelData can cause a dangerous memory write
https://bugs.webkit.org/show_bug.cgi?id=159414

Reviewed by Brent Fulgham.

Source/WebCore:

Initialize local BITMAP variable, in case the ::GetObject function that should initialize it
fails to do so, because the bitmap handle is invalid.

Tests: Tools/TestWebKitAPI/Tests/WebCore/win/DIBPixelData.cpp

* platform/graphics/win/DIBPixelData.cpp:
(WebCore::DIBPixelData::initialize): Initialize local variable.
(WebCore::DIBPixelData::setRGBABitmapAlpha): Return early if we have no bitmap.
* platform/graphics/win/DIBPixelData.h: Link fix.

Tools:

Add test to check that DIBPixelData::setRGBABitmapAlpha does not cause a crash
when the HDC parameter is invalid.

* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/Tests/WebCore/win/DIBPixelData.cpp: Added.
(TestWebKitAPI::TEST):

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

3 years agoRevert r202560 to fix the ARMv7 build with ARM instruction set
ossy@webkit.org [Fri, 15 Jul 2016 10:21:33 +0000 (10:21 +0000)]
Revert r202560 to fix the ARMv7 build with ARM instruction set
https://bugs.webkit.org/show_bug.cgi?id=159707

Reviewed by Carlos Garcia Campos.

* wtf/Platform.h: Revert r202560.

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

3 years ago[ARM] Disable Inline Caching on ARMv7 traditional until proper fix
ossy@webkit.org [Fri, 15 Jul 2016 09:43:33 +0000 (09:43 +0000)]
[ARM] Disable Inline Caching on ARMv7 traditional until proper fix
https://bugs.webkit.org/show_bug.cgi?id=159759

Reviewed by Saam Barati.

* jit/Repatch.cpp:
(JSC::forceICFailure):

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

3 years ago[GTK] Add basic tabs support to MiniBrowser
carlosgc@webkit.org [Fri, 15 Jul 2016 09:25:15 +0000 (09:25 +0000)]
[GTK] Add basic tabs support to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=159803

Reviewed by Sergio Villar Senin.

It's quite common to have issues with web views loaded in secondary tabs, and we need to use an external browser
like epiphany to debug those issues. It would be a lot easier to work on those bugs if we could use the MiniBrowser.

* MiniBrowser/gtk/BrowserTab.c: Added.
(titleChanged):
(isLoadingChanged):
(decidePolicy):
(removeChildIfInfoBar):
(loadChanged):
(createInfoBarQuestionMessage):
(tlsErrorsDialogResponse):
(loadFailedWithTLSerrors):
(permissionRequestDialogResponse):
(decidePermissionRequest):
(colorChooserRGBAChanged):
(popoverColorClosed):
(colorChooserRequestFinished):
(runColorChooserCallback):
(inspectorOpenedInWindow):
(inspectorClosed):
(browserTabSetProperty):
(browserTabFinalize):
(browser_tab_init):
(browserTabConstructed):
(browser_tab_class_init):
(getInternalURI):
(browser_tab_new):
(browser_tab_get_web_view):
(browser_tab_load_uri):
(browser_tab_get_title_widget):
(browser_tab_set_status_text):
(browser_tab_toggle_inspector):
(browser_tab_start_search):
(browser_tab_stop_search):
(browser_tab_add_accelerators):
(fullScreenMessageTimeoutCallback):
(browser_tab_enter_fullscreen):
(browser_tab_leave_fullscreen):
* MiniBrowser/gtk/BrowserTab.h: Added.
* MiniBrowser/gtk/BrowserWindow.c:
(getExternalURI):
(browserWindowSetStatusText):
(reloadOrStopCallback):
(goBackCallback):
(goForwardCallback):
(settingsCallback):
(webViewURIChanged):
(browserWindowHistoryItemActivated):
(browserWindowUpdateNavigationActions):
(webViewCreate):
(webViewEnterFullScreen):
(webViewLeaveFullScreen):
(webViewDecidePolicy):
(browserWindowCanZoomIn):
(browserWindowCanZoomOut):
(browserWindowZoomIn):
(browserWindowZoomOut):
(scrollEventCallback):
(faviconChanged):
(webViewIsLoadingChanged):
(defaultZoomCallback):
(searchCallback):
(newTabCallback):
(toggleWebInspector):
(reloadPage):
(reloadPageIgnoringCache):
(stopPageLoad):
(loadHomePage):
(editingCommandCallback):
(insertImageCommandCallback):
(insertLinkCommandCallback):
(browserWindowSetupEditorToolbar):
(browserWindowSwitchTab):
(browserWindowTabAddedOrRemoved):
(browser_window_init):
(browserWindowConstructed):
(browserWindowSaveSession):
(browserWindowDeleteEvent):
(browser_window_new):
(browser_window_append_view):
(browser_window_load_uri):
(browser_window_load_session):
(browser_window_set_background_color):
(resetStatusText): Deleted.
(activateUriEntryCallback): Deleted.
(webViewTitleChanged): Deleted.
(resetEntryProgress): Deleted.
(browserWindowCreateBackForwardMenu): Deleted.
(webViewReadyToShow): Deleted.
(webViewLoadFailed): Deleted.
(webViewMouseTargetChanged): Deleted.
(browserWindowUpdateZoomActions): Deleted.
(webViewZoomLevelChanged): Deleted.
(updateUriEntryIcon): Deleted.
(zoomInCallback): Deleted.
(zoomOutCallback): Deleted.
(toggleFullScreen): Deleted.
(browserWindowEditingCommandToggleButtonSetActive): Deleted.
(browserWindowFinalize): Deleted.
(browser_window_class_init): Deleted.
* MiniBrowser/gtk/BrowserWindow.h:
* MiniBrowser/gtk/CMakeLists.txt:
* MiniBrowser/gtk/main.c:
(createBrowserTab):
(aboutURISchemeRequestCallback):
(main):
(parseBackgroundColor): Deleted.

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

3 years agoAdd Test262 test files and yaml
keith_miller@apple.com [Fri, 15 Jul 2016 06:03:25 +0000 (06:03 +0000)]
Add Test262 test files and yaml

Rubber Stamped by Benjamin Poulain.

This patch adds all the test262 test files and the yaml that drives
run-jsc-stress-tests.

* tests/test262.yaml: Added. Yaml file to drive the test262 test suite with our driver.
* tests/test262/LICENSE: Added. License for the test262 test suite.
* tests/test262/harness/: Added. Harness directory for the test262 tests.
* tests/test262/test/: Added. Directory with all the actual test files.

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

3 years agoChange CSSParser::sourceSize returning Optional<CSSParser::SourceSize>
yoav@yoav.ws [Fri, 15 Jul 2016 05:49:36 +0000 (05:49 +0000)]
Change CSSParser::sourceSize returning Optional<CSSParser::SourceSize>
https://bugs.webkit.org/show_bug.cgi?id=159666

Reviewed by Michael Catanzaro.

Source/WebCore:

Tests:
    fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html

* css/CSSGrammar.y.in: Avoid adding SourceSize to source_size_list when the value is a Nullopt.
* css/CSSParser.cpp:
(WebCore::CSSParser::sourceSize): Return a Nullopt when an invalid value is encountered.
* css/CSSParser.h:

LayoutTests:

Added a test to make sure that an invalid source-size value is skipped, but the next one is properly picked.

* fast/dom/HTMLImageElement/sizes/image-sizes-invalids-expected.txt:
* fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html:

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

3 years agoReturn the correct value from Heap::externalMemorySize
commit-queue@webkit.org [Fri, 15 Jul 2016 04:59:08 +0000 (04:59 +0000)]
Return the correct value from Heap::externalMemorySize
https://bugs.webkit.org/show_bug.cgi?id=159797
<rdar://problem/27362446>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-07-14
Reviewed by Timothy Hatcher.

* heap/Heap.h:
(JSC::Heap::externalMemorySize):
We should have been returning m_externalMemorySize which is a subset
of m_extraMemorySize. In practice the difference can be small. A major
difference in "extra memory size" may be from deprecated memory size
and array buffer sizes.

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

3 years ago[RTL Scrollbars] Frame scrollbars don't move to the right when text direction changes...
tonikitoo@webkit.org [Fri, 15 Jul 2016 03:56:51 +0000 (03:56 +0000)]
[RTL Scrollbars] Frame scrollbars don't move to the right when text direction changes to RTL
https://bugs.webkit.org/show_bug.cgi?id=158252

Patch by Antonio Gomes <tonikitoo@igalia.com> on 2016-07-14
Reviewed by Myles C. Maxfield.

Source/WebCore:

When the 'dir' attribute changes either on body or on the document
element level, the associated FrameView does not trigger an update on
the frame level vertical scrollbar.

Patch adds a 'hook' so that RenderBox::styleDidChange can call in
order to get the document level scrollbar placed properly in the next
layout.

Test: fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement.html
      fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2.html
      fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement.html

* page/FrameView.cpp:
(WebCore::FrameView::topContentDirectionDidChange):
* page/FrameView.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):

LayoutTests:

* fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement.html: Added.
* fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-expected.txt: Added.
* fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2.html: Added.
* fast/scrolling/rtl-scrollbars-alternate-body-dir-attr-does-not-update-scrollbar-placement-2-expected.html: Added.
* fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement.html: Added.
* fast/scrolling/rtl-scrollbars-alternate-iframe-body-dir-attr-does-not-update-scrollbar-placement-expected.txt: Added.

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

3 years agoSupport new emoji group candidates
mmaxfield@apple.com [Fri, 15 Jul 2016 03:11:15 +0000 (03:11 +0000)]
Support new emoji group candidates
https://bugs.webkit.org/show_bug.cgi?id=159755
<rdar://problem/27325521>

Reviewed by Dean Jackson.

Source/WebCore:

There are a few code points which should be able to be joined (with ZWJ) to
either U+2640 or U+2642 to change the gender of the emoji. These patterns
should also work with an additional 0xFE0F variation selector. This patch
adds these new patterns to our existing emoji group candidate infrastructure.

Tests: fast/text/emoji-gender-2-3.html
       fast/text/emoji-gender-2-4.html
       fast/text/emoji-gender-2-5.html
       fast/text/emoji-gender-2-6.html
       fast/text/emoji-gender-2-7.html
       fast/text/emoji-gender-2-8.html
       fast/text/emoji-gender-2-9.html
       fast/text/emoji-gender-2.html
       fast/text/emoji-gender-3.html
       fast/text/emoji-gender-4.html
       fast/text/emoji-gender-5.html
       fast/text/emoji-gender-6.html
       fast/text/emoji-gender-7.html
       fast/text/emoji-gender-8.html
       fast/text/emoji-gender-9.html
       fast/text/emoji-gender-fe0f-3.html
       fast/text/emoji-gender-fe0f-4.html
       fast/text/emoji-gender-fe0f-5.html
       fast/text/emoji-gender-fe0f-6.html
       fast/text/emoji-gender-fe0f-7.html
       fast/text/emoji-gender-fe0f-8.html
       fast/text/emoji-gender-fe0f-9.html
       fast/text/emoji-gender.html
       fast/text/emoji-num-glyphs.html
       fast/text/emoji-single-parent-family-2.html
       fast/text/emoji-single-parent-family.html

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Removed incorrect ASSERT()s.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::characterRangeCodePath):
* platform/text/CharacterProperties.h:
(WebCore::isEmojiGroupCandidate):

Source/WTF:

This patch doesn't update the rules for our cursor movement iterator, because
I don't know the language used for implementing these rules. These rules will
be updated in the near future. When they do,
editing/deleting/delete-emoji-expected.txt will need to be updated.

* wtf/text/TextBreakIterator.cpp:
(WTF::cursorMovementIterator):

LayoutTests:

Because this patch doesn't update the rules for our cursor movement
iterator, the new expected result for editing/deleting/delete-emoji.html
expects incorrect results. In the patch where we update these rules,
the expected result should also be updated.

Because these new emoji require system support, TestExpectations has
been updated to mark the tests as failing until the system support has
been added.

* TestExpectations:
* editing/deleting/delete-emoji-expected.txt:
* editing/deleting/delete-emoji.html:
* fast/text/emoji-gender-2-3-expected.html: Added.
* fast/text/emoji-gender-2-3.html: Added.
* fast/text/emoji-gender-2-4-expected.html: Added.
* fast/text/emoji-gender-2-4.html: Added.
* fast/text/emoji-gender-2-5-expected.html: Added.
* fast/text/emoji-gender-2-5.html: Added.
* fast/text/emoji-gender-2-6-expected.html: Added.
* fast/text/emoji-gender-2-6.html: Added.
* fast/text/emoji-gender-2-7-expected.html: Added.
* fast/text/emoji-gender-2-7.html: Added.
* fast/text/emoji-gender-2-8-expected.html: Added.
* fast/text/emoji-gender-2-8.html: Added.
* fast/text/emoji-gender-2-9-expected.html: Added.
* fast/text/emoji-gender-2-9.html: Added.
* fast/text/emoji-gender-2-expected-mismatch.html: Added.
* fast/text/emoji-gender-2.html: Added.
* fast/text/emoji-gender-3-expected.html: Added.
* fast/text/emoji-gender-3.html: Added.
* fast/text/emoji-gender-4-expected.html: Added.
* fast/text/emoji-gender-4.html: Added.
* fast/text/emoji-gender-5-expected.html: Added.
* fast/text/emoji-gender-5.html: Added.
* fast/text/emoji-gender-6-expected.html: Added.
* fast/text/emoji-gender-6.html: Added.
* fast/text/emoji-gender-7-expected.html: Added.
* fast/text/emoji-gender-7.html: Added.
* fast/text/emoji-gender-8-expected.html: Added.
* fast/text/emoji-gender-8.html: Added.
* fast/text/emoji-gender-9-expected.html: Added.
* fast/text/emoji-gender-9.html: Added.
* fast/text/emoji-gender-expected-mismatch.html: Added.
* fast/text/emoji-gender-fe0f-3-expected.html: Added.
* fast/text/emoji-gender-fe0f-3.html: Added.
* fast/text/emoji-gender-fe0f-4-expected.html: Added.
* fast/text/emoji-gender-fe0f-4.html: Added.
* fast/text/emoji-gender-fe0f-5-expected.html: Added.
* fast/text/emoji-gender-fe0f-5.html: Added.
* fast/text/emoji-gender-fe0f-6-expected.html: Added.
* fast/text/emoji-gender-fe0f-6.html: Added.
* fast/text/emoji-gender-fe0f-7-expected.html: Added.
* fast/text/emoji-gender-fe0f-7.html: Added.
* fast/text/emoji-gender-fe0f-8-expected.html: Added.
* fast/text/emoji-gender-fe0f-8.html: Added.
* fast/text/emoji-gender-fe0f-9-expected.html: Added.
* fast/text/emoji-gender-fe0f-9.html: Added.
* fast/text/emoji-gender.html: Added.
* fast/text/emoji-num-glyphs-expected.txt: Added.
* fast/text/emoji-num-glyphs.html: Added.
* fast/text/emoji-single-parent-family-2-expected-mismatch.html: Added.
* fast/text/emoji-single-parent-family-2.html: Added.
* fast/text/emoji-single-parent-family-expected-mismatch.html: Added.
* fast/text/emoji-single-parent-family.html: Added.

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

3 years agoCrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::MediaQueryEvaluator...
dino@apple.com [Fri, 15 Jul 2016 02:31:20 +0000 (02:31 +0000)]
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::MediaQueryEvaluator::evaluate const
https://bugs.webkit.org/show_bug.cgi?id=159799
<rdar://problem/27346959>

Reviewed by Myles Maxfield.

Speculative fix for this crash, which seems to happen when asking for the Node's
renderer(). From the incoming crash logs, it is triggered by mutations on
a <picture> or <img> element, which would require choosing a new source,
and causing some media queries to evaluate.

The only place in MediaQueryEvaluator that has anything to do with
renderers is when gathering up some style information to pass to the
actual evaluation function. I put a guard against a missing documentElement
in there.

* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::evaluate): Make sure documentElement is not
null.

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

3 years agoUpdate HTML*Element class override methods in final classes
commit-queue@webkit.org [Fri, 15 Jul 2016 02:17:24 +0000 (02:17 +0000)]
Update HTML*Element class override methods in final classes
https://bugs.webkit.org/show_bug.cgi?id=159456

Patch by Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au> on 2016-07-14
Reviewed by Youenn Fablet.

Update HTML*Element classes so that overriden methods in final classes are marked final.
Also marked HTMLDivElement overriden methods as final since they are not overridden by derived classes.

* html/HTMLAppletElement.h:
* html/HTMLAreaElement.h:
* html/HTMLAttachmentElement.h:
* html/HTMLAudioElement.h:
* html/HTMLBRElement.h:
* html/HTMLBaseElement.h:
* html/HTMLBodyElement.h:
* html/HTMLButtonElement.h:
* html/HTMLCanvasElement.h:
* html/HTMLDataElement.h:
* html/HTMLDetailsElement.h:
* html/HTMLDivElement.h:
* html/HTMLEmbedElement.h:
* html/HTMLFieldSetElement.h:
* html/HTMLFontElement.h:
* html/HTMLFormElement.h:
* html/HTMLFrameSetElement.h:
* html/HTMLHRElement.h:
* html/HTMLHtmlElement.h:
* html/HTMLKeygenElement.h:
* html/HTMLLIElement.h:
* html/HTMLLabelElement.h:
* html/HTMLLegendElement.h:
* html/HTMLLinkElement.h:
* html/HTMLMapElement.h:
* html/HTMLMarqueeElement.h:
* html/HTMLMetaElement.h:
* html/HTMLMeterElement.h:
* html/HTMLModElement.h:
* html/HTMLOListElement.h:
* html/HTMLObjectElement.h:
* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.h:
* html/HTMLOutputElement.h:
* html/HTMLParagraphElement.h:
* html/HTMLParamElement.h:
* html/HTMLPreElement.h:
* html/HTMLProgressElement.h:
* html/HTMLQuoteElement.h:
* html/HTMLScriptElement.h:
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.h:
* html/HTMLSummaryElement.h:
* html/HTMLTableCaptionElement.h:
* html/HTMLTableColElement.h:
* html/HTMLTableElement.h:
* html/HTMLTableSectionElement.h:
* html/HTMLTemplateElement.h:
* html/HTMLTextAreaElement.h:
* html/HTMLTitleElement.h:
* html/HTMLUListElement.h:
* html/HTMLUnknownElement.h:
* html/HTMLVideoElement.h:
* html/HTMLWBRElement.h:

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

3 years agoIt should be a syntax error to have a 'use strict' directive inside a function that...
sbarati@apple.com [Fri, 15 Jul 2016 02:11:42 +0000 (02:11 +0000)]
It should be a syntax error to have a 'use strict' directive inside a function that has a non-simple parameter list
https://bugs.webkit.org/show_bug.cgi?id=159790
<rdar://problem/27171636>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Is is a syntax error for a function's parameter list to be non-simple
and for the function to also contain a 'use strict' directive.

See section 14.2.1 of the spec:
https://tc39.github.io/ecma262/#sec-arrow-function-definitions-static-semantics-early-errors

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseSourceElements):
(JSC::Parser<LexerType>::parseFormalParameters):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::strictMode):
(JSC::Scope::isValidStrictMode):
(JSC::Scope::shadowsArguments):
(JSC::Scope::setHasNonSimpleParameterList):
(JSC::Scope::hasNonSimpleParameterList):
(JSC::Scope::copyCapturedVariablesToVector):

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

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

3 years agoModernize GlyphMetricsMap
cdumez@apple.com [Fri, 15 Jul 2016 02:07:45 +0000 (02:07 +0000)]
Modernize GlyphMetricsMap
https://bugs.webkit.org/show_bug.cgi?id=159788

Reviewed by Darin Adler.

Modernize GlyphMetricsMap a bit.

* platform/graphics/GlyphMetricsMap.h:
- Drop WTF_MAKE_NONCOPYABLE as the class is already non-copyable due to having
  to having a std::unique_ptr data member.
- Drop GlyphMetricsMap default constructor and let the compiler generate it
  instead. This required using inline initialization for m_filledPrimaryPage.

(WebCore::GlyphMetricsMap::GlyphMetricsPage::GlyphMetricsPage):
- Make m_metrics data member private as it does not need to be public.
- Make setMetricsForIndex(unsigned index, const T& metrics) setter private
  as it does not need to be public.
- Make GlyphMetricsPage(const T& initialValue) constructor explicit as it
  takes only 1 parameter.

(WebCore::GlyphMetricsMap<T>::locatePageSlowCase):
- Use HashMap::ensure() to make the code a bit nicer.

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

3 years ago[iOS WK2] When scrolling apple.com/music on iPad Pro in landscape, left-hand tiles...
simon.fraser@apple.com [Fri, 15 Jul 2016 01:46:25 +0000 (01:46 +0000)]
[iOS WK2] When scrolling apple.com/music on iPad Pro in landscape, left-hand tiles appear first
https://bugs.webkit.org/show_bug.cgi?id=159798
rdar://problem/27362717

Reviewed by Tim Horton.
Source/WebCore:

In out-of-visible tiled layers, we always allocated the top-left tile, wasting
memory and causing ugliness when scrolling that layer into view. This happened
because getTileIndexRangeForRect() had no way to express the fact that no tiles
should be created.

Fix getTileIndexRangeForRect() to return a bool, and fix callers to respect the
return value.

Test: compositing/tiling/offscreen-tiled-layer.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::setNeedsDisplayInRect):
(WebCore::TileGrid::tilesWouldChangeForCoverageRect):
(WebCore::TileGrid::getTileIndexRangeForRect):
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::ensureTilesForRect):
(WebCore::TileGrid::extent):
* platform/graphics/ca/TileGrid.h:

LayoutTests:

Test with an offscreen tiled layer.

* compositing/tiling/offscreen-tiled-layer-expected.txt: Added.
* compositing/tiling/offscreen-tiled-layer.html: Added.
* platform/ios-simulator-wk1/compositing/tiling/offscreen-tiled-layer-expected.txt: Added.
* platform/ios-simulator-wk2/compositing/tiling/offscreen-tiled-layer-expected.txt: Added.
* platform/mac-wk1/compositing/tiling/offscreen-tiled-layer-expected.txt: Added.

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

3 years agoSkipping editing/spelling/copy-paste-crash.html on ios-simulator.
ryanhaddad@apple.com [Fri, 15 Jul 2016 00:52:15 +0000 (00:52 +0000)]
Skipping editing/spelling/copy-paste-crash.html on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=142969

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years agoMerge Blink test case
bfulgham@apple.com [Fri, 15 Jul 2016 00:39:51 +0000 (00:39 +0000)]
Merge Blink test case
https://bugs.webkit.org/show_bug.cgi?id=117422

Patch is from a set of Blink changes (patches by <leviw@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/507e1576555bd2ce6688206f28339c25761893b1>
<https://chromium.googlesource.com/chromium/blink/+/4c95872f52340cf0cf9a2a7078bb63a94f38d302>

* fast/list/list-style-position-inside-expected.txt: Added.
* fast/list/list-style-position-inside.html: Added.
* fast/sub-pixel/float-list-inside-expected.txt: Added.
* fast/sub-pixel/float-list-inside.html: Added.

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

3 years agoRemove credentials in URL when accessed through location.href
wilander@apple.com [Fri, 15 Jul 2016 00:10:45 +0000 (00:10 +0000)]
Remove credentials in URL when accessed through location.href
https://bugs.webkit.org/show_bug.cgi?id=139562
<rdar://problem/27331164>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/security/location-href-clears-username-password.html

The reason for this change is to not allow scripts on the page to
exfiltrate username and password from the URL.

* page/Location.cpp:
(WebCore::Location::href):
    Now checks if there is a username or password in the URL. If so,
    it copies the URL and removes the username and password.

LayoutTests:

The reason for this change is to not allow scripts on the page to
exfiltrate username and password from the URL.

* http/tests/security/location-href-clears-username-password-expected.txt: Added.
* http/tests/security/location-href-clears-username-password.html: Added.
    Test case adapted from https://src.chromium.org/viewvc/blink?revision=189367&view=revision.

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

3 years agoAllow RefPtrs of const RefCounted types
commit-queue@webkit.org [Fri, 15 Jul 2016 00:00:36 +0000 (00:00 +0000)]
Allow RefPtrs of const RefCounted types
https://bugs.webkit.org/show_bug.cgi?id=158269

Patch by Alex Christensen <achristensen@webkit.org> on 2016-07-14
Reviewed by Anders Carlsson.

Source/WTF:

* wtf/RefCounted.h:
(WTF::RefCountedBase::ref):
(WTF::RefCountedBase::~RefCountedBase):
(WTF::RefCountedBase::derefBase):
(WTF::RefCounted::deref):
Creating references to a const object does not really modify the object,
so everything in RefCounted is now mutable, and ref and deref are const.

Tools:

* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI::ConstRefCounted::create):
(TestWebKitAPI::returnConstRefCountedRef):
(TestWebKitAPI::returnRefCountedRef):

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

3 years agoImproved WebKit Nightly start page design.
jond@apple.com [Thu, 14 Jul 2016 23:46:55 +0000 (23:46 +0000)]
Improved WebKit Nightly start page design.
https://bugs.webkit.org/show_bug.cgi?id=159780

Reviewed by Timothy Hatcher.

Added better 404 handling, improved presentation of the
start page and new Apache rewrites for the P1 bug list.

* .htaccess:
* wp-content/themes/webkit/functions.php:
* wp-content/themes/webkit/nightly-start.php:

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

3 years agoMerge Blink test case
bfulgham@apple.com [Thu, 14 Jul 2016 23:45:41 +0000 (23:45 +0000)]
Merge Blink test case
https://bugs.webkit.org/show_bug.cgi?id=116507

Patch is from a Blink change (patch by <ojan@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/6598fc75a7260643ecfc42856ef24bcf96380443>

* compositing/iframes/crash-mouse-event-expected.txt: Added.
* compositing/iframes/crash-mouse-event.html: Added.

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

3 years agoWeb Inspector: Rename CCTNode to CallingContextTreeNode
commit-queue@webkit.org [Thu, 14 Jul 2016 23:38:13 +0000 (23:38 +0000)]
Web Inspector: Rename CCTNode to CallingContextTreeNode
https://bugs.webkit.org/show_bug.cgi?id=159782

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-07-14
Reviewed by Timothy Hatcher.

* UserInterface/Models/CallingContextTree.js:
* UserInterface/Models/CallingContextTreeNode.js:
Extra to its own file and rename.

* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/TestStub.html:
Include the new file.

* UserInterface/Views/ProfileDataGridNode.js:
(WebInspector.ProfileDataGridNode):
* UserInterface/Views/ProfileDataGridTree.js:
(WebInspector.ProfileDataGridTree.prototype._updateCurrentFocusDetails):
Rename shorthand "cctnode".

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

3 years agoWeb Inspector: SidebarPanel classes should use View.layout instead of "refresh"
mattbaker@apple.com [Thu, 14 Jul 2016 23:37:37 +0000 (23:37 +0000)]
Web Inspector: SidebarPanel classes should use View.layout instead of "refresh"
https://bugs.webkit.org/show_bug.cgi?id=159745
<rdar://problem/27335252>

Reviewed by Timothy Hatcher.

* UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
(WebInspector.ApplicationCacheDetailsSidebarPanel.prototype.set applicationCacheFrame):
Use needsLayout.

* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.layout):
Move refresh logic to layout.
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.initialLayout):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._styleSheetAddedOrRemoved):
Defer layout to coalesce updates.
(WebInspector.CSSStyleDetailsSidebarPanel):
(WebInspector.CSSStyleDetailsSidebarPanel.prototype.refresh): Deleted.

* UserInterface/Views/DOMDetailsSidebarPanel.js:
(WebInspector.DOMDetailsSidebarPanel.prototype.set domNode):
Use needsLayout.

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
Move refresh logic to layout.

* UserInterface/Views/DetailsSidebarPanel.js:
(WebInspector.DetailsSidebarPanel.prototype.shown): Deleted.
Base class already forces a layout when shown.
(WebInspector.DetailsSidebarPanel.prototype.needsRefresh): Deleted.
No longer needed.
(WebInspector.DetailsSidebarPanel.prototype.refresh): Deleted.
Renamed layout.
(WebInspector.DetailsSidebarPanel): Deleted.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype.supportsDOMNode):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._layerTreeDidChange):
Use needsLayout.
(WebInspector.LayerTreeDetailsSidebarPanel.prototype.shown):
Base class already forces a layout when shown.

* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WebInspector.ResourceDetailsSidebarPanel.prototype.set resource):
Use needsLayout.

* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.set callFrame):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._removeWatchExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressions):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._refreshAllWatchExpressionsButtonClicked):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._didEvaluateExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._mainResourceDidChange):
Use needsLayout.

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

3 years ago[css-grid] Handle min-content/max-content with orthogonal flows
jfernandez@igalia.com [Thu, 14 Jul 2016 23:33:13 +0000 (23:33 +0000)]
[css-grid] Handle min-content/max-content with orthogonal flows
https://bugs.webkit.org/show_bug.cgi?id=159294

Reviewed by Darin Adler.

Currently there is no support for orthogonal flows in many aspects of the
Grid Layout logic.

The Grid sizing algorithm should be adapted to this scenario, hence this
patch focus on the min-content and max-content functions, used to resolve
content based track sizes.

There are still issues related to alignment and sizes using percentages,
but they will be addressed in different patches.

Tests: fast/css-grid-layout/grid-item-positioning-with-orthogonal-flows.html
       fast/css-grid-layout/grid-item-sizing-with-orthogonal-flows.html
       fast/css-grid-layout/grid-item-spanning-and-orthogonal-flows.html
       fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
       fast/css-grid-layout/grid-track-sizing-with-percentages-and-orthogonal-flows.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridSizingData::advanceNextState):
(WebCore::RenderGrid::GridSizingData::isValidTransitionForDirection):
(WebCore::RenderGrid::computeTrackSizesForDirection):
(WebCore::RenderGrid::repeatTracksSizingIfNeeded): Added.
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::hasOverrideContainingBlockContentSizeForChild):
(WebCore::overrideContainingBlockContentSizeForChild):
(WebCore::setOverrideContainingBlockContentSizeForChild):
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::isOrthogonalChild): Added.
(WebCore::RenderGrid::logicalHeightForChild):
(WebCore::RenderGrid::flowAwareDirectionForChild): Added.
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild):
(WebCore::RenderGrid::minContentForChild):
(WebCore::RenderGrid::maxContentForChild):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Added.
(WebCore::RenderGrid::gridAreaBreadthForChild):
(WebCore::RenderGrid::columnAxisPositionForChild):
(WebCore::RenderGrid::rowAxisPositionForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
* rendering/RenderGrid.h:
(WebCore::RenderGrid::SizingOperation): This enum has been moved to the header file.
(WebCore::RenderGrid::m_hasAnyOrthogonalChild): New class attribute to know if there are any orthogonal grid items.
(WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild):
(WebCore::RenderGrid::logicalHeightForChild):
(WebCore::RenderGrid::gridAreaBreadthForChild):
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):

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

3 years agoUnreviewed, rolling out r203248.
ryanhaddad@apple.com [Thu, 14 Jul 2016 23:21:34 +0000 (23:21 +0000)]
Unreviewed, rolling out r203248.

This change causes LayoutTests to crash and exit early

Reverted changeset:

"Use more Refs with WorkQueues"
https://bugs.webkit.org/show_bug.cgi?id=159792
http://trac.webkit.org/changeset/203248

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

3 years agoUse emptyString() instead of "" when possible
cdumez@apple.com [Thu, 14 Jul 2016 23:17:51 +0000 (23:17 +0000)]
Use emptyString() instead of "" when possible
https://bugs.webkit.org/show_bug.cgi?id=159789

Reviewed by Alex Christensen.

Use emptyString() instead of "" when possible to reduce String allocations.

Source/WebCore:

* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* css/CSSSelector.h:
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::removeProperty):
(WebCore::MutableStyleProperties::removeCustomProperty):
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
(WebCore::TextCheckingHelper::findFirstBadGrammar):
* editing/TypingCommand.h:
(WebCore::TypingCommand::create):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::cleanup):
* inspector/InspectorStyleSheet.cpp:
(WebCore::fillMediaListChain):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
* platform/gtk/DataObjectGtk.h:
(WebCore::DataObjectGtk::clearURIList):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
* platform/network/curl/ResourceHandleManager.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::updateContent):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::noneDashboardRegions):
* rendering/svg/SVGTextMetrics.cpp:
(WebCore::SVGTextMetrics::SVGTextMetrics):
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexString):

Source/WebKit/cf:

* WebCoreSupport/WebInspectorClientCF.cpp:
(populateSetting):

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::parseRFC822HeaderFields):

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::pasteboardChangedOwner):
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::parseRFC822HeaderFields):
(WebKit::NPN_Status):

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

3 years agoediting/spelling/spellcheck-async.html sometimes crashes with GuardMalloc
bfulgham@apple.com [Thu, 14 Jul 2016 23:15:20 +0000 (23:15 +0000)]
editing/spelling/spellcheck-async.html sometimes crashes with GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=142969
<rdar://problem/27331095>

Reviewed by Alex Christensen.

Fix based on a Blink change (patch by <rouslan@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/c713736b122c2224804b2db72f1f711cb47ee260%5E%21/#F1>

Source/WebCore:

Test: editing/spelling/copy-paste-crash.html
      editing/spelling/spellcheck-async.html

* editing/SpellChecker.cpp:
(WebCore::SpellCheckRequest::didSucceed):
(WebCore::SpellCheckRequest::didCancel):

LayoutTests:

* editing/spelling/copy-paste-crash-expected.txt: Added.
* editing/spelling/copy-paste-crash.html: Added.
* platform/platform/mac-wk2/TestExpectations: Skip test on mac-wk2 since all Spelling tests are
currently broken (see <https://webkit.org/b/105616>).

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

3 years agoUse more Refs with WorkQueues
achristensen@apple.com [Thu, 14 Jul 2016 23:04:29 +0000 (23:04 +0000)]
Use more Refs with WorkQueues
https://bugs.webkit.org/show_bug.cgi?id=159792

Reviewed by Brady Eidson.

* NetworkProcess/CustomProtocols/CustomProtocolManager.h:
* Platform/IPC/Connection.cpp:
(IPC::Connection::setShouldExitOnSyncMessageSendFailure):
(IPC::Connection::addWorkQueueMessageReceiver):
* Platform/IPC/Connection.h:
* Shared/mac/SecItemShim.cpp:
(WebKit::SecItemShim::initializeConnection):
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::create):
(WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
(WebKit::StorageManager::StorageManager):
* UIProcess/Storage/StorageManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
(WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::initializeConnection):
(WebKit::SecItemShimProxy::secItemRequest):
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::initializeConnection):
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::initializeConnection):
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/ViewUpdateDispatcher.cpp:
(WebKit::ViewUpdateDispatcher::initializeConnection):
(WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):

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

3 years agoRemove duplicate TestExpectations entry.
ryanhaddad@apple.com [Thu, 14 Jul 2016 22:14:10 +0000 (22:14 +0000)]
Remove duplicate TestExpectations entry.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoImageBuffer's succes flag should be set to false at the very beginning of the c'tor.
zalan@apple.com [Thu, 14 Jul 2016 22:05:08 +0000 (22:05 +0000)]
ImageBuffer's succes flag should be set to false at the very beginning of the c'tor.
https://bugs.webkit.org/show_bug.cgi?id=159784

Reviewed by Simon Fraser.

No change in functionality.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):

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

3 years agoWeb Automation: FrameNotFound errors happen a lot for the main frame
timothy@apple.com [Thu, 14 Jul 2016 21:52:52 +0000 (21:52 +0000)]
Web Automation: FrameNotFound errors happen a lot for the main frame
https://bugs.webkit.org/show_bug.cgi?id=159777
rdar://problem/27224628

Send both pageID and frameID, and have the WebProcess side resolve the
mainFrame from 0 based on the known pageID. This avoids a race waiting
for the DidCreateMainFrame message.

Reviewed by Brian Burg.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::webFrameIDForHandle):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
(WebKit::WebAutomationSession::getAllCookies):
(WebKit::WebAutomationSession::deleteSingleCookie):
(WebKit::WebAutomationSession::webFrameProxyForHandle): Deleted.
(WebKit::WebAutomationSession::webFrameIDForHandle): Added.
* UIProcess/Automation/WebAutomationSession.h:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
(WebKit::WebAutomationSessionProxy::resolveParentFrame):
(WebKit::WebAutomationSessionProxy::focusFrame):
(WebKit::WebAutomationSessionProxy::computeElementLayout):
(WebKit::WebAutomationSessionProxy::takeScreenshot):
(WebKit::WebAutomationSessionProxy::getCookiesForFrame):
(WebKit::WebAutomationSessionProxy::deleteCookie):
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:

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

3 years agoUse SocketProvider to create SocketStreamHandles
achristensen@apple.com [Thu, 14 Jul 2016 21:43:03 +0000 (21:43 +0000)]
Use SocketProvider to create SocketStreamHandles
https://bugs.webkit.org/show_bug.cgi?id=159774

Source/WebCore:

Reviewed by Brady Eidson.

No new tests.  No change in behaviour.

In r202930 I introduced the SocketProvider, but I used it to make a WebSocketChannel
instead of a SocketStreamHandle, which is the class I want to make into an interface
and proxy the web traffic over to the NetworkProcess.

* CMakeLists.txt:
* Modules/websockets/ThreadableWebSocketChannel.cpp: Added.
(WebCore::ThreadableWebSocketChannel::create):
I removed this in 202930, so this is restoring it from that patch, hence the old copyright.
* Modules/websockets/ThreadableWebSocketChannel.h:
(WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::WebSocketChannel):
(WebCore::WebSocketChannel::connect):
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::create):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
(WebCore::WorkerThreadableWebSocketChannel::resume):
(WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::~Bridge):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
(WebCore::WorkerThreadableWebSocketChannel::create):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::EmptyEditorClient::registerRedoStep):
(WebCore::EmptySocketProvider::createWebSocketChannel): Deleted.
* loader/EmptyClients.h:
* page/SocketProvider.cpp: Added.
(WebCore::SocketProvider::createSocketStreamHandle):
* page/SocketProvider.h:
(WebCore::SocketProvider::~SocketProvider): Deleted.
* platform/network/cf/SocketStreamHandle.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit:

Reviewed by Alex Christensen.

* PlatformMac.cmake:
* PlatformWin.cmake:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

Reviewed by Brady Eidson.

* Misc/WebSocketProvider.h: Removed.
* Misc/WebSocketProvider.mm: Removed.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKit/win:

Reviewed by Brady Eidson.

* WebSocketProvider.cpp: Removed.
* WebSocketProvider.h: Removed.
* WebView.cpp: Replaced WebSocketProvider with SocketProvider as we did in WebCore.

Source/WebKit2:

Reviewed by Brady Eidson.

* WebProcess/Network/WebSocketProvider.cpp:
(WebKit::WebSocketProvider::createSocketStreamHandle):
(WebKit::WebSocketProvider::createWebSocketChannel): Deleted.
* WebProcess/Network/WebSocketProvider.h:

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

3 years agoWeb Inspector: Maintain selected function when switching between different profile...
commit-queue@webkit.org [Thu, 14 Jul 2016 21:42:42 +0000 (21:42 +0000)]
Web Inspector: Maintain selected function when switching between different profile representations
https://bugs.webkit.org/show_bug.cgi?id=159778
<rdar://problem/27355913>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-07-14
Reviewed by Timothy Hatcher.

* UserInterface/Models/CallingContextTree.js:
(WebInspector.CCTNode):
(WebInspector.CCTNode.prototype.get hash):
(WebInspector.CCTNode.prototype.findOrMakeChild):
(WebInspector.CCTNode.prototype.equals):
Expose the hash so two nodes can be compared cheaply.

* UserInterface/Views/ProfileView.js:
(WebInspector.ProfileView.prototype._repopulateDataGridFromTree):
(WebInspector.ProfileView.prototype._restoreSharedState):
(WebInspector.ProfileView.prototype._dataGridNodeSelected):
Share data between multiple ProfileViews. Currently just remembering
and restoring the selected function.

* UserInterface/Views/ScriptProfileTimelineView.js:
(WebInspector.ScriptProfileTimelineView):
(WebInspector.ScriptProfileTimelineView.prototype._showProfileViewForOrientation):
Include the shared data when constructing new ProfileViews.

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

3 years ago[WK2][iOS] Potential null dereference under ViewGestureController::beginSwipeGesture()
cdumez@apple.com [Thu, 14 Jul 2016 21:39:15 +0000 (21:39 +0000)]
[WK2][iOS] Potential null dereference under ViewGestureController::beginSwipeGesture()
https://bugs.webkit.org/show_bug.cgi?id=159776
<rdar://problem/22467100>

Reviewed by Tim Horton.

Potential null dereference under ViewGestureController::beginSwipeGesture() of:
m_webPageProxy.backForwardList().currentItem()

The client side is expected to call ViewGestureController::canSwipeInDirection() but
this only guarantees that the m_alternateBackForwardListSourceView's currentItem is
non-null when m_alternateBackForwardListSourceView is non-null. It does not guarantee
that m_webPageProxy's currentItem is non-null.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):

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

3 years ago"User delete" tests are flakey timeouts (and/or DatabaseProcess crashes).
beidson@apple.com [Thu, 14 Jul 2016 21:15:28 +0000 (21:15 +0000)]
"User delete" tests are flakey timeouts (and/or DatabaseProcess crashes).
https://bugs.webkit.org/show_bug.cgi?id=158741

Reviewed by Alex Christensen.

No new tests (Covered by existing tests in some configurations)

- Check if a database hard delete is complete in more places.
- Asynchronously clear out the hard close protector instead of synchronously.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
(WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
(WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
(WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
(WebCore::IDBServer::UniqueIDBDatabase::doneWithHardClose): Deleted.

* Modules/indexeddb/server/UniqueIDBDatabase.h:
(WebCore::IDBServer::UniqueIDBDatabase::hardClosedForUserDelete):

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):

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

3 years agoCSSStyleSheet members should clear their owner node when destroyed
bfulgham@apple.com [Thu, 14 Jul 2016 21:01:23 +0000 (21:01 +0000)]
CSSStyleSheet members should clear their owner node when destroyed
https://bugs.webkit.org/show_bug.cgi?id=117470

Reviewed by Chris Dumez.

Make sure that CSSStyleSheet members are detached from their owner node when
the owning object is destroyed.

I audited other CSSStyleSheet uses, and found one other place where the owner node was not
being cleared during destruction. The Inspector also uses CSSStyleSheet, but seems to
handle the node ownership properly.

Fix based on a Blink change (patch by <haraken@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/c4949bfdeb2a613701afa1410bdae70531b8f6bf>

Also includes a follow-up fix (patch by <haraken@chromium.org>):
<https://chromium.googlesource.com/chromium/blink/+/9c3932dc80b33429db3a5873cb266b726c8a19bf>

No test case. Was found by the Chromium team through review of their crash traces under minor DOM GC.

* contentextensions/ContentExtensionStyleSheet.cpp:
(WebCore::ContentExtensions::ContentExtensionStyleSheet::~ContentExtensionStyleSheet):
* contentextensions/ContentExtensionStyleSheet.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::~InlineStyleSheetOwner):
(WebCore::authorStyleSheetsForElement):

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

3 years agoASSERTION FAILED: : this != replacement()
ggaren@apple.com [Thu, 14 Jul 2016 20:54:37 +0000 (20:54 +0000)]
ASSERTION FAILED: : this != replacement()
https://bugs.webkit.org/show_bug.cgi?id=159779

Reviewed by Michael Saboff.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::jettison): If we jettison during GC, and our owner
is dead, we choose not to replace ourselves. (See
https://bugs.webkit.org/show_bug.cgi?id=159588.) So, it's possible to
invalidate and still be our owner's CodeBlock. Relax our ASSERT to allow
for this.

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

3 years agoFix the !ENABLE(WEB_SOCKETS) build after r202930
ossy@webkit.org [Thu, 14 Jul 2016 20:14:22 +0000 (20:14 +0000)]
Fix the !ENABLE(WEB_SOCKETS) build after r202930
https://bugs.webkit.org/show_bug.cgi?id=159768

Reviewed by Alex Christensen.

Source/WebCore:

* loader/EmptyClients.cpp:
* loader/EmptyClients.h:
* page/SocketProvider.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):

Source/WebKit/mac:

* Misc/WebSocketProvider.h:

Source/WebKit/win:

* WebSocketProvider.h:

Source/WebKit2:

* WebProcess/Network/WebSocketProvider.h:

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

3 years agoAdd test to confirm we do not crash in media destruction
bfulgham@apple.com [Thu, 14 Jul 2016 19:46:14 +0000 (19:46 +0000)]
Add test to confirm we do not crash in media destruction
https://bugs.webkit.org/show_bug.cgi?id=122816

Test based on a Blink change (patch by <igor.o@sisa.samsung.com>):
<https://chromium.googlesource.com/chromium/blink/+/7a2b2dcefbc013003487d5055eeda7a57daafa93%5E%21/#F0>

We do not seem to have the bug that prompted the Chromium source change. Adding
test case to ensure we do not introduce this problem in the future.

* editing/undo/audio-in-undo-stack-crash-expected.txt: Added.
* editing/undo/audio-in-undo-stack-crash.html: Added.

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

3 years agoAvoid an extra heap allocation when dispatching Functions to WorkQueue
cdumez@apple.com [Thu, 14 Jul 2016 19:45:22 +0000 (19:45 +0000)]
Avoid an extra heap allocation when dispatching Functions to WorkQueue
https://bugs.webkit.org/show_bug.cgi?id=158367

Reviewed by Anders Carlsson.

Avoid an extra heap allocation when dispatching Functions to WorkQueue
by adding leakCallable() / adoptCallable() functions to Function.

* wtf/Function.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):

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

3 years agoDOMIterators should be assigned a correct prototype
commit-queue@webkit.org [Thu, 14 Jul 2016 19:32:24 +0000 (19:32 +0000)]
DOMIterators should be assigned a correct prototype
https://bugs.webkit.org/show_bug.cgi?id=159115

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-14
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/headers/headers-basic.html: Updating test (changes to be upstreamed to w3c wpt repo)

Source/WebCore:

Default iterator object internal prototype property is the Iterator prototype as defined in
http://heycam.github.io/webidl/#dfn-iterator-prototype-object.
Linking DOMIterator prototype to IteratorPrototype.
This allows adding @@iterator property to the result of entries, keys and values methods.
This in turns allow doing for-of loops on them.

Covered by updated test.

* ForwardingHeaders/runtime/IteratorPrototype.h: Added.
* bindings/js/JSDOMIterator.h: Setting correct prototype and marking next prototype property as enumerable.

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

3 years agoRemove support for value iterators from JSDOMIterator
commit-queue@webkit.org [Thu, 14 Jul 2016 19:30:09 +0000 (19:30 +0000)]
Remove support for value iterators from JSDOMIterator
https://bugs.webkit.org/show_bug.cgi?id=159293

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-14
Reviewed by Chris Dumez.

Source/WebCore:

Value iterators are now handled without using DOMIterator.
Since FontFaceSet is using DOMIterator as an intermediate step towards supporting set-like,
entries and forEach implementation should be made compliant with set-like.
This means that item value should be passed instead of an index in entries iterator and forEach callback.

Covered by updated test.

* bindings/js/JSDOMIterator.h:
(WebCore::JSDOMIterator<JSWrapper>::asJS): Pass set item as entries value field.
(WebCore::appendForEachArguments): Pass set item as second parameter.
(WebCore::iteratorForEach): Remove index handling.

LayoutTests:

* fast/text/font-face-set-javascript-expected.txt:
* fast/text/font-face-set-javascript.html:

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

3 years agoFix the !ENABLE(MATHML) build after r201739
ossy@webkit.org [Thu, 14 Jul 2016 19:29:13 +0000 (19:29 +0000)]
Fix the !ENABLE(MATHML) build after r201739
https://bugs.webkit.org/show_bug.cgi?id=159767

Reviewed by Alex Christensen.

* dom/Document.cpp:
(WebCore::Document::validateCustomElementName):

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

3 years agoFix the !ENABLE(CSS_IMAGE_SET) build
ossy@webkit.org [Thu, 14 Jul 2016 19:28:29 +0000 (19:28 +0000)]
Fix the !ENABLE(CSS_IMAGE_SET) build
https://bugs.webkit.org/show_bug.cgi?id=159766

Reviewed by Alex Christensen.

* css/CSSParser.cpp:

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

3 years agoLand test expectations for rdar://problem/27353750.
ryanhaddad@apple.com [Thu, 14 Jul 2016 19:09:53 +0000 (19:09 +0000)]
Land test expectations for rdar://problem/27353750.

* platform/mac/TestExpectations:

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

3 years agoPossible crash under NavigationState::NavigationClient::processDidCrash()
cdumez@apple.com [Thu, 14 Jul 2016 18:33:22 +0000 (18:33 +0000)]
Possible crash under NavigationState::NavigationClient::processDidCrash()
https://bugs.webkit.org/show_bug.cgi?id=159773
<rdar://problem/19814215>

Reviewed by Anders Carlsson.

Add a m_navigationState.m_navigationDelegateMethods.webViewWebProcessDidCrash before
trying to call it to avoid crashing if the client does not implement it.

At the beginning of the method, we abort early only if both webViewWebContentProcessDidTerminate
and webViewWebProcessDidCrash are implemented. However, if webViewWebContentProcessDidTerminate
implemented but not webViewWebProcessDidCrash we can end up crashing as we fail to check later
on before trying to call it.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::processDidCrash):

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

3 years agoJSONObject Walker::walk must save array length before processing array elements.
mark.lam@apple.com [Thu, 14 Jul 2016 18:18:55 +0000 (18:18 +0000)]
JSONObject Walker::walk must save array length before processing array elements.
https://bugs.webkit.org/show_bug.cgi?id=153485

Reviewed by Darin Adler and Michael Saboff.

Source/JavaScriptCore:

According to https://tc39.github.io/ecma262/#sec-internalizejsonproperty,
JSON.parse() should cache the length of an array and use the cached length when
iterating array elements (see section 24.3.1.1 2.b.iii).

* runtime/JSONObject.cpp:
(JSC::Walker::walk):
* tests/stress/JSON-parse-should-cache-array-lengths.js: Added.
(toString):
(shouldBe):
(test):
(test2):

LayoutTests:

* js/JSON-parse-reviver-expected.txt:
* js/script-tests/JSON-parse-reviver.js:
- Fixed a bug in arrayReviver() where it was setting the array length to 3,
  but was immediately returning a value from the reviver for index 3.  This
  effectively forces array.length to 4.  As a result, case 4 always failed
  silently, and case 5 never executed.
- Added tracking of cases visited by the revivers so that they can be verified.

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

3 years agoCleanup of MathML headers
fred.wang@free.fr [Thu, 14 Jul 2016 17:59:17 +0000 (17:59 +0000)]
Cleanup of MathML headers
https://bugs.webkit.org/show_bug.cgi?id=159336

Reviewed by Alex Christensen.

We do some cleanup in MathML headers:
- Use #pragma once
- Use final for class that are not extended.
- Use final instead of override for virtual members that are not overridden by derived classes.
- Try and reduce the visibility of function members to private or protected as appropriate.
- Remove useless #include
- Remove useless class or friendship declaration
- Remove unused functions

No new tests, behavior is unchanged.

* mathml/MathMLElement.h:
* mathml/MathMLInlineContainerElement.h:
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.h:
* mathml/MathMLOperatorDictionary.h:
* mathml/MathMLPaddedElement.h:
* mathml/MathMLSelectElement.h:
* mathml/MathMLSpaceElement.h:
* mathml/MathMLTextElement.h:
* rendering/mathml/MathOperator.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.h:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLMath.h:
* rendering/mathml/RenderMathMLMenclose.h:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::RenderMathMLRow): Deleted. We no longer create anonymous row.
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.h:

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

3 years agoFix the DatabaseProcess build with disabled IDB
ossy@webkit.org [Thu, 14 Jul 2016 17:50:46 +0000 (17:50 +0000)]
Fix the DatabaseProcess build with disabled IDB
https://bugs.webkit.org/show_bug.cgi?id=159769

Reviewed by Alex Christensen.

* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
(WebKit::WebToDatabaseProcessConnection::didClose):

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

3 years ago[mips] Handle properly unaligned halfword load
commit-queue@webkit.org [Thu, 14 Jul 2016 17:38:16 +0000 (17:38 +0000)]
[mips] Handle properly unaligned halfword load
https://bugs.webkit.org/show_bug.cgi?id=153226

Patch by Julien Brianceau <jbriance@cisco.com> on 2016-07-14
Reviewed by Michael Catanzaro.

Waiting for the kernel to silently fix-up unaligned accesses is
not efficient, so let's provide an implementation of load16Unaligned
in mips macro assembler.

Performance improvement seen with SunSpider's regexp-dna test.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::load16Unaligned):
(JSC::MacroAssemblerMIPS::load32WithUnalignedHalfWords):

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

3 years agoPass SessionID to WebSocketHandle constructor
achristensen@apple.com [Thu, 14 Jul 2016 17:26:00 +0000 (17:26 +0000)]
Pass SessionID to WebSocketHandle constructor
https://bugs.webkit.org/show_bug.cgi?id=159772

Reviewed by Brady Eidson.

No new tests.  No change in behavior.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* platform/network/cf/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
* platform/network/curl/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/soup/SocketStreamHandle.h:

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

3 years ago[GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux...
commit-queue@webkit.org [Thu, 14 Jul 2016 15:48:12 +0000 (15:48 +0000)]
[GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux implementation
https://bugs.webkit.org/show_bug.cgi?id=159346

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-07-14
Reviewed by Antonio Gomes.

This is a follow up of r203216 to fix wrong use of Optional values.

* platform/linux/MemoryPressureHandlerLinux.cpp:

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

3 years ago[ThreadedCompositor] Build fails in debug mode after r202040
commit-queue@webkit.org [Thu, 14 Jul 2016 12:33:35 +0000 (12:33 +0000)]
[ThreadedCompositor] Build fails in debug mode after r202040
https://bugs.webkit.org/show_bug.cgi?id=159757

Patch by Hyunjun Ko <zzoon@igalia.com> on 2016-07-14
Reviewed by Michael Catanzaro.

Debug mode build failed due to call getter method, which is
removed, in ASSERT().

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::glContext): Deleted.
(WebKit::ThreadedCompositor::didChangeVisibleRect): Deleted.
(WebKit::ThreadedCompositor::renderLayerTree): Deleted.

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

3 years agoDOM value iterable interfaces should use Array prototype methods
commit-queue@webkit.org [Thu, 14 Jul 2016 11:16:17 +0000 (11:16 +0000)]
DOM value iterable interfaces should use Array prototype methods
https://bugs.webkit.org/show_bug.cgi?id=159296

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-14
Reviewed by Chris Dumez and Mark Lam.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj: Marking some header files as private so that they can be included in
WebCore.
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation): copying iterable methods (entries, forEach, keys and values) to private slots.

Source/WebCore:

Test: fast/dom/NodeList/nodelist-iterable.html
Also covered by updated layout test and binding tests.

For value iterators, copy the iterator methods from Array prototype: as per https://heycam.github.io/webidl/#es-iterable,
[re: entries] If the interface has a value iterator, then the Function object is the initial value of the "entries" data property of %ArrayPrototype% ([ECMA-262], section 6.1.7.4).
[re: keys] If the interface has a value iterator, then the Function object is the initial value of the "keys" data property of %ArrayPrototype% ([ECMA-262], section 6.1.7.4).
[re: forEach] If the interface defines an indexed property getter, then the Function object is the initial value of the "forEach" data property of %ArrayPrototype% ([ECMA-262], section 6.1.7.4).
[re: Symbol.iterator] If the interface defines an indexed property getter, then the Function object is %ArrayProto_values% ([ECMA-262], section 6.1.7.4).
[re: values] If the interface has a value iterator, then the Function object is the value of the @@iterator property.

This change applies only to NodeList at the moment.
Copy of Array prototype iterator methods is disabled if the interface has no indexed getter.

* CMakeLists.txt:
* ForwardingHeaders/builtins/BuiltinNames.h: Added.
* ForwardingHeaders/builtins/JSCBuiltins.h: Added.
* ForwardingHeaders/runtime/CommonIdentifiers.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMIterator.cpp: Added.
(WebCore::addValueIterableMethods): Copy iterator methods from array prototype.
* bindings/js/JSDOMIterator.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
(GenerateImplementation):
(IsValueIterableInterface): Introduced to only copy iterator methods if the interface has an indexed getter.
(IsKeyValueIterableInterface): Introduced to detect whether generating iterator methods.
(GenerateImplementationIterableFunctions):
* bindings/scripts/test/GObject/WebKitDOMTestIterable.cpp: Added.
* bindings/scripts/test/GObject/WebKitDOMTestIterable.h: Added.
* bindings/scripts/test/GObject/WebKitDOMTestIterablePrivate.h: Added.
* bindings/scripts/test/JS/JSTestIterable.cpp: Added.
* bindings/scripts/test/JS/JSTestIterable.h: Added.
* bindings/scripts/test/JS/JSTestObj.cpp: Updated as TestObj defines both iterable<> and indexed getter.
* bindings/scripts/test/ObjC/DOMTestIterable.h: Added.
* bindings/scripts/test/ObjC/DOMTestIterable.mm: Added.
* bindings/scripts/test/ObjC/DOMTestIterableInternal.h: Added.
* bindings/scripts/test/TestIterable.idl: Added to handle the case of value iterator without indexed getter defined.
Array prototype methods should not be copied.
* bindings/scripts/test/TestObj.idl: Changing to be a value iterator (with indexed getter already defined).
Array prototype methods should be copied.

LayoutTests:

* fast/dom/nodeListIterator-expected.txt:
* fast/dom/nodeListIterator.html:
* fast/dom/NodeList/nodelist-iterable-expected.txt: Added.
* fast/dom/NodeList/nodelist-iterable.html: Added.

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

3 years ago[Fetch API] Request and Response url getter should use URL serialization
commit-queue@webkit.org [Thu, 14 Jul 2016 10:14:53 +0000 (10:14 +0000)]
[Fetch API] Request and Response url getter should use URL serialization
https://bugs.webkit.org/show_bug.cgi?id=159705

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-14
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/response-url-expected.txt: Added.
* web-platform-tests/fetch/api/basic/response-url-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/response-url-worker.html: Added.
* web-platform-tests/fetch/api/basic/response-url.html: Added.
* web-platform-tests/fetch/api/basic/response-url.js: Added.
(checkResponseURL):
* web-platform-tests/fetch/api/request/request-init-003.sub-expected.txt:
* web-platform-tests/fetch/api/request/request-init-003.sub.html:

Source/WebCore:

Tests: fetch/fetch-url-serialization.html
       imported/w3c/web-platform-tests/fetch/api/basic/response-url-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/response-url.html

Implementing https://url.spec.whatwg.org/#concept-url-serializer and applying it to Request and Response getter.
Adding a temporary routine to compute url cannot-be-a-base-url flag. The parsing routine should store that
information in the URL itself.

Added tests to cover serialization routine. Failing tests are mostly due to limitations of the URL parser.
Tests do not check for URLs with username and password as Request constructor throws with such URLs.

* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::url): Adding request url serialization, fragment included.
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::url): Adding response url serialization, fragment excluded.
* Modules/fetch/FetchResponse.h:
* platform/URL.cpp:
(WebCore::cannotBeABaseURL): Temporary helper function to have a coarse evaluation of url cannot-be-a-base-url flag.
(WebCore::URL::serialize): Implementation of https://url.spec.whatwg.org/#concept-url-serializer.
* platform/URL.h:
(WebCore::URL::hasUser): Helper getter.
(WebCore::URL::hasPassword): Ditto.
(WebCore::URL::hasQuery): Ditto.
(WebCore::URL::hasFragment): Ditto.

LayoutTests:

* fetch/fetch-url-serialization-expected.txt: Added.
* fetch/fetch-url-serialization.html: Added.
* fetch/fetch-urls.json: Added.

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

3 years ago[css-grid] Const-ify track sizing algorithm
svillar@igalia.com [Thu, 14 Jul 2016 08:36:10 +0000 (08:36 +0000)]
[css-grid] Const-ify track sizing algorithm
https://bugs.webkit.org/show_bug.cgi?id=159716

Reviewed by Carlos Garcia Campos.

All the methods used to run the track sizing algorithm should not
modify the state of LayoutGrid. We can safely const-ify all of them
and remove the ugly const_cast in computeIntrinsicLogicalWidths().

No new tests needed as there is no change in behavior.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::logicalHeightForChild):
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::updateOverrideContainingBlockContentLogicalWidthForChild):
(WebCore::RenderGrid::minContentForChild):
(WebCore::RenderGrid::maxContentForChild):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
(WebCore::RenderGrid::distributeSpaceToTracks):
* rendering/RenderGrid.h:

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

3 years agoREGRESSION (r202918): LayoutTest media/video-main-content-allow-then-deny.html is...
jer.noble@apple.com [Thu, 14 Jul 2016 07:54:21 +0000 (07:54 +0000)]
REGRESSION (r202918): LayoutTest media/video-main-content-allow-then-deny.html is flaky, failing almost every time on El Capitan
https://bugs.webkit.org/show_bug.cgi?id=159533

Reviewed by Eric Carlson.

Source/WebCore:

Move the contents of mainContentCheckTimerFired() into updateIsMainContent() so that the
results of changing the m_isMainContent ivar are acted upon no matter why m_isMainContent
changes.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::mainContentCheckTimerFired):
(WebCore::MediaElementSession::updateIsMainContent):

LayoutTests:

* platform/mac/TestExpectations:

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

3 years agoRebaseline test after r203204 and r203207.
achristensen@apple.com [Thu, 14 Jul 2016 07:29:29 +0000 (07:29 +0000)]
Rebaseline test after r203204 and r203207.

* js/typed-array-mutated-during-set-expected.txt:

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

3 years agoModernize WebSocket handle
achristensen@apple.com [Thu, 14 Jul 2016 07:05:40 +0000 (07:05 +0000)]
Modernize WebSocket handle
https://bugs.webkit.org/show_bug.cgi?id=159750

Reviewed by Brady Eidson.

Source/WebCore:

No new tests.  No change in behavior.
This patch just removes ThreadableWebSocketChannel::InvalidMessage which is never used
and makes our use of SocketStreamHandleClient a reference instead of a pointer.

* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::send):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* platform/network/SocketStreamHandleBase.cpp:
(WebCore::SocketStreamHandleBase::SocketStreamHandleBase):
(WebCore::SocketStreamHandleBase::send):
(WebCore::SocketStreamHandleBase::disconnect):
(WebCore::SocketStreamHandleBase::sendPendingData):
(WebCore::SocketStreamHandleBase::setClient): Deleted.
* platform/network/SocketStreamHandleBase.h:
(WebCore::SocketStreamHandleBase::~SocketStreamHandleBase):
(WebCore::SocketStreamHandleBase::bufferedAmount):
(WebCore::SocketStreamHandleBase::client):
* platform/network/cf/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::addCONNECTCredentials):
(WebCore::SocketStreamHandle::copyCFStreamDescription):
(WebCore::SocketStreamHandle::readStreamCallback):
(WebCore::SocketStreamHandle::writeStreamCallback):
(WebCore::SocketStreamHandle::reportErrorToClient):
(WebCore::SocketStreamHandle::~SocketStreamHandle):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::SocketStreamHandle::port):
* platform/network/curl/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/curl/SocketStreamHandleCurl.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::SocketStreamHandle::readData):
(WebCore::SocketStreamHandle::didReceiveData):
(WebCore::SocketStreamHandle::didOpenSocket):
(WebCore::SocketStreamHandle::createCopy):
* platform/network/soup/SocketStreamHandle.h:
* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::~SocketStreamHandle):
(WebCore::SocketStreamHandle::connected):
(WebCore::SocketStreamHandle::connectedCallback):
(WebCore::SocketStreamHandle::readBytes):
(WebCore::SocketStreamHandle::didFail):
(WebCore::SocketStreamHandle::writeReady):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::SocketStreamHandle::beginWaitingForSocketWritability):

Source/WebKit2:

* UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
(WebKit::connectionCallback):

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

3 years ago[GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux...
carlosgc@webkit.org [Thu, 14 Jul 2016 06:36:25 +0000 (06:36 +0000)]
[GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux implementation
https://bugs.webkit.org/show_bug.cgi?id=159346

Reviewed by Antonio Gomes.

The eventFD file descriptor is pollable, so it would be much better to use a poll instead of a blocking read in
a secondary thread and then communicate back to the main thread. This is very easy to do with GSource in GLib,
so we could use that when GLib is available and keep the current implementation as a fallback.

* platform/MemoryPressureHandler.cpp:
(WebCore::m_holdOffTimer): Use a RunLoop timer.
* platform/MemoryPressureHandler.h:
* platform/linux/MemoryPressureHandlerLinux.cpp:
(WebCore::MemoryPressureHandler::EventFDPoller::EventFDPoller): Helper class do the eventFD polling.
(WebCore::MemoryPressureHandler::logErrorAndCloseFDs): Check if file descriptors are -1 not 0.
(WebCore::MemoryPressureHandler::install): Return early also if the hold off timer is active. Use EventFDPoller
to do the polling.
(WebCore::MemoryPressureHandler::uninstall): Stop the hold off timer and clear the EventFDPoller.

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

3 years agoREGRESSION(r202273): [GTK] Redirected X window is resized to the previous size on...
carlosgc@webkit.org [Thu, 14 Jul 2016 06:34:08 +0000 (06:34 +0000)]
REGRESSION(r202273): [GTK] Redirected X window is resized to the previous size on size allocate
https://bugs.webkit.org/show_bug.cgi?id=159551

Reviewed by Michael Catanzaro.

In r202273 I added webkitWebViewBaseResizeRedirectedWindow() helper to remove duplicated code in all places
where we were resizing the redirected window to the current drawing area size. But on size allocate, we were
updating the redirected window first, and then the drawing area, to ensure that when the drawing area notifies
the web process the redirected window is already at the new size. This regression doesn't have any visual
effect, because we are ensure the right size always before rendering, but there's a small extra resize in this case.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSizeAllocate): Resize the redirected window before updating the drawing area size.

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

3 years agoTest WTF.StringViewIterators is crashing since r203119
carlosgc@webkit.org [Thu, 14 Jul 2016 06:17:36 +0000 (06:17 +0000)]
Test WTF.StringViewIterators is crashing since r203119
https://bugs.webkit.org/show_bug.cgi?id=159710

Reviewed by Darin Adler.

There are two problems in the test case added in r203119. First is that it's testing
StringView::CodeUnits::Iterator instead of StringView::CodePoints::Iterator, and second is that
StringView::codePoints() returns a temporary, so the iterator created from the temporary ends up pointing to a
const reference to the string view member of the deleted CodePoints object.

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

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

3 years agoFix the magic numbers for ARM traditional in InlineAccess.h
ossy@webkit.org [Thu, 14 Jul 2016 05:24:43 +0000 (05:24 +0000)]
Fix the magic numbers for ARM traditional in InlineAccess.h
https://bugs.webkit.org/show_bug.cgi?id=159708

Reviewed by Saam Barati.

* bytecode/InlineAccess.h:
(JSC::InlineAccess::sizeForPropertyAccess):
(JSC::InlineAccess::sizeForPropertyReplace):
(JSC::InlineAccess::sizeForLengthAccess):

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

3 years agoRebaseline EFL and Windows MathML tests after r203171
fred.wang@free.fr [Thu, 14 Jul 2016 04:55:27 +0000 (04:55 +0000)]
Rebaseline EFL and Windows MathML tests after r203171

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-13

* platform/efl/mathml/opentype/horizontal-expected.txt:
* platform/efl/mathml/opentype/horizontal-munderover-expected.txt:
* platform/efl/mathml/opentype/large-operators-expected.txt:
* platform/efl/mathml/opentype/opentype-stretchy-expected.txt:
* platform/efl/mathml/opentype/opentype-stretchy-horizontal-expected.txt:
* platform/efl/mathml/opentype/vertical-expected.txt:
* platform/efl/mathml/presentation/menclose-notation-default-longdiv-expected.txt:
* platform/efl/mathml/presentation/menclose-notation-values-expected.txt:
* platform/efl/mathml/presentation/mo-stretch-expected.txt:
* platform/efl/mathml/presentation/mspace-children-expected.txt:
* platform/efl/mathml/presentation/roots-expected.txt:
* platform/efl/mathml/radical-fallback-expected.txt:
* platform/win/mathml/mathml-in-dashboard-expected.txt:
* platform/win/mathml/opentype/horizontal-expected.txt:
* platform/win/mathml/opentype/horizontal-munderover-expected.txt:
* platform/win/mathml/opentype/large-operators-expected.txt:
* platform/win/mathml/opentype/opentype-stretchy-expected.txt:
* platform/win/mathml/opentype/opentype-stretchy-horizontal-expected.txt:
* platform/win/mathml/opentype/vertical-expected.txt:
* platform/win/mathml/presentation/menclose-notation-default-longdiv-expected.txt:
* platform/win/mathml/presentation/mo-stretch-expected.txt:
* platform/win/mathml/presentation/mspace-children-expected.txt:
* platform/win/mathml/presentation/roots-expected.txt:
* platform/win/mathml/radical-fallback-expected.txt:

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

3 years ago[CSS][ARMv7] :nth-child() do not reserve enough registers if it is in backtracking...
benjamin@webkit.org [Thu, 14 Jul 2016 03:45:13 +0000 (03:45 +0000)]
[CSS][ARMv7] :nth-child() do not reserve enough registers if it is in backtracking chain
https://bugs.webkit.org/show_bug.cgi?id=159746
rdar://problem/26156169

Reviewed by Andreas Kling.

The generator generateElementIsNthChild() requires 6 registers in style resolution
to mark previous siblings with generateAddStyleRelationIfResolvingStyle() in the loop.

We were only reserving 5, which is a problem is the sixth is taken by the backtracking
register. x86_64 was already requiring 6 for unrelated reasons and ARM64 has so many registers
that you cannot possibly run out of them in CSS JIT.

I generalized the x86_64 path to all architectures.
I did not limit this case to style resolution because the extra register is irrelevant
in most cases. The only difference is one extra push/pop on ARMv7 if you use querySelector
with :nth-child in a backtracking chain.

This problem is covered by the existing test fast/selectors/nth-child-with-backtracking.html

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::minimumRegisterRequirements): Deleted.

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

3 years agoDrop unnecessary check from ContainerNode::removeChild()
cdumez@apple.com [Thu, 14 Jul 2016 03:43:07 +0000 (03:43 +0000)]
Drop unnecessary check from ContainerNode::removeChild()
https://bugs.webkit.org/show_bug.cgi?id=159747

Reviewed by Andreas Kling.

Drop unnecessary check from ContainerNode::removeChild() to make sure that
the parent of the node being removed is |this|. We already do this check
a few lines above. The only thing that happens in between is the ref'ing
of the node, which does not cause any JS execution.

This check was introduced in r55783 because there used to be a call to
document()->removeFocusedNodeOfSubtree(child.get());
between the two checks. However, this call has been removed since then
and the extra parentNode() check was left in.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChild): Deleted.

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

3 years ago[iOS] Copy WebKitTestRunnerInjectedBundle.bundle into PlugIns subdirectory and code...
dbates@webkit.org [Thu, 14 Jul 2016 02:38:07 +0000 (02:38 +0000)]
[iOS] Copy WebKitTestRunnerInjectedBundle.bundle into PlugIns subdirectory and code sign it
https://bugs.webkit.org/show_bug.cgi?id=159738
<rdar://problem/27304649>

Reviewed by Dan Bernstein.

The bundle WebKitTestRunnerInjectedBundle.bundle contains executable code and should be
code signed if applicable. We should also copy this bundle into the PlugIns subdirectory
of the WebKitTestRunnerApp.app bundle instead of the top-level bundle directory as the
PlugIns subdirectory is the directory where loadable bundles of an app are expected to live.

* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::initializeInjectedBundlePath): Modified code to look for the
bundle WebKitTestRunnerInjectedBundle.bundle in the plugin directory of the main bundle.

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

3 years agoAddressing post-review comments after r203119
mmaxfield@apple.com [Thu, 14 Jul 2016 02:01:33 +0000 (02:01 +0000)]
Addressing post-review comments after r203119
https://bugs.webkit.org/show_bug.cgi?id=159749

Unreviewed.

* wtf/text/StringView.h:
(WTF::StringView::CodePoints::Iterator::Iterator):
(WTF::StringView::CodePoints::Iterator::operator*):
(WTF::StringView::CodePoints::Iterator::operator==):

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

3 years agoUnreviewed, rebaseline tests for ES6 TypedArray behavior.
keith_miller@apple.com [Thu, 14 Jul 2016 01:45:18 +0000 (01:45 +0000)]
Unreviewed, rebaseline tests for ES6 TypedArray behavior.

* js/typed-array-mutated-during-set-expected.txt:
* js/typed-array-mutated-during-set.html:

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

3 years agoYARR uses mixture of int and unsigned values to index into subject string
msaboff@apple.com [Thu, 14 Jul 2016 01:20:11 +0000 (01:20 +0000)]
YARR uses mixture of int and unsigned values to index into subject string
https://bugs.webkit.org/show_bug.cgi?id=159744

Reviewed by Benjamin Poulain.

In most cases, we refer to characters in subject strings using a negative index from the number of
"checked" characters in a subject string.  The required length is compared against the actual length
and then we use that required length as the checked amount.  For example, when matching the string of
4 digits in the RegExp /abc \d{4}/, we know that need 8 characters in the subject string.  We refer
to the digits part of the expression from an already checked index of 8 and use negative offsets of
-4 through -1.  In many cases we used a signed int for the negative offsets.  There are other cases
where we used unsigned values as the amount of negative offset to use when accessing subject characters.

Changed all occurrances of character offsets to unsigned or Checked Arithmetic unsigned values.  Note
that the pre-existing Checked class is used in other places to check for under/overflow with arithmetic
operations.  Those unsigned offsets are always the number of characters before (negative) from the
current checked character offset.  Also added some asserts for cases where arithmetic is not protected
by other checks or with Checked<> wrapped values.

In the case of the JIT, subject characters are accessed using base with scaled index and offset
addressing.  The MacroAssembler provides this addressing using the BaseIndex struct.  The offset for
this struct is a 32 bit signed quantity.  Since we only care about negative offsets, we really only
have 31 bits.  Changed the generation of a BaseOffset address to handle the case when the offset and
scaled combination will exceed the 31 bits of negative offset.  This is done by moving the base value
into a temp register and biasing the temp base and offset to smaller values so that we can emit
instructions that can reference characters without exceeding the 31 bits of negative offset.

To abstract the character address generation, put the base with scaled index and offset into
one function and used that function everywhere the YARR JIT wants to access subject characters.
Also consilidated a few cases where we were generating inline what readCharacter() does.  Usually
this was due to using a different index register.

Added a new regression test.

* tests/stress/regress-159744.js: Added regression test.
(testRegExp):
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::recordParenthesesMatch):
(JSC::Yarr::Interpreter::resetMatches):
(JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
(JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
(JSC::Yarr::ByteCompiler::closeBodyAlternative):
(JSC::Yarr::ByteCompiler::atomParenthesesSubpatternEnd):
(JSC::Yarr::ByteCompiler::atomParenthesesOnceEnd):
(JSC::Yarr::ByteCompiler::atomParenthesesTerminalEnd):
(JSC::Yarr::ByteCompiler::emitDisjunction):
* yarr/YarrInterpreter.h:
(JSC::Yarr::ByteTerm::ByteTerm):
(JSC::Yarr::ByteTerm::BOL):
(JSC::Yarr::ByteTerm::UncheckInput):
(JSC::Yarr::ByteTerm::EOL):
(JSC::Yarr::ByteTerm::WordBoundary):
(JSC::Yarr::ByteTerm::BackReference):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::notAtEndOfInput):
(JSC::Yarr::YarrGenerator::negativeOffsetIndexedAddress):
(JSC::Yarr::YarrGenerator::readCharacter):
(JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
(JSC::Yarr::YarrGenerator::storeToFrame):
(JSC::Yarr::YarrGenerator::generateAssertionBOL):
(JSC::Yarr::YarrGenerator::backtrackAssertionBOL):
(JSC::Yarr::YarrGenerator::generateAssertionEOL):
(JSC::Yarr::YarrGenerator::matchAssertionWordchar):
(JSC::Yarr::YarrGenerator::generateAssertionWordBoundary):
(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
(JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
(JSC::Yarr::YarrGenerator::generatePatternCharacterGreedy):
(JSC::Yarr::YarrGenerator::backtrackPatternCharacterNonGreedy):
(JSC::Yarr::YarrGenerator::generateCharacterClassOnce):
(JSC::Yarr::YarrGenerator::generateCharacterClassFixed):
(JSC::Yarr::YarrGenerator::generateCharacterClassGreedy):
(JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):
(JSC::Yarr::YarrGenerator::generate):
(JSC::Yarr::YarrGenerator::backtrack):
(JSC::Yarr::YarrGenerator::YarrGenerator):
* yarr/YarrPattern.h:
(JSC::Yarr::PatternTerm::PatternTerm):

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

3 years agoCrashes with detached ArrayBuffers
keith_miller@apple.com [Thu, 14 Jul 2016 00:15:03 +0000 (00:15 +0000)]
Crashes with detached ArrayBuffers
https://bugs.webkit.org/show_bug.cgi?id=157088
<rdar://problem/27327362>

Reviewed by Filip Pizlo.

TypedArray.prototype.fill was incorrect because it should perform
ToNumber coercion each time it tries to store the
object. Currently, we only perform the coercion once at the
beginning of the loop. If we find that we need to improve the
performance of this function, we can add a faster C++ path back
that only handles the primitive case.

This patch also moves the isNeutered() checks from put and
putByIndex into setIndex. This fixes an issue where setIndex might
store to a no longer valid offset.

* builtins/TypedArrayPrototype.js:
(globalPrivate.typedArrayClampArgumentToStartOrEnd):
(fill):
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::setIndexQuickly):
(JSC::JSGenericTypedArrayView::setIndex):
(JSC::JSGenericTypedArrayView::setRangeToValue): Deleted.
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::put): Deleted.
(JSC::JSGenericTypedArrayView<Adaptor>::putByIndex): Deleted.
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncFill): Deleted.
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSTypedArrayViewPrototype::finishCreation):
(JSC::typedArrayViewProtoFuncFill): Deleted.
* tests/stress/typedarray-fill.js:
* tests/stress/typedarray-functions-with-neutered.js:
(defaultForArg):
(test2):
(checkArgumentsForType): Deleted.
(checkArguments): Deleted.

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

3 years agoAttempted build fix.
bdakin@apple.com [Thu, 14 Jul 2016 00:12:58 +0000 (00:12 +0000)]
Attempted build fix.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

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

3 years agoSome bad unicode regex escapes aren't flagged as errors
msaboff@apple.com [Thu, 14 Jul 2016 00:11:56 +0000 (00:11 +0000)]
Some bad unicode regex escapes aren't flagged as errors
https://bugs.webkit.org/show_bug.cgi?id=158080

Reviewed by Saam Barati.

Source/JavaScriptCore:

If we have a partial unicode escape, eg /\u{1/u or /\u12|abc/u, we
didn't check for the closing '}' and processed the unicode escape with
the hex value provided.

Added a check that we properly terminated a \u{} unicode escape.
If we fail that check and there isn't a prior error, we record that we
have an invalid unicode escape.  The next existing line in the code will
terminate parsing and bubble up the error.

* yarr/YarrParser.h:
(JSC::Yarr::Parser::parseEscape):

LayoutTests:

New tests.

* js/regress-158080.html: Added.
* js/script-tests/regress-158080.js: Added.

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

3 years agoImport W3C WebCryptoAPI tests
jiewen_tan@apple.com [Thu, 14 Jul 2016 00:08:29 +0000 (00:08 +0000)]
Import W3C WebCryptoAPI tests
https://bugs.webkit.org/show_bug.cgi?id=159636

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* WebCryptoAPI/OWNERS: Added.
* WebCryptoAPI/README.md: Added.
* WebCryptoAPI/WebCryptoAPI.idl: Added.
* WebCryptoAPI/digest/digest.js: Added.
(run_test.):
(run_test.copyBuffer):
(run_test.equalBuffers):
(run_test):
* WebCryptoAPI/digest/digest.worker.js: Added.
* WebCryptoAPI/digest/test_digest-expected.txt: Added.
* WebCryptoAPI/digest/test_digest.html: Added.
* WebCryptoAPI/digest/w3c-import.log: Added.
* WebCryptoAPI/encrypt_decrypt/aes.js: Added.
(run_test.):
(run_test.importVectorKey):
(run_test):
(run_test.equalBuffers):
* WebCryptoAPI/encrypt_decrypt/aes_cbc.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/aes_cbc_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/aes_ctr.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/aes_ctr_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/aes_gcm.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/aes_gcm_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/rsa.js: Added.
(run_test.):
(run_test.else):
(run_test.importVectorKeys):
(run_test.copyBuffer):
(run_test.equalBuffers):
(run_test):
* WebCryptoAPI/encrypt_decrypt/rsa.worker.js: Added.
* WebCryptoAPI/encrypt_decrypt/rsa_vectors.js: Added.
(getTestVectors):
* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_cbc.html: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr.html: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm.html: Added.
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt: Added.
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep.html: Added.
* WebCryptoAPI/encrypt_decrypt/w3c-import.log: Added.
* WebCryptoAPI/generateKey/failures.js: Added.
(run_test.parameterString):
(run_test.testError):
(run_test):
(run_test.invalidUsages):
(run_test.):
* WebCryptoAPI/generateKey/failures.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-CBC.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-CTR.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-GCM.worker.js: Added.
* WebCryptoAPI/generateKey/failures_AES-KW.worker.js: Added.
* WebCryptoAPI/generateKey/failures_ECDH.worker.js: Added.
* WebCryptoAPI/generateKey/failures_ECDSA.worker.js: Added.
* WebCryptoAPI/generateKey/failures_HMAC.worker.js: Added.
* WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.js: Added.
* WebCryptoAPI/generateKey/failures_RSA-PSS.worker.js: Added.
* WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.js: Added.
* WebCryptoAPI/generateKey/successes.js: Added.
(run_test.parameterString):
(run_test.):
(run_test.testSuccess):
(run_test):
* WebCryptoAPI/generateKey/successes.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-CBC.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-CTR.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-GCM.worker.js: Added.
* WebCryptoAPI/generateKey/successes_AES-KW.worker.js: Added.
* WebCryptoAPI/generateKey/successes_ECDH.worker.js: Added.
* WebCryptoAPI/generateKey/successes_ECDSA.worker.js: Added.
* WebCryptoAPI/generateKey/successes_HMAC.worker.js: Added.
* WebCryptoAPI/generateKey/successes_RSA-OAEP.worker.js: Added.
* WebCryptoAPI/generateKey/successes_RSA-PSS.worker.js: Added.
* WebCryptoAPI/generateKey/successes_RSASSA-PKCS1-v1_5.worker.js: Added.
* WebCryptoAPI/generateKey/test_aes-cbc-expected.txt: Added.
* WebCryptoAPI/generateKey/test_aes-cbc.html: Added.
* WebCryptoAPI/generateKey/test_aes-ctr-expected.txt: Added.
* WebCryptoAPI/generateKey/test_aes-ctr.html: Added.
* WebCryptoAPI/generateKey/test_failures-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CBC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CBC.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CTR-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-CTR.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-GCM-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-GCM.html: Added.
* WebCryptoAPI/generateKey/test_failures_AES-KW-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_AES-KW.html: Added.
* WebCryptoAPI/generateKey/test_failures_ECDH-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_ECDH.html: Added.
* WebCryptoAPI/generateKey/test_failures_ECDSA-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_ECDSA.html: Added.
* WebCryptoAPI/generateKey/test_failures_HMAC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_HMAC.html: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-OAEP-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-OAEP.html: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-PSS-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_RSA-PSS.html: Added.
* WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5-expected.txt: Added.
* WebCryptoAPI/generateKey/test_failures_RSASSA-PKCS1-v1_5.html: Added.
* WebCryptoAPI/generateKey/test_successes-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CBC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CBC.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CTR-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-CTR.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-GCM-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-GCM.html: Added.
* WebCryptoAPI/generateKey/test_successes_AES-KW-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_AES-KW.html: Added.
* WebCryptoAPI/generateKey/test_successes_ECDH-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_ECDH.html: Added.
* WebCryptoAPI/generateKey/test_successes_ECDSA-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_ECDSA.html: Added.
* WebCryptoAPI/generateKey/test_successes_HMAC-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_HMAC.html: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-OAEP-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-OAEP.html: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-PSS-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_RSA-PSS.html: Added.
* WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5-expected.txt: Added.
* WebCryptoAPI/generateKey/test_successes_RSASSA-PKCS1-v1_5.html: Added.
* WebCryptoAPI/generateKey/w3c-import.log: Added.
* WebCryptoAPI/getRandomValues.js: Added.
(run_test.):
(run_test):
* WebCryptoAPI/getRandomValues.worker.js: Added.
* WebCryptoAPI/idlharness-expected.txt: Added.
* WebCryptoAPI/idlharness.html: Added.
* WebCryptoAPI/idlharness.worker.js: Added.
(request.onload):
* WebCryptoAPI/test_getRandomValues-expected.txt: Added.
* WebCryptoAPI/test_getRandomValues.html: Added.
* WebCryptoAPI/tools/generate.py: Added.
* WebCryptoAPI/tools/w3c-import.log: Added.
* WebCryptoAPI/util/helpers.js: Added.
(allNonemptySubsetsOf):
(objectToString.):
(objectToString):
(assert_goodCryptoKey):
(allAlgorithmSpecifiersFor):
(allValidUsages):
(allNameVariants):
* WebCryptoAPI/util/w3c-import.log: Added.
* WebCryptoAPI/w3c-import.log: Added.

LayoutTests:

* TestExpectations:
Skip test cases for unimplemented features.

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

3 years agoUnreviewed, rolling out r203199.
cdumez@apple.com [Wed, 13 Jul 2016 23:54:23 +0000 (23:54 +0000)]
Unreviewed, rolling out r203199.

Broke the build

Reverted changeset:

"Crashes with detached ArrayBuffers"
https://bugs.webkit.org/show_bug.cgi?id=157088
http://trac.webkit.org/changeset/203199

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

3 years agoCrashes with detached ArrayBuffers
keith_miller@apple.com [Wed, 13 Jul 2016 23:38:44 +0000 (23:38 +0000)]
Crashes with detached ArrayBuffers
https://bugs.webkit.org/show_bug.cgi?id=157088
<rdar://problem/27327362>

Reviewed by Filip Pizlo.

TypedArray.prototype.fill was incorrect because it should perform
ToNumber coercion each time it tries to store the
object. Currently, we only perform the coercion once at the
beginning of the loop. If we find that we need to improve the
performance of this function, we can add a faster C++ path back
that only handles the primitive case.

This patch also moves the isNeutered() checks from put and
putByIndex into setIndex. This fixes an issue where setIndex might
store to a no longer valid offset.

* builtins/TypedArrayPrototype.js:
(globalPrivate.typedArrayClampArgumentToStartOrEnd):
(fill):
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::setIndexQuickly):
(JSC::JSGenericTypedArrayView::setIndex):
(JSC::JSGenericTypedArrayView::setRangeToValue): Deleted.
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::put): Deleted.
(JSC::JSGenericTypedArrayView<Adaptor>::putByIndex): Deleted.
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncFill): Deleted.
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSTypedArrayViewPrototype::finishCreation):
(JSC::typedArrayViewProtoFuncFill): Deleted.
* tests/stress/typedarray-fill.js:
* tests/stress/typedarray-functions-with-neutered.js:
(defaultForArg):
(test2):
(checkArgumentsForType): Deleted.
(checkArguments): Deleted.

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

3 years agoUncaught Exception: TypeError: null is not an object (evaluating 'this._contentViewCo...
mattbaker@apple.com [Wed, 13 Jul 2016 23:33:39 +0000 (23:33 +0000)]
Uncaught Exception: TypeError: null is not an object (evaluating 'this._contentViewContainer.currentContentView.showsFilterBar')
https://bugs.webkit.org/show_bug.cgi?id=159696
<rdar://problem/27312356>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._contentViewSelectionPathComponentDidChange):
Early return if content view not visible, since the event is sent during
tab teardown and the current TimelineView may be invalid.

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

3 years agoRemove test-results.
lforschler@apple.com [Wed, 13 Jul 2016 22:43:30 +0000 (22:43 +0000)]
Remove test-results.

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

3 years ago[WK2] Use more references for connections
cdumez@apple.com [Wed, 13 Jul 2016 22:42:46 +0000 (22:42 +0000)]
[WK2] Use more references for connections
https://bugs.webkit.org/show_bug.cgi?id=159739

Reviewed by Alex Christensen.

Use more references for connections to make it more obvious they cannot
be null.

* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::DatabaseToWebProcessConnection):
* DatabaseProcess/DatabaseToWebProcessConnection.h:
(WebKit::DatabaseToWebProcessConnection::connection):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::connection):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::messageSenderConnection):
* Shared/mac/CookieStorageShim.mm:
(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
(WebKit::preregisterSandboxExtensionsIfNecessary):
* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
(WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection):
* WebProcess/Databases/WebToDatabaseProcessConnection.h:
(WebKit::WebToDatabaseProcessConnection::connection):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::blobSize):
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::NetworkProcessConnection):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
* WebProcess/Network/NetworkProcessConnection.h:
(WebKit::NetworkProcessConnection::connection):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::remove):
(WebKit::WebLoaderStrategy::setDefersLoading):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::createPingHandle):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::messageSenderConnection):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):
(WebKit::WebPlatformStrategies::addCookie):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
(WebKit::WebProcess::networkConnection):
(WebKit::WebProcess::prefetchDNS):
* WebProcess/WebProcess.h:

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

3 years agoMove WKPreferencesRef functions to the correct file
andersca@apple.com [Wed, 13 Jul 2016 22:40:49 +0000 (22:40 +0000)]
Move WKPreferencesRef functions to the correct file
https://bugs.webkit.org/show_bug.cgi?id=159741

Reviewed by Sam Weinig.

Also, get rid of WKPreferencesGetPaymentsEnabled and WKPreferencesSetPaymentsEnabled.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetApplePayEnabled):
(WKPreferencesSetApplePayEnabled):
(WKPreferencesGetApplePayCapabilityDisclosureAllowed):
(WKPreferencesSetApplePayCapabilityDisclosureAllowed):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WKPreferencesGetApplePayEnabled): Deleted.
(WKPreferencesSetApplePayEnabled): Deleted.
(WKPreferencesGetApplePayCapabilityDisclosureAllowed): Deleted.
(WKPreferencesSetApplePayCapabilityDisclosureAllowed): Deleted.
(WKPreferencesGetPaymentsEnabled): Deleted.
(WKPreferencesSetPaymentsEnabled): Deleted.

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

3 years agoRemove duplicated TestExpectation for perf/rel-list-remove.html on ios-simulator
ryanhaddad@apple.com [Wed, 13 Jul 2016 22:18:32 +0000 (22:18 +0000)]
Remove duplicated TestExpectation for perf/rel-list-remove.html on ios-simulator

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

3 years agoTest gardening for fast/text/font-face-javascript.html
mmaxfield@apple.com [Wed, 13 Jul 2016 22:02:01 +0000 (22:02 +0000)]
Test gardening for fast/text/font-face-javascript.html
https://bugs.webkit.org/show_bug.cgi?id=156631

Unreviewed.

* TestExpectations:
* fast/text/font-face-javascript-expected.txt:
* fast/text/font-face-javascript.html:

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

3 years agoAdd _applePayCapabilityDisclosureAllowed SPI declaration
andersca@apple.com [Wed, 13 Jul 2016 21:58:56 +0000 (21:58 +0000)]
Add _applePayCapabilityDisclosureAllowed SPI declaration
https://bugs.webkit.org/show_bug.cgi?id=159740

Reviewed by Dan Bernstein.

Also, delete an old method that is no longer used.

* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _paymentsEnabled]): Deleted.
(-[WKWebViewConfiguration _setPaymentsEnabled:]): Deleted.

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

3 years agoMarking imported/blink/storage/indexeddb/blob-valid-after-deletion.html as flaky...
ryanhaddad@apple.com [Wed, 13 Jul 2016 21:42:53 +0000 (21:42 +0000)]
Marking imported/blink/storage/indexeddb/blob-valid-after-deletion.html as flaky on Mac and ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=158640

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoBlank news article on kottke.org
zalan@apple.com [Wed, 13 Jul 2016 21:33:12 +0000 (21:33 +0000)]
Blank news article on kottke.org
https://bugs.webkit.org/show_bug.cgi?id=159733
<rdar://problem/26743065>

Reviewed by Simon Fraser.

This patch ensures that we update the visible content rect, when Auto Layout moves the WKWebView around.
We normally expect setFrameRect to be called to position WKWebView. However Auto Layout relies on layoutSubviews,
and in order to always have up-to-date visible content rect, we need to override layoutSubviews in WKWebView.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView layoutSubviews]):

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

3 years agoAdd test verifying detached iframes cannot set IDB values
commit-queue@webkit.org [Wed, 13 Jul 2016 21:14:28 +0000 (21:14 +0000)]
Add test verifying detached iframes cannot set IDB values
https://bugs.webkit.org/show_bug.cgi?id=159736

Patch by Alex Christensen <achristensen@webkit.org> on 2016-07-13
Reviewed by Brady Eidson.

We match Chrome but not Firefox in this case.

* storage/indexeddb/detached-iframe-expected.txt: Added.
* storage/indexeddb/detached-iframe.html: Added.
* storage/indexeddb/resources/detached-iframe.html: Added.
* storage/indexeddb/resources/detached-iframe.js: Added.
(done):
(unexpectedErrorCallback):
(getRequestCallback):
(dbOpenedSecondTime):
(getValueFromIDB):
(makeDetachedFrame):
(prepareDatabase):

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

3 years agoREGRESSION(r202953): Clicking on input[type=file] doesn't open a file picker
rniwa@webkit.org [Wed, 13 Jul 2016 20:52:21 +0000 (20:52 +0000)]
REGRESSION(r202953): Clicking on input[type=file] doesn't open a file picker
https://bugs.webkit.org/show_bug.cgi?id=159686
Source/WebCore:

Reviewed by Chris Dumez.

The bug was caused by DOMActivate event not propagating out of the user-agent shadow tree
of a file input, and FileInputType not receiving the event to open the file picker.

Made DOMActivate "composed" event which cross shadow boundaries to fix the bug. The feedback
was given back to W3C on https://github.com/w3c/webcomponents/issues/513#issuecomment-231851617

Test: fast/forms/file/open-file-panel.html

* dom/Event.cpp:
(WebCore::Event::composed):

Tools:

Reviewed by Chris Dumez.

Added a code to print "OPEN FILE PANEL" in the text when runOpenPanel is called in the UI delegate.

* WebKitTestRunner/TestController.cpp:
(WTR::runOpenPanel):
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):

LayoutTests:

<rdar://problem/27263589>

Reviewed by Chris Dumez.

Added a regression test for opening a file picker on a type=file input element.

The test currently only works on WebKit2 since the support for logging "OPEN FILE PANEL"
was only added to WebKitTestRunner.

Also added WebKit2 specific expected results for some tests that tries to open file panel.

* fast/forms/file/open-file-panel-expected.txt: Added.
* fast/forms/file/open-file-panel.html: Added.
* platform/ios-simulator-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
* platform/wk2/accessibility: Added.
* platform/wk2/accessibility/axpress-on-aria-button-expected.txt: Copied from LayoutTests/accessibility/axpress-on-aria-button-expected.txt.
* platform/wk2/accessibility/file-upload-button-with-axpress-expected.txt: Copied from LayoutTests/accessibility/file-upload-button-with-axpress-expected.txt.
* platform/wk2/fast: Added.
* platform/wk2/fast/events: Added.
* platform/wk2/fast/events/domactivate-sets-underlying-click-event-as-handled-expected.txt: Copied from LayoutTests/fast/events/domactivate-sets-underlying-click-event-as-handled-expected.txt.

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