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