Add media query support for wide gamut displays on Mac
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-17  Dean Jackson  <dino@apple.com>
2
3         Add media query support for wide gamut displays on Mac
4         https://bugs.webkit.org/show_bug.cgi?id=157824
5         <rdar://problem/26333137>
6
7         Reviewed by Simon Fraser.
8
9         Implement the Mac version of the color-gamut media query
10         by filling out the screenSupportsExtendedColor function.
11
12         On Yosemite, we always return false. On El Capitan, we
13         can check the ColorProfile via ColorSync to see if the
14         screen is wide gamut.
15
16         There is already a test in fast/media/mq-color-gamut.html
17
18         * css/MediaQueryEvaluator.cpp:
19         (WebCore::color_gamutMediaFeatureEval): Pass the mainFrame's view
20         to screenSupportsExtendedColor, so that it can fetch the NSScreen.
21         * platform/PlatformScreen.h: screenSupportsExtendedColor now takes
22         an optional Widget parameter.
23         * platform/ios/PlatformScreenIOS.mm:
24         (WebCore::screenSupportsExtendedColor): Add empty parameter.
25         * platform/mac/PlatformScreenMac.mm:
26         (WebCore::screenSupportsExtendedColor): Get the NSWindow, then the
27         NSScreen, then the ColorSpace, then the ColorSyncProfile, and
28         check if it is a wide gamut profile.
29         * platform/spi/cg/CoreGraphicsSPI.h: Add the SPI declarations.
30
31 2016-05-17  Chris Dumez  <cdumez@apple.com>
32
33         Unreviewed, fix Darin's post-mortem review comments for r201052.
34
35         * rendering/RenderFieldset.cpp:
36         (WebCore::RenderFieldset::findLegend):
37         * rendering/svg/SVGRenderSupport.cpp:
38         (WebCore::SVGRenderSupport::layoutChildren):
39
40 2016-05-17  Beth Dakin  <bdakin@apple.com>
41
42         Make handleAcceptedCandidate a public function
43         https://bugs.webkit.org/show_bug.cgi?id=157763
44         -and corresponding-
45         rdar://problem/26206397
46
47         Reviewed by Tim Horton.
48
49         Define handleAcceptedCandidateWithSoftSpaces on EditorClient so that it can 
50         be invoked on any EditorClient. 
51         * loader/EmptyClients.h:
52         * page/EditorClient.h:
53         (WebCore::EditorClient::handleAcceptedCandidateWithSoftSpaces):
54
55 2016-05-17  Chris Dumez  <cdumez@apple.com>
56
57         Unreviewed debug build fix after r201052.
58
59         * rendering/svg/RenderSVGText.cpp:
60         (WebCore::findPreviousAndNextAttributes): Deleted.
61
62 2016-05-17  Chris Dumez  <cdumez@apple.com>
63
64         Use RenderChildIterator more for traversing a renderer's children
65         https://bugs.webkit.org/show_bug.cgi?id=157811
66
67         Reviewed by Antti Koivisto.
68
69         Use RenderChildIterator more for traversing a renderer's children.
70
71         * inspector/InspectorLayerTreeAgent.cpp:
72         (WebCore::InspectorLayerTreeAgent::layersForNode):
73         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
74         * inspector/InspectorLayerTreeAgent.h:
75         * rendering/AutoTableLayout.cpp:
76         (WebCore::AutoTableLayout::recalcColumn):
77         * rendering/InlineIterator.h:
78         (WebCore::isEmptyInline):
79         * rendering/RenderBlock.cpp:
80         (WebCore::RenderBlock::addFocusRingRects):
81         * rendering/RenderBox.cpp:
82         (WebCore::RenderBox::positionForPoint):
83         * rendering/RenderElement.cpp:
84         (WebCore::RenderElement::updateOutlineAutoAncestor):
85         * rendering/RenderElement.h:
86         * rendering/RenderFieldset.cpp:
87         (WebCore::RenderFieldset::findLegend):
88         * rendering/RenderFieldset.h:
89         * rendering/RenderInline.cpp:
90         (WebCore::RenderInline::generateCulledLineBoxRects):
91         (WebCore::RenderInline::culledInlineFirstLineBox):
92         (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
93         (WebCore::RenderInline::dirtyLineBoxes):
94         * rendering/RenderListItem.cpp:
95         (WebCore::getParentOfFirstLineBox):
96         * rendering/RenderObject.cpp:
97         (WebCore::RenderObject::setFlowThreadStateIncludingDescendants):
98         (WebCore::RenderObject::addAbsoluteRectForLayer):
99         (WebCore::RenderObject::paintingRootRect):
100         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
101         (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
102         (WebCore::RenderObject::updateDragState):
103         * rendering/RenderTable.cpp:
104         (WebCore::RenderTable::firstColumn):
105         * rendering/RenderTableCol.cpp:
106         (WebCore::RenderTableCol::clearPreferredLogicalWidthsDirtyBits):
107         * rendering/RenderTableSection.cpp:
108         (WebCore::RenderTableSection::layoutRows):
109         * rendering/RenderTreeAsText.cpp:
110         (WebCore::write):
111         * rendering/svg/RenderSVGText.cpp:
112         (WebCore::findPreviousAndNextAttributes):
113         (WebCore::RenderSVGText::subtreeChildWasAdded):
114         (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
115         * rendering/svg/SVGRenderSupport.cpp:
116         (WebCore::updateObjectBoundingBox):
117         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
118         (WebCore::SVGRenderSupport::layoutChildren):
119         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
120         (WebCore::SVGTextLayoutAttributesBuilder::collectTextPositioningElements):
121         * rendering/svg/SVGTextMetricsBuilder.cpp:
122         (WebCore::SVGTextMetricsBuilder::walkTree):
123
124 2016-05-17  Dean Jackson  <dino@apple.com>
125
126         Remove ES6_GENERATORS flag
127         https://bugs.webkit.org/show_bug.cgi?id=157815
128         <rdar://problem/26332894>
129
130         Reviewed by Geoffrey Garen.
131
132         This flag isn't needed. Generators are enabled everywhere and
133         part of a stable specification.
134
135         * Configurations/FeatureDefines.xcconfig:
136
137 2016-05-16  Simon Fraser  <simon.fraser@apple.com>
138
139         BitmapImage::destroyDecodedDataIfNecessary() should only count frames with image data
140         https://bugs.webkit.org/show_bug.cgi?id=157779
141
142         Reviewed by Tim Horton.
143
144         BitmapImage::destroyDecodedDataIfNecessary() throws away all frames of an image if the
145         decoded frame size exceeds a threshold. However, it counts all frames, whether or not
146         they have an image (some frames may only have metadata, but m_frameBytes still returns
147         height*width*4).
148
149         Fix by only count m_frameBytes for frames that have an image.
150
151         * platform/graphics/BitmapImage.cpp:
152         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
153         * platform/graphics/BitmapImage.h:
154         (WebCore::FrameData::FrameData):
155         (WebCore::FrameData::usedFrameBytes):
156
157 2016-05-17  Dave Hyatt  <hyatt@apple.com>
158
159         Optimize layer repaint rect computation and painting.
160         https://bugs.webkit.org/show_bug.cgi?id=157631
161
162         Reviewed by Zalan Bujtas.
163
164         This patch changes the computation of repaint rects to be for self-painting layers
165         only. In addition, hasBoxDecorations() has been changed to hasVisibleBoxDecorations(),
166         and it will no longer be set for transparent borders.
167
168         For scrolling layer position updating, visually empty layers have their repaint rects
169         cleared, and we don't compute repaint rects during the scroll. We would like to do this
170         all the time, but computeRepaintRects can be called at times when the visually empty
171         state is stale/unknown. For now we limit it to scrolling, since we know that the layer's
172         visually empty state is correct.
173
174         * rendering/InlineFlowBox.cpp:
175         (WebCore::InlineFlowBox::paintBoxDecorations):
176         * rendering/RenderBlock.cpp:
177         (WebCore::RenderBlock::paintObject):
178         * rendering/RenderBlockLineLayout.cpp:
179         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
180         * rendering/RenderBox.cpp:
181         (WebCore::RenderBox::updateFromStyle):
182         (WebCore::RenderBox::paintBoxDecorations):
183         * rendering/RenderBoxModelObject.cpp:
184         (WebCore::RenderBoxModelObject::willBeDestroyed):
185         (WebCore::RenderBoxModelObject::hasVisibleBoxDecorationStyle):
186         (WebCore::RenderBoxModelObject::updateFromStyle):
187         (WebCore::RenderBoxModelObject::hasBoxDecorationStyle): Deleted.
188         * rendering/RenderBoxModelObject.h:
189         * rendering/RenderElement.cpp:
190         (WebCore::RenderElement::styleWillChange):
191         (WebCore::mustRepaintBackgroundOrBorder):
192         * rendering/RenderImage.cpp:
193         (WebCore::RenderImage::imageChanged):
194         * rendering/RenderInline.cpp:
195         (WebCore::RenderInline::styleDidChange):
196         * rendering/RenderLayer.cpp:
197         (WebCore::RenderLayer::RenderLayer):
198         (WebCore::RenderLayer::updateLayerPositions):
199         (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
200         (WebCore::RenderLayer::computeRepaintRects):
201         (WebCore::RenderLayer::clearRepaintRects):
202         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
203         (WebCore::RenderLayer::scrollTo):
204         (WebCore::RenderLayer::calculateClipRects):
205         * rendering/RenderLayer.h:
206         * rendering/RenderLayerBacking.cpp:
207         (WebCore::RenderLayerBacking::updateDrawsContent):
208         (WebCore::RenderLayerBacking::compositingOpacity):
209         (WebCore::hasVisibleBoxDecorations):
210         (WebCore::canCreateTiledImage):
211         (WebCore::hasVisibleBoxDecorationsOrBackgroundImage):
212         (WebCore::supportsDirectBoxDecorationsComposition):
213         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
214         (WebCore::RenderLayerBacking::containsPaintedContent):
215         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
216         (WebCore::hasBoxDecorations): Deleted.
217         (WebCore::hasBoxDecorationsOrBackgroundImage): Deleted.
218         * rendering/RenderLayerModelObject.cpp:
219         (WebCore::RenderLayerModelObject::styleDidChange):
220         * rendering/RenderNamedFlowFragment.cpp:
221         (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
222         * rendering/RenderObject.h:
223         (WebCore::RenderObject::hasVisibleBoxDecorations):
224         (WebCore::RenderObject::setFloating):
225         (WebCore::RenderObject::setInline):
226         (WebCore::RenderObject::computeBackgroundIsKnownToBeObscured):
227         (WebCore::RenderObject::setSelectionStateIfNeeded):
228         (WebCore::RenderObject::setHasVisibleBoxDecorations):
229         (WebCore::RenderObject::invalidateBackgroundObscurationStatus):
230         (WebCore::RenderObject::hasBoxDecorations): Deleted.
231         (WebCore::RenderObject::setHasBoxDecorations): Deleted.
232         * rendering/RenderReplaced.cpp:
233         (WebCore::RenderReplaced::paint):
234         * rendering/RenderTable.cpp:
235         (WebCore::RenderTable::paintObject):
236         (WebCore::RenderTable::paintBoxDecorations):
237         * rendering/RenderTableCell.cpp:
238         (WebCore::RenderTableCell::styleDidChange):
239         * rendering/RenderWidget.cpp:
240         (WebCore::RenderWidget::paint):
241         * rendering/style/BorderData.h:
242         (WebCore::BorderData::hasBorder):
243         (WebCore::BorderData::hasVisibleBorder):
244         (WebCore::BorderData::hasFill):
245         (WebCore::BorderData::hasBorderRadius):
246         * rendering/style/RenderStyle.h:
247         * rendering/svg/RenderSVGRoot.cpp:
248         (WebCore::RenderSVGRoot::layout):
249         (WebCore::RenderSVGRoot::styleDidChange):
250
251 2016-05-17  Filip Pizlo  <fpizlo@apple.com>
252
253         WTF should know about Language
254         https://bugs.webkit.org/show_bug.cgi?id=157756
255
256         Reviewed by Geoffrey Garen.
257
258         No new tests because this does not change behavior.
259
260         This change is all about moving some language functionality to WTF. Quoting the WTF
261         ChangeLog, this contains two changes:
262
263         - Move everything that WebCore's logic for getting the platform user preferred language
264           depended on into WTF. This means CFBundleSPI.h and BlockObjCExceptions.h|cpp.
265
266         - Move WebCore::platformUserPreferredLanguages() to WTF::platformUserPreferredLanguages().
267           This is needed by https://bugs.webkit.org/show_bug.cgi?id=157755, which will make JSC
268           use this to detect the platform user preferred language when running standalone.
269
270         The changes in WebCore are mostly about rewiring #includes and #imports and removing the
271         code that we moved to WTF. But there is one logic change: previously,
272         platformUserPreferredLanguages() would call WebCore::languageDidChange(). It can't do that
273         directly anymore, but WTF gives WebCore some API for registering the callback. So in
274         Language.cpp we now register languageDidChange anytime we do something that would
275         necessitate it, like calling platformUserPreferredLanguages(). This also registers the
276         callback inside addLanguageChangeObserver(), since it's possible for that to be called
277         after JSC had called platformUserPreferredLanguages() but before WebCore does so.
278
279         * PlatformEfl.cmake:
280         * PlatformGTK.cmake:
281         * PlatformMac.cmake:
282         * PlatformWin.cmake:
283         * WebCore.xcodeproj/project.pbxproj:
284         * bindings/objc/DOMCustomXPathNSResolver.mm:
285         * editing/ios/EditorIOS.mm:
286         * editing/mac/DictionaryLookup.mm:
287         * editing/mac/EditorMac.mm:
288         * page/CaptionUserPreferencesMediaAF.cpp:
289         * page/ios/EventHandlerIOS.mm:
290         * page/ios/FrameIOS.mm:
291         * page/mac/ChromeMac.mm:
292         * page/mac/EventHandlerMac.mm:
293         * platform/Language.cpp:
294         (WebCore::registerLanguageDidChangeCallbackIfNecessary):
295         (WebCore::observerMap):
296         (WebCore::addLanguageChangeObserver):
297         (WebCore::overrideUserPreferredLanguages):
298         (WebCore::userPreferredLanguages):
299         * platform/Language.h:
300         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
301         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
302         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
303         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
304         * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
305         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
306         * platform/graphics/cocoa/FontCocoa.mm:
307         * platform/graphics/mac/ColorMac.mm:
308         * platform/graphics/mac/GraphicsContext3DMac.mm:
309         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
310         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
311         * platform/ios/ScrollViewIOS.mm:
312         * platform/ios/WidgetIOS.mm:
313         * platform/mac/BlockExceptions.h: Removed.
314         * platform/mac/BlockExceptions.mm: Removed.
315         * platform/mac/CursorMac.mm:
316         * platform/mac/Language.mm: Removed.
317         * platform/mac/ScrollAnimatorMac.mm:
318         * platform/mac/ScrollViewMac.mm:
319         * platform/mac/ScrollbarThemeMac.mm:
320         * platform/mac/ThemeMac.mm:
321         * platform/mac/WidgetMac.mm:
322         * platform/mediastream/mac/AVVideoCaptureSource.mm:
323         * platform/network/mac/CookieJarMac.mm:
324         * platform/network/mac/ResourceErrorMac.mm:
325         * platform/network/mac/ResourceHandleMac.mm:
326         * platform/spi/cf/CFBundleSPI.h: Removed.
327         * platform/unix/LanguageUnix.cpp: Removed.
328         * platform/win/LanguageWin.cpp: Removed.
329
330 2016-05-16  Dean Jackson  <dino@apple.com>
331
332         Tidy unused parameters with build flags in isValidKeywordPropertyAndValue
333         https://bugs.webkit.org/show_bug.cgi?id=157780
334         <rdar://problem/26327312>
335
336         Reviewed by Alex Christensen.
337
338         CSS_COMPOSITING and CSS_REGIONS aren't runtime flags any more, so
339         don't need a parser context. Meanwhile CSS_GRID_LAYOUT does, even
340         though it wasn't in the condition for the UNUSED_PARAM.
341
342         * css/CSSParser.cpp:
343         (WebCore::isValidKeywordPropertyAndValue):
344
345 2016-05-17  Chris Dumez  <cdumez@apple.com>
346
347         Regression(r177786): GlyphMetricsMap<T>::locatePageSlowCase() fills existing pages with unknown metrics
348         https://bugs.webkit.org/show_bug.cgi?id=157749
349
350         Reviewed by Antti Koivisto.
351
352         After r177786, GlyphMetricsMap<T>::locatePageSlowCase() would unconditionally fill
353         pages with unknown metrics. This patch updates the code to do so only if the page
354         is new, thus restoring the pre-r177786 behavior.
355
356         * platform/graphics/GlyphMetricsMap.h:
357         (WebCore::GlyphMetricsMap::metricsForGlyph):
358         (WebCore::GlyphMetricsMap::setMetricsForGlyph):
359         (WebCore::GlyphMetricsMap::GlyphMetricsPage::GlyphMetricsPage):
360         (WebCore::GlyphMetricsMap::GlyphMetricsPage::fill):
361         (WebCore::GlyphMetricsMap::locatePage):
362         (WebCore::GlyphMetricsMap<T>::locatePageSlowCase):
363         (WebCore::GlyphMetricsMap::GlyphMetricsPage::metricsForGlyph): Deleted.
364         (WebCore::GlyphMetricsMap::GlyphMetricsPage::setMetricsForGlyph): Deleted.
365         (WebCore::GlyphMetricsMap::GlyphMetricsPage::setMetricsForIndex): Deleted.
366         (WebCore::GlyphMetricsMap<float>::unknownMetrics): Deleted.
367         (WebCore::GlyphMetricsMap<FloatRect>::unknownMetrics): Deleted.
368
369 2016-05-17  Csaba Osztrogonác  <ossy@webkit.org>
370
371         Fix the !ENABLE(WEB_TIMING) build after r200887
372         https://bugs.webkit.org/show_bug.cgi?id=157796
373
374         Reviewed by Chris Dumez.
375
376         * loader/DocumentThreadableLoader.cpp:
377         (WebCore::DocumentThreadableLoader::didFinishLoading):
378         (WebCore::DocumentThreadableLoader::loadRequest):
379         * loader/DocumentThreadableLoader.h:
380         * loader/cache/CachedResourceLoader.cpp:
381         (WebCore::CachedResourceLoader::requestResource):
382         (WebCore::CachedResourceLoader::revalidateResource):
383         (WebCore::CachedResourceLoader::loadResource):
384         * loader/cache/CachedResourceLoader.h:
385
386 2016-05-17  Myles C. Maxfield  <mmaxfield@apple.com>
387
388         REGRESSION(r54729): Line breaking in complex mixed-direction text is inconsistent across page refreshes
389         https://bugs.webkit.org/show_bug.cgi?id=157783
390         <rdar://problem/22908924>
391
392         Reviewed by Zalan Bujtas.
393
394         mappedIndices is uninitialized.
395
396         Test: fast/text/complex-mixed-direction-line-breaking.html
397
398         * platform/graphics/mac/ComplexTextController.cpp:
399         (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
400
401 2016-05-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
402
403         DOMPromise should only restrict the resolution type
404         https://bugs.webkit.org/show_bug.cgi?id=157307
405
406         Reviewed by Darin Adler.
407
408         Removing from DOMPromise the rejection template parameter.
409         Supported rejection types are integers (Exception codes) and DOM objects (DOMError typically).
410
411         Updated DeferredWrapper to accept Ref<>&& and RefPtr<>&&.
412         Relanding without touching JSDOMBinding.h as this seemed to be impacting performances.
413
414         Changes also allow in most cases to remove the need for explictly declaring the
415         rejection/resolution type.
416
417         Minor refactoring of FontFaceSet promise handling to use DOMPromise in lieu of DeferredWrapper.
418
419         Covered by existing tests.
420         Changes should not be visible from user scripts.
421
422         * Modules/fetch/FetchBody.cpp:
423         (WebCore::FetchBody::consume):
424         (WebCore::FetchBody::consumeText):
425         (WebCore::blobFromArrayBuffer):
426         (WebCore::FetchBody::loadingFailed):
427         * Modules/fetch/FetchBody.h:
428         (WebCore::FetchBody::formData):
429         * Modules/fetch/FetchBodyOwner.cpp:
430         (WebCore::FetchBodyOwner::arrayBuffer):
431         (WebCore::FetchBodyOwner::blob):
432         (WebCore::FetchBodyOwner::formData):
433         (WebCore::FetchBodyOwner::json):
434         (WebCore::FetchBodyOwner::text):
435         * Modules/fetch/FetchResponse.cpp:
436         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
437         * Modules/fetch/FetchResponse.h:
438         * Modules/mediastream/MediaDevices.h:
439         * Modules/mediastream/PeerConnectionBackend.h:
440         * Modules/mediastream/UserMediaRequest.cpp:
441         (WebCore::UserMediaRequest::didCreateStream):
442         * Modules/streams/ReadableStreamSource.h:
443         * Modules/webaudio/AudioContext.h:
444         * bindings/js/JSDOMPromise.cpp:
445         (WebCore::fulfillPromiseWithJSON):
446         * bindings/js/JSDOMPromise.h:
447         (WebCore::TypeInspector::decltype):
448         (WebCore::TypeInspector::testIsVector):
449         (WebCore::TypeInspector::testIsRefOrRefPtr):
450         (WebCore::DeferredWrapper::resolve):
451         (WebCore::DeferredWrapper::reject):
452         (WebCore::DOMPromise::resolve):
453         (WebCore::DOMPromise::reject):
454         (WebCore::DeferredWrapper::resolveWithValue):
455         (WebCore::DeferredWrapper::rejectWithValue):
456         (WebCore::callPromiseFunction):
457         * bindings/js/JSSubtleCryptoCustom.cpp:
458         (WebCore::JSSubtleCrypto::importKey):
459         (WebCore::JSSubtleCrypto::unwrapKey):
460         * css/FontFace.h:
461         * css/FontFaceSet.cpp:
462         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
463         (WebCore::FontFaceSet::load):
464         (WebCore::FontFaceSet::registerReady):
465         * css/FontFaceSet.h:
466         * html/HTMLMediaElement.h:
467
468 2016-05-16  Alex Christensen  <achristensen@webkit.org>
469
470         Modernize CSS Parser
471         https://bugs.webkit.org/show_bug.cgi?id=157772
472
473         Reviewed by Brady Eidson.
474
475         No new tests.  This patch just replaces PassRefPtr with RefPtr&&.
476
477         * css/CSSParser.cpp:
478         (WebCore::CSSParser::parseDeclaration):
479         (WebCore::CSSParser::SourceSize::SourceSize):
480         (WebCore::CSSParser::createStyleProperties):
481         (WebCore::CSSParser::addProperty):
482         (WebCore::CSSParser::parseValidPrimitive):
483         (WebCore::CSSParser::addExpandedPropertyForValue):
484         (WebCore::CSSParser::parseVariableDependentValue):
485         (WebCore::CSSParser::parseValue):
486         (WebCore::CSSParser::parseColumnsShorthand):
487         (WebCore::CSSParser::parseGridItemPositionShorthand):
488         (WebCore::CSSParser::parseGridAreaShorthand):
489         (WebCore::CSSParser::parseInsetRoundedCorners):
490         (WebCore::CSSParser::parseBasicShapeInset):
491         (WebCore::ShadowParseContext::commitLength):
492         (WebCore::ShadowParseContext::commitColor):
493         (WebCore::BorderImageParseContext::requireWidth):
494         (WebCore::BorderImageParseContext::requireOutset):
495         (WebCore::BorderImageParseContext::commitImage):
496         (WebCore::BorderImageParseContext::commitImageSlice):
497         (WebCore::BorderImageParseContext::commitForwardSlashOperator):
498         (WebCore::BorderImageParseContext::commitBorderWidth):
499         (WebCore::BorderImageParseContext::commitBorderOutset):
500         (WebCore::BorderImageParseContext::commitRepeat):
501         (WebCore::BorderImageParseContext::commitWebKitBorderImage):
502         (WebCore::BorderImageParseContext::commitBorderImage):
503         (WebCore::BorderImageParseContext::commitBorderImageProperty):
504         (WebCore::BorderImageSliceParseContext::commitFill):
505         (WebCore::BorderImageSliceParseContext::commitBorderImageSlice):
506         (WebCore::BorderImageQuadParseContext::commitNumber):
507         (WebCore::BorderImageQuadParseContext::setAllowFinalCommit):
508         (WebCore::BorderImageQuadParseContext::setTop):
509         (WebCore::BorderImageQuadParseContext::commitBorderImageQuad):
510         (WebCore::CSSParser::parseCounter):
511         (WebCore::parseDeprecatedGradientPoint):
512         (WebCore::CSSParser::parseDeprecatedGradient):
513         (WebCore::valueFromSideKeyword):
514         (WebCore::parseGradientColorOrKeyword):
515         (WebCore::CSSParser::parsePerspectiveOrigin):
516         (WebCore::CSSParser::addTextDecorationProperty):
517         (WebCore::CSSParser::parseTextDecoration):
518         (WebCore::CSSParser::realLex):
519         (WebCore::CSSParser::createImportRule):
520         (WebCore::CSSParser::createMediaRule):
521         (WebCore::CSSParser::processAndAddNewRuleToSourceTreeIfNeeded):
522         (WebCore::CSSParser::addNewRuleToSourceTree):
523         * css/CSSParser.h:
524         (WebCore::CSSParser::hasProperties):
525         (WebCore::CSSParser::resetPropertyRange):
526         (WebCore::CSSParser::isExtractingSourceData):
527
528 2016-05-16  Chris Dumez  <cdumez@apple.com>
529
530         Add RenderDescendantIterator to traverse a RenderObject's descendants
531         https://bugs.webkit.org/show_bug.cgi?id=157785
532
533         Reviewed by Zalan Bujtas.
534
535         Add RenderDescendantIterator to traverse a RenderObject's descendants. I
536         am planning to use it in the iOS Text Autosizing code (See Bug 157784).
537
538         * WebCore.xcodeproj/project.pbxproj:
539         * rendering/RenderDescendantIterator.h: Added.
540         (WebCore::RenderDescendantIterator<T>::RenderDescendantIterator):
541         (WebCore::RenderDescendantIterator<T>::operator):
542         (WebCore::RenderDescendantConstIterator<T>::RenderDescendantConstIterator):
543         (WebCore::RenderDescendantConstIterator<T>::operator):
544         (WebCore::RenderDescendantIteratorAdapter<T>::RenderDescendantIteratorAdapter):
545         (WebCore::RenderDescendantIteratorAdapter<T>::begin):
546         (WebCore::RenderDescendantIteratorAdapter<T>::end):
547         (WebCore::RenderDescendantConstIteratorAdapter<T>::RenderDescendantConstIteratorAdapter):
548         (WebCore::RenderDescendantConstIteratorAdapter<T>::begin):
549         (WebCore::RenderDescendantConstIteratorAdapter<T>::end):
550         (WebCore::descendantsOfType):
551         * rendering/RenderIterator.h:
552         (WebCore::RenderObjectTraversal::firstChild):
553         (WebCore::RenderObjectTraversal::nextAncestorSibling):
554         (WebCore::RenderObjectTraversal::next):
555         (WebCore::RenderTraversal::firstChild):
556         (WebCore::RenderTraversal::lastChild):
557         (WebCore::RenderTraversal::nextSibling):
558         (WebCore::RenderTraversal::previousSibling):
559         (WebCore::RenderTraversal::findAncestorOfType):
560         (WebCore::RenderTraversal::firstWithin):
561         (WebCore::RenderTraversal::next):
562         (WebCore::RenderIterator<T>::traverseNext):
563         (WebCore::RenderConstIterator<T>::traverseNext):
564
565 2016-05-16  Alex Christensen  <achristensen@webkit.org>
566
567         Remove YouTube site-specific hack
568         https://bugs.webkit.org/show_bug.cgi?id=157776
569
570         Reviewed by Eric Carlson.
571
572         No new tests.  Youtube fullscreen seems to work without
573         http://trac.webkit.org/changeset/173533 now.
574
575         * dom/Document.cpp:
576         (WebCore::unwrapFullScreenRenderer):
577         (WebCore::Document::webkitWillEnterFullScreenForElement):
578         (WebCore::Document::webkitDidEnterFullScreenForElement):
579         (WebCore::Document::webkitWillExitFullScreenForElement):
580         (WebCore::Document::webkitDidExitFullScreenForElement):
581         (WebCore::Document::setFullScreenRenderer):
582         (WebCore::hostIsYouTube): Deleted.
583
584 2016-05-16  Brent Fulgham  <bfulgham@apple.com>
585
586         heap use-after-free at WebCore::TimerBase::heapPopMin()
587         https://bugs.webkit.org/show_bug.cgi?id=157742
588         <rdar://problem/26236778>
589
590         Reviewed by David Kilzer.
591
592         Tested by fast/frames/resources/crash-during-iframe-load-stop.html.
593
594         * loader/FrameLoader.cpp:
595         (WebCore::FrameLoader::stopForUserCancel): Protect m_frame from destruction while it is still
596         being used by the current stack frame.
597         (WebCore::FrameLoader::frameDetached): Ditto.
598         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy): Ditto.
599
600 2016-05-16  Dean Jackson  <dino@apple.com>
601
602         WebCoreJSBuiltinInternals won't compile if some build flags are off
603         https://bugs.webkit.org/show_bug.cgi?id=157777
604         <rdar://problem/26312967>
605
606         Reviewed by Simon Fraser.
607
608         Allow this file to compile when some build flags are disabled.
609
610         * bindings/js/WebCoreJSBuiltinInternals.cpp:
611         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
612
613 2016-05-16  Brady Eidson  <beidson@apple.com>
614
615         Modern IDB: Give each UniqueIDBDatabase its own task queues.
616         https://bugs.webkit.org/show_bug.cgi?id=157757
617
618         Reviewed by Alex Christensen.
619
620         No new tests (Refactor, no behavior change).
621
622         Each UniqueIDBDatabase now maintains its own databaseTask and databaseTaskReply queues.
623         
624         Instead of posting the specific task(reply) with the IDBServer, it merely posts a task(reply) that says
625         "Handle your next task(reply)".
626
627         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
628         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
629         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
630         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
631         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
632         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
633         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
634         (WebCore::IDBServer::UniqueIDBDatabase::performCreateObjectStore):
635         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
636         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
637         (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
638         (WebCore::IDBServer::UniqueIDBDatabase::performClearObjectStore):
639         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
640         (WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
641         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
642         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
643         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
644         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
645         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
646         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
647         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
648         (WebCore::IDBServer::UniqueIDBDatabase::getCount):
649         (WebCore::IDBServer::UniqueIDBDatabase::performGetCount):
650         (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
651         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteRecord):
652         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
653         (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
654         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
655         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
656         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
657         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
658         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
659         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
660         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
661         (WebCore::IDBServer::UniqueIDBDatabase::performActivateTransactionInBackingStore):
662         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
663         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
664         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
665         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
666         * Modules/indexeddb/server/UniqueIDBDatabase.h:
667
668 2016-05-16  Saam barati  <sbarati@apple.com>
669
670         Hook up ShadowChicken to the debugger to show tail deleted frames
671         https://bugs.webkit.org/show_bug.cgi?id=156685
672         <rdar://problem/25770521>
673
674         Reviewed by Filip Pizlo and Mark Lam and Joseph Pecoraro.
675
676         Tests: inspector/debugger/tail-deleted-frames-this-value.html
677                inspector/debugger/tail-deleted-frames.html
678                inspector/debugger/tail-recursion.html
679
680         * ForwardingHeaders/interpreter/ShadowChicken.h: Added.
681
682 2016-05-16  Alex Christensen  <achristensen@webkit.org>
683
684         Don't include CSSParser.h from other headers
685         https://bugs.webkit.org/show_bug.cgi?id=157765
686
687         Reviewed by Zalan Bujtas.
688
689         No change in behavior.  This just makes it so touching CSSParser.h doesn't rebuild as many files.
690
691         * css/CSSCalculationValue.cpp:
692         * css/CSSParser.cpp:
693         (WebCore::CSSParser::sourceSize):
694         (WebCore::filterProperties):
695         * css/CSSParser.h:
696         (WebCore::CSSParser::ValueWithCalculation::ValueWithCalculation):
697         * css/CSSProperty.h:
698         (WebCore::prefixingVariantForPropertyId):
699         * css/FontFace.cpp:
700         * css/StyleProperties.cpp:
701         (WebCore::MutableStyleProperties::parseDeclaration):
702         (WebCore::MutableStyleProperties::addParsedProperties):
703         * css/StyleProperties.h:
704         * css/StyleResolver.h:
705         * rendering/style/RenderStyle.cpp:
706
707 2016-05-16  Aaron Chu  <aaron_chu@apple.com>
708
709         REGRESSION (r200441): Yahoo sports, finance and news pages automatically scroll
710         https://bugs.webkit.org/show_bug.cgi?id=157692
711         <rdar://problem/26231897>
712
713         Reviewed by Eric Carlson.
714
715         Test: media/video-controls-to-not-scroll-page-on-load.html
716
717         This bug was due to the fact that showControls button was shown and focused
718         when the video controls are hidden. The showControls button is used by FKA or 
719         screen readers to make the video controls reappear after they have faded out. 
720         When the showControls button is shown, a focus() is called on it to ensure that
721         the screen reader is focusing on the button instead of <body> or the video chrome.
722         To fix this bug, I added the shouldHaveControls() check before calling focus() on
723         the showControls button.
724
725         * Modules/mediacontrols/mediaControlsApple.js:
726         (Controller.prototype.showShowControlsButton):
727
728 2016-05-16  Joseph Pecoraro  <pecoraro@apple.com>
729
730         Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
731
732         Tests: fast/profiler/*
733
734         * CMakeLists.txt:
735         * DerivedSources.cpp:
736         * DerivedSources.make:
737         * ForwardingHeaders/profiler/LegacyProfiler.h: Added.
738         * ForwardingHeaders/profiler/Profile.h: Added.
739         * ForwardingHeaders/profiler/ProfileNode.h: Added.
740         * WebCore.xcodeproj/project.pbxproj:
741         * bindings/js/JSCustomXPathNSResolver.cpp:
742         * bindings/js/JSDOMWindowBase.cpp:
743         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
744         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
745         * bindings/js/JSDOMWindowBase.h:
746         * bindings/js/JSWorkerGlobalScopeBase.cpp:
747         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
748         * bindings/js/JSWorkerGlobalScopeBase.h:
749         * bindings/js/ScriptCachedFrameData.cpp:
750         * bindings/js/ScriptController.cpp:
751         (WebCore::ScriptController::clearWindowShell):
752         * bindings/js/ScriptProfile.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
753         * bindings/js/ScriptProfileNode.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
754         * bindings/scripts/CodeGeneratorJS.pm:
755         (AddClassForwardIfNeeded):
756         * bindings/scripts/test/JS/JSTestObj.cpp:
757         (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
758         (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
759         * bindings/scripts/test/TestObj.idl:
760         * css/CSSParser.cpp:
761         * dom/Document.cpp:
762         * inspector/InspectorConsoleInstrumentation.h:
763         (WebCore::InspectorInstrumentation::stopProfiling):
764         * inspector/InspectorController.cpp:
765         (WebCore::InspectorController::InspectorController):
766         (WebCore::InspectorController::legacyProfilerEnabled):
767         (WebCore::InspectorController::setLegacyProfilerEnabled):
768         * inspector/InspectorController.h:
769         * inspector/InspectorInstrumentation.cpp:
770         (WebCore::InspectorInstrumentation::stopProfilingImpl):
771         * inspector/InspectorInstrumentation.h:
772         * inspector/InspectorTimelineAgent.cpp:
773         (WebCore::InspectorTimelineAgent::startFromConsole):
774         (WebCore::InspectorTimelineAgent::stopFromConsole):
775         * inspector/InspectorTimelineAgent.h:
776         * inspector/PageDebuggerAgent.cpp:
777         * inspector/PageRuntimeAgent.cpp:
778         * inspector/ScriptProfile.idl: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
779         * inspector/ScriptProfileNode.idl: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
780         * inspector/TimelineRecordFactory.cpp:
781         (WebCore::buildAggregateCallInfoInspectorObject):
782         (WebCore::buildInspectorObject):
783         (WebCore::buildProfileInspectorObject):
784         (WebCore::TimelineRecordFactory::appendProfile):
785         * inspector/TimelineRecordFactory.h:
786         * page/DOMWindow.cpp:
787         * page/Page.cpp:
788         * page/PageConsoleClient.cpp:
789         (WebCore::PageConsoleClient::profileEnd):
790         (WebCore::PageConsoleClient::clearProfiles):
791         * page/PageConsoleClient.h:
792         * testing/Internals.cpp:
793         (WebCore::Internals::resetToConsistentState):
794         (WebCore::Internals::consoleProfiles):
795         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
796         * testing/Internals.h:
797         * testing/Internals.idl:
798         * testing/js/WebCoreTestSupport.cpp:
799         * xml/XSLStyleSheetLibxslt.cpp:
800         * xml/XSLTProcessorLibxslt.cpp:
801
802 2016-05-16  Zalan Bujtas  <zalan@apple.com>
803
804         RenderLayer::hitTestList could mutate the list of candidate layers.
805         https://bugs.webkit.org/show_bug.cgi?id=157718
806         <rdar://problem/22556046>
807
808         Reviewed by Simon Fraser.
809
810         This patch ensures that we always start hittesting a clean render tree at EventHandler::hitTestResultAtPoint.
811
812         Speculative fix.
813
814         * page/EventHandler.cpp:
815         (WebCore::EventHandler::hitTestResultAtPoint):
816
817 2016-05-13  Enrica Casucci  <enrica@apple.com>
818
819         Remove unused initializer for WebEvent on iOS.
820         https://bugs.webkit.org/show_bug.cgi?id=157689
821
822         Reviewed by Anders Carlsson.
823
824         This is no longer used and can be removed.
825         The logic tied to isPopupVariant has been incorporated
826         in keyboard flags. The characterSet property is no longer needed too.
827
828         * platform/ios/WebEvent.h:
829         * platform/ios/WebEvent.mm:
830         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
831         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:isPopupVariant:keyCode:isTabKey:characterSet:]): Deleted.
832         (-[WebEvent _characterSetDescription]): Deleted.
833         (-[WebEvent isPopupVariant]): Deleted.
834         (-[WebEvent characterSet]): Deleted.
835
836 2016-05-16  Simon Fraser  <simon.fraser@apple.com>
837
838         Add a WebCore logging channel for images
839         https://bugs.webkit.org/show_bug.cgi?id=157752
840
841         Reviewed by Zalan Bujtas.
842
843         Create an Images log channel, and log various things related to decoding and drawing
844         images.
845
846         * platform/Logging.h:
847         * platform/graphics/BitmapImage.cpp:
848         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
849         (WebCore::BitmapImage::cacheFrame):
850         (WebCore::BitmapImage::startAnimation):
851         * platform/graphics/cg/GraphicsContextCG.cpp:
852         (WebCore::GraphicsContext::drawNativeImage):
853         * platform/graphics/cg/ImageDecoderCG.cpp:
854         (WebCore::ImageDecoder::createFrameImageAtIndex):
855
856 2016-05-12  Ada Chan  <adachan@apple.com>
857
858         Don't execute JavaScript within HTMLMediaElement::stop()
859         https://bugs.webkit.org/show_bug.cgi?id=157655
860
861         Reviewed by Chris Dumez.
862
863         * dom/ScriptExecutionContext.cpp:
864         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
865         Move the setting of m_activeDOMObjectsAreSuspended to true earlier so we won't execute
866         any JS while suspending the objects.
867         * html/HTMLMediaElement.cpp:
868         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
869         Bail early if the controls script hasn't been injected yet or the DOM object has been
870         stopped or suspended.
871
872 2016-05-16  Ryosuke Niwa  <rniwa@webkit.org>
873
874         Focus ordering should respect slot elements
875         https://bugs.webkit.org/show_bug.cgi?id=151379
876
877         Reviewed by Antti Koivisto.
878
879         Implemented the sequential focus navigation ordering as discussed on
880         https://github.com/w3c/webcomponents/issues/375
881
882         New behavior treats each shadow root and slot as a "focus scope". The focus navigation ordering
883         is defined within each "focus scope" using tabindex, treating any "focus scope owner"
884         (e.g. shadow host or a slot) as if it was having tabindex=0 if it wasn't itself focusable.
885
886         This patch modifies FocusNavigationScope to support a focus scope defined for a slot element in
887         addition to the one defined for a shadow tree and a document as previously supported.
888
889         Tests: fast/shadow-dom/focus-across-details-element.html
890                fast/shadow-dom/focus-navigation-across-slots.html
891
892         * dom/Node.cpp:
893         (WebCore::parentShadowRoot): Extracted from assignedSlot.
894         (WebCore::Node::assignedSlot):
895         (WebCore::Node::assignedSlotForBindings): Added.
896         * dom/Node.h:
897         * dom/NonDocumentTypeChildNode.idl:
898         * html/HTMLDetailsElement.h:
899         (HTMLDetailsElement::hasCustomFocusLogic): Added. Don't treat details element as a "focus scope".
900         * html/HTMLSummaryElement.h:
901         (HTMLSummaryElement::hasCustomFocusLogic): Ditto for summary element.
902         * page/FocusController.cpp:
903         (WebCore::hasCustomFocusLogic): Moved.
904         (WebCore::isFocusScopeOwner): Added. Returns true on a shadow host without a custom focus logic or
905         on a slot inside a shadow tree whose shadow host doesn't have a custom focus logic.
906         (WebCore::FocusNavigationScope::firstChildInScope): Now takes a reference. Call isFocusScopeOwner
907         to check for both slots and shadow roots instead of just the latter. This fixes a subtle bug that
908         focus may never get out of textarea in some cases due to its failure to check hasCustomFocusLogic.
909         (WebCore::FocusNavigationScope::lastChildInScope): Ditto.
910         (WebCore::FocusNavigationScope::parentInScope): Made this a member function since it needs to check
911         against m_slotElement inside the focus scope of a slot.
912         (WebCore::FocusNavigationScope::nextSiblingInScope): Added. Finds the next assigned node in a slot
913         in the focus scope defined for a slot. Just calls nextSibling() in the focus scope for shadow tree
914         and document.
915         (WebCore::FocusNavigationScope::previousSiblingInScope): Ditto for finding the previous sibling.
916         (WebCore::FocusNavigationScope::firstNodeInScope): Added. This function replaces rootNode() which
917         doesn't exist for the focus scope of a slot element.
918         (WebCore::FocusNavigationScope::lastNodeInScope): Ditto for the last node.
919         (WebCore::FocusNavigationScope::nextInScope):
920         (WebCore::FocusNavigationScope::previousInScope):
921         (WebCore::FocusNavigationScope::FocusNavigationScope): Added a variant that takes HTMLSlotElement.
922         (WebCore::FocusNavigationScope::owner): Added the support for slot elements.
923         (WebCore::FocusNavigationScope::scopeOf): Ditto.
924         (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Ditto.
925         (WebCore::isFocusableElementOrScopeOwner): Added the support for slot elements and renamed from
926         isFocusableOrHasShadowTreeWithoutCustomFocusLogic.
927         (WebCore::isNonFocusableScopeOwner): Ditto. Renamed from isNonFocusableShadowHost.
928         (WebCore::isFocusableScopeOwner): Ditto. Renamed from isFocusableShadowHost.
929         (WebCore::shadowAdjustedTabIndex): Added the support for slot elements.
930         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
931         (WebCore::FocusController::nextFocusableElementWithinScope):
932         (WebCore::FocusController::previousFocusableElementWithinScope):
933         (WebCore::FocusController::findElementWithExactTabIndex):
934         (WebCore::nextElementWithGreaterTabIndex): Call firstNodeInScope() instead of rootNode() here since
935         there is no root node for the focus scope defined for a slot element.
936         (WebCore::previousElementWithLowerTabIndex): Ditto for scope.lastNodeInScope().
937         (WebCore::FocusController::nextFocusableElementOrScopeOwner):
938         (WebCore::FocusController::previousFocusableElementOrScopeOwner):
939         (WebCore::parentInScope): Deleted.
940         (WebCore::FocusNavigationScope::rootNode): Deleted.
941         (WebCore::FocusNavigationScope::scopeOwnedByShadowHost): Deleted.
942         (WebCore::isNonFocusableShadowHost): Deleted.
943         (WebCore::isFocusableShadowHost): Deleted.
944         (WebCore::isFocusableOrHasShadowTreeWithoutCustomFocusLogic): Deleted.
945
946 2016-05-16  Chris Dumez  <cdumez@apple.com>
947
948         Use WTF::Optional for ScrollView's m_deferredScrollDelta / m_deferredScrollOffsets
949         https://bugs.webkit.org/show_bug.cgi?id=157747
950
951         Reviewed by Zalan Bujtas.
952
953         Use WTF::Optional for ScrollView's m_deferredScrollDelta / m_deferredScrollOffsets
954         instead of std::unique_ptr as it is more suited for this purpose.
955
956         * platform/ScrollView.cpp:
957         (WebCore::ScrollView::scrollOffsetChangedViaPlatformWidget):
958         (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange):
959         (WebCore::ScrollView::scrollTo):
960         * platform/ScrollView.h:
961
962 2016-05-16  Zalan Bujtas  <zalan@apple.com>
963
964         containingBlockFor*Position functions should take the renderer instead of the parent.
965         https://bugs.webkit.org/show_bug.cgi?id=157659
966
967         Reviewed by Simon Fraser.
968
969         containingBlockForFixedPosition, containingBlockForAbsolutePosition and containingBlockForObjectInFlow functions
970         expect the renderer's parent to be passed in (unless it is a RenderInline!). It is rather misleading and highly error-prone.
971         We should call them with the renderer itself instead.
972
973         * dom/Element.cpp:
974         (WebCore::layoutOverflowRectContainsAllDescendants): This expects ancestor containing block.
975         * rendering/LogicalSelectionOffsetCaches.h:
976         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
977         * rendering/RenderElement.cpp:
978         (WebCore::containingBlockForFixedPosition):
979         (WebCore::containingBlockForAbsolutePosition):
980         (WebCore::containingBlockForObjectInFlow):
981         * rendering/RenderElement.h:
982         * rendering/RenderInline.cpp:
983         (WebCore::RenderInline::styleWillChange):
984         * rendering/RenderLineBreak.cpp:
985         (WebCore::RenderLineBreak::collectSelectionRects): Not a behaviour change.
986         * rendering/RenderObject.cpp:
987         (WebCore::RenderObject::containingBlock): RenderScrollbarPart renderer now returns
988         the containing block based on its owning renderer's style.
989
990 2016-05-16  Brent Fulgham  <bfulgham@apple.com>
991
992         REGRESSION (r192098): Content missing after copy and paste to Notes App on retina displays
993         https://bugs.webkit.org/show_bug.cgi?id=157630
994         <rdar://problem/25277577>
995
996         Reviewed by Simon Fraser.
997
998         Tested by http/tests/images/hidpi-srcset-copy.html
999
1000         The code to create a WebArchive (or other representation) of a webpage was using the 'src' attribute of
1001         the image element, which might be changed to reflect the optimal image dimensions for a specific
1002         display. Instead, we should use the 'imageSourceURL' method of the Element class so we get the correct
1003         'original' image URL in our cached resources.
1004
1005         * editing/cocoa/HTMLConverter.mm:
1006         (HTMLConverter::_processElement): Use 'imageSourceURL', rather than getting the raw 'src' attribute.
1007         * html/HTMLImageElement.cpp:
1008         (WebCore::HTMLImageElement::addSubresourceAttributeURLs): Ditto.
1009
1010 2016-05-16  Brady Eidson  <beidson@apple.com>
1011
1012         Random CachedFont.cpp cleanup.
1013         https://bugs.webkit.org/show_bug.cgi?id=157740
1014
1015         Reviewed by Myles C. Maxfield.
1016
1017         No new tests (Refactor/cleanup, no behavior change)
1018
1019         * loader/cache/CachedFont.cpp:
1020         (WebCore::CachedFont::ensureCustomFontData): Remove unneeded local RefPtr<>
1021         (WebCore::CachedFont::createCustomFontData): Refactor to not require unnecessary Ref-churn in the common case.
1022
1023 2016-05-16  Chris Dumez  <cdumez@apple.com>
1024
1025         Modernize Track classes' code
1026         https://bugs.webkit.org/show_bug.cgi?id=157735
1027
1028         Reviewed by Eric Carlson.
1029
1030         Modernize Track classes' code a bit.
1031
1032         * Modules/mediasource/MediaSource.cpp:
1033         (WebCore::MediaSource::removeSourceBuffer):
1034         * Modules/mediasource/SourceBuffer.cpp:
1035         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
1036         * bindings/js/JSTrackCustom.cpp:
1037         (WebCore::toTrack):
1038         (WebCore::toJS):
1039         * html/HTMLMediaElement.cpp:
1040         (WebCore::HTMLMediaElement::audioTrackEnabledChanged):
1041         (WebCore::HTMLMediaElement::textTrackModeChanged):
1042         (WebCore::HTMLMediaElement::videoTrackSelectedChanged):
1043         (WebCore::HTMLMediaElement::textTrackRemoveCues):
1044         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
1045         (WebCore::HTMLMediaElement::addAudioTrack):
1046         (WebCore::HTMLMediaElement::addTextTrack):
1047         (WebCore::HTMLMediaElement::addVideoTrack):
1048         (WebCore::HTMLMediaElement::removeAudioTrack):
1049         (WebCore::HTMLMediaElement::removeTextTrack):
1050         (WebCore::HTMLMediaElement::removeVideoTrack):
1051         (WebCore::HTMLMediaElement::forgetResourceSpecificTracks):
1052         (WebCore::HTMLMediaElement::audioTracks):
1053         (WebCore::HTMLMediaElement::textTracks):
1054         (WebCore::HTMLMediaElement::videoTracks):
1055         (WebCore::HTMLMediaElement::didAddTextTrack):
1056         (WebCore::HTMLMediaElement::didRemoveTextTrack):
1057         (WebCore::HTMLMediaElement::setSelectedTextTrack):
1058         (WebCore::HTMLMediaElement::textTrackAddCues): Deleted.
1059         (WebCore::HTMLMediaElement::closeCaptionTracksChanged): Deleted.
1060         * html/HTMLMediaElement.h:
1061         * html/shadow/MediaControlElements.cpp:
1062         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
1063         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
1064         * html/track/AudioTrack.cpp:
1065         (WebCore::AudioTrack::~AudioTrack):
1066         (WebCore::AudioTrack::setPrivate):
1067         (WebCore::AudioTrack::isValidKind):
1068         (WebCore::AudioTrack::willRemove):
1069         (WebCore::AudioTrack::setEnabled): Deleted.
1070         (WebCore::AudioTrack::updateKindFromPrivate): Deleted.
1071         * html/track/AudioTrack.h:
1072         (isType):
1073         * html/track/AudioTrackList.cpp:
1074         (AudioTrackList::append):
1075         (AudioTrackList::item):
1076         (AudioTrackList::getTrackById):
1077         (AudioTrackList::eventTargetInterface): Deleted.
1078         * html/track/AudioTrackList.h:
1079         * html/track/InbandTextTrack.cpp:
1080         (WebCore::InbandTextTrack::willRemove):
1081         * html/track/TextTrack.cpp:
1082         (WebCore::TextTrack::setKind):
1083         (WebCore::TextTrack::trackIndex):
1084         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
1085         (WebCore::TextTrack::setLanguage):
1086         * html/track/TextTrack.h:
1087         (isType):
1088         * html/track/TextTrackList.cpp:
1089         (TextTrackList::getTrackIndex):
1090         (TextTrackList::getTrackIndexRelativeToRenderedTracks):
1091         (TextTrackList::item):
1092         (TextTrackList::getTrackById):
1093         (TextTrackList::invalidateTrackIndexesAfterTrack):
1094         (TextTrackList::append):
1095         (TextTrackList::remove):
1096         (TextTrackList::contains):
1097         * html/track/TextTrackList.h:
1098         * html/track/TrackBase.h:
1099         * html/track/TrackEvent.cpp:
1100         (WebCore::TrackEvent::TrackEvent):
1101         * html/track/TrackEvent.h:
1102         * html/track/TrackListBase.cpp:
1103         (TrackListBase::remove):
1104         (TrackListBase::contains):
1105         (TrackListBase::scheduleTrackEvent):
1106         (TrackListBase::scheduleAddTrackEvent):
1107         (TrackListBase::scheduleRemoveTrackEvent):
1108         * html/track/TrackListBase.h:
1109         * html/track/VideoTrack.cpp:
1110         (WebCore::VideoTrack::willRemove):
1111         (WebCore::VideoTrack::setKind):
1112         (WebCore::VideoTrack::setLanguage):
1113         * html/track/VideoTrack.h:
1114         (isType):
1115         * html/track/VideoTrackList.cpp:
1116         (VideoTrackList::append):
1117         (VideoTrackList::item):
1118         (VideoTrackList::getTrackById):
1119         (VideoTrackList::selectedIndex):
1120         * html/track/VideoTrackList.h:
1121
1122 2016-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1123
1124         CSSParser.cpp triggers -Wunused-parameter
1125         https://bugs.webkit.org/show_bug.cgi?id=157734
1126
1127         Reviewed by Csaba Osztrogonác.
1128
1129         * css/CSSParser.cpp:
1130         (WebCore::isValidKeywordPropertyAndValue):
1131
1132 2016-05-16  Zan Dobersek  <zdobersek@igalia.com>
1133
1134         [Cairo] GraphicsContext3D::ImageExtractor should use the correct size for copying non-image surfaces
1135         https://bugs.webkit.org/show_bug.cgi?id=157580
1136
1137         Reviewed by Darin Adler.
1138
1139         GraphicsContext3D::ImageExtractor::extractImage() shouldn't use m_imageWidth
1140         and m_imageHeight members when copying the non-image-backed Cairo surface into
1141         the image-based replacement simply because these two are not initialized until
1142         later in this method.
1143
1144         Instead, the size of the to-be-copied image should be queried via the
1145         cairoSurfaceSize() utility function which properly handles Cairo surfaces of
1146         different types.
1147
1148         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1149         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
1150
1151 2016-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1152
1153         REGRESSION (r199821): Large animated GIFs with slow network do not animate till the last frame
1154         https://bugs.webkit.org/show_bug.cgi?id=157500
1155
1156         Reviewed by Darin Adler.
1157
1158         r199821 relies on the assumption that the image frameCount can be retrieved
1159         only once when the image size is available and it is not going to change. It
1160         turned out this assumption is wrong for some animated GIFs. The frameCount
1161         can change every time a new data block is decoded.
1162
1163         The fix is to invalidate the image cached metadata every time a new data
1164         block is decoded.
1165
1166         Test: http/tests/misc/slow-loading-animated-image.html
1167
1168         * platform/graphics/BitmapImage.cpp:
1169         (WebCore::BitmapImage::BitmapImage): Move the "fromImage" BitmapImage constructor
1170         to BitmapImage.cpp. The ImageSource needs to be initialized differently for
1171         this case from the decoder image case. Also get rid of the template constructor.
1172         Most of the flags of the BitmapImage will be deleted with the asynchronous image
1173         decoding work.
1174         
1175         (WebCore::BitmapImage::cacheFrame): Delete unused flag m_hasUniformFrameSize.
1176         It was added in r35761 and was mainly used by BitmapImage::currentFrameSize().
1177         But this function itself was deleted in r172348.
1178         
1179         (WebCore::BitmapImage::dataChanged): Invalidate the image metadata cache.
1180         
1181         * platform/graphics/BitmapImage.h:
1182         (WebCore::BitmapImage::BitmapImage): Deleted.
1183         Delete unused flag m_hasUniformFrameSize. Also define new static functions in
1184         FrameData to calculate platform dependent properties of an image.
1185         
1186         * platform/graphics/ImageSource.cpp:
1187         (WebCore::ImageSource::ImageSource): Add a new constructor for the "fromImage"
1188         BitmapImage case. The purpose of this constructor is to keep m_needsUpdateMetadata
1189         and m_maximumSubsamplingLevel be initialized as they are in the class definition.
1190         This constructor will be used with the asynchronous image decoding work where the
1191         ImageSource needs to cache the FrameData.
1192         
1193         (WebCore::ImageSource::updateMetadata): If needsUpdateMetaData() is true, cache new metadata.
1194         
1195         (WebCore::ImageSource::subsamplingLevelForScale): Call updateMetadata() with its new name.
1196         (WebCore::ImageSource::frameCount): Ditto
1197         (WebCore::ImageSource::cacheMetadata): Deleted.
1198         
1199         * platform/graphics/ImageSource.h:
1200         (WebCore::ImageSource::setNeedsUpdateMetadata): Invalidate the image cached metadata.
1201         
1202         * platform/graphics/cairo/BitmapImageCairo.cpp:
1203         (WebCore::NativeImage::size):
1204         (WebCore::NativeImage::hasAlpha):
1205         (WebCore::BitmapImage::BitmapImage): Deleted.
1206         Delete the "fromImage" BitmapImage constructor from this file since it is now platform
1207         independent and has been moved to BitmapImage.cpp. Also add the new NativeImage platform
1208         dependent functions which are used by the new "fromImage" BitmapImage constructor.
1209         
1210         * platform/graphics/cg/BitmapImageCG.cpp:
1211         (WebCore::NativeImage::size):
1212         (WebCore::NativeImage::hasAlpha):
1213         (WebCore::BitmapImage::BitmapImage): Deleted.
1214         Ditto.
1215
1216 2016-05-15  Frederic Wang  <fwang@igalia.com>
1217
1218         Small removal of useless code for MathML token elements
1219         https://bugs.webkit.org/show_bug.cgi?id=157568
1220
1221         Reviewed by Darin Adler.
1222
1223         We remove two pieces of code for MathML token elements with unclear purposes and that do not
1224         have any effect on math rendering.
1225
1226         No new tests, behavior is unchanged.
1227
1228         * css/mathml.css:
1229         (mtext): Deleted. This was probably a hack that is no longer needed with the latest math font
1230         ascent/descent management.
1231         * mathml/MathMLTextElement.cpp:
1232         (WebCore::MathMLTextElement::createElementRenderer): Deleted. Removing this does not break
1233         the mentioned test.
1234
1235 2016-05-15  Chris Dumez  <cdumez@apple.com>
1236
1237         Use more references in JS wrappers related code
1238         https://bugs.webkit.org/show_bug.cgi?id=157721
1239
1240         Reviewed by Darin Adler.
1241
1242         - Use more references in JS wrappers related code.
1243         - Avoid some refcounting churn when using toJSNewlyCreated() and in
1244           HTML/SVG elements factories by moving the Ref<> around.
1245         - Add toJS() / toJSNewlyCreated() implementations for Text, XMLDocument
1246           and HTMLDocument. Now that toJSNewlyCreated() takes a Ref<>&& /
1247           RefPtr<>&& in, the compiler is no longer able to implicitly use the
1248           toJSNewlyCreated() implementation of a parent class for a subclass
1249           type (complains about calls being ambiguous). I thought about updating
1250           the bindings generator to always generate a toJSNewlyCreated() for
1251           all wrapper types (that would call the one on the parent class if the
1252           subclass does not have a proper implementation). However this would
1253           add some complexity to the bindings generator and it did not seem
1254           worth it because [NewObject] and therefore toJSNewlyCreated() is only
1255           used for a very limited set of subtypes. I have therefore decided to
1256           add the toJS() / toJSNewlyCreated() implementations for the subtypes
1257           in question. This also has the benefit of avoiding calling the more
1258           complex implementations on Node / Document.
1259
1260         * CMakeLists.txt:
1261         * WebCore.xcodeproj/project.pbxproj:
1262         * bindings/js/JSAnimationTimelineCustom.cpp:
1263         (WebCore::toJS):
1264         * bindings/js/JSAudioContextCustom.cpp:
1265         (WebCore::constructJSAudioContext):
1266         * bindings/js/JSBindingsAllInOne.cpp:
1267         * bindings/js/JSBlobCustom.cpp:
1268         (WebCore::constructJSBlob):
1269         * bindings/js/JSCSSRuleCustom.cpp:
1270         (WebCore::toJS):
1271         * bindings/js/JSCSSValueCustom.cpp:
1272         (WebCore::toJS):
1273         * bindings/js/JSDOMBinding.h:
1274         (WebCore::getCachedWrapper):
1275         (WebCore::createWrapper):
1276         (WebCore::wrap):
1277         (WebCore::getExistingWrapper):
1278         (WebCore::createNewWrapper):
1279         (WebCore::toJS):
1280         (WebCore::finiteInt32Value): Deleted.
1281         * bindings/js/JSDocumentCustom.cpp:
1282         (WebCore::createNewDocumentWrapper):
1283         (WebCore::toJS):
1284         (WebCore::cachedDocumentWrapper):
1285         (WebCore::reportMemoryForFramelessDocument):
1286         (WebCore::toJSNewlyCreated):
1287         * bindings/js/JSDocumentCustom.h:
1288         * bindings/js/JSDocumentFragmentCustom.cpp:
1289         (WebCore::createNewDocumentFragmentWrapper):
1290         (WebCore::toJSNewlyCreated):
1291         (WebCore::toJS):
1292         * bindings/js/JSElementCustom.cpp:
1293         (WebCore::toJSNewlyCreated):
1294         * bindings/js/JSElementCustom.h:
1295         (WebCore::toJSNewlyCreated):
1296         * bindings/js/JSEventCustom.cpp:
1297         (WebCore::createNewEventWrapper):
1298         (WebCore::toJS):
1299         (WebCore::toJSNewlyCreated):
1300         * bindings/js/JSFileCustom.cpp:
1301         (WebCore::constructJSFile):
1302         * bindings/js/JSHTMLCollectionCustom.cpp:
1303         (WebCore::toJS):
1304         * bindings/js/JSHTMLDocumentCustom.cpp:
1305         (WebCore::createNewHTMLDocumentWrapper):
1306         (WebCore::toJS):
1307         (WebCore::toJSNewlyCreated):
1308         * bindings/js/JSHTMLTemplateElementCustom.cpp:
1309         (WebCore::JSHTMLTemplateElement::content):
1310         * bindings/js/JSImageDataCustom.cpp:
1311         (WebCore::toJS):
1312         * bindings/js/JSNodeCustom.cpp:
1313         (WebCore::createWrapperInline):
1314         (WebCore::createWrapper):
1315         (WebCore::toJSNewlyCreated):
1316         (WebCore::getOutOfLineCachedWrapper):
1317         * bindings/js/JSNodeCustom.h:
1318         (WebCore::toJS):
1319         * bindings/js/JSNodeListCustom.cpp:
1320         (WebCore::createWrapper):
1321         (WebCore::toJSNewlyCreated):
1322         * bindings/js/JSNodeListCustom.h:
1323         (WebCore::toJS):
1324         * bindings/js/JSRTCPeerConnectionCustom.cpp:
1325         (WebCore::constructJSRTCPeerConnection):
1326         * bindings/js/JSRTCSessionDescriptionCustom.cpp:
1327         (WebCore::constructJSRTCSessionDescription):
1328         * bindings/js/JSSVGPathSegCustom.cpp:
1329         (WebCore::toJS):
1330         * bindings/js/JSStyleSheetCustom.cpp:
1331         (WebCore::toJS):
1332         * bindings/js/JSTextCustom.cpp: Copied from Source/WebCore/dom/XMLDocument.idl.
1333         (WebCore::createNewTextWrapper):
1334         (WebCore::toJS):
1335         (WebCore::toJSNewlyCreated):
1336         * bindings/js/JSTextTrackCueCustom.cpp:
1337         (WebCore::toJS):
1338         * bindings/js/JSTrackCustom.cpp:
1339         (WebCore::toJS):
1340         * bindings/js/JSXMLDocumentCustom.cpp: Copied from Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp.
1341         (WebCore::createNewXMLDocumentWrapper):
1342         (WebCore::toJS):
1343         (WebCore::toJSNewlyCreated):
1344         * bindings/scripts/CodeGeneratorJS.pm:
1345         (GenerateHeader):
1346         (GenerateImplementation):
1347         * bindings/scripts/test/JS/*: Rebaseline bindings tests.
1348         * dom/Element.cpp:
1349         (WebCore::Element::setInnerHTML):
1350         * dom/Text.idl:
1351         * dom/XMLDocument.idl:
1352         * dom/make_names.pl:
1353         (printWrapperFunctions):
1354         (printWrapperFactoryCppFile):
1355         (printWrapperFactoryHeaderFile):
1356         * editing/MarkupAccumulator.cpp:
1357         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1358         * html/HTMLDocument.idl:
1359         * html/HTMLTemplateElement.cpp:
1360         (WebCore::HTMLTemplateElement::content):
1361         (WebCore::HTMLTemplateElement::cloneNodeInternal):
1362         * html/HTMLTemplateElement.h:
1363         * html/parser/HTMLConstructionSite.cpp:
1364         (WebCore::insert):
1365         (WebCore::HTMLConstructionSite::insertTextNode):
1366         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
1367         * inspector/InspectorDOMAgent.cpp:
1368         (WebCore::InspectorDOMAgent::buildObjectForNode):
1369         * xml/parser/XMLDocumentParserLibxml2.cpp:
1370         (WebCore::XMLDocumentParser::startElementNs):
1371
1372 2016-05-15  Darin Adler  <darin@apple.com>
1373
1374         Something tiny left out of the last patch.
1375
1376         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to update this file.
1377         * editing/ApplyStyleCommand.cpp:
1378         (WebCore::ApplyStyleCommand::applyInlineStyleChange): Removed unneeded null check; all
1379         code paths already have null checks.
1380
1381 2016-05-15  Darin Adler  <darin@apple.com>
1382
1383         More CTTE and other cleanups for HTML editing header
1384         https://bugs.webkit.org/show_bug.cgi?id=157722
1385
1386         Reviewed by Chris Dumez.
1387
1388         These changes are mostly things Chris asked for in his review of my last patch
1389         or other related style and small efficiency improvements.
1390
1391         - using nullptr instead of 0
1392         - using is<Text> instead of isTextNode and is<> instead of hasTagName
1393         - changing argument type of functions like editingIgnoresContent to a reference
1394         - using { } instead of constructor calls for classes like Position
1395         - using words like position intead of abbreviations like pos
1396         - using auto rather than explicit types
1397         - rename functions that return true for HTMLElement to express that in the function names
1398
1399         * dom/Position.cpp:
1400         (WebCore::nextRenderedEditable): nullptr
1401         (WebCore::previousRenderedEditable): nullptr
1402         (WebCore::Position::Position): is<>, reference
1403         (WebCore::Position::moveToPosition): reference
1404         (WebCore::Position::offsetForPositionAfterAnchor): Added a null assertion and
1405         null check that replaces the one that used to be in lastOffsetForEditing.
1406         (WebCore::Position::parentAnchoredEquivalent): { }, reference
1407         (WebCore::Position::computeNodeBeforePosition): nullptr
1408         (WebCore::Position::computeNodeAfterPosition): nullptr
1409         (WebCore::Position::anchorTypeForLegacyEditingPosition): reference
1410         (WebCore::Position::previous): reference
1411         (WebCore::Position::next): reference
1412         (WebCore::Position::parentEditingBoundary): nullptr
1413         (WebCore::Position::previousCharacterPosition): { }, pos -> position
1414         (WebCore::Position::nextCharacterPosition): { }, pos -> position
1415         (WebCore::endsOfNodeAreVisuallyDistinctPositions): reference
1416         (WebCore::Position::upstream): { }, pos -> position
1417         (WebCore::Position::downstream): { }, pos -> position
1418         (WebCore::Position::rootUserSelectAllForNode): nullptr
1419         (WebCore::Position::isCandidate): auto, reference, is<>
1420         (WebCore::Position::rendersInDifferentPosition): pos -> position, auto, is<>
1421         (WebCore::Position::leadingWhitespacePosition): { }, is<>
1422         (WebCore::Position::trailingWhitespacePosition): { }
1423         (WebCore::Position::getInlineBoxAndOffset): reference
1424         (WebCore::Position::equals): reference, is<>
1425
1426         * dom/PositionIterator.cpp:
1427         (WebCore::PositionIterator::operator Position): reference
1428         (WebCore::PositionIterator::isCandidate): reference
1429
1430         * editing/ApplyStyleCommand.cpp:
1431         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): is<>
1432         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): is<>, reference
1433         (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun): reference
1434         (WebCore::ApplyStyleCommand::removeInlineStyle): auto, is<>, reference
1435         (WebCore::ApplyStyleCommand::nodeFullySelected): is<>
1436         (WebCore::ApplyStyleCommand::nodeFullyUnselected): is<>
1437         (WebCore::ApplyStyleCommand::splitTextAtStart): is<>
1438         (WebCore::ApplyStyleCommand::splitTextElementAtStart): is<>
1439         (WebCore::ApplyStyleCommand::splitTextElementAtEnd): is<>
1440         (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode): is<>
1441         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Removed unneeded
1442         is<Element> calls before calling areIdenticalElements.
1443         (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange): Tightened
1444         up logic for the loop to avoid redundant checks.
1445         (WebCore::ApplyStyleCommand::applyInlineStyleChange): auto
1446
1447         * editing/CompositeEditCommand.cpp:
1448         (WebCore::CompositeEditCommand::insertNodeAt): reference
1449         (WebCore::CompositeEditCommand::appendNode): reference
1450         (WebCore::CompositeEditCommand::moveParagraphs): isListHTMLElement
1451
1452         * editing/DeleteSelectionCommand.cpp:
1453         (WebCore::DeleteSelectionCommand::handleGeneralDelete): reference
1454
1455         * editing/FormatBlockCommand.cpp: Fixed order of includes.
1456         (WebCore::enclosingBlockToSplitTreeTo): isListHTMLElement
1457
1458         * editing/InsertParagraphSeparatorCommand.cpp:
1459         (WebCore::InsertParagraphSeparatorCommand::doApply): reference
1460
1461         * editing/ModifySelectionListLevel.cpp:
1462         (WebCore::getStartEndListChildren): isListHTMLElement
1463         (WebCore::IncreaseSelectionListLevelCommand::doApply):isListHTMLElement
1464         (WebCore::canDecreaseListLevel):isListHTMLElement
1465
1466         * editing/RemoveNodeCommand.cpp: Removed unneeded include.
1467
1468         * editing/ReplaceNodeWithSpanCommand.cpp:
1469         (WebCore::ReplaceNodeWithSpanCommand::doApply): Use HTMLSpanElement::create.
1470
1471         * editing/ReplaceSelectionCommand.cpp:
1472         (WebCore::isInterchangeNewlineNode): is<>, downcast<>
1473         (WebCore::isInterchangeConvertedSpaceSpan): is<>, downcast<>
1474         (WebCore::positionAvoidingPrecedingNodes): pos -> position, reference
1475         (WebCore::ReplaceSelectionCommand::doApply): isListHTMLElement
1476         (WebCore::ReplaceSelectionCommand::insertAsListItems): isListHTMLElement
1477
1478         * editing/SpellChecker.cpp: Removed unneeded include.
1479
1480         * editing/TextIterator.cpp:
1481         (WebCore::SimplifiedBackwardsTextIterator::advance): reference
1482
1483         * editing/VisibleSelection.cpp:
1484         (WebCore::VisibleSelection::selectionFromContentsOfNode): reference
1485
1486         * editing/VisibleUnits.cpp:
1487         (WebCore::previousLinePosition): reference
1488         (WebCore::nextLinePosition): reference
1489         (WebCore::findStartOfParagraph): reference
1490         (WebCore::findEndOfParagraph): reference
1491
1492         * editing/htmlediting.cpp:
1493         (WebCore::canHaveChildrenForEditing): Moved here from header file so we don't
1494         have to include "Text.h". Not critical to inline this.
1495         (WebCore::isAtomicNode): reference
1496         (WebCore::lastOffsetForEditing): reference
1497         (WebCore::stringWithRebalancedWhitespace): Changed to use StringBuilder instead
1498         of Vector<UChar> so this won't turn 8-bit strings into 16-bit strings. Changed
1499         to not use the StringBuilder at all until we encounter a character that needs
1500         to be changed.
1501         (WebCore::isSpecialHTMLElement): Renamed to make it clear that it only can return
1502         true for a Node that is an HTMLElement.
1503         (WebCore::firstInSpecialElement): isSpecialHTMLElement
1504         (WebCore::lastInSpecialElement): isSpecialHTMLElement
1505         (WebCore::isListHTMLElement): Renamed to make it clear that it can only return
1506         true for a Node that is an HTMLElement.
1507         (WebCore::isListItem): isListHTMLElement, is<>
1508         (WebCore::enclosingNodeOfType): p -> position, nullptr
1509         (WebCore::highestEnclosingNodeOfType): p -> position
1510         (WebCore::enclosingListChild): isListHTMLElement, is<>
1511         (WebCore::embeddedSublist): isListHTMLElement
1512         (WebCore::appendedSublist):isListHTMLElement
1513         (WebCore::caretMaxOffset): is<>
1514         (WebCore::caretRendersInsideNode): changed to take a reference
1515         (WebCore::rendererForCaretPainting): reference
1516
1517         * editing/htmlediting.h: Updated for name changes and type changes above.
1518
1519         * editing/markup.cpp:
1520         (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): reference
1521         (WebCore::highestAncestorToWrapMarkup): auto, reference, isListHTMLElement
1522
1523         * html/HTMLSpanElement.cpp:
1524         (WebCore::HTMLSpanElement::create): Added overload that does not require a tag name.
1525         * html/HTMLSpanElement.h: Ditto.
1526
1527         * page/DOMSelection.cpp: Removed unneeded includes.
1528
1529         * rendering/RenderBox.cpp:
1530         (WebCore::RenderBox::localCaretRect): reference
1531
1532 2016-05-15  Commit Queue  <commit-queue@webkit.org>
1533
1534         Unreviewed, rolling out r200925.
1535         https://bugs.webkit.org/show_bug.cgi?id=157725
1536
1537         Does not build if MEDIA_SESSION is enabled (Requested by
1538         cdumez_ on #webkit).
1539
1540         Reverted changeset:
1541
1542         "Use new Web IDL dictionary support for
1543         MediaSession.setMetadata()"
1544         https://bugs.webkit.org/show_bug.cgi?id=157711
1545         http://trac.webkit.org/changeset/200925
1546
1547 2016-05-14  Chris Dumez  <cdumez@apple.com>
1548
1549         Use new Web IDL dictionary support for MediaSession.setMetadata()
1550         https://bugs.webkit.org/show_bug.cgi?id=157711
1551
1552         Reviewed by Eric Carlson.
1553
1554         Use new Web IDL dictionary support for MediaSession.setMetadata().
1555
1556         No new tests, no intended Web-exposed behavior change.
1557
1558         * Modules/mediasession/MediaSession.cpp:
1559         (WebCore::MediaSession::setMetadata):
1560         (WebCore::MediaSession::deactivate): Deleted.
1561         * Modules/mediasession/MediaSession.h:
1562         * Modules/mediasession/MediaSession.idl:
1563
1564 2016-05-14  Joseph Pecoraro  <pecoraro@apple.com>
1565
1566         Remove LegacyProfiler
1567         https://bugs.webkit.org/show_bug.cgi?id=153565
1568
1569         Reviewed by Mark Lam.
1570
1571         * CMakeLists.txt:
1572         * DerivedSources.cpp:
1573         * DerivedSources.make:
1574         * ForwardingHeaders/profiler/LegacyProfiler.h: Removed.
1575         * ForwardingHeaders/profiler/Profile.h: Removed.
1576         * ForwardingHeaders/profiler/ProfileNode.h: Removed.
1577         * WebCore.xcodeproj/project.pbxproj:
1578         * bindings/js/JSCustomXPathNSResolver.cpp:
1579         * bindings/js/JSDOMWindowBase.cpp:
1580         (WebCore::JSDOMWindowBase::supportsLegacyProfiling): Deleted.
1581         (WebCore::JSDOMWindowBase::supportsRichSourceInfo): Deleted.
1582         * bindings/js/JSDOMWindowBase.h:
1583         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1584         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling): Deleted.
1585         * bindings/js/JSWorkerGlobalScopeBase.h:
1586         * bindings/js/ScriptCachedFrameData.cpp:
1587         * bindings/js/ScriptController.cpp:
1588         (WebCore::ScriptController::clearWindowShell): Deleted.
1589         * bindings/js/ScriptProfile.h: Removed.
1590         * bindings/js/ScriptProfileNode.h: Removed.
1591         * bindings/scripts/CodeGeneratorJS.pm:
1592         (AddClassForwardIfNeeded): Deleted.
1593         * bindings/scripts/test/JS/JSTestObj.cpp:
1594         * bindings/scripts/test/TestObj.idl:
1595         * css/CSSParser.cpp:
1596         * dom/Document.cpp:
1597         * inspector/InspectorConsoleInstrumentation.h:
1598         (WebCore::InspectorInstrumentation::stopProfiling):
1599         * inspector/InspectorController.cpp:
1600         (WebCore::InspectorController::InspectorController):
1601         (WebCore::InspectorController::legacyProfilerEnabled): Deleted.
1602         (WebCore::InspectorController::setLegacyProfilerEnabled): Deleted.
1603         * inspector/InspectorController.h:
1604         * inspector/InspectorInstrumentation.cpp:
1605         (WebCore::InspectorInstrumentation::stopProfilingImpl):
1606         * inspector/InspectorInstrumentation.h:
1607         * inspector/InspectorTimelineAgent.cpp:
1608         (WebCore::InspectorTimelineAgent::startFromConsole):
1609         (WebCore::InspectorTimelineAgent::stopFromConsole):
1610         * inspector/InspectorTimelineAgent.h:
1611         * inspector/PageDebuggerAgent.cpp:
1612         * inspector/PageRuntimeAgent.cpp:
1613         * inspector/ScriptProfile.idl: Removed.
1614         * inspector/ScriptProfileNode.idl: Removed.
1615         * inspector/TimelineRecordFactory.cpp:
1616         (WebCore::buildAggregateCallInfoInspectorObject): Deleted.
1617         (WebCore::buildInspectorObject): Deleted.
1618         (WebCore::buildProfileInspectorObject): Deleted.
1619         (WebCore::TimelineRecordFactory::appendProfile): Deleted.
1620         * page/DOMWindow.cpp:
1621         * page/Page.cpp:
1622         * page/PageConsoleClient.cpp:
1623         (WebCore::PageConsoleClient::profileEnd):
1624         (WebCore::PageConsoleClient::clearProfiles): Deleted.
1625         * page/PageConsoleClient.h:
1626         * testing/Internals.cpp:
1627         (WebCore::Internals::resetToConsistentState): Deleted.
1628         (WebCore::Internals::consoleProfiles): Deleted.
1629         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled): Deleted.
1630         * testing/Internals.h:
1631         * testing/Internals.idl:
1632         * testing/js/WebCoreTestSupport.cpp:
1633         * xml/XSLStyleSheetLibxslt.cpp:
1634         * xml/XSLTProcessorLibxslt.cpp:
1635
1636 2016-05-13  Ryosuke Niwa  <rniwa@webkit.org>
1637
1638         ToT WebKit doesn't show tooltip on perf dashboard's summary page
1639         https://bugs.webkit.org/show_bug.cgi?id=157705
1640
1641         Reviewed by Darin Adler.
1642
1643         The bug was caused by WebKit doesn't look for the title attribute across shadow boundaries.
1644         Fixed it by using a newly added Node::parentNodeInComposedTree in HitTestResult::title.
1645
1646         Test: fast/shadow-dom/tooltip-on-composed-tree.html
1647
1648         * dom/Node.cpp:
1649         (WebCore::Node::parentInComposedTree): Added.
1650         * dom/Node.h:
1651         * rendering/HitTestResult.cpp:
1652         (WebCore::HitTestResult::title): Fixed the bug.
1653         (WebCore::HitTestResult::innerTextIfTruncated): Fixed a related bug when ShowsToolTipOverTruncatedText
1654         is enabled. Unfortunately, there is no machinery to test this feature yet.
1655
1656 2016-05-14  Darin Adler  <darin@apple.com>
1657
1658         CTTE for the HTML editing header
1659         https://bugs.webkit.org/show_bug.cgi?id=157676
1660
1661         Reviewed by Chris Dumez.
1662
1663         * accessibility/AXObjectCache.cpp:
1664         (WebCore::AccessibilityReplacedText::postTextStateChangeNotification): Use auto so we have a
1665         change to compile more efficient code using the more specific types returned, rather than
1666         explicitly using a less specific type like Node.
1667         (WebCore::AXObjectCache::startCharacterOffsetOfParagraph): Ditto.
1668         * accessibility/atk/WebKitAccessibleInterfaceText.cpp: Update for deprecatedIsEditingWhitespace name.
1669         * dom/Position.cpp:
1670         (WebCore::Position::offsetForPositionAfterAnchor): Update to use a reference instead of a pointer.
1671         (WebCore::Position::next): Ditto.
1672         (WebCore::Position::atFirstEditingPositionForNode): Ditto.
1673         (WebCore::Position::atLastEditingPositionForNode): Ditto.
1674         (WebCore::Position::atStartOfTree): Ditto.
1675         (WebCore::Position::atEndOfTree): Ditto.
1676         (WebCore::Position::upstream): Ditto.
1677         (WebCore::Position::downstream): Ditto.
1678         (WebCore::Position::rendersInDifferentPosition): Ditto.
1679         * dom/PositionIterator.cpp:
1680         (WebCore::PositionIterator::increment): Ditto.
1681         (WebCore::PositionIterator::decrement): Ditto.
1682         (WebCore::PositionIterator::atEnd): Ditto.
1683         (WebCore::PositionIterator::atEndOfNode): Ditto.
1684         * editing/AlternativeTextController.cpp:
1685         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
1686         Use new name, deprecatedIsEditingWhitespace.
1687         * editing/ApplyBlockElementCommand.cpp:
1688         (WebCore::ApplyBlockElementCommand::formatSelection): Use auto (see rationale above).
1689         * editing/ApplyStyleCommand.cpp:
1690         (WebCore::ApplyStyleCommand::applyBlockStyle): More of the same.
1691         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Ditto.
1692         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): Ditto.
1693         (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode): Ditto.
1694         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): Ditto.
1695         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): Ditto.
1696         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Ditto.
1697         * editing/BreakBlockquoteCommand.cpp:
1698         (WebCore::BreakBlockquoteCommand::doApply): Ditto.
1699         * editing/CompositeEditCommand.cpp:
1700         (WebCore::postTextStateChangeNotification): Ditto.
1701         (WebCore::CompositeEditCommand::insertNodeAt): Ditto.
1702         (WebCore::CompositeEditCommand::positionOutsideTabSpan): Ditto.
1703         (WebCore::containsOnlyDeprecatedEditingWhitespace): Ditto.
1704         (WebCore::CompositeEditCommand::shouldRebalanceLeadingWhitespaceFor): Ditto.
1705         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Ditto.
1706         (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): Ditto.
1707         (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto.
1708         (WebCore::CompositeEditCommand::moveParagraphWithClones): Ditto.
1709         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
1710         * editing/DeleteSelectionCommand.cpp:
1711         (WebCore::DeleteSelectionCommand::initializeStartEnd): Ditto.
1712         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Ditto.
1713         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
1714         (WebCore::DeleteSelectionCommand::doApply): Ditto.
1715         * editing/EditCommand.cpp:
1716         (WebCore::EditCommand::postTextStateChangeNotification): Ditto.
1717         * editing/EditingStyle.cpp: Ditto.
1718         * editing/Editor.cpp:
1719         (WebCore::Editor::advanceToNextMisspelling): Ditto.
1720         * editing/FormatBlockCommand.cpp:
1721         (WebCore::FormatBlockCommand::formatRange): Ditto.
1722         * editing/IndentOutdentCommand.cpp:
1723         (WebCore::IndentOutdentCommand::outdentParagraph): Ditto.
1724         * editing/InsertLineBreakCommand.cpp:
1725         (WebCore::InsertLineBreakCommand::doApply): Ditto.
1726         * editing/InsertListCommand.cpp:
1727         (WebCore::InsertListCommand::fixOrphanedListChild): Ditto.
1728         (WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
1729         (WebCore::InsertListCommand::unlistifyParagraph): Ditto.
1730         (WebCore::InsertListCommand::listifyParagraph): Ditto.
1731         * editing/InsertParagraphSeparatorCommand.cpp:
1732         (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
1733         * editing/InsertTextCommand.cpp:
1734         (WebCore::InsertTextCommand::insertTab): Ditto.
1735         * editing/ModifySelectionListLevel.cpp:
1736         (WebCore::IncreaseSelectionListLevelCommand::doApply): Ditto.
1737         * editing/ReplaceSelectionCommand.cpp:
1738         (WebCore::ReplacementFragment::removeUnrenderedNodes): Ditto.
1739         (WebCore::ReplaceSelectionCommand::shouldMerge): Ditto.
1740         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): Ditto.
1741         (WebCore::ReplaceSelectionCommand::mergeEndIfNeeded): Ditto.
1742         (WebCore::enclosingInline): Ditto.
1743         (WebCore::ReplaceSelectionCommand::doApply): Ditto.
1744         * editing/TextIterator.cpp:
1745         (WebCore::maxOffsetIncludingCollapsedSpaces): Ditto.
1746         * editing/TypingCommand.cpp:
1747         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1748         * editing/VisiblePosition.cpp:
1749         (WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore): Ditto.
1750         (WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter): Ditto.
1751         * editing/VisibleSelection.cpp:
1752         (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity): Ditto.
1753         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): Ditto.
1754         * editing/VisibleUnits.cpp:
1755         (WebCore::previousRootInlineBoxCandidatePosition): Ditto.
1756         (WebCore::nextRootInlineBoxCandidatePosition): Ditto.
1757         (WebCore::startOfParagraph): Ditto.
1758         (WebCore::endOfParagraph): Ditto.
1759         (WebCore::startOfEditableContent): Ditto.
1760         (WebCore::endOfEditableContent): Ditto.
1761
1762         * editing/htmlediting.cpp:
1763         (WebCore::highestEditableRoot): Changed return type to ContainerNode. Maybe later could
1764         change it to Element.
1765         (WebCore::lowestEditableAncestor): Changed return type to Element.
1766         (WebCore::isEditableToAccessibility): Use auto.
1767         (WebCore::isRichlyEditablePosition): Ditto.
1768         (WebCore::editableRootForPosition): Ditto.
1769         (WebCore::unsplittableElementForPosition):Ditto.
1770         (WebCore::nextCandidate): Streamline.
1771         (WebCore::nextVisuallyDistinctCandidate): Ditto.
1772         (WebCore::previousCandidate): Ditto.
1773         (WebCore::previousVisuallyDistinctCandidate): Ditto.
1774         (WebCore::firstEditablePositionAfterPositionInRoot): Changed arugment type to
1775         ContainerNode.
1776         (WebCore::lastEditablePositionBeforePositionInRoot): Ditto.
1777         (WebCore::lastOffsetForEditing): Changed argument type to reference.
1778         (WebCore::stringWithRebalancedWhitespace): Optimized the case where the function does
1779         not need to change the string, so it just returns the passed string rather than a copy.
1780         (WebCore::isTableStructureNode): Use auto.
1781         (WebCore::isSpecialElement): Made this function private to the file. Use auto.
1782         (WebCore::firstInSpecialElement): Return an HTMLElement.
1783         (WebCore::lastInSpecialElement): Ditto.
1784         (WebCore::isFirstVisiblePositionInSpecialElement): Made this function private to the file.
1785         (WebCore::positionBeforeContainingSpecialElement): Changed out argument to HTMLElement.
1786         (WebCore::isLastVisiblePositionInSpecialElement): Ditto.
1787         (WebCore::positionAfterContainingSpecialElement): Ditto.
1788         (WebCore::positionOutsideContainingSpecialElement): Ditto.
1789         (WebCore::isFirstPositionAfterTable): Changed return type to Element.
1790         (WebCore::isLastPositionBeforeTable): Ditto.
1791         (WebCore::visiblePositionBeforeNode): Changed argument type to reference.
1792         (WebCore::visiblePositionAfterNode): Ditto.
1793         (WebCore::enclosingElementWithTag): Use auto. Removed special case for null since the
1794         algorithm already handles null correctly.
1795         (WebCore::enclosingNodeOfType): Use auto.
1796         (WebCore::highestEnclosingNodeOfType): Ditto.
1797         (WebCore::highestNodeToRemoveInPruning): Ditto.
1798         (WebCore::enclosingTableCell): Changed return type to Element.
1799         (WebCore::enclosingAnchorElement): Removed special case for null since the algorithm
1800         already handles null correctly.
1801         (WebCore::enclosingList): Use auto.
1802         (WebCore::enclosingListChild): Use auto.
1803         (WebCore::enclosingEmptyListItem): Use auto.
1804         (WebCore::outermostEnclosingList): Use auto.
1805         (WebCore::canMergeLists): Use references and more specific type. Since both elements are
1806         known to be HTMLElement, compare local names instead of using hasTagName.
1807         (WebCore::isRenderedTable): Use auto.
1808         (WebCore::isTableCell): Ditto.
1809         (WebCore::isEmptyTableCell): Ditto.
1810         (WebCore::createBreakElement): Deleted. Callers can use HTMLBRElement directly.
1811         (WebCore::createOrderedListElement): Deleted. Callers can use HTMLOListElement directly.
1812         (WebCore::createUnorderedListElement): Deleted. Callers can use HTMLUListElement directly.
1813         (WebCore::createListItemElement): Deleted. Callers can use HTMLLIElement directly.
1814         (WebCore::isTabSpanNode): Remove redundant checks and did more specific typecast.
1815         (WebCore::isTabSpanTextNode): Removed redundant null checks.
1816         (WebCore::tabSpanNode): Changed return type to HTMLSpanElement.
1817         (WebCore::positionOutsideTabSpan): Deleted. Unused function.
1818         (WebCore::createTabSpanElement): Made one of the overloads private to this file. Use auto.
1819         Changed argument type since we don't need to support null. Moved createEditingTextNode code,
1820         specific to the version without a string into that function rather than the helper function.
1821         (WebCore::isNodeRendered): Changed argument type to a reference.
1822         (WebCore::numEnclosingMailBlockquotes): Streamlined.
1823         (WebCore::isMailBlockquote): Use downcast instead of static_cast.
1824         (WebCore::caretMinOffset): Take a reference instead of a pointer.
1825         (WebCore::caretMaxOffset): Ditto.
1826         (WebCore::selectionForParagraphIteration): Use auto.
1827         (WebCore::indexForVisiblePosition): Ditto.
1828         (WebCore::visiblePositionForIndex): Ditto.
1829         (WebCore::visiblePositionForIndexUsingCharacterIterator): Ditto.
1830         (WebCore::isVisiblyAdjacent): Made this private to this file.
1831         (WebCore::isNodeVisiblyContainedWithin): Changed argument type to a reference.
1832         (WebCore::areIdenticalElements): Changed argument types to references.
1833         (WebCore::adjustedSelectionStartForStyleComputation): Use auto.
1834         (WebCore::isBlockFlowElement): Changed argument type to a reference. Use auto.
1835         (WebCore::deprecatedEnclosingBlockFlowElement): Updated for reference changes.
1836         (WebCore::rendererForCaretPainting): Use auto.
1837
1838         * editing/htmlediting.h: Use pragma once. Removed unneeded includes and forward declarations.
1839         Removed various non-helpful comments (the sections still don't make sense; not really good to
1840         group functions by their return types). Moved inline functoin bodies to the bottom of the file.
1841         Renamed isWhitespace to deprecatedIsEditingWhitespace.
1842
1843         * editing/markup.cpp:
1844         (WebCore::createFragmentFromText): Use HTMLBRElement.
1845         * page/DOMSelection.cpp:
1846         (WebCore::DOMSelection::extend): Updated since caretMaxOffset takes a reference.
1847
1848 2016-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
1849
1850         Support ArrayBufferViews in the CSS Font Loading API
1851         https://bugs.webkit.org/show_bug.cgi?id=157694
1852         <rdar://problem/25554267>
1853
1854         This patch adds a new mode to CSSFontFaceSource for immediate (ArrayBuffer) data.
1855         Then, FontFace can simply be hooked up to this new mode.
1856
1857         Reviewed by Darin Adler.
1858
1859         Test: fast/text/css-font-loading-arraybuffer.html
1860
1861         * css/CSSFontFaceSource.cpp:
1862         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
1863         (WebCore::CSSFontFaceSource::font):
1864         * css/CSSFontFaceSource.h:
1865         * css/FontFace.cpp:
1866         (WebCore::FontFace::create):
1867         * loader/cache/CachedFont.cpp:
1868         (WebCore::CachedFont::ensureCustomFontData):
1869         (WebCore::CachedFont::createCustomFontData):
1870         (WebCore::CachedFont::createFont):
1871         (WebCore::CachedFont::platformDataFromCustomData):
1872         * loader/cache/CachedFont.h:
1873
1874 2016-05-14  Chris Dumez  <cdumez@apple.com>
1875
1876         [WebIDL] Add support for dictionary members of integer types
1877         https://bugs.webkit.org/show_bug.cgi?id=157703
1878
1879         Reviewed by Darin Adler.
1880
1881         Add support for dictionary members of integer types, including support
1882         for the [Clamp] and [EnforceRange] IDL extended attributes on such
1883         members.
1884
1885         * bindings/js/JSDOMConvert.h:
1886         (WebCore::convert):
1887         (WebCore::convertOptional):
1888         - Add the needed template specializations so we can use convertOptional()
1889           with integral types.
1890         - Use std::enable_if so the template specializations meants to be used
1891           for floating point types or integral types can only be instantiated
1892           for such types.
1893
1894         * bindings/scripts/CodeGeneratorJS.pm:
1895         (GenerateConversionRuleWithLeadingComma):
1896         (GetIntegerConversionConfiguration):
1897         (JSValueToNative):
1898         Generate the right IntegerConversionConfiguration parameter for convert()
1899         and convertOptional() when converting dictionary members of integral
1900         types
1901
1902         * bindings/scripts/IDLParser.pm:
1903         (parseDictionaryMember):
1904         Fix bug in the IDL parser where we weren't initializing the extended
1905         attributes for dictionary members.
1906
1907         * bindings/scripts/test/JS/JSTestObj.cpp:
1908         * bindings/scripts/test/TestObj.idl:
1909         Add bindings tests coverage.
1910
1911 2016-05-14  Chris Dumez  <cdumez@apple.com>
1912
1913         Allocate MacGlyphToPathTranslator / CairoGlyphToPathTranslator on the stack
1914         https://bugs.webkit.org/show_bug.cgi?id=157690
1915
1916         Reviewed by Myles C. Maxfield.
1917
1918         Allocate MacGlyphToPathTranslator / CairoGlyphToPathTranslator on the
1919         stack. We also now use the subclass type for the local variable so it
1920         will bypass the vtable for various virtual function calls (if the compiler
1921         was not already smart enough to figure this out).
1922
1923         * platform/graphics/cairo/FontCairo.cpp:
1924         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1925         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1926         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1927
1928 2016-05-13  Chris Dumez  <cdumez@apple.com>
1929
1930         Unreviewed attempt to fix the iOS build after the protector variables renaming.
1931
1932         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1933         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1934         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1935         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1936         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1937         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1938         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1939         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1940         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1941         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1942         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
1943
1944 2016-05-13  Zalan Bujtas  <zalan@apple.com>
1945
1946         All scrolling height/width values should be integral rounded.
1947         https://bugs.webkit.org/show_bug.cgi?id=157687
1948
1949         Reviewed by Simon Fraser.
1950
1951         Both clientHeight(Width) and scrollHeight(width) need to be explicitly integral
1952         rounded in order to ensure that scrollable content is computed properly.
1953         This will evolve into subpixel snapping once we apply subpixel arithmetics on scrolling.
1954
1955         Not testable.
1956
1957         * rendering/RenderBox.cpp:
1958         (WebCore::RenderBox::scrollWidth):
1959         * rendering/RenderLayer.cpp:
1960         (WebCore::RenderLayer::scrollTo):
1961         (WebCore::RenderLayer::horizontalScrollbarStart):
1962         (WebCore::RenderLayer::scrollWidth):
1963         (WebCore::RenderLayer::scrollHeight):
1964         (WebCore::RenderLayer::computeScrollDimensions):
1965         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
1966         * rendering/RenderLayer.h:
1967
1968 2016-05-13  Chris Dumez  <cdumez@apple.com>
1969
1970         [NetworkCache] Avoid having to re-parse URLs after deserializing them
1971         https://bugs.webkit.org/show_bug.cgi?id=157660
1972
1973         Reviewed by Darin Adler.
1974
1975         Avoid having to re-parse URLs after deserializing them in the WebKit2
1976         network cache storage implementation.
1977
1978         We previously serialized URLs as Strings, which meant that we had the
1979         re-parse them upon deserialization. We now serialize all of the URL
1980         data members to avoid having to parse the String again.
1981
1982         * platform/URL.h:
1983         (WebCore::URL::encode):
1984         (WebCore::URL::decode):
1985         * platform/network/ResourceRequestBase.h:
1986         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
1987         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
1988         * platform/network/ResourceResponseBase.h:
1989         (WebCore::ResourceResponseBase::encode):
1990         (WebCore::ResourceResponseBase::decode):
1991
1992 2016-05-13  Sam Weinig  <sam@webkit.org>
1993
1994         ScriptController::processingUserGesture should propagate across postMessage boundaries
1995         <rdar://problem/26273173>
1996         https://bugs.webkit.org/show_bug.cgi?id=157686
1997
1998         Reviewed by Anders Carlsson.
1999
2000         Test: fast/dom/Window/post-message-user-action.html
2001
2002         * dom/UserGestureIndicator.h:
2003         Export processingUserGesture() for testing.
2004
2005         * page/DOMWindow.cpp:
2006         (WebCore::PostMessageTimer::PostMessageTimer):
2007         (WebCore::PostMessageTimer::event):
2008         Maintain the processingUserGesture bit through postMessage.
2009
2010         * testing/Internals.cpp:
2011         (WebCore::Internals::setResourceTimingSupport):
2012         (WebCore::Internals::isProcessingUserGesture):
2013         * testing/Internals.h:
2014         * testing/Internals.idl:
2015         Add new internals function to get the current state of the UseGestureIndicator for testing.
2016
2017 2016-05-13  Chris Dumez  <cdumez@apple.com>
2018
2019         Align window.scroll() / scrollTo() / scrollBy() with the CSSOM specification
2020         https://bugs.webkit.org/show_bug.cgi?id=157666
2021
2022         Reviewed by Darin Adler.
2023
2024         Align window.scroll() / scrollTo() / scrollBy() with Firefox and the CSSOM
2025         specification:
2026         https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface
2027
2028         In particular, the following changes were made:
2029         1. Make parameters to scroll() / scrollTo() / scrollBy() mandatory.
2030         2. Add overloads for scroll() / scrollTo() / scrollBy() that take an
2031            optional ScrollToOptions dictionary.
2032         3. Update API to use "unrestricted double" typing for x/y instead of
2033            "long". This matches the specification but it does not really change
2034            our behavior at this point because the values are still casted to
2035            int in our implementation.
2036
2037         Web-Exposed behavior changes:
2038         1. JS can now pass a dictionary to scroll() / scrollTo() / scrollBy().
2039            This a new feature that Firefox already supports (Chrome does not).
2040         2. Passing only 1 parameter to scroll() / scrollTo() / scrollBy() that
2041            is not a dictionary will now throw a TypeError. The compatibility
2042            risky should be low because Firefox and Chrome already throw in this
2043            case (Chrome has been throwing for 2 years and a half).
2044         3. Calling scrollTo() / scroll() without any parameter no longer
2045            scrolls to 0. Instead we use the current viewport's x/y which means
2046            we don't scroll at all. The new behavior matches Firefox, Chrome and
2047            IE 11. This fixes scrolling on the following Website:
2048            https://members.chosun.com/cms_subscribe/application/index.jsp
2049
2050         No new tests, extended existing testing.
2051
2052         * bindings/js/JSDOMConvert.h:
2053         (WebCore::convert):
2054         (WebCore::convertOptional):
2055         * bindings/scripts/CodeGeneratorJS.pm:
2056         (ShouldAllowNonFiniteForFloatingPointType):
2057         (GenerateConversionRuleWithLeadingComma):
2058         (GenerateDictionaryImplementationContent):
2059         (JSValueToNative):
2060         * bindings/scripts/test/JS/JSTestObj.cpp:
2061         (WebCore::convert<TestObj::Dictionary>):
2062         * bindings/scripts/test/TestObj.idl:
2063         * page/DOMWindow.cpp:
2064         (WebCore::DOMWindow::scrollBy):
2065         (WebCore::DOMWindow::scrollTo):
2066         * page/DOMWindow.h:
2067         * page/DOMWindow.idl:
2068
2069 2016-05-13  Commit Queue  <commit-queue@webkit.org>
2070
2071         Unreviewed, rolling out r200894.
2072         https://bugs.webkit.org/show_bug.cgi?id=157695
2073
2074         This change broke the iOS build (Requested by ryanhaddad on
2075         #webkit).
2076
2077         Reverted changeset:
2078
2079         "Remove unused initializer for WebEvent on iOS."
2080         https://bugs.webkit.org/show_bug.cgi?id=157689
2081         http://trac.webkit.org/changeset/200894
2082
2083 2016-05-13  Brady Eidson  <beidson@apple.com>
2084
2085         Rename all protector variables that should be called `protectedThis`
2086         https://bugs.webkit.org/show_bug.cgi?id=157610
2087
2088         Reviewed by Alex Christensen.
2089
2090         No new tests (Renaming, no behavior change).
2091         
2092         WebCore has so many instances of these protectors as well as so much variance in naming them,
2093         that I think it deserved a new style pass.
2094
2095         * Modules/fetch/FetchResponse.cpp:
2096         * Modules/geolocation/GeoNotifier.cpp:
2097         * Modules/geolocation/Geolocation.cpp:
2098         * Modules/indexeddb/IDBTransaction.cpp:
2099         * Modules/indexeddb/client/TransactionOperation.h:
2100         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2101         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2102         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2103         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2104         * Modules/mediastream/UserMediaRequest.cpp:
2105         * Modules/notifications/NotificationCenter.cpp:
2106         * Modules/webaudio/AudioContext.cpp:
2107         * Modules/webdatabase/Database.cpp:
2108         * Modules/websockets/WebSocket.cpp:
2109         * Modules/websockets/WebSocketChannel.cpp:
2110         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2111         * accessibility/AccessibilityObject.cpp:
2112         * accessibility/AccessibilityRenderObject.cpp:
2113         * bindings/gobject/GObjectEventListener.cpp:
2114         * bindings/js/JSCustomElementInterface.cpp:
2115         * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
2116         * bindings/js/JSCustomXPathNSResolver.cpp:
2117         * bindings/js/JSDOMGlobalObjectTask.cpp:
2118         * bindings/js/JSDOMWindowBase.cpp:
2119         * bindings/js/JSErrorHandler.cpp:
2120         * bindings/js/JSEventListener.cpp:
2121         * bindings/js/JSMutationCallback.cpp:
2122         * bindings/js/JSNodeFilterCustom.cpp:
2123         * bindings/js/SerializedScriptValue.cpp:
2124         * bindings/scripts/CodeGeneratorJS.pm:
2125         * bindings/scripts/test/JS/JSTestCallback.cpp:
2126         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2127         * bridge/runtime_root.cpp:
2128         * css/CSSFontSelector.cpp:
2129         * css/StyleSheetContents.cpp:
2130         * dom/CharacterData.cpp:
2131         * dom/ContainerNode.cpp:
2132         * dom/Document.cpp:
2133         * dom/EventTarget.cpp:
2134         * dom/Node.cpp:
2135         * dom/ScriptExecutionContext.cpp:
2136         * dom/ScriptedAnimationController.cpp:
2137         * dom/StringCallback.cpp:
2138         * html/HTMLEmbedElement.cpp:
2139         * html/HTMLFormControlElement.cpp:
2140         * html/HTMLFormElement.cpp:
2141         * html/HTMLInputElement.cpp:
2142         * html/HTMLLinkElement.cpp:
2143         * html/HTMLMediaElement.cpp:
2144         * html/HTMLObjectElement.cpp:
2145         * html/HTMLOptionElement.cpp:
2146         * html/HTMLScriptElement.cpp:
2147         * html/HTMLTableElement.cpp:
2148         * html/HTMLTextAreaElement.cpp:
2149         * html/HTMLTitleElement.cpp:
2150         * html/parser/HTMLDocumentParser.cpp:
2151         * html/shadow/SliderThumbElement.cpp:
2152         * html/shadow/SpinButtonElement.cpp:
2153         * inspector/InspectorFrontendClientLocal.cpp:
2154         * loader/DocumentLoader.cpp:
2155         * loader/DocumentThreadableLoader.cpp:
2156         * loader/MediaResourceLoader.cpp:
2157         * loader/NetscapePlugInStreamLoader.cpp:
2158         * loader/ResourceLoader.cpp:
2159         * loader/SubresourceLoader.cpp:
2160         * loader/cache/CachedRawResource.cpp:
2161         * loader/cf/SubresourceLoaderCF.cpp:
2162         * loader/mac/ResourceLoaderMac.mm:
2163         * page/DOMWindow.cpp:
2164         * page/DOMWindowExtension.cpp:
2165         * page/FrameView.cpp:
2166         * page/animation/AnimationBase.cpp:
2167         * page/scrolling/ThreadedScrollingTree.cpp:
2168         * platform/ScrollView.cpp:
2169         * platform/graphics/DisplayRefreshMonitor.cpp:
2170         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2171         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
2172         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2173         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2174         * platform/mac/WidgetMac.mm:
2175         * platform/network/BlobResourceHandle.cpp:
2176         * platform/network/cf/ResourceHandleCFNet.cpp:
2177         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2178         * platform/network/curl/CurlDownload.cpp:
2179         * platform/network/mac/ResourceHandleMac.mm:
2180         * platform/network/soup/SocketStreamHandleSoup.cpp:
2181         * platform/win/PopupMenuWin.cpp:
2182         * workers/WorkerScriptLoader.cpp:
2183         * xml/XMLHttpRequest.cpp:
2184         * xml/parser/XMLDocumentParser.cpp:
2185         * xml/parser/XMLDocumentParserLibxml2.cpp:
2186
2187 2016-05-13  Enrica Casucci  <enrica@apple.com>
2188
2189         Remove unused initializer for WebEvent on iOS.
2190         https://bugs.webkit.org/show_bug.cgi?id=157689
2191
2192         Reviewed by Anders Carlsson.
2193
2194         This is no longer used and can be removed.
2195         The logic tied to isPopupVariant has been incorporated
2196         in keyboard flags. The characterSet property is no longer needed too.
2197
2198         * platform/ios/WebEvent.h:
2199         * platform/ios/WebEvent.mm:
2200         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
2201         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:isPopupVariant:keyCode:isTabKey:characterSet:]): Deleted.
2202         (-[WebEvent _characterSetDescription]): Deleted.
2203         (-[WebEvent isPopupVariant]): Deleted.
2204         (-[WebEvent characterSet]): Deleted.
2205
2206 2016-05-13  Simon Fraser  <simon.fraser@apple.com>
2207
2208         cross-fade() rendering doesn't match expectation
2209         https://bugs.webkit.org/show_bug.cgi?id=157665
2210         rdar://problem/17917708
2211
2212         Reviewed by Dean Jackson.
2213
2214         Cross-fading two opaque images would result in a non-opaque result in between the endpoints,
2215         probably because r157045 caused both images to be drawn with srcOver, since drawImage()
2216         clobbers the composite operation in the context.
2217
2218         Fix by passing the composite operation to the drawImage() calls for the non-transparency layer
2219         code path.
2220
2221         Converted css3/images/cross-fade-blending.html into a ref test to test this.
2222
2223         * platform/graphics/CrossfadeGeneratedImage.cpp:
2224         (WebCore::drawCrossfadeSubimage):
2225
2226 2016-05-13  Simon Fraser  <simon.fraser@apple.com>
2227
2228         Unprefix -webkit-cross-fade()
2229         https://bugs.webkit.org/show_bug.cgi?id=157632
2230
2231         Reviewed by Darin Adler.
2232
2233         Support unprefixed cross-fade() in addition to the prefixed value when parsing,
2234         and have computed style round-trip the correct one.
2235
2236         If computed style is queried during an image transition, return an unprefixed
2237         cross-fade(). If blending cross-fade values, only return the prefixed function if
2238         both inputs are prefixed.
2239
2240         Tested by modified and existing tests.
2241
2242         * css/CSSCrossfadeValue.cpp:
2243         (WebCore::CSSCrossfadeValue::customCSSText):
2244         (WebCore::CSSCrossfadeValue::blend):
2245         * css/CSSCrossfadeValue.h:
2246         (WebCore::CSSCrossfadeValue::create):
2247         (WebCore::CSSCrossfadeValue::isPrefixed):
2248         (WebCore::CSSCrossfadeValue::CSSCrossfadeValue):
2249         * css/CSSParser.cpp:
2250         (WebCore::CSSParser::isGeneratedImageValue):
2251         (WebCore::CSSParser::parseGeneratedImage):
2252         (WebCore::CSSParser::parseCrossfade):
2253         * css/CSSParser.h:
2254
2255 2016-05-13  Yoav Weiss  <yoav@yoav.ws>
2256
2257         ResourceTiming entries for cached resources and XHR
2258         https://bugs.webkit.org/show_bug.cgi?id=157669
2259
2260         Reviewed by Alex Christensen.
2261
2262          - Moves the ResourceTiming storage and addition logic into its own class, so that it
2263            can be accessed by both CachedResourceLoader and DocumentThreadableLoader.
2264          - Using the above, adds ResourceTiming collection into DocumentThreadableLoader,
2265            in order to support ResourceTiming entries for XHR based requests.
2266          - Adds ResourceTiming entries for resources that are reused from the memory cache.
2267
2268         Test: http/tests/performance/performance-resource-timing-cached-entries.html
2269
2270         * CMakeLists.txt: Add ResourceTimingInformation.
2271         * WebCore.xcodeproj/project.pbxproj: Add ResourceTimingInformation.
2272         * loader/DocumentThreadableLoader.cpp:
2273         (WebCore::DocumentThreadableLoader::didFinishLoading): Add a call to addResourceTiming.
2274         (WebCore::DocumentThreadableLoader::loadRequest): Store the initiator information.
2275         * loader/DocumentThreadableLoader.h:
2276         * loader/ResourceTimingInformation.cpp: Added.
2277         (WebCore::ResourceTimingInformation::addResourceTiming): Moved addResourceTiming logic from CachedResourceLoader.
2278         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation): Moved addResourceTiming logic from
2279         CachedResourceLoader. Removed reliance on the committingFirstRealLoad bool when storing initiator info, as I don't
2280         see why it is required, and it made no sense in the context of DocumentThreadableLoader.
2281         * loader/ResourceTimingInformation.h: Added.
2282         * loader/cache/CachedResourceLoader.cpp:
2283         (WebCore::CachedResourceLoader::requestResource): Add a ResourceTiming entry when a resource is reused from MemoryCache.
2284         (WebCore::CachedResourceLoader::revalidateResource): Use ResourceTimingInformation::storeResourceTimingInitiatorInformation.
2285         (WebCore::CachedResourceLoader::loadResource): Use ResourceTimingInformation::storeResourceTimingInitiatorInformation.
2286         (WebCore::CachedResourceLoader::loadDone): Use ResourceTimingInformation::addResourceTiming.
2287         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation): Deleted.
2288         * loader/cache/CachedResourceLoader.h:
2289
2290 2016-05-13  Doug Russell  <d_russell@apple.com>
2291
2292         AX: Regressions in undo/redo accessibility from Bug 153361
2293         https://bugs.webkit.org/show_bug.cgi?id=157652
2294
2295         Reviewed by Darin Adler.
2296         
2297         Use indexForVisiblePosition & visiblePositionForIndex to store selection data
2298         so that AccessibilityUndoReplacedText can build valid selection ranges and
2299         retrieve strings for AT notifications.
2300
2301         Tests: accessibility/mac/value-change/value-change-user-info-contenteditable-expected.txt:
2302                accessibility/mac/value-change/value-change-user-info-contenteditable.html:
2303                accessibility/mac/value-change/value-change-user-info-textarea-expected.txt:
2304                accessibility/mac/value-change/value-change-user-info-textarea.html:
2305                accessibility/mac/value-change/value-change-user-info-textfield-expected.txt:
2306                accessibility/mac/value-change/value-change-user-info-textfield.html:
2307
2308         * accessibility/AXObjectCache.cpp:
2309         (WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
2310         (WebCore::AXObjectCache::postTextStateChangeNotification):
2311         (WebCore::AXObjectCache::postTextReplacementNotification):
2312         * editing/CompositeEditCommand.cpp:
2313         (WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithEndingSelection):
2314         (WebCore::AccessibilityUndoReplacedText::configureRangeDeletedByReapplyWithStartingSelection):
2315         (WebCore::AccessibilityUndoReplacedText::setRangeDeletedByUnapply):
2316         (WebCore::AccessibilityUndoReplacedText::captureTextForUnapply):
2317         (WebCore::AccessibilityUndoReplacedText::captureTextForReapply):
2318         (WebCore::AccessibilityUndoReplacedText::textDeletedByUnapply):
2319         (WebCore::AccessibilityUndoReplacedText::textDeletedByReapply):
2320         (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
2321         (WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
2322         (WebCore::EditCommandComposition::EditCommandComposition):
2323         (WebCore::EditCommandComposition::unapply):
2324         (WebCore::EditCommandComposition::reapply):
2325         (WebCore::EditCommandComposition::setStartingSelection):
2326         (WebCore::EditCommandComposition::setEndingSelection):
2327         (WebCore::EditCommandComposition::setRangeDeletedByUnapply):
2328         (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection): Deleted.
2329         (WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection): Deleted.
2330         (WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange): Deleted.
2331         (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply): Deleted.
2332         (WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply): Deleted.
2333         (WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply): Deleted.
2334         (WebCore::AccessibilityUndoReplacedText::textInsertedByReapply): Deleted.
2335         (WebCore::EditCommandComposition::setTextInsertedByUnapplyRange): Deleted.
2336         * editing/CompositeEditCommand.h:
2337         * editing/Editor.cpp:
2338         (WebCore::Editor::replaceSelectionWithFragment):
2339         * editing/TypingCommand.cpp:
2340         (WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
2341         (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
2342         (WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
2343         (WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
2344         (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
2345
2346 2016-05-13  Chris Dumez  <cdumez@apple.com>
2347
2348         Unreviewed, rolling out r200837.
2349
2350         Seems to have regressed Speedometer and JetStream on iOS
2351
2352         Reverted changeset:
2353
2354         "DOMPromise should only restrict the resolution type"
2355         https://bugs.webkit.org/show_bug.cgi?id=157307
2356         http://trac.webkit.org/changeset/200837
2357
2358 2016-05-13  Sam Weinig  <sam@webkit.org>
2359
2360         Rename WKDataDetectorTypeSpotlightSuggestion to WKDataDetectorTypeLookupSuggestion
2361         <rdar://problem/26269611>
2362
2363         Reviewed by Dan Bernstein and Enrica Casucci. 
2364
2365         * editing/cocoa/DataDetection.h:
2366         * editing/cocoa/DataDetection.mm:
2367         (WebCore::constructURLStringForResult):
2368         (WebCore::DataDetection::detectContentInRange):
2369
2370 2016-05-13  Nan Wang  <n_wang@apple.com>
2371
2372         AX: Wrong CharacterOffset from an upstream VisiblePosition
2373         https://bugs.webkit.org/show_bug.cgi?id=157644
2374
2375         Reviewed by Chris Fleizach.
2376
2377         We should adjust the text marker's CharacterOffset if its corresponding
2378         VisiblePosition has upstream affinity.
2379
2380         Test: accessibility/mac/character-offset-from-upstream-position.html
2381
2382         * accessibility/AXObjectCache.cpp:
2383         (WebCore::AXObjectCache::characterOffsetForTextMarkerData):
2384         (WebCore::AXObjectCache::traverseToOffsetInRange):
2385         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
2386
2387 2016-05-13  Beth Dakin  <bdakin@apple.com>
2388
2389         Add dyldSPI.h for linked on or after checks, and add one for link preview
2390         https://bugs.webkit.org/show_bug.cgi?id=157401
2391         -and corresponding-
2392         rdar://problem/26253396
2393
2394         Reviewed by Darin Adler.
2395
2396         This patch removes DynamicLinkerSPI.h and replaces it with 
2397         wtf/spi/darwin/dyldSPI.h
2398
2399         * WebCore.xcodeproj/project.pbxproj:
2400         * html/HTMLObjectElement.cpp:
2401         * platform/graphics/ios/FontServicesIOS.mm:
2402         * platform/spi/cocoa/DynamicLinkerSPI.h: Removed.
2403
2404 2016-05-13  Brady Eidson  <beidson@apple.com>
2405
2406         Give CrossThreadCopier a default specialization for Vectors of objects.
2407         https://bugs.webkit.org/show_bug.cgi?id=157675
2408
2409         Reviewed by Darin Adler.
2410
2411         No new tests (Refactor, no change in behavior).
2412
2413         * platform/CrossThreadCopier.cpp:
2414         (WebCore::Vector<String>>::copy): Deleted.
2415         * platform/CrossThreadCopier.h: Add a default specialization for Vector<T> where T is a type
2416           that is CrossThreadCopyable itself.
2417
2418 2016-05-13  Chris Dumez  <cdumez@apple.com>
2419
2420         Have the WorkerGlobalScope API return more references
2421         https://bugs.webkit.org/show_bug.cgi?id=157663
2422
2423         Reviewed by Alexey Proskuryakov.
2424
2425         Have the WorkerGlobalScope API return more references instead of
2426         pointers.
2427
2428         * workers/WorkerGlobalScope.cpp:
2429         (WebCore::WorkerGlobalScope::location):
2430         (WebCore::WorkerGlobalScope::navigator):
2431         * workers/WorkerGlobalScope.h:
2432         (WebCore::WorkerGlobalScope::self):
2433
2434 2016-05-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2435
2436         DOMPromise should only restrict the resolution type
2437         https://bugs.webkit.org/show_bug.cgi?id=157307
2438
2439         Reviewed by Darin Adler.
2440
2441         Removing from DOMPromise the rejection template parameter.
2442         Supported rejection types are integers (Exception codes) and DOM objects (DOMError typically).
2443
2444         Updated toJS and DeferredWrapper to accept Ref<>&& and RefPtr<>&&.
2445         Previously Ref<>&& were not accepted and only "const RefPtr<>&" was accepted.
2446         This in turn created an unecessary churn count when calling toJS.
2447
2448         Changes also allow in most cases to remove the need for explictly declaring the
2449         rejection/resolution type.
2450
2451         Minor refactoring of FontFaceSet promise handling to use DOMPromise in lieu of DeferredWrapper.
2452
2453         Covered by existing tests.
2454         Changes should not be visible from user scripts.
2455
2456         * Modules/fetch/FetchBody.cpp:
2457         (WebCore::FetchBody::consume):
2458         (WebCore::FetchBody::consumeText):
2459         (WebCore::blobFromArrayBuffer):
2460         (WebCore::FetchBody::loadingFailed):
2461         * Modules/fetch/FetchBody.h:
2462         (WebCore::FetchBody::formData):
2463         * Modules/fetch/FetchBodyOwner.cpp:
2464         (WebCore::FetchBodyOwner::arrayBuffer):
2465         (WebCore::FetchBodyOwner::blob):
2466         (WebCore::FetchBodyOwner::formData):
2467         (WebCore::FetchBodyOwner::json):
2468         (WebCore::FetchBodyOwner::text):
2469         * Modules/fetch/FetchResponse.cpp:
2470         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2471         * Modules/fetch/FetchResponse.h:
2472         * Modules/mediastream/MediaDevices.h:
2473         * Modules/mediastream/PeerConnectionBackend.h:
2474         * Modules/mediastream/UserMediaRequest.cpp:
2475         (WebCore::UserMediaRequest::didCreateStream):
2476         * Modules/streams/ReadableStreamSource.h:
2477         * Modules/webaudio/AudioContext.h:
2478         * bindings/js/JSDOMBinding.h:
2479         (WebCore::toJS):
2480         (WebCore::jsPair):
2481         * bindings/js/JSDOMPromise.cpp:
2482         (WebCore::fulfillPromiseWithJSON):
2483         * bindings/js/JSDOMPromise.h:
2484         (WebCore::TypeInspector::decltype):
2485         (WebCore::TypeInspector::testIsVector):
2486         (WebCore::TypeInspector::testIsRefOrRefPtr):
2487         (WebCore::DeferredWrapper::resolve):
2488         (WebCore::DeferredWrapper::reject):
2489         (WebCore::DOMPromise::resolve):
2490         (WebCore::DOMPromise::reject):
2491         (WebCore::DeferredWrapper::resolveWithValue):
2492         (WebCore::DeferredWrapper::rejectWithValue):
2493         (WebCore::callPromiseFunction):
2494         * bindings/js/JSSubtleCryptoCustom.cpp:
2495         (WebCore::JSSubtleCrypto::importKey):
2496         (WebCore::JSSubtleCrypto::unwrapKey):
2497         * css/FontFace.h:
2498         * css/FontFaceSet.cpp:
2499         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
2500         (WebCore::FontFaceSet::load):
2501         (WebCore::FontFaceSet::registerReady):
2502         * css/FontFaceSet.h:
2503         * html/HTMLMediaElement.h:
2504
2505 2016-05-12  Sergio Villar Senin  <svillar@igalia.com>
2506
2507         [css-grid] Show auto-repeat line names in ComputedStyle
2508         https://bugs.webkit.org/show_bug.cgi?id=157622
2509
2510         Reviewed by Darin Adler.
2511
2512         Add the necessary machinery to show the named lines from auto-repeat tracks in
2513         getComputedStyle(). A new class OrderedNamedLinesCollector was added to abstract the
2514         retrieval of line names no matter where they come from (explicit or auto-repeat tracks).
2515
2516         * css/CSSComputedStyleDeclaration.cpp:
2517         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
2518         (WebCore::OrderedNamedLinesCollector::isEmpty): TRUE if we don't have named lines neither on
2519         explicit nor auto-repeat tracks.
2520         (WebCore::OrderedNamedLinesCollector::appendLines): Add the named lines found for a given
2521         index to the CSSGridLineNamesValue.
2522         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex): Collects named lines found
2523         for a given index.
2524         (WebCore::addValuesForNamedGridLinesAtIndex): Use the collector to gather named lines.
2525         (WebCore::valueForGridTrackList): Ditto.
2526
2527 2016-05-13  Tina Liu  <iting_liu@apple.com>
2528
2529         Revert r199691.
2530         https://bugs.webkit.org/show_bug.cgi?id=157645
2531         <rdar://problem/26235373>
2532
2533         Reviewed by Darin Adler.
2534
2535         * plugins/PluginStrategy.h:
2536
2537 2016-05-12  Chris Dumez  <cdumez@apple.com>
2538
2539         Drop WorkerGlobalScope's custom GetOwnPropertySlot() implementation
2540         https://bugs.webkit.org/show_bug.cgi?id=157662
2541
2542         Reviewed by Darin Adler.
2543
2544         Drop WorkerGlobalScope's custom GetOwnPropertySlot() implementation as
2545         it is no longer needed after <http://trac.webkit.org/changeset/196678>.
2546
2547         JSC::getStaticPropertySlot() now properly checks for overrides *before*
2548         checking the static table.
2549
2550         No new tests, no web-exposed behavior change.
2551
2552         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2553         (WebCore::JSWorkerGlobalScope::getOwnPropertySlotDelegate): Deleted.
2554         * workers/WorkerGlobalScope.idl:
2555
2556 2016-05-12  Zan Dobersek  <zdobersek@igalia.com>
2557
2558         CoordinatedGraphicsLayer::syncLayerState() should set the m_layerState.contentsOpaque flag
2559         https://bugs.webkit.org/show_bug.cgi?id=157575
2560
2561         Reviewed by Darin Adler.
2562
2563         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2564         (WebCore::CoordinatedGraphicsLayer::syncLayerState): The contentsOpaque flag in the
2565         layer's CoordinatedGraphicsLayerState object should also be set to the current value
2566         of the layer. This is the only flag in the union of 9 members that's not being updated
2567         in this method.
2568
2569 2016-05-12  Zan Dobersek  <zdobersek@igalia.com>
2570
2571         [TexMap] Handle TextureMapperShaderProgram objects through references
2572         https://bugs.webkit.org/show_bug.cgi?id=157619
2573
2574         Reviewed by Antonio Gomes.
2575
2576         TextureMapper code always expects valid TextureMapperShaderProgram
2577         objects to be created, so it doesn't make sense to access these
2578         objects through raw pointers or RefPtr<>s.
2579
2580         * platform/graphics/texmap/TextureMapperGL.cpp:
2581         (WebCore::TextureMapperGL::drawBorder):
2582         (WebCore::prepareFilterProgram):
2583         (WebCore::TextureMapperGL::drawTexture):
2584         (WebCore::TextureMapperGL::drawSolidColor):
2585         (WebCore::TextureMapperGL::drawEdgeTriangles):
2586         (WebCore::TextureMapperGL::drawUnitRect):
2587         (WebCore::TextureMapperGL::draw):
2588         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
2589         (WebCore::TextureMapperGL::drawFiltered):
2590         (WebCore::TextureMapperGL::beginClip):
2591         * platform/graphics/texmap/TextureMapperGL.h:
2592
2593 2016-05-12  Zan Dobersek  <zdobersek@igalia.com>
2594
2595         VideoSinkGStreamer: plug a GstBuffer leak in webkitVideoSinkRequestRender()
2596         https://bugs.webkit.org/show_bug.cgi?id=157617
2597
2598         Reviewed by Darin Adler.
2599
2600         Unref the newly-created GstBuffer object after creating the new GstSample
2601         that's based on it. gst_sample_new() doesn't take the ownership of it.
2602
2603         Also, don't unref the GstBuffer object that's passed in to the
2604         webkitVideoSinkRequestRender() function in case the allocation of the
2605         replacement buffer fails. We don't have any ownership over that buffer
2606         and it's not unreffed anywhere else in this function.
2607
2608         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2609         (webkitVideoSinkRequestRender):
2610
2611 2016-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
2612
2613         [Cocoa] Text shadow sometimes clipped unexpectedly
2614         https://bugs.webkit.org/show_bug.cgi?id=108929
2615
2616         Reviewed by Dean Jackson.
2617
2618         CoreGraphics can only draw one text shadow at a time. We work around that by drawing
2619         the text multiple times, one for each shadow. However, we want to make sure that the
2620         original text isn't also drawn multiple times, so we bump up the shadow offsets so
2621         the text and the shadow don't intersect, and then we clip out the original text (so
2622         only the shadow remains).
2623
2624         Unfortunately, this clipping requires knowing where the visual extent of the text is,
2625         which WebKit currently has trouble with. In particular, we often use layout extents
2626         in lieu of visual extents, which is a problem when the glyphs draw outside of their
2627         layout boxes. In this case, it causes us to think the text shadow is much smaller
2628         than it really is, so our clipping operation clips to an area which is too small.
2629
2630         A quick solution to this is to inflate the clip rect by an amount proportional to the
2631         font size, and offset the text shadow accordingly. If this amount is large enough,
2632         this bug will occur on few enough sites that it is reasonable to consider this bug
2633         fixed without the real solution of educating WebKit properly about the difference
2634         between text layout rects and text visual extent rects.
2635
2636         Test: fast/text/multiple-text-shadow-overflow-layout-rect.html
2637
2638         * rendering/TextPainter.cpp:
2639         (WebCore::ShadowApplier::ShadowApplier):
2640
2641 2016-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
2642
2643         REGRESSION(r200601): Crash when using local() and unicode-range in @font-face blocks
2644         https://bugs.webkit.org/show_bug.cgi?id=157646
2645
2646         Reviewed by Geoffrey Garen.
2647
2648         I simply forgot a null check.
2649
2650         Test: fast/text/isLoading-crash-failed-font.html
2651
2652         * css/CSSSegmentedFontFace.cpp:
2653
2654 2016-05-12  Jiewen Tan  <jiewen_tan@apple.com>
2655
2656         REGRESSION (r199313): ICBC app: text field In the webview is not tappable
2657         https://bugs.webkit.org/show_bug.cgi?id=157396
2658         <rdar://problem/25931513>
2659
2660         Reviewed by David Kilzer.
2661
2662         Add a quirk for WebKit1 apps.
2663
2664         * loader/SubframeLoader.cpp:
2665         (WebCore::SubframeLoader::requestFrame):
2666         Even though the HTML spec suggests that we should navigate to about:blank
2667         for subframes/iframes, of which the src cannot be resolved to an valid URL,
2668         many existing WebKit1 apps are relying on invalid URLs to bridge their WebView
2669         codes and their native Objective-C codes. Therefore, a quirk is added to
2670         escape the URL validation for existing WebKit1 apps.
2671         (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank):
2672         * loader/SubframeLoader.h:
2673         * page/Settings.in:
2674
2675 2016-05-12  Ada Chan  <adachan@apple.com>
2676
2677         Prevent clicks in the placeholder from playing or pausing the video in a MediaDocument.
2678         https://bugs.webkit.org/show_bug.cgi?id=157625
2679
2680         Reviewed by Jer Noble.
2681
2682         * Modules/mediacontrols/mediaControlsApple.js:
2683         (Controller.prototype.createControls):
2684         (Controller.prototype.handlePlaceholderClick):
2685
2686 2016-05-12  Chris Dumez  <cdumez@apple.com>
2687
2688         Drop toJS() overload taking a PassRefPtr<> parameter
2689         https://bugs.webkit.org/show_bug.cgi?id=157627
2690
2691         Reviewed by Alex Christensen.
2692
2693         Update our implementation stop stop returning PassRefPtrs to the
2694         JS bindings and drop the toJS() overload taking a PassRefPtr<>
2695         parameter
2696
2697         * Modules/mediasource/SourceBuffer.cpp:
2698         (WebCore::SourceBuffer::buffered):
2699         * Modules/mediasource/SourceBuffer.h:
2700         * Modules/webaudio/AudioBuffer.cpp:
2701         (WebCore::AudioBuffer::getChannelData):
2702         * Modules/webaudio/AudioBuffer.h:
2703         * animation/DocumentTimeline.cpp:
2704         (WebCore::DocumentTimeline::create):
2705         * animation/DocumentTimeline.h:
2706         * bindings/js/JSDOMBinding.h:
2707         (WebCore::toJS): Deleted.
2708         (WebCore::toJSNewlyCreated): Deleted.
2709         * css/CSSPrimitiveValue.cpp:
2710         (WebCore::CSSPrimitiveValue::getRGBColorValue):
2711         * css/CSSPrimitiveValue.h:
2712         * html/HTMLMediaElement.cpp:
2713         (WebCore::HTMLMediaElement::error):
2714         * html/HTMLMediaElement.h:
2715         * html/LabelableElement.cpp:
2716         (WebCore::LabelableElement::labels):
2717         * html/LabelableElement.h:
2718         * html/canvas/WebGLGetInfo.cpp:
2719         (WebCore::WebGLGetInfo::getWebGLBuffer):
2720         (WebCore::WebGLGetInfo::getWebGLFloatArray):
2721         (WebCore::WebGLGetInfo::getWebGLFramebuffer):
2722         (WebCore::WebGLGetInfo::getWebGLIntArray):
2723         (WebCore::WebGLGetInfo::getWebGLProgram):
2724         (WebCore::WebGLGetInfo::getWebGLRenderbuffer):
2725         (WebCore::WebGLGetInfo::getWebGLTexture):
2726         (WebCore::WebGLGetInfo::getWebGLUnsignedByteArray):
2727         (WebCore::WebGLGetInfo::getWebGLUnsignedIntArray):
2728         (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
2729         (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
2730         * html/canvas/WebGLGetInfo.h:
2731         * html/canvas/WebGLRenderingContextBase.cpp:
2732         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
2733         (WebCore::WebGLRenderingContextBase::createBuffer):
2734         (WebCore::WebGLRenderingContextBase::createFramebuffer):
2735         (WebCore::WebGLRenderingContextBase::createTexture):
2736         (WebCore::WebGLRenderingContextBase::createProgram):
2737         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
2738         (WebCore::WebGLRenderingContextBase::createShader):
2739         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
2740         (WebCore::WebGLRenderingContextBase::getActiveUniform):
2741         (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
2742         (WebCore::WebGLRenderingContextBase::getUniformLocation):
2743         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
2744         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
2745         * html/canvas/WebGLRenderingContextBase.h:
2746         * html/track/TextTrackCue.cpp:
2747         (WebCore::TextTrackCue::create):
2748         * html/track/TextTrackCue.h:
2749         * html/track/VTTCue.cpp:
2750         (WebCore::VTTCueBox::create):
2751         * html/track/VTTCue.h:
2752         * page/DOMSelection.cpp:
2753         (WebCore::DOMSelection::getRangeAt):
2754         * page/DOMSelection.h:
2755         * page/DOMWindow.cpp:
2756         (WebCore::DOMWindow::matchMedia):
2757         (WebCore::DOMWindow::styleMedia):
2758         (WebCore::DOMWindow::getComputedStyle):
2759         (WebCore::DOMWindow::getMatchedCSSRules):
2760         (WebCore::DOMWindow::webkitConvertPointFromNodeToPage):
2761         (WebCore::DOMWindow::webkitConvertPointFromPageToNode):
2762         (WebCore::DOMWindow::open):
2763         * page/DOMWindow.h:
2764         * page/Location.cpp:
2765         (WebCore::Location::ancestorOrigins):
2766         * page/Location.h:
2767
2768 2016-05-12  Ryosuke Niwa  <rniwa@webkit.org>
2769
2770         Touch.prototype is undefined on iOS
2771         https://bugs.webkit.org/show_bug.cgi?id=157560
2772         <rdar://problem/26143008>
2773
2774         Reviewed by Chris Dumez.
2775
2776         Remove Touch and TouchList attributes from DOMWindow.
2777         These attributes should be exposed via generated binding code (JSDOMWindow.cpp).
2778
2779         * bindings/js/JSDOMWindowCustom.cpp:
2780         (WebCore::JSDOMWindow::touch): Deleted.
2781         (WebCore::JSDOMWindow::touchList): Deleted.
2782         * bindings/js/ios/TouchConstructors.cpp:
2783         * page/DOMWindow.idl:
2784
2785 2016-05-12  Ryosuke Niwa  <rniwa@webkit.org>
2786
2787         indexForVisiblePosition should use the root editable element as the scope
2788         https://bugs.webkit.org/show_bug.cgi?id=157611
2789
2790         Reviewed by Darin Adler.
2791
2792         Use the highest editing host instead of the document node as the scope in indexForVisiblePosition
2793         when it's called inside an editable region. This refactoring is necessary to unblock the work to support
2794         undo/redo in VoiceOver after r199030.
2795
2796         We have to workaround a bug in indexForVisiblePosition that it could return a slightly higher index than
2797         the expected value because TextIterator emits an extra new line after a block element with a large margin
2798         at the bottom. Unfortunately, fixing this requires a lot of code changes since the rest of the editing
2799         code assumes this behavior and/or happens to cancel it out with some other quirks.
2800
2801         * editing/ApplyBlockElementCommand.cpp:
2802         (WebCore::ApplyBlockElementCommand::doApply):
2803         * editing/htmlediting.cpp:
2804         (WebCore::indexForVisiblePosition):
2805
2806 2016-05-12  Zalan Bujtas  <zalan@apple.com>
2807
2808         Cleanup RenderObject::containingBlock.
2809         https://bugs.webkit.org/show_bug.cgi?id=157628
2810
2811         Reviewed by Chris Dumez.
2812
2813         No change in functionality.
2814
2815         * rendering/RenderObject.cpp:
2816         (WebCore::RenderObject::containingBlock):
2817
2818 2016-05-12  Eric Carlson  <eric.carlson@apple.com>
2819
2820         Adjust "main content" video heuristic
2821         https://bugs.webkit.org/show_bug.cgi?id=157532
2822         <rdar://problem/25840861>
2823
2824         Reviewed by Darin Adler.
2825
2826         Test: media/video-main-content-autoplay.html, plus existing tests updated.
2827
2828         * html/MediaElementSession.cpp:
2829         (WebCore::MediaElementSession::canControlControlsManager): Use isElementLargeEnoughForMainContent.
2830         (WebCore::isMainContent): Ditto.
2831         (WebCore::isElementLargeEnoughForMainContent): Check video area and aspect ratio.
2832         (WebCore::MediaElementSession::mainContentCheckTimerFired): Call result.setToNonUserAgentShadowAncestor 
2833           so it doesn't hit test the video controls in the shadow DOM.
2834
2835 2016-05-12  Fujii Hironori  <Hironori.Fujii@sony.com>
2836
2837         [curl] ASSERTION FAILED: isLocalFile() || url == m_string in fast/dom/34176.html
2838         https://bugs.webkit.org/show_bug.cgi?id=157059
2839
2840         Reviewed by Darin Adler.
2841
2842         Fix incorrect usage of URL constructor. CURLINFO_EFFECTIVE_URL
2843         does not conform to URL's ParsedURLString.  Created a new utility
2844         function to convert CURLINFO_EFFECTIVE_URL to a URL, and replaced
2845         all codes converting CURLINFO_EFFECTIVE_URL with it.
2846
2847         Test: fast/dom/34176.html
2848
2849         * platform/network/curl/CurlDownload.cpp:
2850         (WebCore::CurlDownload::didReceiveHeader): Use getCurlEffectiveURL
2851         * platform/network/curl/ResourceHandleManager.cpp:
2852         (WebCore::getCurlEffectiveURL): Added.
2853         (WebCore::handleLocalReceiveResponse): Use getCurlEffectiveURL
2854         (WebCore::getProtectionSpace): Ditto.
2855         (WebCore::headerCallback): Ditto.
2856         (WebCore::ResourceHandleManager::downloadTimerCallback): Ditto.
2857         * platform/network/curl/ResourceHandleManager.h: Add a declaration
2858         of getCurlEffectiveURL.
2859
2860 2016-05-12  Chris Dumez  <cdumez@apple.com>
2861
2862         Avoid unnecessary null checks in toJS() when the implementation returns a reference or Ref<>
2863         https://bugs.webkit.org/show_bug.cgi?id=157604
2864
2865         Reviewed by Darin Adler.
2866
2867         Avoid unnecessary null checks in toJS() when the implementation returns
2868         a C++ reference or Ref<>. To achieve this, the following changes were
2869         made:
2870         1. Have toJS() overload that takes a raw pointer call the one that
2871            takes in a C++ reference, instead of the other way around. This way,
2872            we only do the null check when passing a raw pointer in.
2873         2. Stop calling WTF::getPtr() on the value returned by the
2874            implementation because this causes us to call toJS() with a raw
2875            pointer every time.
2876         3. Add an toJS() overload in JSDOMBinding.h that takes a Ref<T> in and
2877            that calls toJS() with a C++ reference internally. This way, we
2878            bypass the null check if the implementation returns a Ref<T>.
2879
2880         Further refactoring could be done but I try to keep the size of this
2881         patch as small as possible. toJS() should probably take the ExecState
2882         and the globalObject by reference, for e.g.
2883
2884         * bindings/js/JSAnimationTimelineCustom.cpp:
2885         (WebCore::toJS):
2886         * bindings/js/JSBlobCustom.cpp:
2887         (WebCore::toJS):
2888         (WebCore::constructJSBlob): Deleted.
2889         * bindings/js/JSCSSRuleCustom.cpp:
2890         (WebCore::toJS):
2891         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2892         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
2893         * bindings/js/JSCSSValueCustom.cpp:
2894         (WebCore::toJS):
2895         * bindings/js/JSCanvasRenderingContextCustom.cpp:
2896         (WebCore::toJS):
2897         * bindings/js/JSCustomElementInterface.cpp:
2898         (WebCore::JSCustomElementInterface::attributeChanged):
2899         * bindings/js/JSDOMBinding.h:
2900         (WebCore::toJS):
2901         (WebCore::toJSNewlyCreated):
2902         * bindings/js/JSDOMFormDataCustom.cpp:
2903         (WebCore::constructJSDOMFormData):
2904         * bindings/js/JSDOMMimeTypeArrayCustom.cpp:
2905         (WebCore::JSDOMMimeTypeArray::nameGetter):
2906         * bindings/js/JSDOMNamedFlowCollectionCustom.cpp:
2907         (WebCore::JSDOMNamedFlowCollection::nameGetter):
2908         * bindings/js/JSDOMPluginArrayCustom.cpp:
2909         (WebCore::JSDOMPluginArray::nameGetter):
2910         * bindings/js/JSDOMPluginCustom.cpp:
2911         (WebCore::JSDOMPlugin::nameGetter):
2912         * bindings/js/JSDOMWindowBase.cpp:
2913         (WebCore::toJS):
2914         * bindings/js/JSDOMWindowBase.h:
2915         (WebCore::toJS):
2916         * bindings/js/JSDOMWindowCustom.cpp:
2917         (WebCore::jsDOMWindowGetOwnPropertySlotNamedItemGetter):
2918         * bindings/js/JSDocumentCustom.cpp:
2919         (WebCore::toJS):
2920         (WebCore::toJSNewlyCreated):
2921         (WebCore::JSDocument::createTouchList):
2922         (WebCore::JSDocument::prepend): Deleted.
2923         * bindings/js/JSDocumentFragmentCustom.cpp:
2924         (WebCore::toJSNewlyCreated):
2925         (WebCore::toJS):
2926         * bindings/js/JSEventCustom.cpp:
2927         (WebCore::toJS):
2928         (WebCore::toJSNewlyCreated):
2929         * bindings/js/JSEventTargetCustom.cpp:
2930         (WebCore::toJS):
2931         * bindings/js/JSFileReaderCustom.cpp:
2932         (WebCore::JSFileReader::result):
2933         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2934         (WebCore::namedItems):
2935         (WebCore::callHTMLAllCollection):
2936         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2937         (WebCore::JSHTMLCanvasElement::getContext):
2938         * bindings/js/JSHTMLCollectionCustom.cpp:
2939         (WebCore::JSHTMLCollection::nameGetter):
2940         (WebCore::toJS):
2941         * bindings/js/JSHTMLDocumentCustom.cpp:
2942         (WebCore::JSHTMLDocument::nameGetter):
2943         * bindings/js/JSHTMLElementCustom.cpp:
2944         (WebCore::constructJSHTMLElement):
2945         (WebCore::JSHTMLElement::pushEventHandlerScope):
2946         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
2947         (WebCore::namedItems):
2948         * bindings/js/JSHTMLFormElementCustom.cpp:
2949         (WebCore::JSHTMLFormElement::nameGetter):
2950         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2951         (WebCore::JSHTMLOptionsCollection::nameGetter):
2952         * bindings/js/JSIDBCursorCustom.cpp:
2953         (WebCore::JSIDBCursor::source):
2954         (WebCore::toJS):
2955         * bindings/js/JSIDBDatabaseCustom.cpp:
2956         (WebCore::JSIDBDatabase::createObjectStore):
2957         (WebCore::JSIDBDatabase::transaction):
2958         * bindings/js/JSIDBRequestCustom.cpp:
2959         (WebCore::JSIDBRequest::result):
2960         (WebCore::JSIDBRequest::source):
2961         * bindings/js/JSImageConstructor.cpp:
2962         (WebCore::JSImageConstructor::construct):
2963         * bindings/js/JSImageDataCustom.cpp:
2964         (WebCore::toJS):
2965         * bindings/js/JSLazyEventListener.cpp:
2966         (WebCore::JSLazyEventListener::initializeJSFunction):
2967         * bindings/js/JSMediaSessionCustom.cpp:
2968         (WebCore::constructJSMediaSession):
2969         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
2970         (WebCore::toJS):
2971         * bindings/js/JSNamedNodeMapCustom.cpp:
2972         (WebCore::JSNamedNodeMap::nameGetter):
2973         * bindings/js/JSNodeCustom.cpp:
2974         (WebCore::createWrapperInline):
2975         (WebCore::toJSNewlyCreated):
2976         (WebCore::willCreatePossiblyOrphanedTreeByRemovalSlowCase):
2977         (WebCore::getOutOfLineCachedWrapper): Deleted.
2978         * bindings/js/JSNodeCustom.h:
2979         (WebCore::toJS):
2980         * bindings/js/JSNodeListCustom.cpp:
2981         (WebCore::toJSNewlyCreated):
2982         * bindings/js/JSNodeListCustom.h:
2983         (WebCore::toJS):
2984         * bindings/js/JSPerformanceEntryCustom.cpp:
2985         (WebCore::toJS):
2986         * bindings/js/JSPopStateEventCustom.cpp:
2987         (WebCore::JSPopStateEvent::state):
2988         * bindings/js/JSRTCStatsResponseCustom.cpp:
2989         (WebCore::JSRTCStatsResponse::nameGetter):
2990         * bindings/js/JSSVGPathSegCustom.cpp:
2991         (WebCore::toJS):
2992         * bindings/js/JSStyleSheetCustom.cpp:
2993         (WebCore::toJS):
2994         * bindings/js/JSTextTrackCueCustom.cpp:
2995         (WebCore::toJS):
2996         * bindings/js/JSTrackCustom.cpp:
2997         (WebCore::toJS):
2998         * bindings/js/JSTrackCustom.h:
2999         * bindings/js/JSTrackEventCustom.cpp:
3000         (WebCore::JSTrackEvent::track):
3001         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
3002         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
3003         * bindings/js/JSWorkerCustom.cpp:
3004         (WebCore::constructJSWorker):
3005         * bindings/js/ReadableStreamController.cpp:
3006         (WebCore::createReadableStream):
3007         * bindings/scripts/CodeGeneratorJS.pm:
3008         (GenerateHeader):
3009         (GenerateImplementation):
3010         (GenerateCallbackHeader):
3011         (GenerateCallbackImplementation):
3012         (NativeToJSValue):
3013         (GenerateConstructorDefinition):
3014         (ceilingToPowerOf2): Deleted.
3015         (ConstructorHasProperties): Deleted.
3016         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3017         (WebCore::toJSNewlyCreated):
3018         (WebCore::toJS):
3019         (WebCore::JSTestActiveDOMObject::toWrapped): Deleted.
3020         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3021         (WebCore::toJS):
3022         (WebCore::toJSNewlyCreated):
3023         * bindings/scripts/test/JS/JSTestCallback.cpp:
3024         (WebCore::JSTestCallback::callbackWithArrayParam):
3025         (WebCore::JSTestCallback::callbackWithStringList):
3026         (WebCore::JSTestCallback::callbackRequiresThisToPass):
3027         (WebCore::toJS):
3028         * bindings/scripts/test/JS/JSTestCallback.h:
3029         (WebCore::toJS):
3030         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
3031         (WebCore::JSTestCallbackFunction::callbackWithArrayParam):
3032         (WebCore::JSTestCallbackFunction::callbackWithStringList):
3033         (WebCore::JSTestCallbackFunction::callbackRequiresThisToPass):
3034         (WebCore::toJS):
3035         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
3036         (WebCore::toJS):
3037         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3038         (WebCore::toJSNewlyCreated):
3039         (WebCore::toJS):
3040         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped): Deleted.
3041         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3042         (WebCore::toJS):
3043         (WebCore::toJSNewlyCreated):
3044         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3045         (WebCore::toJSNewlyCreated):
3046         (WebCore::toJS):
3047         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped): Deleted.
3048         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3049         (WebCore::toJS):
3050         (WebCore::toJSNewlyCreated):
3051         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3052         (WebCore::toJSNewlyCreated):
3053         (WebCore::toJS):
3054         (WebCore::JSTestCustomNamedGetter::toWrapped): Deleted.
3055         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3056         (WebCore::toJS):
3057         (WebCore::toJSNewlyCreated):
3058         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3059         (WebCore::JSTestEventConstructorConstructor::construct):
3060         (WebCore::toJSNewlyCreated):
3061         (WebCore::toJS):
3062         (WebCore::JSTestEventConstructor::toWrapped): Deleted.
3063         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3064         (WebCore::toJS):
3065         (WebCore::toJSNewlyCreated):
3066         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3067         (WebCore::jsTestEventTargetPrototypeFunctionItem):
3068         (WebCore::toJSNewlyCreated):
3069         (WebCore::toJS):
3070         (WebCore::JSTestEventTarget::toWrapped): Deleted.
3071         * bindings/scripts/test/JS/JSTestEventTarget.h:
3072         (WebCore::toJS):
3073         (WebCore::toJSNewlyCreated):
3074         * bindings/scripts/test/JS/JSTestException.cpp:
3075         (WebCore::toJSNewlyCreated):
3076         (WebCore::toJS):
3077         (WebCore::JSTestException::toWrapped): Deleted.
3078         * bindings/scripts/test/JS/JSTestException.h:
3079         (WebCore::toJS):
3080         (WebCore::toJSNewlyCreated):
3081         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3082         (WebCore::toJSNewlyCreated):
3083         (WebCore::toJS):
3084         (WebCore::JSTestGenerateIsReachable::toWrapped): Deleted.
3085         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3086         (WebCore::toJS):
3087         (WebCore::toJSNewlyCreated):
3088         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3089         (WebCore::toJSNewlyCreated):
3090         (WebCore::toJS):
3091         (WebCore::JSTestGlobalObject::toWrapped): Deleted.
3092         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3093         (WebCore::toJS):
3094         (WebCore::toJSNewlyCreated):
3095         * bindings/scripts/test/JS/JSTestInterface.cpp:
3096         (WebCore::JSTestInterfaceConstructor::construct):
3097         (WebCore::jsTestInterfaceImplementsNode):
3098         (WebCore::jsTestInterfaceSupplementalNode):
3099         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
3100         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
3101         (WebCore::toJSNewlyCreated):
3102         (WebCore::toJS):
3103         (WebCore::JSTestInterface::toWrapped): Deleted.
3104         * bindings/scripts/test/JS/JSTestInterface.h:
3105         (WebCore::toJS):
3106         (WebCore::toJSNewlyCreated):
3107         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3108         (WebCore::toJSNewlyCreated):
3109         (WebCore::toJS):
3110         (WebCore::JSTestMediaQueryListListener::toWrapped): Deleted.
3111         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3112         (WebCore::toJS):
3113         (WebCore::toJSNewlyCreated):
3114         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3115         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
3116         (WebCore::toJSNewlyCreated):
3117         (WebCore::toJS):
3118         (WebCore::JSTestNamedConstructor::toWrapped): Deleted.
3119         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3120         (WebCore::toJS):
3121         (WebCore::toJSNewlyCreated):
3122         * bindings/scripts/test/JS/JSTestNode.cpp:
3123         (WebCore::JSTestNodeConstructor::construct):
3124         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3125         (WebCore::toJSNewlyCreated):
3126         (WebCore::toJS):
3127         (WebCore::JSTestNondeterministic::toWrapped): Deleted.
3128         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3129         (WebCore::toJS):
3130         (WebCore::toJSNewlyCreated):
3131         * bindings/scripts/test/JS/JSTestObj.cpp:
3132         (WebCore::JSTestObjConstructor::construct):
3133         (WebCore::jsTestObjReadOnlyTestObjAttr):
3134         (WebCore::jsTestObjTestObjAttr):
3135         (WebCore::jsTestObjTestNullableObjAttr):
3136         (WebCore::jsTestObjLenientTestObjAttr):
3137         (WebCore::jsTestObjXMLObjAttr):
3138         (WebCore::jsTestObjTypedArrayAttr):
3139         (WebCore::jsTestObjStrictTypeCheckingAttribute):
3140         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
3141         (WebCore::jsTestObjWithScriptStateAttributeRaises):
3142         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
3143         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
3144         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3145         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3146         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
3147         (WebCore::jsTestObjContentDocument):
3148         (WebCore::jsTestObjMutablePoint):
3149         (WebCore::jsTestObjImmutablePoint):
3150         (WebCore::jsTestObjPutForwardsAttribute):
3151         (WebCore::jsTestObjPutForwardsNullableAttribute):
3152         (WebCore::jsTestObjPrototypeFunctionObjMethod):
3153         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
3154         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
3155         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
3156         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
3157         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
3158         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
3159         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
3160         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
3161         (WebCore::jsTestObjPrototypeFunctionGetElementById):
3162         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
3163         (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
3164         (WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
3165         (WebCore::toJSNewlyCreated):
3166         (WebCore::toJS):
3167         (WebCore::JSTestObj::toWrapped): Deleted.
3168         * bindings/scripts/test/JS/JSTestObj.h:
3169         (WebCore::toJS):
3170         (WebCore::toJSNewlyCreated):
3171         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3172         (WebCore::constructJSTestOverloadedConstructors1):
3173         (WebCore::constructJSTestOverloadedConstructors2):
3174         (WebCore::constructJSTestOverloadedConstructors3):
3175         (WebCore::constructJSTestOverloadedConstructors4):
3176         (WebCore::constructJSTestOverloadedConstructors5):
3177         (WebCore::toJSNewlyCreated):
3178         (WebCore::toJS):
3179         (WebCore::JSTestOverloadedConstructors::toWrapped): Deleted.
3180         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3181         (WebCore::toJS):
3182         (WebCore::toJSNewlyCreated):
3183         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3184         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
3185         (WebCore::toJSNewlyCreated):
3186         (WebCore::toJS):
3187         (WebCore::JSTestOverrideBuiltins::toWrapped): Deleted.
3188         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3189         (WebCore::toJS):
3190         (WebCore::toJSNewlyCreated):
3191         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3192         (WebCore::toJSNewlyCreated):
3193         (WebCore::toJS):
3194         (WebCore::JSTestSerializedScriptValueInterface::toWrapped): Deleted.
3195         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3196         (WebCore::toJS):
3197         (WebCore::toJSNewlyCreated):
3198         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3199         (WebCore::JSTestTypedefsConstructor::construct):
3200         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
3201         (WebCore::toJSNewlyCreated):
3202         (WebCore::toJS):
3203         (WebCore::JSTestTypedefs::toWrapped): Deleted.
3204         * bindings/scripts/test/JS/JSTestTypedefs.h:
3205         (WebCore::toJS):
3206         (WebCore::toJSNewlyCreated):
3207         * bindings/scripts/test/JS/JSattribute.cpp:
3208         (WebCore::toJSNewlyCreated):
3209         (WebCore::toJS):
3210         (WebCore::JSattribute::toWrapped): Deleted.
3211         * bindings/scripts/test/JS/JSattribute.h:
3212         (WebCore::toJS):
3213         (WebCore::toJSNewlyCreated):
3214         * bindings/scripts/test/JS/JSreadonly.cpp:
3215         (WebCore::toJSNewlyCreated):
3216         (WebCore::toJS):
3217         (WebCore::JSreadonly::toWrapped): Deleted.
3218         * bindings/scripts/test/JS/JSreadonly.h:
3219         (WebCore::toJS):
3220         (WebCore::toJSNewlyCreated):
3221         * html/HTMLMediaElement.cpp:
3222         (WebCore::controllerJSValue):
3223         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
3224
3225 2016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
3226
3227         Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
3228         https://bugs.webkit.org/show_bug.cgi?id=157624
3229
3230         Reviewed by Darin Adler.
3231
3232         No new tests needed.
3233
3234         * loader/EmptyClients.h:
3235         * loader/FrameLoaderClient.h:
3236         * loader/HistoryController.cpp:
3237         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
3238
3239 2016-05-12  Antoine Quint  <graouts@apple.com>
3240
3241         Correctly handle prefixed and unprefixed variants in CSSStyleDeclaration
3242         https://bugs.webkit.org/show_bug.cgi?id=157569
3243         <rdar://problem/26223115>
3244
3245         Reviewed by Dean Jackson.
3246
3247         Tests: fast/css/prefixed-unprefixed-variant-style-declaration.html
3248                fast/css/shorthand-omitted-initial-value-overrides-shorthand.html
3249
3250         We essentially revert the code added with https://bugs.webkit.org/show_bug.cgi?id=110011
3251         which duplicated properties that had a prefixed or unprefixed variant. What we do now is
3252         to return the value of the prefixed or unprefixed variant through a CSSStyleDeclaration,
3253         but only return the properties specified by the author when reading from the `cssText` property.
3254
3255         * css/CSSParser.cpp:
3256         (WebCore::CSSParser::parseValue):
3257         (WebCore::CSSParser::parseTransitionShorthand):
3258         (WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
3259         * css/CSSParser.h:
3260         Remove all code adding duplicated properties for the prefixed or unprefixed
3261         variant of properties that exist in both forms.
3262
3263         * css/CSSPropertyNames.in:
3264         Treat transition properties as we do animation properties. 
3265
3266         * css/PropertySetCSSStyleDeclaration.cpp:
3267         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
3268         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
3269         Make these two methods call into the matching getXXXInternal() variant instead
3270         of going through the property set directly so that they would correctly pick up
3271         on the prefixed or unprefixed variant should there be one when the specified property
3272         is not specified directly.
3273
3274         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
3275         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
3276         We used to simply return the value for the given property from the property set, which
3277         we still do but now also check if there is prefixed or unprefixed variant for the provided
3278         property in case it was absent.
3279
3280         * css/StyleProperties.cpp:
3281         (WebCore::MutableStyleProperties::removeShorthandProperty):
3282         Remove all code adding duplicated properties for the prefixed or unprefixed
3283         variant of properties that exist in both forms.
3284
3285         (WebCore::StyleProperties::asText):
3286         Drive-by fix to also handle the animation-play-state and -webkit-animation-play-state properties
3287         when serializing to the shorthand.
3288
3289         (WebCore::MutableStyleProperties::removeProperty): Deleted.
3290         (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty): Deleted.
3291         (WebCore::MutableStyleProperties::setProperty): Deleted.
3292         (WebCore::getIndexInShorthandVectorForPrefixingVariant): Deleted.
3293         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty): Deleted.
3294         (WebCore::MutableStyleProperties::setPrefixingVariantProperty): Deleted.
3295         * css/StyleProperties.h:
3296         Remove all code adding duplicated properties for the prefixed or unprefixed
3297         variant of properties that exist in both forms.
3298
3299 2016-05-12  Commit Queue  <commit-queue@webkit.org>
3300
3301         Unreviewed, rolling out r200766.
3302         https://bugs.webkit.org/show_bug.cgi?id=157623
3303
3304         it is breaking yosemite builds (Requested by youenn on
3305         #webkit).
3306
3307         Reverted changeset:
3308
3309         "DOMPromise should only restrict the resolution type"
3310         https://bugs.webkit.org/show_bug.cgi?id=157307
3311         http://trac.webkit.org/changeset/200766
3312
3313 2016-05-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3314
3315         DOMPromise should only restrict the resolution type
3316         https://bugs.webkit.org/show_bug.cgi?id=157307
3317
3318         Reviewed by Darin Adler.
3319
3320         Removing from DOMPromise the rejection template parameter.
3321         Supported rejection types are integers (Exception codes) and DOM objects (DOMError typically).
3322
3323         Updated toJS and DeferredWrapper to accept Ref<>&& and RefPtr<>&&.
3324         Previously Ref<>&& were not accepted and only "const RefPtr<>&" was accepted.
3325         This in turn created an unecessary churn count when calling toJS.
3326
3327         Changes also allow in most cases to remove the need for explictly declaring the
3328         rejection/resolution type.
3329
3330         Minor refactoring of FontFaceSet promise handling to use DOMPromise in lieu of DeferredWrapper.
3331
3332         Covered by existing tests.
3333         Changes should not be visible from user scripts.
3334
3335         * Modules/fetch/FetchBody.cpp:
3336         (WebCore::FetchBody::consume):
3337         (WebCore::FetchBody::consumeText):
3338         (WebCore::blobFromArrayBuffer):
3339         (WebCore::FetchBody::loadingFailed):
3340         * Modules/fetch/FetchBody.h:
3341         (WebCore::FetchBody::formData):
3342         * Modules/fetch/FetchBodyOwner.cpp:
3343         (WebCore::FetchBodyOwner::arrayBuffer):
3344         (WebCore::FetchBodyOwner::blob):
3345         (WebCore::FetchBodyOwner::formData):
3346         (WebCore::FetchBodyOwner::json):
3347         (WebCore::FetchBodyOwner::text):
3348         * Modules/fetch/FetchResponse.cpp:
3349         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
3350         * Modules/fetch/FetchResponse.h:
3351         * Modules/mediastream/MediaDevices.h:
3352         * Modules/mediastream/PeerConnectionBackend.h:
3353         * Modules/mediastream/UserMediaRequest.cpp:
3354         (WebCore::UserMediaRequest::didCreateStream):
3355         * Modules/streams/ReadableStreamSource.h:
3356         * Modules/webaudio/AudioContext.h:
3357         * bindings/js/JSDOMBinding.h:
3358         (WebCore::toJS):
3359         (WebCore::jsPair):
3360         * bindings/js/JSDOMPromise.cpp:
3361         (WebCore::fulfillPromiseWithJSON):
3362         * bindings/js/JSDOMPromise.h:
3363         (WebCore::TypeInspector::decltype):
3364         (WebCore::TypeInspector::testIsVector):
3365         (WebCore::TypeInspector::testIsRefOrRefPtr):
3366         (WebCore::DeferredWrapper::resolve):
3367         (WebCore::DeferredWrapper::reject):
3368         (WebCore::DOMPromise::resolve):
3369         (WebCore::DOMPromise::reject):
3370         (WebCore::DeferredWrapper::resolveWithValue):
3371         (WebCore::DeferredWrapper::rejectWithValue):
3372         (WebCore::callPromiseFunction):
3373         * bindings/js/JSSubtleCryptoCustom.cpp:
3374         (WebCore::JSSubtleCrypto::importKey):
3375         (WebCore::JSSubtleCrypto::unwrapKey):
3376         * css/FontFace.h:
3377         * css/FontFaceSet.cpp:
3378         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
3379         (WebCore::FontFaceSet::load):
3380         (WebCore::FontFaceSet::registerReady):
3381         * css/FontFaceSet.h:
3382         * html/HTMLMediaElement.h:
3383
3384 2016-05-12  Manuel Rego Casasnovas  <rego@igalia.com>
3385
3386         [css-grid] Incorrect parsing when using just 'span" as grid-line value
3387         https://bugs.webkit.org/show_bug.cgi?id=157615
3388
3389         Reviewed by Sergio Villar Senin.
3390
3391         The spec is pretty clear about this:
3392         https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line
3393
3394         The possible options when using "span" to reference a grid line are:
3395           [ span && [ <integer> || <custom-ident> ] ]
3396
3397         Thus, "span" keyword alone produces an invalid declaration.
3398
3399         * css/CSSParser.cpp:
3400         (WebCore::CSSParser::parseGridPosition):
3401
3402 2016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
3403
3404         Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
3405         https://bugs.webkit.org/show_bug.cgi?id=157564
3406
3407         Reviewed by Darin Adler.
3408
3409         * Configurations/FeatureDefines.xcconfig:
3410
3411 2016-05-11  Ryosuke Niwa  <rniwa@webkit.org>
3412
3413         TextIteratorStopsOnFormControls is never used
3414         https://bugs.webkit.org/show_bug.cgi?id=157609
3415
3416         Reviewed by Alex Christensen.
3417