219b9a388bf149ebe4ae74d4a74251cdddcb29d4
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-25  Filip Pizlo  <fpizlo@apple.com>
2
3         WebCore on Mac ignores the user's preferred region (country) while getting the language
4         https://bugs.webkit.org/show_bug.cgi?id=156993
5
6         Reviewed by Geoffrey Garen.
7
8         I don't know how to test this since this depends on user settings.
9         
10         WebCore was previously getting the list of preferred languages, and for each one, deducing
11         the default region. That's wrong, since for example it doesn't respect the user's choice (in
12         System Preferences) to display dates/calenders/etc according to a different region (like how
13         I have my machine set to en-pl right now).
14         
15         It might be possible for the country code we get via kCFLocaleCountryCode to be something
16         that our ICU doesn't handle. To defend against this, we search for the resulting country
17         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
18         behavior.
19
20         * platform/mac/Language.mm:
21         (WebCore::httpStyleLanguageCode):
22         (WebCore::platformUserPreferredLanguages):
23
24 2016-04-26  Chris Dumez  <cdumez@apple.com>
25
26         [Web IDL] Specify default values for optional parameters of TypedArray types
27         https://bugs.webkit.org/show_bug.cgi?id=157017
28
29         Reviewed by Darin Adler.
30
31         Specify default values for optional parameters of TypedArray types and let
32         the bindings generator use WTF::Optional<> for the ones that do not have a
33         default value.
34
35         * bindings/scripts/CodeGeneratorJS.pm:
36         (CanUseWTFOptionalForParameter): Deleted.
37         * html/HTMLMediaElement.cpp:
38         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
39         (WebCore::HTMLMediaElement::webkitAddKey):
40         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
41         * html/HTMLMediaElement.h:
42         * html/HTMLMediaElement.idl:
43
44 2016-04-26  Chris Dumez  <cdumez@apple.com>
45
46         [Web IDL] Specify default values for optional parameters of type 'long' / 'unrestricted double'
47         https://bugs.webkit.org/show_bug.cgi?id=157012
48
49         Reviewed by Darin Adler.
50
51         Specify default values for optional parameters of type 'long' / 'unrestricted double'
52         and let the bindings generator use WTF::Optional<> for the ones that do not have a
53         default value.
54
55         * Modules/mediastream/RTCDTMFSender.cpp:
56         (WebCore::RTCDTMFSender::insertDTMF):
57         (WebCore::RTCDTMFSender::didPlayTone): Deleted.
58         * Modules/mediastream/RTCDTMFSender.h:
59         * Modules/webaudio/AudioBufferSourceNode.cpp:
60         (WebCore::AudioBufferSourceNode::start):
61         (WebCore::AudioBufferSourceNode::startPlaying): Deleted.
62         * Modules/webaudio/AudioBufferSourceNode.h:
63         * Modules/webaudio/AudioBufferSourceNode.idl:
64         * Modules/webaudio/AudioContext.cpp:
65         (WebCore::AudioContext::createDelay): Deleted.
66         * Modules/webaudio/AudioContext.h:
67         * Modules/webaudio/AudioContext.idl:
68         * Modules/webaudio/AudioScheduledSourceNode.cpp:
69         (WebCore::AudioScheduledSourceNode::start): Deleted.
70         (WebCore::AudioScheduledSourceNode::stop): Deleted.
71         * Modules/webaudio/AudioScheduledSourceNode.h:
72         * Modules/webaudio/OscillatorNode.idl:
73         * bindings/scripts/CodeGeneratorJS.pm:
74         (CanUseWTFOptionalForParameter): Deleted.
75         * bindings/scripts/test/JS/JSTestObj.cpp:
76         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
77         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
78         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
79         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
80         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
81         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
82         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
83         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue): Deleted.
84         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString): Deleted.
85         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): Deleted.
86         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
87         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
88         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
89         * html/HTMLInputElement.idl:
90         * page/WindowTimers.idl:
91         * testing/Internals.h:
92         * testing/Internals.idl:
93
94 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
95
96         Drop [UsePointersEvenForNonNullableObjectArguments] from SpeechSynthesis
97         https://bugs.webkit.org/show_bug.cgi?id=156901
98
99         Reviewed by Darin Adler.
100
101         SpeechSynthesis.speak will now throw in case of bad parameters instead of silently failing.
102         Started refactoring to use more references where possible.
103
104         Covered by updated test.
105
106         * Modules/speech/SpeechSynthesis.cpp:
107         (WebCore::SpeechSynthesis::startSpeakingImmediately): Refactored to get a reference.
108         (WebCore::SpeechSynthesis::speak):
109         (WebCore::SpeechSynthesis::fireEvent):
110         (WebCore::SpeechSynthesis::handleSpeakingCompleted): Removing first item in utteranceQueue unconditionally,
111         since that would crash in Debug mode otherwise.
112         (WebCore::SpeechSynthesis::boundaryEventOccurred):
113         (WebCore::SpeechSynthesis::didStartSpeaking):
114         (WebCore::SpeechSynthesis::didPauseSpeaking):
115         (WebCore::SpeechSynthesis::didResumeSpeaking):
116         (WebCore::SpeechSynthesis::didFinishSpeaking):
117         (WebCore::SpeechSynthesis::speakingErrorOccurred):
118         * Modules/speech/SpeechSynthesis.h:
119         * Modules/speech/SpeechSynthesis.idl:
120
121 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
122
123         Drop [UsePointersEvenForNonNullableObjectArguments] from WebKitNamedFlow
124         https://bugs.webkit.org/show_bug.cgi?id=156979
125
126         Reviewed by Chris Dumez.
127
128         No change of behavior.
129
130         * dom/WebKitNamedFlow.idl: Marking contentNode parameter as nullable.
131
132 2016-04-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
133
134         Drop [UsePointersEvenForNonNullableObjectArguments] from EventTarget
135         https://bugs.webkit.org/show_bug.cgi?id=156977
136
137         Reviewed by Chris Dumez.
138
139         No change of behavior.
140
141         * dom/EventTarget.idl:
142
143 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
144
145         Remove the build flag for template elements
146         https://bugs.webkit.org/show_bug.cgi?id=157022
147
148         Reviewed by Daniel Bates.
149
150         Removed the build flag.
151
152         * Configurations/FeatureDefines.xcconfig:
153         * DerivedSources.cpp:
154         * bindings/js/JSHTMLTemplateElementCustom.cpp:
155         (WebCore::JSHTMLTemplateElement::content):
156         * css/html.css:
157         (summary::-webkit-details-marker):
158         (template):
159         (bdi, output):
160         * dom/ContainerNode.cpp:
161         (WebCore::isInTemplateContent):
162         (WebCore::containsConsideringHostElements):
163         (WebCore::ContainerNode::parserInsertBefore):
164         (WebCore::ContainerNode::parserAppendChild):
165         * dom/Document.cpp:
166         (WebCore::Document::Document):
167         (WebCore::Document::~Document):
168         (WebCore::Document::getCachedLocale):
169         (WebCore::Document::ensureTemplateDocument):
170         (WebCore::Document::fonts):
171         * dom/Document.h:
172         (WebCore::Document::setTemplateDocumentHost):
173         (WebCore::Document::templateDocumentHost):
174         (WebCore::Document::hasDisabledFieldsetElement):
175         (WebCore::Document::textEncoding):
176         (WebCore::Document::templateDocument):
177         * dom/Element.cpp:
178         (WebCore::Element::setInnerHTML):
179         * dom/Node.cpp:
180         (WebCore::Node::containsIncludingHostElements):
181         (WebCore::Node::pseudoAwarePreviousSibling):
182         * dom/TemplateContentDocumentFragment.h:
183         * editing/MarkupAccumulator.cpp:
184         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
185         * editing/markup.cpp:
186         (WebCore::createFragmentForInnerOuterHTML):
187         * html/HTMLTagNames.in:
188         * html/HTMLTemplateElement.cpp:
189         (WebCore::HTMLTemplateElement::didMoveToNewDocument):
190         * html/HTMLTemplateElement.h:
191         * html/HTMLTemplateElement.idl:
192         * html/parser/HTMLConstructionSite.cpp:
193         (WebCore::insert):
194         (WebCore::HTMLConstructionSite::insertTextNode):
195         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
196         (WebCore::HTMLConstructionSite::findFosterSite):
197         * html/parser/HTMLElementStack.cpp:
198         (WebCore::HTMLNames::isScopeMarker):
199         (WebCore::HTMLNames::isTableScopeMarker):
200         (WebCore::HTMLNames::isTableBodyScopeMarker):
201         (WebCore::HTMLNames::isTableRowScopeMarker):
202         (WebCore::HTMLElementStack::inSelectScope):
203         (WebCore::HTMLElementStack::hasTemplateInHTMLScope):
204         (WebCore::HTMLElementStack::htmlElement):
205         * html/parser/HTMLElementStack.h:
206         * html/parser/HTMLPreloadScanner.cpp:
207         (WebCore::TokenPreloadScanner::scan):
208         * html/parser/HTMLPreloadScanner.h:
209         * html/parser/HTMLStackItem.h:
210         (WebCore::isSpecialNode):
211         * html/parser/HTMLTreeBuilder.cpp:
212         (WebCore::HTMLTreeBuilder::isParsingTemplateContents):
213         (WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents):
214         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
215         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
216         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
217         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
218         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
219         (WebCore::HTMLTreeBuilder::processColgroupEndTagForInColumnGroup):
220         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
221         (WebCore::HTMLTreeBuilder::processStartTag):
222         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
223         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
224         (WebCore::HTMLTreeBuilder::processEndTagForInCell):
225         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
226         (WebCore::HTMLTreeBuilder::processEndTag):
227         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
228         (WebCore::HTMLTreeBuilder::processEndOfFile):
229         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
230         (WebCore::HTMLTreeBuilder::finished):
231         * html/parser/HTMLTreeBuilder.h:
232         * inspector/InspectorDOMAgent.cpp:
233         (WebCore::InspectorDOMAgent::buildObjectForNode):
234         * inspector/InspectorInstrumentation.h:
235         (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
236         * xml/parser/XMLDocumentParserLibxml2.cpp:
237         (WebCore::XMLDocumentParser::startElementNs):
238
239 2016-04-25  Jiewen Tan  <jiewen_tan@apple.com>
240
241         [iOS] ftp links crash @ WebCore::FTPDirectoryDocumentParser::appendEntry
242         https://bugs.webkit.org/show_bug.cgi?id=157019
243         <rdar://problem/24292650>
244
245         Reviewed by Chris Dumez.
246
247         Create separate Ref<Element> object for every row element instead of reusing
248         one because Ref<>'s operator=() does not allow assignment after a WTFMove().
249
250         * html/FTPDirectoryDocument.cpp:
251         (WebCore::FTPDirectoryDocumentParser::appendEntry):
252
253 2016-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
254
255         [Cocoa] Guarantee FontPlatformData's m_cgFont is never nullptr
256         https://bugs.webkit.org/show_bug.cgi?id=156929
257
258         Reviewed by Darin Adler.
259
260         After some investigation, it turns out that there is no place where it is meaningful
261         to pass us a null CoreText font. Therefore, the CoreGraphics font is also never null.
262
263         We should simply check for these null values at the ingestion site in order to
264         make the guarantee internally of having non-null values.
265
266         * platform/graphics/FontPlatformData.cpp:
267         (WebCore::FontPlatformData::FontPlatformData): Because the pointer is never null, we
268         can delete the code which handles that case.
269         * platform/graphics/FontPlatformData.h:
270         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
271         (WebCore::webFallbackFontFamily): Deleted.
272         (WebCore::FontPlatformData::setFallbackCGFont): Deleted.
273         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
274         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Asking the
275         CTRun for its kCTFontAttributeName will always return non-null.
276         * platform/graphics/mac/FontCustomPlatformData.cpp:
277         (WebCore::FontCustomPlatformData::fontPlatformData): Once we have a font descriptor,
278         CTFontCreateWithFontDescriptor() will always return non-null. We check if the font
279         descriptor is null elsewhere.
280         * platform/mac/DragImageMac.mm: The fonts in this file are gotten by asking for the
281         system font, which will always return non-null.
282         (WebCore::fontFromNSFont):
283         (WebCore::widthWithFont):
284         (WebCore::drawAtPoint):
285         (WebCore::createDragImageForLink):
286
287 2016-04-25  Chris Dumez  <cdumez@apple.com>
288
289         Crash under MemoryCache::remove()
290         https://bugs.webkit.org/show_bug.cgi?id=157000
291         <rdar://problem/23344660>
292
293         Reviewed by Andreas Kling.
294
295         MemoryCache::evictResources() was caching the number of resources ('size')
296         in the cache for a particular sessionID, and then proceed to call
297         MemoryCache::remove() 'size' times using the first item in the HashMap
298         each time. This was unsafe because resources may be ref'ing each other
299         and therefore removing one may cause other resources to get removed as
300         well. In such case, we would call remove() too many times and crash because
301         we dereferenced resources.begin()->value (with the HashMap being empty).
302
303         This patch avoids the issue by copying the resources to a Vector and
304         ref'ing them first, before going on to remove each one from the cache.
305
306         * loader/cache/MemoryCache.cpp:
307         (WebCore::MemoryCache::forEachSessionResource):
308         (WebCore::MemoryCache::evictResources):
309         * loader/cache/MemoryCache.h:
310
311 2016-04-25  Chris Dumez  <cdumez@apple.com>
312
313         Crash under WebCore::MutationObserver::deliverAllMutations()
314         https://bugs.webkit.org/show_bug.cgi?id=156997
315         <rdar://problem/16542323>
316
317         Reviewed by Ryosuke Niwa.
318
319         The crash traces indicate that we may derefence a null pointer when
320         dereferencing MutationCallback::scriptExecutationContext() in
321         MutationObserver::canDeliver(). This can happen when the script
322         execution context gets destroyed as a JSMutationCallback is an
323         ActiveDOMObject, which is a ContextDestructionObserver.
324
325         This patch refactors the code so that MutationObserver::canDeliver()
326         now simply asks JSMutationCallback if it can invoke its callback.
327         JSMutationCallback makes this decision using
328         ActiveDOMCallback::canInvokeCallback() which does a proper null
329         check of the ScriptExecutationContext. This avoids some code
330         duplication and fixes the crash.
331
332         * bindings/js/JSMutationCallback.h:
333         * dom/MutationCallback.h:
334         * dom/MutationObserver.cpp:
335         (WebCore::MutationObserver::canDeliver):
336
337 2016-04-25  Brady Eidson  <beidson@apple.com>
338
339         Fix a flaky test after r200032
340
341         * fileapi/File.cpp:
342         (WebCore::File::lastModified): This used to return a date object which did a WTF::timeClip on the double,
343           but now that we're returning a raw double we need to WTF::timeClip it ourselves.
344
345 2016-04-25  Chris Dumez  <cdumez@apple.com>
346
347         [Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'
348         https://bugs.webkit.org/show_bug.cgi?id=156995
349
350         Reviewed by Darin Adler.
351
352         Specify default values for optional parameters of type 'float' / 'unrestricted float'
353         and let the bindings generator use WTF::Optional<> for the ones that do not have a
354         default value.
355
356         * bindings/scripts/CodeGeneratorJS.pm:
357         (CanUseWTFOptionalForParameter): Deleted.
358         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
359         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
360         * html/canvas/CanvasRenderingContext2D.cpp:
361         (WebCore::CanvasRenderingContext2D::setStrokeColor):
362         (WebCore::CanvasRenderingContext2D::setFillColor):
363         (WebCore::CanvasRenderingContext2D::setShadow):
364         (WebCore::CanvasRenderingContext2D::fillText):
365         (WebCore::CanvasRenderingContext2D::strokeText):
366         (WebCore::CanvasRenderingContext2D::drawTextInternal):
367         (WebCore::CanvasRenderingContext2D::clearShadow): Deleted.
368         (WebCore::normalizeSpaces): Deleted.
369         (WebCore::CanvasRenderingContext2D::measureText): Deleted.
370         * html/canvas/CanvasRenderingContext2D.h:
371         * html/canvas/CanvasRenderingContext2D.idl:
372         * testing/Internals.idl:
373
374 2016-04-25  Brent Fulgham  <bfulgham@apple.com>
375
376         Add port 4190 (managesieve) to port blacklist
377         https://bugs.webkit.org/show_bug.cgi?id=156986
378         <rdar://problem/9119470>
379
380         Reviewed by Daniel Bates.
381
382         Tested by security/block-test.html.
383
384         * platform/URL.cpp:
385         (WebCore::portAllowed): Add 4190 to the port blacklist.
386
387 2016-04-25  Nan Wang  <n_wang@apple.com>
388
389         AX: Crash at -[WebAccessibilityObjectWrapper accessibilityAttributeValue:] + 4391
390         https://bugs.webkit.org/show_bug.cgi?id=156987
391
392         Reviewed by Chris Fleizach.
393
394         When we hit test on a slider indicator asking for the value when the parent slider's
395         accessibility object is not created or the parent slider has been removed, it will cause
396         crash. Fixed it by adding a check to see if the object is detached from the parent. 
397
398         Test: accessibility/mac/slider-thumb-value-crash.html
399
400         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
401         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
402
403 2016-04-25  Jer Noble  <jer.noble@apple.com>
404
405         WebKitPlaybackSessionModelMediaElement should initialize the interface added by setWebPlaybackSessionInterface() with initial data
406         https://bugs.webkit.org/show_bug.cgi?id=156996
407
408         Reviewed by Beth Dakin.
409
410         Notify the interface of the current values in the media element when the model is given an interface.
411
412         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
413         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
414
415 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
416
417         Toggling animation-play-state can re-start a finished animation
418         https://bugs.webkit.org/show_bug.cgi?id=156731
419
420         Reviewed by Dean Jackson.
421
422         After an animation completed, CompositeAnimation::updateKeyframeAnimations() cleared
423         all state that the animation had run on the element, so changing the value of some
424         animation property triggered the animation to run again. This is wrong, since animation-name
425         still applied to the element.
426
427         Fix by keeping state for keyframe animations in the Done state in the m_keyframeAnimations
428         map. This allows for the removal of the index property on KeyframeAnimation.
429
430         Tests: animations/change-completed-animation-transform.html
431                animations/change-completed-animation.html
432
433         * page/animation/AnimationBase.cpp:
434         (WebCore::AnimationBase::timeToNextService):
435         * page/animation/AnimationBase.h:
436         (WebCore::AnimationBase::isAnimatingProperty):
437         * page/animation/CompositeAnimation.cpp: Add animations that should stick around to AnimationNameMap,
438         and swap with m_keyframeAnimations at the end.
439         (WebCore::CompositeAnimation::updateKeyframeAnimations):
440         * page/animation/KeyframeAnimation.cpp:
441         (WebCore::KeyframeAnimation::KeyframeAnimation):
442         (WebCore::KeyframeAnimation::getAnimatedStyle):
443         * page/animation/KeyframeAnimation.h:
444
445 2016-04-25  Alberto Garcia  <berto@igalia.com>
446
447         [GTK] Crashes if DISPLAY is unset
448         https://bugs.webkit.org/show_bug.cgi?id=156972
449
450         Reviewed by Carlos Garcia Campos.
451
452         If DISPLAY is unset then m_display will be NULL, crashing WebKit
453         when XCloseDisplay is called in the PlatformDisplayX11 destructor.
454
455         * platform/graphics/x11/PlatformDisplayX11.cpp:
456         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
457
458 2016-04-25  Ryan Haddad  <ryanhaddad@apple.com>
459
460         Update JS bindings test results after r200037
461
462         Unreviewed test gardening.
463
464         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
465         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
466
467 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
468
469         play-state not parsed as part of animation shorthand
470         https://bugs.webkit.org/show_bug.cgi?id=156959
471
472         Reviewed by Darin Adler.
473
474         We failed to parse animation-play-state as part of the animation shorthand, contrary
475         to the spec and other browsers.
476
477         Fix for both the prefixed and unprefixed properties. There is some compat risk here,
478         but only changing unprefixed behavior will probably lead to more author confusion.
479
480         Test: animations/play-state-in-shorthand.html
481
482         * css/CSSParser.cpp:
483         (WebCore::CSSParser::parseAnimationShorthand):
484         * css/CSSPropertyNames.in:
485         * css/StylePropertyShorthand.cpp:
486         (WebCore::animationShorthandForParsing): Remove the long comment which is no longer relevant
487         now that the behavior has been written into the spec.
488
489 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
490
491         Negative animation-delay is treated as 0s
492         https://bugs.webkit.org/show_bug.cgi?id=141008
493
494         Reviewed by Daniel Bates.
495         
496         Fix keyframe animations which start in the paused state.
497         
498         Explicitly move such animations from the new to the paused state, and
499         set m_pauseTime to 0, rather than leaving it at -1. Fix getElapsedTime()
500         to compute a correct time elapsed time for such animations, which takes
501         negative delay into account correctly.
502         
503         Fix assertions which need to account for the new transition of New -> PlayStatePaused.
504
505         Test: animations/play-state-start-paused.html
506
507         * page/animation/AnimationBase.cpp:
508         (WebCore::AnimationBase::updateStateMachine):
509         (WebCore::AnimationBase::getElapsedTime):
510         * page/animation/KeyframeAnimation.cpp:
511         (WebCore::KeyframeAnimation::animate):
512
513 2016-04-25  Antti Koivisto  <antti@apple.com>
514
515         Inline RenderStyle into RenderElement
516         https://bugs.webkit.org/show_bug.cgi?id=156981
517
518         Reviewed by Andreas Kling.
519
520         We can save memory and reduce indirection of style access by inlining RenderStyle to RenderElement.
521
522         This patch also makes RenderStyle moveable and switches from std::unique_ptr<RenderStyle> to RenderStyle&&
523         in many places where ownership is passed.
524
525         * Modules/plugins/PluginReplacement.h:
526         (WebCore::PluginReplacement::scriptObject):
527         (WebCore::PluginReplacement::willCreateRenderer):
528         * Modules/plugins/QuickTimePluginReplacement.h:
529         * Modules/plugins/QuickTimePluginReplacement.mm:
530         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
531         (WebCore::QuickTimePluginReplacement::createElementRenderer):
532         * Modules/plugins/YouTubePluginReplacement.cpp:
533         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
534         (WebCore::YouTubePluginReplacement::createElementRenderer):
535         * Modules/plugins/YouTubePluginReplacement.h:
536         * css/StyleResolver.cpp:
537         (WebCore::StyleResolver::styleForElement):
538         (WebCore::StyleResolver::styleForKeyframe):
539         (WebCore::StyleResolver::pseudoStyleForElement):
540         (WebCore::StyleResolver::styleForPage):
541         (WebCore::StyleResolver::defaultStyleForElement):
542         (WebCore::StyleResolver::addToMatchedPropertiesCache):
543         (WebCore::StyleResolver::applyPropertyToStyle):
544         * dom/Document.cpp:
545         (WebCore::Document::recalcStyle):
546         (WebCore::Document::webkitWillEnterFullScreenForElement):
547         (WebCore::Document::setFullScreenRenderer):
548         * dom/Element.cpp:
549         (WebCore::Element::rendererIsNeeded):
550         (WebCore::Element::createElementRenderer):
551         * dom/Element.h:
552         (WebCore::Element::copyNonAttributePropertiesFromElement):
553         * dom/PseudoElement.cpp:
554         (WebCore::PseudoElement::resolveCustomStyle):
555         (WebCore::PseudoElement::didAttachRenderers):
556         (WebCore::PseudoElement::didRecalcStyle):
557         * html/BaseButtonInputType.cpp:
558         (WebCore::BaseButtonInputType::appendFormData):
559         (WebCore::BaseButtonInputType::createInputRenderer):
560         * html/BaseButtonInputType.h:
561         * html/FileInputType.cpp:
562         (WebCore::FileInputType::handleDOMActivateEvent):
563         (WebCore::FileInputType::createInputRenderer):
564         * html/FileInputType.h:
565         * html/HTMLAppletElement.cpp:
566         (WebCore::HTMLAppletElement::rendererIsNeeded):
567         (WebCore::HTMLAppletElement::createElementRenderer):
568
569         ...
570
571 2016-04-25  Eric Carlson  <eric.carlson@apple.com>
572
573         Stop listening for "media can start" notifications when media player is cleared
574         https://bugs.webkit.org/show_bug.cgi?id=156985
575         <rdar://problem/23158505>
576
577         Reviewed by Jer Noble.
578
579         No new tests, I have not been able to create a test that reliably reproduces this.
580
581         * html/HTMLMediaElement.cpp:
582         (WebCore::HTMLMediaElement::loadInternal): Add logging.
583         (WebCore::HTMLMediaElement::selectMediaResource): Assert and return early if there is
584           no media player.
585         (WebCore::HTMLMediaElement::clearMediaPlayer): Stop listening for can start notifications.
586         (WebCore::HTMLMediaElement::visibilityStateChanged): Add logging.
587         (WebCore::HTMLMediaElement::mediaCanStart): Ditto.
588
589 2016-04-25  Chris Dumez  <cdumez@apple.com>
590
591         [Web IDL] Specify default values for parameters of type 'unsigned short'
592         https://bugs.webkit.org/show_bug.cgi?id=156967
593
594         Reviewed by Darin Adler.
595
596         Specify default values for parameters of type 'unsigned short' and let
597         the bindings generator use WTF::Optional<> for the ones without a
598         default value.
599
600         * bindings/scripts/CodeGeneratorJS.pm:
601         (CanUseWTFOptionalForParameter):
602         (GenerateParametersCheck):
603         * testing/Internals.cpp:
604         (WebCore::Internals::layerTreeAsText): Deleted.
605         (WebCore::Internals::displayListForElement): Deleted.
606         (WebCore::Internals::replayDisplayListForElement): Deleted.
607         * testing/Internals.h:
608         * testing/Internals.idl:
609
610 2016-04-25  Per Arne Vollan  <peavo@outlook.com>
611
612         [Win][IndexedDB] Fix build errors.
613         https://bugs.webkit.org/show_bug.cgi?id=156713
614
615         Reviewed by Alex Christensen.
616
617         Fix compile and link errors when building with IndexedDB enabled.
618
619         * Modules/indexeddb/IDBCursor.h:
620         * Modules/indexeddb/IDBTransaction.cpp:
621         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
622         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
623         * PlatformWin.cmake:
624         * platform/win/FileSystemWin.cpp:
625         (WebCore::hardLinkOrCopyFile):
626
627 2016-04-25  Brady Eidson  <beidson@apple.com>
628
629         Implement latest File object spec (including its constructor).
630         https://bugs.webkit.org/show_bug.cgi?id=156511
631
632         Reviewed by Darin Adler.
633
634         Test: fast/files/file-constructor.html
635
636         * CMakeLists.txt:
637         * WebCore.xcodeproj/project.pbxproj:
638
639         * bindings/js/JSDictionary.cpp:
640         (WebCore::JSDictionary::convertValue):
641         * bindings/js/JSDictionary.h:
642
643         * bindings/js/JSFileCustom.cpp: Added.
644         (WebCore::constructJSFile):
645
646         * fileapi/File.cpp:
647         (WebCore::File::File):
648         (WebCore::File::lastModified):
649         (WebCore::File::lastModifiedDate): Deleted.
650         * fileapi/File.h:
651         * fileapi/File.idl:
652
653
654
655 2016-04-25  Antti Koivisto  <antti@apple.com>
656
657         REGRESSION(r156846): Crashes with guard malloc
658         https://bugs.webkit.org/show_bug.cgi?id=156984
659
660         Reviewed by Andreas Kling.
661
662         RenderElement::cachedFirstLineStyle() returns pointer to local std::unique_ptr.
663
664         * rendering/RenderElement.cpp:
665         (WebCore::RenderElement::uncachedFirstLineStyle):
666         (WebCore::RenderElement::cachedFirstLineStyle):
667         (WebCore::RenderElement::firstLineStyle):
668         (WebCore::firstLineStyleForCachedUncachedType): Deleted.
669
670             Don't try to use a single function for the cached and uncached cases. Separate the cases into the calling functions.
671
672 2016-04-25  Daniel Bates  <dabates@apple.com>
673
674         REGRESSION (r196012): Subresource may be blocked by Content Security Policy if it only matches 'self'
675         https://bugs.webkit.org/show_bug.cgi?id=156935
676         <rdar://problem/25351286>
677
678         Reviewed by Darin Adler.
679
680         Fixes an issue where subresource load may be blocked by the Content Security Policy (CSP) if its URL only
681         matched 'self'. In particular, the load would be blocked if initiated from a document that inherited the
682         origin of its owner document (e.g. the document contained in <iframe src="about:blank"></iframe>).
683
684         Following r196012 we compute and cache 'self' and its protocol on instantiation of a ContentSecurityPolicy
685         object for use when matching a URL against it. These cached values become out-of-date if the document
686         subsequently inherits the origin of its owner document. Therefore matches against 'self' will fail and
687         CSP will block a load if its not otherwise allowed by the policy. Previously we would compute 'self' when
688         parsing the definition of a source list and compute the protocol for 'self' each time we tried to match a
689         URL against 'self'. So, 'self' would always be up-to-date with respect to the origin of the document.
690
691         Tests: http/tests/security/contentSecurityPolicy/iframe-blank-url-programmatically-add-external-script.html
692                http/tests/security/contentSecurityPolicy/iframe-srcdoc-external-script.html
693
694         * page/csp/ContentSecurityPolicy.cpp:
695         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Extract out logic for computing and caching
696         'self' and its protocol into ContentSecurityPolicy::updateSourceSelf() and make use of this function.
697         (WebCore::ContentSecurityPolicy::updateSourceSelf): Computes and caches 'self' and its protocol with
698         respect to the specified SecurityOrigin.
699         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Call ContentSecurityPolicy::updateSourceSelf()
700         to ensure that we have an up-to-date representation for 'self' and the protocol of 'self' which can
701         become out-of-date if the document inherited the origin of its owner document.
702         * page/csp/ContentSecurityPolicy.h:
703
704 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
705
706         Drop [UsePointersEvenForNonNullableObjectArguments] from TextTrack
707         https://bugs.webkit.org/show_bug.cgi?id=156899
708
709         Reviewed by Chris Dumez.
710
711         No behavior changes.
712
713         * html/track/TextTrack.idl: Marking cue and region parameter as nullable.
714         Also marking cues and activeCues as nullable attributes.
715
716 2016-04-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
717
718         Drop [UsePointersEvenForNonNullableObjectArguments] from File API interfaces
719         https://bugs.webkit.org/show_bug.cgi?id=156898
720
721         Reviewed by Chris Dumez.
722
723         Making FileReaderSync API API throwing a TypeError in case of null parameters, in lieu of a NOT_FOUND_ERR.
724         Making FileReader API taking nullable parameters as a temporary fix.
725
726         Test: fast/files/workers/worker-file-reader-sync-bad-parameter.html
727
728         * Modules/websockets/WebSocketChannel.cpp:
729         (WebCore::WebSocketChannel::processOutgoingFrameQueue): Updated to cope with FileReaderLoader::start taking a Blob&.
730         * fileapi/FileReader.cpp:
731         (WebCore::FileReader::readAsArrayBuffer): Updated to cope with readInternal taking a Blob&.
732         (WebCore::FileReader::readAsBinaryString): Ditto.
733         (WebCore::FileReader::readAsText): Ditto.
734         (WebCore::FileReader::readAsDataURL): Ditto.
735         (WebCore::FileReader::readInternal):  Updated to cope with FileReaderLoader::start taking a Blob&.
736         * fileapi/FileReader.h:
737         * fileapi/FileReader.idl: Marking the readXX methods as taking a nullable blob parameter to keep compatibility, at least temporarily.
738         * fileapi/FileReaderLoader.cpp:
739         (WebCore::FileReaderLoader::start): It now takes a Blob& as input.
740         * fileapi/FileReaderLoader.h:
741         * fileapi/FileReaderSync.cpp:
742         (WebCore::FileReaderSync::readAsArrayBuffer): Taking a Blob& as input.
743         (WebCore::FileReaderSync::readAsBinaryString): Ditto.
744         (WebCore::FileReaderSync::readAsText): Ditto.
745         (WebCore::FileReaderSync::readAsDataURL): Ditto.
746         (WebCore::FileReaderSync::startLoading) Ditto.
747         * fileapi/FileReaderSync.h:
748         (WebCore::FileReaderSync::readAsText): Ditto.
749         * fileapi/FileReaderSync.idl:
750
751 2016-04-25  Manuel Rego Casasnovas  <rego@igalia.com>
752
753         [css-grid] Fix grid-template-columns|rows computed style with content alignment
754         https://bugs.webkit.org/show_bug.cgi?id=156793
755
756         Reviewed by Darin Adler.
757
758         Computed style of grid-template-columns and grid-template-rows properties
759         was including the distribution offset because of content alignment.
760         We should subtract that offset, like we do for the case of gaps,
761         when we're calculating the computed style.
762
763         Test: fast/css-grid-layout/grid-template-columns-rows-computed-style-gaps-content-alignment.html
764
765         * css/CSSComputedStyleDeclaration.cpp:
766         (WebCore::valueForGridTrackList):
767         * rendering/RenderGrid.cpp:
768         (WebCore::RenderGrid::offsetBetweenTracks):
769         (WebCore::RenderGrid::populateGridPositions): Deleted FIXME.
770         * rendering/RenderGrid.h:
771
772 2016-04-25  Frederic Wang  <fwang@igalia.com>
773
774         Refactor RenderMathMLMenclose.
775         https://bugs.webkit.org/show_bug.cgi?id=155019
776
777         Reviewed by Sergio Villar Senin.
778
779         Tests: mathml/presentation/menclose-notation-equivalence.html
780                mathml/presentation/menclose-notation-values.html
781
782         We rewrite RenderMathMLMenclose so that layout functions correctly override the
783         behavior of RenderMathMLRow. We try and rely on the draft  of the MathML in HTML5
784         implementation note, to make easier to get consistency with other rendering engines
785         in the future. All notations are now drawn with GraphicContext functions instead of
786         mixing them with CSS style. To save memory space, the list of known notations are
787         now saved on a short integer using bit masks instead of a vector of string names.
788         Finally, we remove support for the radical notation so that we no longer need to
789         create an anonymous RenderMathMLRoot.
790
791         * mathml/MathMLMencloseElement.cpp: Remove code for some special notations and just
792         reimplement parsing of the notation attribute.
793         (WebCore::MathMLMencloseElement::MathMLMencloseElement): By default, the notation is longdiv.
794         (WebCore::MathMLMencloseElement::parseAttribute): By default, the list of notation is empty.
795         If there is no notation attribute, the default value longdiv is used.
796         Otherwise, we parse the notation attribute and add each notation, using some equivalences
797         for box, actuarial and madruwb.
798         (WebCore::MathMLMencloseElement::isPresentationAttribute): Deleted. No need to define
799         specific style for some notation.
800         (WebCore::MathMLMencloseElement::finishParsingChildren): Deleted. No need to add an
801         anonymous square root.
802         (WebCore::MathMLMencloseElement::collectStyleForPresentationAttribute): Deleted. No need to
803         define specific style for some notation.
804         (WebCore::MathMLMencloseElement::longDivLeftPadding): Deleted. RenderMathMLMenclose uses an
805         arbitrary size instead of measure a glyph.
806         * mathml/MathMLMencloseElement.h: Define simple bit mask for each notation, add a short
807         integer to store the list of notations together with helper functions. Remove old code.
808         * rendering/mathml/RenderMathMLMenclose.cpp: Rewrite RenderMathMLMenclose so that layout
809         functions correctly override the behavior of RenderMathMLRow.
810         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Init m_ascent to 0.
811         (WebCore::RenderMathMLMenclose::ruleThickness): For now, we use the fallback value used by
812         for other bars. We may refine that in the future.
813         (WebCore::RenderMathMLMenclose::getSpaceAroundContent): Helper function to retrieve the
814         space to add around the content, depending on the notations specified. Note that for
815         notation circle, this spacing depends on the content size.
816         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths): Reimplement this function.
817         This is just adding left/right spacing around the content.
818         (WebCore::RenderMathMLMenclose::layoutBlock): Reimplement this function. We do the normal
819         RenderMathMLRow layout, adjust spacing and child position and
820         calculate m_ascent and m_contentRect.
821         (WebCore::RenderMathMLMenclose::firstLineBaseline): Implement this function.
822         We just return m_ascent.
823         (WebCore::drawLine): Helper function to draw a line using strokePath.
824         (WebCore::RenderMathMLMenclose::paint): We reimplement this function to draw
825         all notations using GraphicContext.
826         (WebCore::RenderMathMLMenclose::addChild): Deleted. No need to manage anonymous renderers.
827         (WebCore::RenderMathMLMenclose::updateLogicalHeight): Deleted. Height is now calculated
828         in layoutBlock.
829         (WebCore::RenderMathMLMenclose::checkNotationalValuesValidity): Deleted.
830         * rendering/mathml/RenderMathMLMenclose.h: Update member definitions.
831         * rendering/mathml/RenderMathMLRoot.cpp: We no longer need anonymous roots.
832         (WebCore::RenderMathMLRoot::RenderMathMLRoot): Deleted.
833         * rendering/mathml/RenderMathMLRoot.h: We no longer need anonymous roots.
834         * rendering/mathml/RenderMathMLRow.cpp: Allow to get the exact metrics of the chid row,
835         for use in RenderMathMLRoot.
836         (WebCore::RenderMathMLRow::computeLineVerticalStretch): rename parameters.
837         (WebCore::RenderMathMLRow::layoutRowItems): Set parameters to the final ascent, descent and
838         logical width of the chid row. Set the temporary logical width for RenderMathMenclose before
839         laying the children out.
840         (WebCore::RenderMathMLRow::layoutBlock): Rename parameters ; add a dummy logicalWidth
841         parameter.
842         * rendering/mathml/RenderMathMLRow.h: Make some functions accessible or overridable by
843         RenderMathMLRoot. Make layoutRowItems return the final ascent, descent and logical width
844         after the chid row is laid out.
845         * rendering/mathml/RenderMathMLSquareRoot.cpp: We no longer need anonymous roots.
846         (WebCore::RenderMathMLSquareRoot::RenderMathMLSquareRoot): Deleted.
847         (WebCore::RenderMathMLSquareRoot::createAnonymousWithParentRenderer): Deleted.
848         * rendering/mathml/RenderMathMLSquareRoot.h: We no longer need anonymous roots.
849
850 2016-04-25  Frederic Wang  <fwang@igalia.com>
851
852         Minor refactoring in RenderMathMLOperator
853         https://bugs.webkit.org/show_bug.cgi?id=156906
854
855         Reviewed by Martin Robinson.
856
857         No new tests, this is only minor refactoring that does not change the behavior.
858
859         * rendering/mathml/RenderMathMLOperator.cpp:
860         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack):
861         We rename the "state" integer to an "expected" enum indicating the next expected part.
862         (WebCore::RenderMathMLOperator::paintGlyph): We add a missing dot at the end of a sequence.
863         We also replace ceil(x+1) with ceil(x)+1 to get rid of the temporary variable.
864
865 2016-04-24  Chris Dumez  <cdumez@apple.com>
866
867         [Web IDL] Specify default values for boolean parameters
868         https://bugs.webkit.org/show_bug.cgi?id=156964
869
870         Reviewed by Darin Adler.
871
872         Specify default values for boolean parameters in our IDL files and
873         let the bindings generator use WTF::Optional<> for the ones without
874         a default value.
875
876         * CMakeLists.txt:
877         * Modules/indexeddb/IDBKeyRange.cpp:
878         * Modules/indexeddb/IDBKeyRange.h:
879         * Modules/indexeddb/IDBKeyRange.idl:
880         * WebCore.xcodeproj/project.pbxproj:
881         * bindings/js/JSBindingsAllInOne.cpp:
882
883         * bindings/js/JSDOMTokenListCustom.cpp: Removed.
884         We no longer need these custom bindings as the bindings generator
885         will now provide the implementation with an Optional<bool>, given
886         that the parameter has no default value.
887
888         * bindings/scripts/CodeGeneratorJS.pm:
889         (CanUseWTFOptionalForParameterType): Deleted.
890         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
891         (webkit_dom_test_obj_method_with_optional_boolean):
892         (webkit_dom_test_obj_method_with_optional_boolean_is_false):
893         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
894         * bindings/scripts/test/JS/JSTestObj.cpp:
895         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
896         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
897         * bindings/scripts/test/ObjC/DOMTestObj.h:
898         * bindings/scripts/test/ObjC/DOMTestObj.mm:
899         (-[DOMTestObj methodWithOptionalBoolean:]):
900         (-[DOMTestObj methodWithOptionalBooleanIsFalse:]):
901         * bindings/scripts/test/TestObj.idl:
902         * dom/Document.h:
903         * dom/Document.idl:
904         * dom/Element.idl:
905         * dom/EventTarget.idl:
906         * html/DOMTokenList.idl:
907
908 2016-04-24  Chris Dumez  <cdumez@apple.com>
909
910         Autogenerated IDBFactory.open() does the wrong thing if you pass an explicit 'undefined' as the second argument
911         https://bugs.webkit.org/show_bug.cgi?id=156939
912
913         Reviewed by Darin Adler.
914
915         As per WebIDL, if undefined is passed by JS for an optional parameter then
916         we should use its default value if it has one, or use the special value
917         "missing":
918         http://heycam.github.io/webidl/#es-overloads (step 10.4)
919
920         Our bindings generator was already mapping undefined to the parameter's
921         default value when present. However, it was missing the notion of
922         "missing" value when there no default value. This patch adds supports
923         for its by passing Optional<>(Nullopt) to the implementation in such
924         case. This means that the implementation will need to use WTF::Optional<>
925         type for parameters that do not have a default value. Thankfully though,
926         in most cases, we will be able to specify a default value in the IDL
927         so cases where we will need to use WTF::Optional<> will actually be
928         rare.
929
930         To avoid having to do too much refactoring in this patch, the support
931         for WTF::Optional is currently blacklisted for most IDL types. I will
932         gradually stop blacklisting each type in follow-up patches, as I either:
933         - Add default parameter values in our IDL (preferred)
934         - Use WTF::Optional<> in our implementation (when we cannot specify a
935           default value).
936
937         This patch fixes a bug with IDBFactory.open()'s second parameter (version)
938         for which undefined should not throw and indicate that the version
939         should not be changed. We now use WTF::Optional in the implementation to
940         distinguish this case and not throw.
941
942         No new tests, existing tests were updated / rebaselined.
943
944         * Modules/indexeddb/IDBFactory.cpp:
945         (WebCore::IDBFactory::open):
946         (WebCore::IDBFactory::openInternal): Deleted.
947         * Modules/indexeddb/IDBFactory.h:
948         * bindings/scripts/CodeGeneratorJS.pm:
949         (ShouldUseWTFOptionalForParameterType):
950         (GenerateParametersCheck):
951         * fileapi/Blob.idl:
952         * inspector/InspectorIndexedDBAgent.cpp:
953
954 2016-04-23  Chris Dumez  <cdumez@apple.com>
955
956         [WebIDL] Drop [Default] WebKit-IDL extended attribute
957         https://bugs.webkit.org/show_bug.cgi?id=156955
958
959         Reviewed by Darin Adler.
960
961         Drop [Default] WebKit-IDL extended attribute in favor of the standard
962         WebIDL syntax for parameters' default value.
963
964         Here is what it looks like:
965         [Default=NullString] optional DOMString a -> optional DOMString a = null
966         [Default=NullString] optional DOMString? a -> optional DOMString? a = null
967         [Default=Undefined] optional DOMString a -> optional DOMString a = "undefined"
968         [Default=Undefined] optional DOMString? a -> optional DOMString? a = null
969         [Default=Undefined] optional long a -> optional long a = 0
970         [Default=Undefined] optional bool a -> optional bool a = false
971         [Default=Undefined] optional unrestricted double a -> optional unrestricted double a = NaN
972         [Default=Undefined] optional unrestricted float a -> optional unrestricted float a = NaN
973         [Default=Undefined] optional sequence<DOMString> a -> optional sequence<DOMString> a = []
974
975         These do not cause any Web-Exposed behavior change. However, when getting
976         rid of [Default] started passing more parameters by derefence instead of
977         pointer (as is expected for parameters not marked as nullable). As a result,
978         I had to mark a few parameters as nullable in the IDL to maintain the
979         previous behavior. In some cases, the implementation was already throwing
980         when passing null. In such cases, I have not marked the type as nullable
981         so that the generated bindings now throw the exception instead of our
982         implementation code. In some cases, the exception being thrown is now
983         different. This is why some of the layout tests had to be rebaselined.
984
985         No new tests, existing tests have been rebaselined. No significant Web
986         exposed behavior change is expected from this patch, beside exceptions
987         type sometimes being different.
988
989         * Modules/encryptedmedia/MediaKeys.idl:
990         * Modules/fetch/FetchRequest.idl:
991         * Modules/gamepad/deprecated/GamepadList.idl:
992         * Modules/indexeddb/IDBDatabase.idl:
993         * Modules/mediastream/RTCStatsResponse.idl:
994         * Modules/notifications/Notification.idl:
995         * Modules/speech/SpeechSynthesisUtterance.idl:
996         * Modules/webaudio/AudioNode.idl:
997         * Modules/websockets/WebSocket.idl:
998         * bindings/scripts/CodeGeneratorJS.pm:
999         (GenerateParametersCheck):
1000         * bindings/scripts/IDLAttributes.txt:
1001         * bindings/scripts/IDLParser.pm:
1002         (parseDefault):
1003         (parseDefaultValue):
1004         * bindings/scripts/test/TestInterface.idl:
1005         * bindings/scripts/test/TestNamedConstructor.idl:
1006         * bindings/scripts/test/TestObj.idl:
1007         * bindings/scripts/test/TestOverrideBuiltins.idl:
1008         * css/CSSKeyframesRule.idl:
1009         * css/CSSMediaRule.idl:
1010         * css/CSSPrimitiveValue.idl:
1011         * css/CSSRuleList.idl:
1012         * css/CSSStyleDeclaration.idl:
1013         * css/CSSStyleSheet.idl:
1014         * css/CSSSupportsRule.idl:
1015         * css/CSSValueList.idl:
1016         * css/MediaList.idl:
1017         * css/MediaQueryList.idl:
1018         * css/MediaQueryListListener.idl:
1019         * css/StyleMedia.idl:
1020         * css/StyleSheetList.idl:
1021         * css/WebKitCSSFilterValue.idl:
1022         * css/WebKitCSSMatrix.idl:
1023         * css/WebKitCSSTransformValue.idl:
1024         * dom/ClientRectList.idl:
1025         * dom/Comment.idl:
1026         * dom/CompositionEvent.idl:
1027         * dom/CustomEvent.h:
1028         * dom/CustomEvent.idl:
1029         * dom/DOMImplementation.idl:
1030         * dom/DOMStringList.idl:
1031         * dom/DataTransferItem.idl:
1032         * dom/DataTransferItemList.idl:
1033         * dom/DeviceMotionEvent.idl:
1034         * dom/DeviceOrientationEvent.idl:
1035         * dom/Document.cpp:
1036         (WebCore::Document::adoptNode):
1037         * dom/Document.idl:
1038         * dom/Element.cpp:
1039         (WebCore::Element::setAttributeNode):
1040         (WebCore::Element::setAttributeNodeNS):
1041         (WebCore::Element::removeAttributeNode):
1042         (WebCore::Element::parseAttributeName): Deleted.
1043         * dom/Element.h:
1044         * dom/Element.idl:
1045         * dom/Event.idl:
1046         * dom/HashChangeEvent.idl:
1047         * dom/KeyboardEvent.idl:
1048         * dom/MessageEvent.idl:
1049         * dom/MouseEvent.idl:
1050         * dom/MutationEvent.idl:
1051         * dom/NamedNodeMap.cpp:
1052         (WebCore::NamedNodeMap::setNamedItem):
1053         (WebCore::NamedNodeMap::setNamedItemNS):
1054         (WebCore::NamedNodeMap::item): Deleted.
1055         * dom/NamedNodeMap.h:
1056         * dom/NamedNodeMap.idl:
1057         * dom/Node.idl:
1058         * dom/NodeFilter.idl:
1059         * dom/NonElementParentNode.idl:
1060         * dom/OverflowEvent.idl:
1061         * dom/Range.idl:
1062         * dom/Text.idl:
1063         * dom/TextEvent.idl:
1064         * dom/TouchEvent.idl:
1065         * dom/UIEvent.idl:
1066         * dom/WheelEvent.idl:
1067         * html/DOMFormData.idl:
1068         * html/HTMLAllCollection.idl:
1069         * html/HTMLAudioElement.idl:
1070         * html/HTMLCanvasElement.idl:
1071         * html/HTMLCollection.idl:
1072         * html/HTMLDocument.idl:
1073         * html/HTMLElement.cpp:
1074         (WebCore::HTMLElement::insertAdjacentElement):
1075         (WebCore::contextElementForInsertion): Deleted.
1076         * html/HTMLElement.h:
1077         * html/HTMLElement.idl:
1078         * html/HTMLFormControlsCollection.idl:
1079         * html/HTMLInputElement.idl:
1080         * html/HTMLMediaElement.idl:
1081         * html/HTMLOptionElement.idl:
1082         * html/HTMLOptionsCollection.idl:
1083         * html/HTMLSelectElement.idl:
1084         * html/HTMLTableElement.idl:
1085         * html/HTMLTableRowElement.idl:
1086         * html/HTMLTableSectionElement.idl:
1087         * html/HTMLTextAreaElement.idl:
1088         * html/ImageData.idl:
1089         * html/canvas/CanvasGradient.idl:
1090         * html/canvas/CanvasRenderingContext2D.idl:
1091         * html/canvas/DOMPath.idl:
1092         * html/canvas/OESVertexArrayObject.idl:
1093         * page/DOMSelection.cpp:
1094         (WebCore::DOMSelection::extend):
1095         (WebCore::DOMSelection::getRangeAt): Deleted.
1096         * page/DOMSelection.h:
1097         * page/DOMSelection.idl:
1098         * page/DOMWindow.idl:
1099         * page/History.idl:
1100         * page/Performance.idl:
1101         * page/WindowTimers.idl:
1102         * plugins/DOMMimeTypeArray.idl:
1103         * plugins/DOMPlugin.idl:
1104         * plugins/DOMPluginArray.idl:
1105         * storage/StorageEvent.idl:
1106         * svg/SVGAnimationElement.idl:
1107         * svg/SVGDocument.idl:
1108         * svg/SVGElement.idl:
1109         * svg/SVGFEDropShadowElement.idl:
1110         * svg/SVGFEGaussianBlurElement.idl:
1111         * svg/SVGFEMorphologyElement.idl:
1112         * svg/SVGFilterElement.idl:
1113         * svg/SVGGraphicsElement.idl:
1114         * svg/SVGMarkerElement.idl:
1115         * svg/SVGPathElement.idl:
1116         * svg/SVGSVGElement.idl:
1117         * svg/SVGTests.idl:
1118         * svg/SVGTextContentElement.idl:
1119         * xml/DOMParser.idl:
1120         * xml/XMLSerializer.cpp:
1121         (WebCore::XMLSerializer::serializeToString):
1122         * xml/XMLSerializer.h:
1123         * xml/XMLSerializer.idl:
1124         * xml/XPathEvaluator.idl:
1125         * xml/XPathExpression.idl:
1126         * xml/XPathNSResolver.idl:
1127         * xml/XPathResult.idl:
1128         * xml/XSLTProcessor.idl:
1129
1130 2016-04-24  Antti Koivisto  <antti@apple.com>
1131
1132         RenderStyle should not be reference counted
1133         https://bugs.webkit.org/show_bug.cgi?id=156846
1134
1135         Reviewed by Andreas Kling.
1136
1137         RenderStyle reference counts its substructures. We no longer share RenderStyle objects between normal renderers
1138         so there is no reason to refcount the RenderStyles themselves too. Making it a non-refcounted type clarifies
1139         ownership relations, reduces branchiness and saves some memory.
1140
1141         This patches switches mostly mechanically from Ref/RefPtr<RenderStyle> to std::unique_ptr<RenderStyle>. In
1142         the future RenderStyle can be given regular value semantics.
1143
1144         * Modules/plugins/PluginReplacement.h:
1145         (WebCore::PluginReplacement::scriptObject):
1146         (WebCore::PluginReplacement::willCreateRenderer):
1147         * Modules/plugins/QuickTimePluginReplacement.h:
1148         * Modules/plugins/QuickTimePluginReplacement.mm:
1149         (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement):
1150         (WebCore::QuickTimePluginReplacement::createElementRenderer):
1151         * Modules/plugins/YouTubePluginReplacement.cpp:
1152         (WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
1153         (WebCore::YouTubePluginReplacement::createElementRenderer):
1154         * Modules/plugins/YouTubePluginReplacement.h:
1155         * css/CSSComputedStyleDeclaration.cpp:
1156         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
1157         (WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
1158         (WebCore::updateStyleIfNeededForNode):
1159         (WebCore::computeRenderStyleForProperty):
1160         (WebCore::ComputedStyleExtractor::customPropertyValue):
1161         (WebCore::ComputedStyleExtractor::propertyValue):
1162         * css/MediaQueryEvaluator.cpp:
1163         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1164         (WebCore::MediaQueryEvaluator::eval):
1165         * css/MediaQueryEvaluator.h:
1166
1167             Clarify in code that MediaQueryEvaluator does not own the style.
1168
1169         * css/MediaQueryMatcher.cpp:
1170         (WebCore::MediaQueryMatcher::mediaType):
1171         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
1172         (WebCore::MediaQueryMatcher::evaluate):
1173         (WebCore::MediaQueryMatcher::matchMedia):
1174         (WebCore::MediaQueryMatcher::styleResolverChanged):
1175         (WebCore::MediaQueryMatcher::prepareEvaluator): Deleted.
1176         * css/MediaQueryMatcher.h:
1177         * css/StyleMedia.cpp:
1178         (WebCore::StyleMedia::matchMedium):
1179         * css/StyleResolver.cpp:
1180         (WebCore::StyleResolver::State::clear):
1181         (WebCore::StyleResolver::State::updateConversionData):
1182         (WebCore::StyleResolver::State::setStyle):
1183         (WebCore::StyleResolver::State::setParentStyle):
1184
1185             State owns the style explicitly set by setParentStyle but not the one given via constructor.
1186
1187         (WebCore::isAtShadowBoundary):
1188         (WebCore::StyleResolver::styleForElement):
1189         (WebCore::StyleResolver::styleForKeyframe):
1190         (WebCore::StyleResolver::keyframeStylesForAnimation):
1191         (WebCore::StyleResolver::pseudoStyleForElement):
1192         (WebCore::StyleResolver::styleForPage):
1193         (WebCore::StyleResolver::defaultStyleForElement):
1194         (WebCore::StyleResolver::applyMatchedProperties):
1195         (WebCore::StyleResolver::applyPropertyToStyle):
1196         * css/StyleResolver.h:
1197         (WebCore::ElementStyle::ElementStyle):
1198         (WebCore::StyleResolver::style):
1199         (WebCore::StyleResolver::parentStyle):
1200         (WebCore::StyleResolver::setOverrideDocumentElementStyle):
1201         (WebCore::StyleResolver::State::document):
1202         (WebCore::StyleResolver::State::element):
1203         (WebCore::StyleResolver::State::style):
1204         (WebCore::StyleResolver::State::takeStyle):
1205         (WebCore::StyleResolver::State::parentStyle):
1206         (WebCore::StyleResolver::State::rootElementStyle):
1207         (WebCore::StyleResolver::State::regionForStyling):
1208         (WebCore::StyleResolver::State::setParentStyle): Deleted.
1209         * dom/Document.cpp:
1210         (WebCore::Document::recalcStyle):
1211         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
1212         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1213         (WebCore::Document::isPageBoxVisible):
1214         (WebCore::Document::pageSizeAndMarginsInPixels):
1215         (WebCore::Document::addAutoSizingNode):
1216         (WebCore::Document::validateAutoSizingNodes):
1217         (WebCore::Document::resetAutoSizingNodes):
1218         (WebCore::Document::setFullScreenRenderer):
1219         * dom/Document.h:
1220         * dom/Element.cpp:
1221         (WebCore::Element::rendererIsNeeded):
1222         (WebCore::Element::createElementRenderer):
1223         (WebCore::Element::resolveComputedStyle):
1224         * dom/Element.h:
1225         (WebCore::Element::copyNonAttributePropertiesFromElement):
1226         * dom/ElementRareData.h:
1227
1228         ...
1229
1230         * page/animation/AnimationBase.h:
1231         * page/animation/AnimationController.cpp:
1232         (WebCore::AnimationControllerPrivate::receivedStartTimeResponse):
1233         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
1234         (WebCore::AnimationControllerPrivate::computeExtentOfAnimation):
1235         (WebCore::AnimationController::cancelAnimations):
1236         (WebCore::AnimationController::updateAnimations):
1237
1238             std::unique_ptr<RenderStyle& animatedStyle argument is now expected no be initially null and
1239             is only set if a new style is created.
1240
1241         (WebCore::AnimationController::getAnimatedStyleForRenderer):
1242         * page/animation/AnimationController.h:
1243         * page/animation/AnimationControllerPrivate.h:
1244         * page/animation/CompositeAnimation.cpp:
1245         (WebCore::CompositeAnimation::updateTransitions):
1246         (WebCore::CompositeAnimation::updateKeyframeAnimations):
1247         (WebCore::CompositeAnimation::animate):
1248         (WebCore::CompositeAnimation::getAnimatedStyle):
1249         * page/animation/CompositeAnimation.h:
1250         * page/animation/ImplicitAnimation.cpp:
1251         (WebCore::ImplicitAnimation::ImplicitAnimation):
1252         (WebCore::ImplicitAnimation::shouldSendEventForListener):
1253         (WebCore::ImplicitAnimation::animate):
1254         (WebCore::ImplicitAnimation::getAnimatedStyle):
1255         (WebCore::ImplicitAnimation::onAnimationEnd):
1256         (WebCore::ImplicitAnimation::reset):
1257         * page/animation/ImplicitAnimation.h:
1258         * page/animation/KeyframeAnimation.cpp:
1259         (WebCore::KeyframeAnimation::KeyframeAnimation):
1260         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
1261         (WebCore::KeyframeAnimation::animate):
1262         (WebCore::KeyframeAnimation::getAnimatedStyle):
1263         * page/animation/KeyframeAnimation.h:
1264         * rendering/RenderAttachment.cpp:
1265         (WebCore::RenderAttachment::RenderAttachment):
1266         * rendering/RenderAttachment.h:
1267         * rendering/RenderBlock.cpp:
1268         (WebCore::RenderBlock::RenderBlock):
1269         (WebCore::RenderBlock::styleDidChange):
1270         (WebCore::RenderBlock::clone):
1271         (WebCore::RenderBlock::updateFirstLetterStyle):
1272         (WebCore::RenderBlock::createFirstLetterRenderer):
1273         * rendering/RenderBlock.h:
1274         * rendering/RenderBlockFlow.cpp:
1275         (WebCore::RenderBlockFlow::MarginInfo::MarginInfo):
1276         (WebCore::RenderBlockFlow::RenderBlockFlow):
1277         * rendering/RenderBlockFlow.h:
1278         * rendering/RenderBox.cpp:
1279         (WebCore::skipBodyBackground):
1280         (WebCore::RenderBox::RenderBox):
1281         * rendering/RenderBox.h:
1282         * rendering/RenderBoxModelObject.cpp:
1283         (WebCore::RenderBoxModelObject::suspendAnimations):
1284         (WebCore::RenderBoxModelObject::RenderBoxModelObject):
1285         * rendering/RenderBoxModelObject.h:
1286         * rendering/RenderButton.cpp:
1287         (WebCore::RenderButton::RenderButton):
1288         (WebCore::RenderButton::setupInnerStyle):
1289         * rendering/RenderButton.h:
1290         * rendering/RenderCombineText.h:
1291         * rendering/RenderDeprecatedFlexibleBox.cpp:
1292         (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
1293         * rendering/RenderDeprecatedFlexibleBox.h:
1294         * rendering/RenderDetailsMarker.cpp:
1295         (WebCore::RenderDetailsMarker::RenderDetailsMarker):
1296         * rendering/RenderDetailsMarker.h:
1297         * rendering/RenderElement.cpp:
1298         (WebCore::controlStatesRendererMap):
1299         (WebCore::RenderElement::RenderElement):
1300         (WebCore::RenderElement::~RenderElement):
1301         (WebCore::RenderElement::createFor):
1302         (WebCore::firstLineStyleForCachedUncachedType):
1303         (WebCore::RenderElement::uncachedFirstLineStyle):
1304         (WebCore::RenderElement::cachedFirstLineStyle):
1305         (WebCore::RenderElement::initializeStyle):
1306         (WebCore::RenderElement::setStyle):
1307         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
1308         (WebCore::RenderElement::styleDidChange):
1309         (WebCore::RenderElement::getCachedPseudoStyle):
1310
1311             Return plain pointer as the cache owns the style.
1312
1313         (WebCore::RenderElement::getUncachedPseudoStyle):
1314
1315             return std::unique_ptr<RenderStyle>
1316
1317         (WebCore::RenderElement::selectionColor):
1318         (WebCore::RenderElement::selectionPseudoStyle):
1319         (WebCore::RenderElement::selectionBackgroundColor):
1320         * rendering/RenderElement.h:
1321         (WebCore::RenderElement::hasInitializedStyle):
1322         (WebCore::RenderElement::style):
1323         (WebCore::RenderElement::element):
1324         (WebCore::RenderElement::setStyleInternal):
1325         * rendering/RenderEmbeddedObject.cpp:
1326
1327         ...
1328
1329         (WebCore::RenderImage::imageResource):
1330         * rendering/RenderInline.cpp:
1331         (WebCore::RenderInline::RenderInline):
1332         (WebCore::updateStyleOfAnonymousBlockContinuations):
1333         (WebCore::RenderInline::styleDidChange):
1334
1335             Continuations now get their own RenderStyles.
1336
1337         (WebCore::RenderInline::addChildIgnoringContinuation):
1338         (WebCore::RenderInline::clone):
1339         * rendering/RenderInline.h:
1340         * rendering/RenderLayer.cpp:
1341         (WebCore::RenderLayer::currentTransform):
1342         (WebCore::RenderLayer::calculateClipRects):
1343         * rendering/RenderLayer.h:
1344
1345         ...
1346
1347         * rendering/style/KeyframeList.cpp:
1348         (WebCore::KeyframeList::operator==):
1349         (WebCore::KeyframeList::insert):
1350
1351             KeyframeValue is now movable but not copyable type. Adjust accordingly.
1352
1353         * rendering/style/KeyframeList.h:
1354         (WebCore::KeyframeValue::KeyframeValue):
1355         (WebCore::KeyframeValue::setKey):
1356         (WebCore::KeyframeValue::style):
1357         (WebCore::KeyframeValue::setStyle):
1358         (WebCore::KeyframeList::animationName):
1359         (WebCore::KeyframeList::addProperty):
1360         (WebCore::KeyframeList::containsProperty):
1361         * rendering/style/RenderStyle.cpp:
1362         (WebCore::defaultStyle):
1363         (WebCore::RenderStyle::create):
1364         (WebCore::RenderStyle::createDefaultStyle):
1365         (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
1366         (WebCore::RenderStyle::clone):
1367         (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
1368
1369             Return std::unique_ptr<RenderStyle> instead of Ref<RenderStyle>.
1370
1371         (WebCore::RenderStyle::RenderStyle):
1372         (WebCore::RenderStyle::~RenderStyle):
1373         (WebCore::resolveAlignmentData):
1374         (WebCore::RenderStyle::operator==):
1375         (WebCore::RenderStyle::hasUniquePseudoStyle):
1376         (WebCore::RenderStyle::getCachedPseudoStyle):
1377         (WebCore::RenderStyle::addCachedPseudoStyle):
1378         (WebCore::RenderStyle::isStyleAvailable): Deleted.
1379         * rendering/style/RenderStyle.h:
1380         (WebCore::RenderStyle::setStyleType):
1381         (WebCore::RenderStyle::cachedPseudoStyles):
1382         (WebCore::RenderStyle::initialIsolation):
1383         (WebCore::RenderStyle::isPlaceholderStyle):
1384         (WebCore::RenderStyle::setIsPlaceholderStyle):
1385
1386             Add placeholder style bit to rareNonInheritedData. We no longer rely on RenderStyle identity for this test.
1387
1388         (WebCore::RenderStyle::noninheritedFlagsMemoryOffset):
1389         * rendering/style/SVGRenderStyle.cpp:
1390         (WebCore::defaultSVGStyle):
1391         (WebCore::SVGRenderStyle::createDefaultStyle):
1392         * rendering/style/StyleRareNonInheritedData.cpp:
1393         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1394         (WebCore::StyleRareNonInheritedData::operator==):
1395         (WebCore::StyleRareNonInheritedData::contentDataEquivalent):
1396         * rendering/style/StyleRareNonInheritedData.h:
1397
1398         ...
1399
1400         (WebCore::findRenderingRoot):
1401         (WebCore::findRenderingRoots):
1402         (WebCore::RenderTreeUpdater::commit):
1403
1404             Style::Update is no longer const as we move the styles from it to the render tree.
1405
1406         (WebCore::pseudoStyleCacheIsInvalid):
1407         (WebCore::RenderTreeUpdater::updateElementRenderer):
1408         (WebCore::moveToFlowThreadIfNeeded):
1409         (WebCore::RenderTreeUpdater::createRenderer):
1410         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1411         * style/RenderTreeUpdater.h:
1412         * style/StyleResolveForDocument.cpp:
1413         (WebCore::Style::resolveForDocument):
1414         * style/StyleResolveForDocument.h:
1415         * style/StyleSharingResolver.cpp:
1416         (WebCore::Style::elementHasDirectionAuto):
1417         (WebCore::Style::SharingResolver::resolve):
1418         * style/StyleSharingResolver.h:
1419         * style/StyleTreeResolver.cpp:
1420         (WebCore::Style::ensurePlaceholderStyle):
1421
1422             Set the placeholder.
1423
1424         (WebCore::Style::TreeResolver::Parent::Parent):
1425         (WebCore::Style::TreeResolver::pushScope):
1426         (WebCore::Style::TreeResolver::pushEnclosingScope):
1427         (WebCore::Style::TreeResolver::popScope):
1428
1429             Set and clear StyleResolver overrideDocumentElementStyle as needed. It is owned by the TreeResolver.
1430
1431         (WebCore::Style::TreeResolver::styleForElement):
1432
1433             Clone the placeholder style.
1434
1435         (WebCore::Style::TreeResolver::resolveElement):
1436         (WebCore::Style::TreeResolver::pushParent):
1437         (WebCore::Style::TreeResolver::resolveComposedTree):
1438         (WebCore::Style::TreeResolver::resolve):
1439
1440             Adopt to the std::unique_ptr and ElementStyle move semantics.
1441
1442         * style/StyleTreeResolver.h:
1443         (WebCore::Style::TreeResolver::scope):
1444         * style/StyleUpdate.cpp:
1445         (WebCore::Style::Update::elementUpdate):
1446         (WebCore::Style::Update::textUpdate):
1447         (WebCore::Style::Update::elementStyle):
1448         (WebCore::Style::Update::addElement):
1449         (WebCore::Style::Update::addText):
1450         * style/StyleUpdate.h:
1451         (WebCore::Style::Update::roots):
1452         (WebCore::Style::Update::document):
1453         * svg/SVGAElement.cpp:
1454         (WebCore::SVGAElement::svgAttributeChanged):
1455         (WebCore::SVGAElement::createElementRenderer):
1456
1457         ...
1458
1459 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1460
1461         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaControlsHost
1462         https://bugs.webkit.org/show_bug.cgi?id=156903
1463
1464         Reviewed by Chris Dumez.
1465
1466         No change of behavior.
1467
1468         * Modules/mediacontrols/MediaControlsHost.idl: Marking some parameters as nullable.
1469
1470 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1471
1472         Drop [UsePointersEvenForNonNullableObjectArguments] from WebGLRenderingContext
1473         https://bugs.webkit.org/show_bug.cgi?id=156909
1474
1475         Reviewed by Chris Dumez.
1476
1477         No change of behavior.
1478
1479         Marking a lot of method parameters as nullable.
1480
1481         * html/canvas/WebGLRenderingContextBase.idl:
1482
1483 2016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1484
1485         Drop [UsePointersEvenForNonNullableObjectArguments] from WebSocket
1486         https://bugs.webkit.org/show_bug.cgi?id=156897
1487
1488         Reviewed by Chris Dumez.
1489
1490         No change of behavior.
1491
1492         Updating WebSocket::send methods to take references, except for ArrayBufferView, which is not yet supported by the binding generator.
1493
1494         * Modules/websockets/WebSocket.cpp:
1495         (WebCore::WebSocket::send):
1496         * Modules/websockets/WebSocket.h:
1497         * Modules/websockets/WebSocket.idl:
1498
1499 2016-04-23  Andy Estes  <aestes@apple.com>
1500
1501         Fix issues found by the clang static analyzer
1502         https://bugs.webkit.org/show_bug.cgi?id=156956
1503
1504         Reviewed by Alexey Proskuryakov.
1505
1506         * editing/cocoa/DataDetection.mm:
1507         (WebCore::DataDetection::detectContentInRange): Stored tz in a RetainPtr.
1508         * platform/cf/KeyedDecoderCF.cpp:
1509         (WebCore::KeyedDecoderCF::KeyedDecoderCF): If dynamic_cf_cast returned nullptr, the result of
1510         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr, then leaked/adopted it
1511         into m_rootDictionary (to avoid retain count churn) if it is a CFDictionary.
1512         * platform/ios/WebAVPlayerController.mm:
1513         (-[WebAVPlayerController dealloc]): Released _externalPlaybackAirPlayDeviceLocalizedName.
1514         (-[WebAVMediaSelectionOption dealloc]): Added to release _localizedDisplayName.
1515         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1516         (-[WebAVPlayerLayer dealloc]): Released _pixelBufferAttributes.
1517         * platform/network/cocoa/WebCoreNSURLSession.h: Removed the readwrite attributes from properties, since
1518         properties are readwrite by default.
1519         * platform/network/cocoa/WebCoreNSURLSession.mm: Removed @dynamic, which isn't necessary just for defining a custom getter.
1520         (-[WebCoreNSURLSessionDataTask dealloc]): Added to release copied ivars.
1521
1522 2016-04-23  Dan Bernstein  <mitz@apple.com>
1523
1524         <rdar://problem/25894586> A project has failed to build because WTF_MAKE_FAST_ALLOCATED was not defined
1525
1526         Rubber-stamped by Chris Dumez.
1527
1528         Reverted the IntSize part of r199735, to let IntSize.h keep being used in another project.
1529
1530         * platform/graphics/IntSize.h:
1531         (WebCore::IntSize::IntSize):
1532
1533 2016-04-23  Chris Dumez  <cdumez@apple.com>
1534
1535         Tie the DiagnosticLoggingClient's lifetime to the Page
1536         https://bugs.webkit.org/show_bug.cgi?id=156938
1537         <rdar://problem/25851499>
1538
1539         Reviewed by Antti Koivisto.
1540
1541         Tie the DiagnosticLoggingClient's lifetime to the Page rather than to the
1542         MainFrame. The diagnostic logging client in WebKit2 requires the WebPage
1543         to be alive in order to send IPC to the UIProcess. The WebPage owns the
1544         Page and Page is not refCounted so the lifetime of the
1545         DiagnosticLoggingClient should now be tied to the one of the WebPage as
1546         well.
1547
1548         Previously, the DiagnosticLoggingClient would stay alive as long as the
1549         MainFrame and could apparently in rare cases outlive the WebPage, thus
1550         crashing when trying to send the IPC.
1551
1552         * history/PageCache.cpp:
1553         (WebCore::logPageCacheFailureDiagnosticMessage):
1554         (WebCore::canCachePage):
1555         * html/HTMLMediaElement.cpp:
1556         (WebCore::HTMLMediaElement::loadResource):
1557         (WebCore::logMediaLoadRequest):
1558         (WebCore::HTMLMediaElement::updatePlayState):
1559         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
1560         * loader/EmptyClients.h:
1561         * loader/FrameLoader.cpp:
1562         (WebCore::logNavigation):
1563         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1564         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1565         * loader/ResourceLoader.cpp:
1566         (WebCore::logResourceResponseSource):
1567         * loader/SubframeLoader.cpp:
1568         (WebCore::logPluginRequest):
1569         * loader/SubresourceLoader.cpp:
1570         (WebCore::SubresourceLoader::willSendRequestInternal):
1571         (WebCore::SubresourceLoader::didReceiveResponse):
1572         (WebCore::logResourceLoaded):
1573         * loader/cache/CachedResourceLoader.cpp:
1574         (WebCore::logMemoryCacheResourceRequest):
1575         (WebCore::logResourceRevalidationDecision):
1576         * page/DiagnosticLoggingClient.h:
1577         * page/MainFrame.cpp:
1578         (WebCore::MainFrame::MainFrame): Deleted.
1579         (WebCore::MainFrame::~MainFrame): Deleted.
1580         (WebCore::MainFrame::diagnosticLoggingClient): Deleted.
1581         * page/MainFrame.h:
1582         * page/Page.cpp:
1583         (WebCore::Page::Page):
1584         (WebCore::Page::~Page):
1585         (WebCore::Page::diagnosticLoggingClient):
1586         * page/Page.h:
1587
1588 2016-04-22  Chris Dumez  <cdumez@apple.com>
1589
1590         Cannot access the SQLTransaction.constructor.prototype
1591         https://bugs.webkit.org/show_bug.cgi?id=156613
1592
1593         Reviewed by Darin Adler.
1594
1595         Drop [NoInterfaceObject] from the following SQL interfaces:
1596         Database, SQLError, SQLResultSet, SQLResultSetRowList and SQLTransaction.
1597
1598         This matches the specification:
1599         https://dev.w3.org/html5/webdatabase/
1600
1601         This was causing the 'constructor' property to be wrong for these
1602         interfaces as it would be a generic Object.
1603
1604         Test: storage/websql/transaction-prototype.html
1605
1606         * Modules/webdatabase/Database.idl:
1607         * Modules/webdatabase/SQLError.idl:
1608         * Modules/webdatabase/SQLResultSet.idl:
1609         * Modules/webdatabase/SQLResultSetRowList.idl:
1610         * Modules/webdatabase/SQLTransaction.idl:
1611
1612 2016-04-22  Joseph Pecoraro  <pecoraro@apple.com>
1613
1614         Web Inspector: Include columnNumber in event listener locations
1615         https://bugs.webkit.org/show_bug.cgi?id=156927
1616         <rdar://problem/25884584>
1617
1618         Reviewed by Brian Burg.
1619
1620         * inspector/InspectorDOMAgent.cpp:
1621         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1622         Include the column number in the location as well.
1623
1624 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
1625
1626         [Win] Unreviewed build fix.
1627
1628         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1629         (PlatformCALayerWin::isHidden):
1630
1631 2016-04-22  Jer Noble  <jer.noble@apple.com>
1632
1633         [iOS] Crash at -[WebAVPlayerLayer resolveBounds]
1634         https://bugs.webkit.org/show_bug.cgi?id=156931
1635         <rdar://problem/25865315> 
1636
1637         Reviewed by Eric Carlson.
1638
1639         When cloning the WebAVPlayerLayer, we must copy over the fullscreenInterface to the cloned layer.
1640
1641         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1642         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
1643
1644 2016-04-22  Chris Dumez  <cdumez@apple.com>
1645
1646         Crash under WebCore::DataDetection::detectContentInRange()
1647         https://bugs.webkit.org/show_bug.cgi?id=156880
1648         <rdar://problem/25622631>
1649
1650         Reviewed by Darin Adler.
1651
1652         We would sometimes crash under WebCore::DataDetection::detectContentInRange()
1653         when dereferencing a null parentNode pointer. This patch adds a null check
1654         for parentNode in the for() loop. It also does some clean up and optimization
1655         since I was passing by.
1656
1657         * editing/cocoa/DataDetection.mm:
1658         (WebCore::DataDetection::detectContentInRange):
1659
1660 2016-04-22  Keith Miller  <keith_miller@apple.com>
1661
1662         buildObjectForEventListener should not call into JSC with a null ExecState
1663         https://bugs.webkit.org/show_bug.cgi?id=156923
1664
1665         Reviewed by Joseph Pecoraro.
1666
1667         If a user had disabled JavaScript on their page then the inspector tried to
1668         add an event listener we would fail to create an ExecState. Since we didn't
1669         check this ExecState was valid we would then attempt to stringify the value,
1670         which would cause JSC to crash.
1671
1672         * inspector/InspectorDOMAgent.cpp:
1673         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1674
1675 2016-04-22  Dean Jackson  <dino@apple.com>
1676
1677         Yet another attempt at fixing Windows.
1678
1679         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1680         (PlatformCALayerWin::isHidden):
1681         * platform/graphics/ca/win/PlatformCALayerWin.h:
1682
1683 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1684
1685         Attempt to fix Windows build after r199862
1686
1687         Unreviewed build fix.
1688
1689         * platform/graphics/ca/win/PlatformCALayerWin.h:
1690
1691 2016-04-22  Brent Fulgham  <bfulgham@apple.com>
1692
1693         Anchor element 'ping' property should only apply to http/https destinations
1694         https://bugs.webkit.org/show_bug.cgi?id=156801
1695         <rdar://problem/25834419>
1696
1697         Reviewed by Chris Dumez.
1698
1699         Take advantage of the hyperlink auditing language "UAs may either ignore the
1700         ping attribute altogether, or selectively ignore URLs in the list (e.g. ignoring
1701         any third-party URLs)" to restrict pings to http/https targets. For details, see
1702         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing>.
1703
1704         Tested by http/tests/navigation/ping-attribute tests.
1705
1706         * loader/PingLoader.cpp:
1707         (WebCore::PingLoader::sendPing): Ignore requests to ping anything outside the
1708         family of HTTP protocols (http/https).
1709
1710 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1711
1712         Fix builds that do not support AVKit
1713
1714         Unreviewed build fix.
1715
1716         * platform/ios/WebAVPlayerController.h:
1717         * platform/ios/WebAVPlayerController.mm:
1718
1719 2016-04-22  Dave Hyatt  <hyatt@apple.com>
1720
1721         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
1722         https://bugs.webkit.org/show_bug.cgi?id=156869
1723         <rdar://problem/23204668>
1724
1725         Reviewed by Zalan Bujtas.
1726
1727         Added fast/block/min-content-with-box-sizing.html
1728
1729         * rendering/RenderBox.cpp:
1730         (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
1731
1732 2016-04-22  Antti Koivisto  <antti@apple.com>
1733
1734         TextAutoSizingKey should use normal refcounting
1735         https://bugs.webkit.org/show_bug.cgi?id=156893
1736
1737         Reviewed by Andreas Kling.
1738
1739         Get rid of special refcounting of style in favor of RefPtr. It also becomes a move-only type
1740         to support future switch to non-refcounted RenderStyle.
1741
1742         Also general cleanups and modernization.
1743
1744         * dom/Document.cpp:
1745         (WebCore::TextAutoSizingTraits::constructDeletedValue):
1746         (WebCore::TextAutoSizingTraits::isDeletedValue):
1747         (WebCore::Document::addAutoSizingNode):
1748         (WebCore::Document::validateAutoSizingNodes):
1749         (WebCore::Document::resetAutoSizingNodes):
1750
1751             Adopt to being move-only.
1752
1753         * rendering/TextAutoSizing.cpp:
1754         (WebCore::cloneRenderStyleWithState):
1755         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
1756
1757             Clone the style for safety against mutations. Cloning is cheap.
1758
1759         (WebCore::TextAutoSizingValue::numNodes):
1760         (WebCore::TextAutoSizingValue::adjustNodeSizes):
1761         (WebCore::TextAutoSizingValue::reset):
1762         (WebCore::TextAutoSizingKey::~TextAutoSizingKey): Deleted.
1763         (WebCore::TextAutoSizingKey::operator=): Deleted.
1764         (WebCore::TextAutoSizingKey::ref): Deleted.
1765         (WebCore::TextAutoSizingKey::deref): Deleted.
1766         * rendering/TextAutoSizing.h:
1767         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
1768         (WebCore::TextAutoSizingKey::style):
1769         (WebCore::TextAutoSizingKey::isDeleted):
1770         (WebCore::operator==):
1771         (WebCore::TextAutoSizingKey::doc): Deleted.
1772         (WebCore::TextAutoSizingKey::isValidDoc): Deleted.
1773         (WebCore::TextAutoSizingKey::isValidStyle): Deleted.
1774         (WebCore::TextAutoSizingKey::deletedKeyDoc): Deleted.
1775         (WebCore::TextAutoSizingKey::deletedKeyStyle): Deleted.
1776
1777             m_doc member is not used for anything except deleted value comparisons. Replace it with a bit.
1778
1779 2016-04-22  Chris Dumez  <cdumez@apple.com>
1780
1781         Crash under FontCache::purgeInactiveFontData()
1782         https://bugs.webkit.org/show_bug.cgi?id=156822
1783         <rdar://problem/25373970>
1784
1785         Reviewed by Darin Adler.
1786
1787         In some rare cases, the Font constructor would mutate the FontPlatformData
1788         that is being passed in. This is an issue because because our FontCache
1789         uses the FontPlatformData as key for the cached fonts. This could lead to
1790         crashes because the WTFMove() in FontCache::purgeInactiveFontData() would
1791         nullify values in our HashMap but we would then fail to remove them from
1792         the HashMap (because the key did not match). We would then reference the
1793         null font when looping again when doing font->hasOneRef().
1794
1795         This patch marks Font::m_platformData member as const to avoid such issues
1796         in the future and moves the code altering the FontPlatformData from the
1797         Font constructor into the FontPlatformData constructor. The purpose of
1798         that code was to initialize FontPlatformData::m_cgFont in case the CGFont
1799         passed in the constructor was null.
1800
1801         * platform/graphics/Font.h:
1802         * platform/graphics/FontCache.cpp:
1803         (WebCore::FontCache::fontForPlatformData):
1804         (WebCore::FontCache::purgeInactiveFontData):
1805         * platform/graphics/FontPlatformData.cpp:
1806         (WebCore::FontPlatformData::FontPlatformData):
1807         * platform/graphics/FontPlatformData.h:
1808         * platform/graphics/cocoa/FontCocoa.mm:
1809         (WebCore::webFallbackFontFamily): Deleted.
1810         (WebCore::Font::platformInit): Deleted.
1811         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1812         (WebCore::webFallbackFontFamily):
1813         (WebCore::FontPlatformData::setFallbackCGFont):
1814         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1815         (WebCore::FontPlatformData::setFallbackCGFont):
1816
1817 2016-04-22  Chris Dumez  <cdumez@apple.com>
1818
1819         Support disabling at runtime IndexedDB constructors exposed to workers
1820         https://bugs.webkit.org/show_bug.cgi?id=156883
1821
1822         Reviewed by Darin Adler.
1823
1824         Support disabling at runtime IndexedDB constructors exposed to workers.
1825         Previously, constructors visibility to workers and window was constrolled
1826         by the same runtime flag.
1827
1828         * Modules/indexeddb/IDBCursor.idl:
1829         * Modules/indexeddb/IDBCursorWithValue.idl:
1830         * Modules/indexeddb/IDBDatabase.idl:
1831         * Modules/indexeddb/IDBFactory.idl:
1832         * Modules/indexeddb/IDBIndex.idl:
1833         * Modules/indexeddb/IDBKeyRange.idl:
1834         * Modules/indexeddb/IDBObjectStore.idl:
1835         * Modules/indexeddb/IDBOpenDBRequest.idl:
1836         * Modules/indexeddb/IDBRequest.idl:
1837         * Modules/indexeddb/IDBTransaction.idl:
1838         * Modules/indexeddb/IDBVersionChangeEvent.idl:
1839         * workers/WorkerGlobalScope.idl:
1840
1841 2016-04-22  Dean Jackson  <dino@apple.com>
1842
1843         Attempting to fix Windows build. Add isHidden implementation.
1844
1845         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1846         (PlatformCALayerWin::isHidden):
1847
1848 2016-04-22  Brady Eidson  <beidson@apple.com>
1849
1850         Attempt at a Windows build fix.
1851
1852         * workers/WorkerMessagingProxy.cpp:
1853         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
1854
1855 2016-04-22  Dave Hyatt  <hyatt@apple.com>
1856
1857          -webkit-image-set doesn't work inside CSS variables
1858         https://bugs.webkit.org/show_bug.cgi?id=156915
1859         <rdar://problem/25473972>
1860
1861         Reviewed by Zalan Bujtas.
1862
1863         Added new tests in fast/hidpi.
1864
1865         * css/CSSPrimitiveValue.cpp:
1866         (WebCore::CSSPrimitiveValue::equals):
1867         (WebCore::CSSPrimitiveValue::buildParserValue):
1868
1869 2016-04-22  Commit Queue  <commit-queue@webkit.org>
1870
1871         Unreviewed, rolling out r199877.
1872         https://bugs.webkit.org/show_bug.cgi?id=156918
1873
1874         The LayoutTest added with this change is failing on all
1875         platforms. (Requested by ryanhaddad on #webkit).
1876
1877         Reverted changeset:
1878
1879         "REGRESSION (r189567): The top of Facebook's messenger.com
1880         looks visually broken"
1881         https://bugs.webkit.org/show_bug.cgi?id=156869
1882         http://trac.webkit.org/changeset/199877
1883
1884 2016-04-22  Brady Eidson  <beidson@apple.com>
1885
1886         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
1887         https://bugs.webkit.org/show_bug.cgi?id=156916
1888
1889         Reviewed by Tim Horton.
1890
1891         No new tests (No behavior change).
1892
1893         * Modules/indexeddb/IDBFactory.cpp: Remove unneeded include.
1894         
1895         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1896         (WebCore::IDBClient::IDBConnectionProxy::ref): Ref the ConnectionToServer.
1897         (WebCore::IDBClient::IDBConnectionProxy::deref): Deref it.
1898         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
1899         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
1900         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
1901         (WebCore::IDBClient::IDBConnectionProxy::create): Deleted.
1902         * Modules/indexeddb/client/IDBConnectionProxy.h:
1903         
1904         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1905         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer): Create a proxy owned by this.
1906         (WebCore::IDBClient::IDBConnectionToServer::proxy): Expose it.
1907         * Modules/indexeddb/client/IDBConnectionToServer.h:
1908         
1909         * dom/Document.cpp:
1910         (WebCore::Document::idbConnectionProxy):
1911
1912         * WebCore.xcodeproj/project.pbxproj:
1913
1914 2016-04-22  Antti Koivisto  <antti@apple.com>
1915
1916         REGRESSION (r194898): Multi download of external SVG defs file by <use> xlinks:href (caching)
1917         https://bugs.webkit.org/show_bug.cgi?id=156368
1918         <rdar://problem/25611746>
1919
1920         Reviewed by Simon Fraser.
1921
1922         We would load svg resources with fragment identifier again because the encoding never matched.
1923
1924         Test: http/tests/svg/svg-use-external.html
1925
1926         * loader/TextResourceDecoder.cpp:
1927         (WebCore::TextResourceDecoder::setEncoding):
1928         (WebCore::TextResourceDecoder::hasEqualEncodingForCharset):
1929
1930             Encoding can depend on mime type. Add a comparison function that takes this into account.
1931
1932         (WebCore::findXMLEncoding):
1933         * loader/TextResourceDecoder.h:
1934         (WebCore::TextResourceDecoder::encoding):
1935         * loader/cache/CachedCSSStyleSheet.h:
1936         * loader/cache/CachedResource.h:
1937         (WebCore::CachedResource::textResourceDecoder):
1938
1939             Add a way to get the TextResourceDecoder from a cached resource.
1940
1941         * loader/cache/CachedResourceLoader.cpp:
1942         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1943
1944             Use the new comparison function.
1945
1946         * loader/cache/CachedSVGDocument.h:
1947         * loader/cache/CachedScript.h:
1948         * loader/cache/CachedXSLStyleSheet.h:
1949
1950 2016-04-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1951
1952         Drop [UsePointersEvenForNonNullableObjectArguments] from InspectorFrontendHost
1953         https://bugs.webkit.org/show_bug.cgi?id=156908
1954
1955         Reviewed by Timothy Hatcher.
1956
1957         No change of behavior.
1958
1959         * inspector/InspectorFrontendHost.idl: Marking event parameter as nullable to keep compatibility.
1960
1961 2016-04-22  Chris Dumez  <cdumez@apple.com>
1962
1963         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
1964         https://bugs.webkit.org/show_bug.cgi?id=156890
1965
1966         Reviewed by Darin Adler.
1967
1968         Drop [UsePointersEvenForNonNullableObjectArguments] from MutationObserver
1969         and clean up / modernize the code a bit. There is not significant Web-
1970         exposed behavior change except that MutationObserver.observe() now throws
1971         a different kind of exception (a TypeError as per Web IDL) when passed in
1972         a null Node.
1973
1974         No new tests, rebaselined existing test.
1975
1976         * bindings/js/JSMutationCallback.cpp:
1977         (WebCore::JSMutationCallback::call):
1978         * bindings/js/JSMutationCallback.h:
1979         * bindings/js/JSMutationObserverCustom.cpp:
1980         (WebCore::constructJSMutationObserver):
1981         * css/PropertySetCSSStyleDeclaration.cpp:
1982         * dom/ChildListMutationScope.cpp:
1983         (WebCore::ChildListMutationAccumulator::enqueueMutationRecord):
1984         * dom/MutationCallback.h:
1985         * dom/MutationObserver.cpp:
1986         (WebCore::MutationObserver::create):
1987         (WebCore::MutationObserver::MutationObserver):
1988         (WebCore::MutationObserver::observe):
1989         (WebCore::MutationObserver::takeRecords):
1990         (WebCore::MutationObserver::enqueueMutationRecord):
1991         (WebCore::MutationObserver::deliver):
1992         (WebCore::MutationObserver::disconnect): Deleted.
1993         * dom/MutationObserver.h:
1994         * dom/MutationObserver.idl:
1995         * dom/MutationObserverInterestGroup.cpp:
1996         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
1997         * dom/MutationObserverInterestGroup.h:
1998         * dom/MutationRecord.cpp:
1999         (WebCore::MutationRecord::createChildList):
2000         * dom/MutationRecord.h:
2001
2002 2016-04-22  Dave Hyatt  <hyatt@apple.com>
2003
2004         REGRESSION (r189567): The top of Facebook's messenger.com looks visually broken
2005         https://bugs.webkit.org/show_bug.cgi?id=156869
2006         <rdar://problem/23204668>
2007
2008         Reviewed by Zalan Bujtas.
2009
2010         Added fast/block/min-content-with-box-sizing.html
2011
2012         * rendering/RenderBox.cpp:
2013         (WebCore::RenderBox::computeContentLogicalHeight):
2014
2015 2016-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
2016
2017         [css-grid] Fix bug with positioned items in vertical writing mode
2018         https://bugs.webkit.org/show_bug.cgi?id=156870
2019
2020         Reviewed by Darin Adler.
2021
2022         In RenderGrid::offsetAndBreadthForPositionedChild() we were using
2023         directly borderLeft(), which is wrong in vertical writing modes.
2024
2025         To fix it we just need to use borderLogicalLeft() which is aware of
2026         the current writing mode.
2027
2028         Test: fast/css-grid-layout/grid-positioned-children-writing-modes.html
2029
2030         * rendering/RenderGrid.cpp:
2031         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2032
2033 2016-04-21  Zan Dobersek  <zdobersek@igalia.com>
2034
2035         REGRESSION(r199738): The ANGLE update broke accelerated compositing in GTK+ port
2036         https://bugs.webkit.org/show_bug.cgi?id=156789
2037
2038         Reviewed by Carlos Garcia Campos.
2039
2040         After the update, the ANGLE library has to be built with
2041         ANGLE_ENABLE_ESSL and ANGLE_ENABLE_GLSL definitions in order
2042         to compile in the support for the two translators that Linux-based
2043         ports using OpenGL ES or OpenGL require. Missing files are also added.
2044
2045         * CMakeLists.txt:
2046
2047 2016-04-21  Chris Dumez  <cdumez@apple.com>
2048
2049         Drop [UsePointersEvenForNonNullableObjectArguments] from Document
2050         https://bugs.webkit.org/show_bug.cgi?id=156881
2051
2052         Reviewed by Darin Adler.
2053
2054         Drop [UsePointersEvenForNonNullableObjectArguments] from Document. There
2055         is no major Web-exposed behavior change but the type of the exception
2056         being thrown when passing null or not enough parameters has changed for
2057         some of the API (It is now always a TypeError as per the Web IDL
2058         specification).
2059
2060         Tests: fast/dom/Document/adoptNode-null.html
2061                fast/dom/Document/importNode-null.html
2062
2063         * dom/ContainerNode.cpp:
2064         (WebCore::ContainerNode::takeAllChildrenFrom):
2065         (WebCore::ContainerNode::parserInsertBefore):
2066         (WebCore::ContainerNode::parserAppendChild):
2067         * dom/Document.cpp:
2068         (WebCore::Document::importNode):
2069         (WebCore::Document::adoptNode):
2070         (WebCore::Document::createNodeIterator):
2071         (WebCore::Document::createTreeWalker):
2072         (WebCore::Document::setBodyOrFrameset):
2073         (WebCore::Document::hasValidNamespaceForElements): Deleted.
2074         (WebCore::Document::scheduleForcedStyleRecalc): Deleted.
2075         (WebCore::Document::scheduleStyleRecalc): Deleted.
2076         (WebCore::Document::unscheduleStyleRecalc): Deleted.
2077         (WebCore::Document::hasPendingStyleRecalc): Deleted.
2078         (WebCore::Document::hasPendingForcedStyleRecalc): Deleted.
2079         (WebCore::Document::recalcStyle): Deleted.
2080         (WebCore::Document::explicitClose): Deleted.
2081         * dom/Document.h:
2082         (WebCore::Document::importNode):
2083         * dom/Document.idl:
2084         * dom/NodeIterator.cpp:
2085         (WebCore::NodeIterator::NodeIterator):
2086         * dom/NodeIterator.h:
2087         (WebCore::NodeIterator::create):
2088
2089 2016-04-21  Frederic Wang  <fwang@igalia.com>
2090
2091         More improvements and explanations regarding resetting CSS properties on the <math> element
2092         https://bugs.webkit.org/show_bug.cgi?id=156840
2093
2094         Reviewed by Darin Adler.
2095
2096         We some follow-up improvements regarding CSS rules on the <math> element, after bug 133603:
2097         - We fix indenting to use 4 spaces.
2098         - We explain why we set -webkit-line-box-contain and add references to related bugs.
2099         - We explain why we reset some CSS spacing rules.
2100         - We explain why the direction is set to ltr.
2101         - We explain why font-family is set to a list of known math fonts and add reference
2102           to the wiki.
2103         - We mention the need to customize math fonts to get consistent style and add references to
2104           a bug report and to the wiki.
2105         - We described each of the math font listed and add some justification about their orders.
2106         - We better explain the section about fonts that do not satisfy the requirements for good
2107           mathematical rendering, reformulate why we still need them for iOS/Mac and we add some
2108           references to a bug report and to the wiki. Some fonts that not pre-installed were removed
2109           in r199773.
2110         - We add a FIXME comments for potential changes of CSS properties on the <math> tag.
2111
2112         We make the following changes to the lists of font-family:
2113         - We move "TeX Gyre Termes Math" into the Times group.
2114         - We move "Asana Math" into the Palatino group.
2115         - We remove iOS conditionals on "Symbol" and "Times New Roman".
2116
2117         No new tests, only order of math fonts that are not used by test framework is changed.
2118
2119         * css/mathml.css:
2120         (math): We merge the two math selectors, reorder some font-families, remove iOS ifdef and
2121         add more description.
2122
2123 2016-04-21  Dean Jackson  <dino@apple.com>
2124
2125         Backdrop Filter should not be visible if element has visibility:hidden
2126         https://bugs.webkit.org/show_bug.cgi?id=149318
2127         <rdar://problem/22749780>
2128
2129         Reviewed by Simon Fraser.
2130
2131         Make sure that backdrop filter layers take note of when
2132         the contents are visible or not.
2133
2134         Tests: css3/filters/backdrop/backdrop-with-visibility-hidden-changing.html
2135                css3/filters/backdrop/backdrop-with-visibility-hidden.html
2136                css3/filters/backdrop/backdrop-with-visibility-hidden-2.html
2137
2138         * platform/graphics/ca/GraphicsLayerCA.cpp:
2139         (WebCore::GraphicsLayerCA::updateContentsVisibility): Tell the backdrop layer about the
2140         change if there is one.
2141         (WebCore::GraphicsLayerCA::updateBackdropFilters): When we update filters, make
2142         sure to check the contents visibility.
2143         (WebCore::dumpInnerLayer): Output "hidden" if the layer is set as such.
2144         * platform/graphics/ca/PlatformCALayer.h: Add an isHidden method.
2145         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2146         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2147         (PlatformCALayerCocoa::isHidden): Call into CALayer isHidden.
2148
2149 2016-04-21  Zalan Bujtas  <zalan@apple.com>
2150
2151         RenderVideo should always update the intrinsic size before layout.
2152         https://bugs.webkit.org/show_bug.cgi?id=156878
2153
2154         Reviewed by Simon Fraser.
2155
2156         In order to layout video element properly we need to know the correct intrinsic size.
2157         This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
2158
2159         This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
2160
2161         * rendering/RenderVideo.cpp:
2162         (WebCore::RenderVideo::updateIntrinsicSize):
2163         (WebCore::RenderVideo::layout):
2164         (WebCore::RenderVideo::updatePlayer):
2165         * rendering/RenderVideo.h:
2166
2167 2016-04-21  Brady Eidson  <beidson@apple.com>
2168
2169         Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
2170         https://bugs.webkit.org/show_bug.cgi?id=156877
2171
2172         Reviewed by Tim Horton.
2173
2174         No new tests (Covered by changes to existing tests).
2175
2176         * workers/WorkerMessagingProxy.cpp:
2177         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): This is the point on the main thread
2178           where we can get the IDBConnectionProxy from the Document and pass it down through Worker
2179           machinery so it can end up at the WorkerGlobalScope.
2180         
2181         Everything else is this patch is just passing it along as needed.
2182
2183         And cleaning up header style for neglected headers.
2184
2185         * workers/DedicatedWorkerGlobalScope.cpp:
2186         (WebCore::DedicatedWorkerGlobalScope::create):
2187         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2188         * workers/DedicatedWorkerGlobalScope.h:
2189
2190         * workers/DedicatedWorkerThread.cpp:
2191         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2192         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2193         * workers/DedicatedWorkerThread.h:
2194         (WebCore::DedicatedWorkerThread::create):
2195         (WebCore::DedicatedWorkerThread::workerObjectProxy):
2196
2197         * workers/WorkerGlobalScope.cpp:
2198         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2199         (WebCore::WorkerGlobalScope::idbConnectionProxy):
2200         * workers/WorkerGlobalScope.h:
2201
2202         * workers/WorkerThread.cpp:
2203         (WebCore::WorkerThread::WorkerThread):
2204         (WebCore::WorkerThread::idbConnectionProxy):
2205         * workers/WorkerThread.h:
2206         (WebCore::WorkerThread::threadID):
2207         (WebCore::WorkerThread::runLoop):
2208         (WebCore::WorkerThread::workerLoaderProxy):
2209         (WebCore::WorkerThread::workerReportingProxy):
2210         (WebCore::WorkerThread::getNotificationClient):
2211         (WebCore::WorkerThread::setNotificationClient):
2212         (WebCore::WorkerThread::workerGlobalScope):
2213
2214 2016-04-21  Anders Carlsson  <andersca@apple.com>
2215
2216         Fix crashes when loading SVG images.
2217
2218         * loader/EmptyClients.cpp:
2219         (WebCore::fillWithEmptyClients):
2220         Give the SVG page its own application cache storage.
2221
2222 2016-04-21  Anders Carlsson  <andersca@apple.com>
2223
2224         Get rid of ApplicationCacheStorage::singleton
2225         https://bugs.webkit.org/show_bug.cgi?id=156882
2226
2227         Reviewed by Tim Horton.
2228
2229         * loader/appcache/ApplicationCacheStorage.cpp:
2230         (WebCore::ApplicationCacheStorage::setCacheDirectory): Deleted.
2231         (WebCore::ApplicationCacheStorage::singleton): Deleted.
2232         * loader/appcache/ApplicationCacheStorage.h:
2233         * page/Page.cpp:
2234         (WebCore::Page::Page):
2235
2236 2016-04-21  Simon Fraser  <simon.fraser@apple.com>
2237
2238         ASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect
2239         https://bugs.webkit.org/show_bug.cgi?id=155362
2240
2241         Reviewed by Zalan Bujtas.
2242
2243         A particular configuration of composited RenderLayers with preserve-3d and clipping
2244         caused assertions because an ancestor clipping layer had masksToBounds() set, but
2245         a preserves3D() parent, triggering an assertion in GraphicsLayerCA::computeVisibleAndCoverageRect().
2246         Make two changes to address this:
2247
2248         First, CSS clip: and clip-path: should force flattening and override preserve-3d in
2249         the RenderStyle.
2250
2251         Second, don't accumulate transforms in GraphicsLayerCA through layers with masksToBounds().
2252
2253         Tests: compositing/clipping/preserve3d-flatten-assertion-nested.html
2254                compositing/clipping/preserve3d-flatten-assertion.html
2255
2256         * css/StyleResolver.cpp:
2257         (WebCore::StyleResolver::adjustRenderStyle):
2258         * platform/graphics/ca/GraphicsLayerCA.cpp:
2259         (WebCore::accumulatesTransform):
2260
2261 2016-04-21  Chris Dumez  <cdumez@apple.com>
2262
2263         Element::idForStyleResolution() is a foot-gun
2264         https://bugs.webkit.org/show_bug.cgi?id=156852
2265
2266         Reviewed by Darin Adler.
2267
2268         Element::idForStyleResolution() is a foot-gun. It requires the caller to check
2269         Element::hasID() first or it may end up crashing when dereferencing elementData()
2270         (e.g. see Bug 156806).
2271
2272         This patch updates Element::idForStyleResolution() to return nullAtom is the
2273         Element does not have an ID. I did not see a performance impact on Speedometer,
2274         Dromaeo DOM Core, Dromaeo CSS Selectors and our local performanceTests/.
2275
2276         * css/ElementRuleCollector.cpp:
2277         (WebCore::ElementRuleCollector::collectMatchingRules):
2278         * css/SelectorChecker.cpp:
2279         (WebCore::SelectorChecker::checkOne):
2280         * css/SelectorFilter.cpp:
2281         (WebCore::collectElementIdentifierHashes):
2282         * dom/Element.h:
2283         (WebCore::Element::idForStyleResolution):
2284         * rendering/RenderBlockFlow.cpp:
2285         (WebCore::needsAppleMailPaginationQuirk):
2286         * rendering/RenderTreeAsText.cpp:
2287         (WebCore::writeRenderRegionList):
2288         * style/StyleSharingResolver.cpp:
2289         (WebCore::Style::SharingResolver::canShareStyleWithElement):
2290
2291 2016-04-21  Brady Eidson  <beidson@apple.com>
2292
2293         Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
2294         https://bugs.webkit.org/show_bug.cgi?id=156868
2295
2296         Reviewed by Tim Horton.
2297
2298         No new tests (No behavior change).
2299
2300         * Modules/indexeddb/IDBDatabase.cpp:
2301         (WebCore::IDBDatabase::create):
2302         (WebCore::IDBDatabase::IDBDatabase):
2303         (WebCore::IDBDatabase::~IDBDatabase):
2304         (WebCore::IDBDatabase::transaction):
2305         (WebCore::IDBDatabase::maybeCloseInServer):
2306         * Modules/indexeddb/IDBDatabase.h:
2307         (WebCore::IDBDatabase::connectionProxy):
2308         (WebCore::IDBDatabase::serverConnection):
2309
2310         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2311         (WebCore::IDBOpenDBRequest::createDeleteRequest):
2312         (WebCore::IDBOpenDBRequest::createOpenRequest):
2313         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
2314         (WebCore::IDBOpenDBRequest::onSuccess):
2315         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2316         (WebCore::IDBOpenDBRequest::requestCompleted):
2317         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
2318         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
2319         * Modules/indexeddb/IDBOpenDBRequest.h:
2320
2321         * Modules/indexeddb/IDBRequest.cpp:
2322         (WebCore::IDBRequest::IDBRequest):
2323         (WebCore::IDBRequest::connectionToServer): Deleted.
2324         * Modules/indexeddb/IDBRequest.h:
2325         (WebCore::IDBRequest::connectionProxy):
2326
2327         * Modules/indexeddb/IDBTransaction.h:
2328
2329         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2330         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2331         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2332
2333 2016-04-21  Jiewen Tan  <jiewen_tan@apple.com>
2334
2335         [iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
2336         https://bugs.webkit.org/show_bug.cgi?id=156829
2337         <rdar://problem/23348217>
2338
2339         Reviewed by Daniel Bates.
2340
2341         Ensure that the frame associated with the ResourceLoadNotifier is kept alive when notifying the Web Inspector.
2342
2343         Covered by existing tests.
2344
2345         * loader/ResourceLoadNotifier.cpp:
2346         (WebCore::ResourceLoadNotifier::didFailToLoad):
2347         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2348         (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
2349         (WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
2350         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
2351         (WebCore::ResourceLoadNotifier::dispatchDidFailLoading):
2352
2353 2016-04-21  Brady Eidson  <beidson@apple.com>
2354
2355         Modern IDB (Workers): More IDBConnectionProxy refactoring.
2356         https://bugs.webkit.org/show_bug.cgi?id=156855
2357
2358         Reviewed by Darin Adler.
2359
2360         No new tests (Covered by changes to existing tests).
2361
2362         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2363         (WebCore::DOMWindowIndexedDatabase::indexedDB):
2364
2365         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
2366         * Modules/indexeddb/IDBFactory.cpp:
2367         (WebCore::IDBFactory::create):
2368         (WebCore::IDBFactory::IDBFactory):
2369         (WebCore::IDBFactory::openInternal):
2370         (WebCore::IDBFactory::deleteDatabase):
2371         * Modules/indexeddb/IDBFactory.h:
2372
2373         Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
2374         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
2375         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
2376         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
2377         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
2378         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
2379
2380         Make IDBConnectionProxy ThreadSafeRefCounted:
2381         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2382         (WebCore::IDBClient::IDBConnectionProxy::create):
2383         * Modules/indexeddb/client/IDBConnectionProxy.h:
2384
2385         * dom/Document.cpp:
2386         (WebCore::Document::idbConnectionProxy):
2387         * dom/Document.h:
2388
2389 2016-04-21  Keith Miller  <keith_miller@apple.com>
2390
2391         WebScriptObject description swizzler should work in a multi-threaded world
2392         https://bugs.webkit.org/show_bug.cgi?id=156808
2393
2394         Reviewed by Geoffrey Garen.
2395
2396         A WebKit legacy API user might be running Objective-C code on another thread.
2397         Since we don't want to corrupt other thread's NSObject description method
2398         we use TLS to record if we are in the stringValue function. As an attempt to
2399         preserve any user swizzling we update the non-stringValue NSObject description
2400         method on each call to stringValue if it has changed. Additionally, the TLS
2401         needs to be a int because the user might call into stringValue, back into JS,
2402         then back into stringValue. If the TLS was a boolean then it would be unset
2403         at that point so when we return into the first stringValue call we would call
2404         the original NSObject description method rather than our override.
2405
2406         Test added to API tests: WebKit1.WebScriptObjectDescription
2407
2408         * bridge/objc/objc_instance.mm:
2409         (-[NSObject _web_description]):
2410         (ObjcInstance::stringValue):
2411         (swizzleNSObjectDescription): Deleted.
2412
2413 2016-04-21  Beth Dakin  <bdakin@apple.com>
2414
2415         Build fix.
2416
2417         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2418         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
2419         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
2420         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
2421
2422 2016-04-21  Beth Dakin  <bdakin@apple.com>
2423
2424         32 bit build fix.
2425
2426         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2427
2428 2016-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2429
2430         Fixed compilation with !ENABLE(SVG_FONTS).
2431         https://bugs.webkit.org/show_bug.cgi?id=156850
2432
2433         Reviewed by Michael Catanzaro.
2434
2435         No new tests needed.
2436
2437         * css/CSSFontFaceSource.cpp:
2438         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
2439         Added missing ENABLE(SVG_FONTS) guards.
2440         * css/CSSFontFaceSource.h: Ditto.
2441         * platform/graphics/FontCascade.cpp: Ditto.
2442         * svg/SVGToOTFFontConversion.cpp:
2443         (WebCore::FontCascade::drawGlyphBuffer): Deleted extraneous
2444         !ENABLE(SVG_FONTS) guard.
2445
2446 2016-04-21  Beth Dakin  <bdakin@apple.com>
2447
2448         Remove reliance on WebAVMediaSelectionOptionMac for the 
2449         WebPlaybackControlsManager
2450         https://bugs.webkit.org/show_bug.cgi?id=156811
2451         -and corresponding-
2452         rdar://problem/25760523
2453
2454         Reviewed by Jer Noble.
2455
2456         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2457         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
2458         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
2459         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
2460         (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
2461         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
2462         (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
2463         (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
2464         (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
2465         (-[WebAVMediaSelectionOptionMac localizedDisplayName]): Deleted.
2466         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]): Deleted.
2467         (-[WebPlaybackControlsManager isSeeking]): Deleted.
2468         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Deleted.
2469         (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
2470         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]): Deleted.
2471         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
2472         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): Deleted.
2473         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
2474         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]): Deleted.
2475         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
2476         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): Deleted.
2477         (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): Deleted.
2478         (WebCore::mediaSelectionOptions): Deleted.
2479
2480 2016-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
2481
2482         REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
2483         https://bugs.webkit.org/show_bug.cgi?id=156766
2484
2485         Reviewed by Darin Adler.
2486
2487         Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
2488         only once and is cached for subsequent uses. 
2489         
2490         The image subsampling is on by default only for iOS. So the and this
2491         patch currently affects the iOS port.
2492
2493         * platform/graphics/ImageSource.cpp:
2494         (WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
2495         Use m_frameCount as a flag for having_the_cache_done.
2496         (WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
2497         before using m_maximumSubsamplingLevel.
2498         (WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
2499         m_frameCount.
2500         * platform/graphics/ImageSource.h:
2501
2502 2016-04-21  Antoine Quint  <graouts@apple.com>
2503
2504         Creating a large number of WebGL contexts should recycle older contexts
2505         https://bugs.webkit.org/show_bug.cgi?id=156689
2506         <rdar://problem/19535330>
2507
2508         Reviewed by Dean Jackson.
2509
2510         We used to stop creating WebGL contexts once a maximum of 64 WebGL contexts had been
2511         created on a page. Other browsers have a limit of 16 concurrent active WebGL contexts
2512         and they lose older contexts when the developer creates a new context, logging a warning
2513         to the console. We now follow the same approach.
2514
2515         Tests: webgl/max-active-contexts-console-warning.html
2516                webgl/max-active-contexts-gc.html
2517                webgl/max-active-contexts-oldest-context-lost.html
2518                webgl/max-active-contexts-webglcontextlost-prevent-default.html
2519
2520         * html/canvas/WebGLRenderingContextBase.cpp:
2521         (WebCore::WebGLRenderingContextBase::recycleContext):
2522
2523         Prints a warning message to the console indicating that an older WebGL context
2524         will be lost to accomodate for the active contexts limit being reached and loses
2525         the provided context in a way that it may not be recovered by calling `event.preventDefault()`
2526         in the `webglcontextlost` event handler. Finally, we destroy the associated GraphicsContext3D
2527         since it will no longer be useful and it may hold large Open GL resources.
2528
2529         * html/canvas/WebGLRenderingContextBase.h:
2530         * platform/graphics/GraphicsContext3D.h:
2531
2532         Changed GraphicsContext3D::create to return RefPtr instead of PassRefPtr.
2533
2534         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2535         (WebCore::GraphicsContext3D::create):
2536         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
2537         (WebCore::GraphicsContext3D::create):
2538         * platform/graphics/mac/GraphicsContext3DMac.mm:
2539         (WebCore::activeContexts):
2540         (WebCore::GraphicsContext3D::create):
2541
2542         Check if we are at the active contexts limit (16) and recycle the oldest context
2543         in our active contexts list. Calling recycleContext() on a context will call the
2544         GraphicsContext3D destructor and remove it from the active contexts list there.
2545
2546         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2547
2548         Remove the deconstructed context from the active contexts list.
2549
2550         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2551         (WebCore::GraphicsContext3D::recycleContext):
2552         * platform/graphics/win/GraphicsContext3DWin.cpp:
2553         (WebCore::GraphicsContext3D::create):
2554
2555 2016-04-21  Dave Hyatt  <hyatt@apple.com>
2556
2557         Don't hyphenate the last word in a paragraph of text.
2558         https://bugs.webkit.org/show_bug.cgi?id=156803
2559
2560         Reviewed by Simon Fraser.
2561
2562         Added fast/text/hyphenate-avoid-orphaned-word.html
2563
2564         * rendering/RenderText.h:
2565         * rendering/line/BreakingContext.h:
2566         (WebCore::BreakingContext::handleText):
2567
2568 2016-04-21  Chris Dumez  <cdumez@apple.com>
2569
2570         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
2571         https://bugs.webkit.org/show_bug.cgi?id=156805
2572
2573         Reviewed by Youenn Fablet.
2574
2575         No new tests, no web-exposed behavior change.
2576
2577         * accessibility/AXObjectCache.cpp:
2578         (WebCore::AXObjectCache::rangeForNodeContents):
2579         (WebCore::characterOffsetsInOrder):
2580         (WebCore::setRangeStartOrEndWithCharacterOffset):
2581         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
2582         (WebCore::AXObjectCache::previousBoundary):
2583         * accessibility/AccessibilityObject.cpp:
2584         (WebCore::AccessibilityObject::selectText):
2585         * accessibility/AccessibilityRenderObject.cpp:
2586         (WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
2587         * dom/Node.cpp:
2588         (WebCore::Node::textRects):
2589         * dom/Range.cpp:
2590         (WebCore::Range::Range):
2591         (WebCore::Range::setDocument):
2592         (WebCore::Range::setStart):
2593         (WebCore::Range::setEnd):
2594         (WebCore::Range::isPointInRange):
2595         (WebCore::Range::comparePoint):
2596         (WebCore::Range::compareNode):
2597         (WebCore::Range::compareBoundaryPoints):
2598         (WebCore::Range::compareBoundaryPointsForBindings):
2599         (WebCore::Range::intersectsNode):
2600         (WebCore::Range::processContents):
2601         (WebCore::Range::insertNode):
2602         (WebCore::Range::checkNodeWOffset):
2603         (WebCore::Range::setStartAfter):
2604         (WebCore::Range::setEndBefore):
2605         (WebCore::Range::setEndAfter):
2606         (WebCore::Range::selectNode):
2607         (WebCore::Range::selectNodeContents):
2608         (WebCore::Range::surroundContents):
2609         (WebCore::Range::setStartBefore):
2610         (WebCore::Range::contains):
2611         (WebCore::rangesOverlap):
2612         (WebCore::rangeOfContents):
2613         (WebCore::boundaryNodeChildrenWillBeRemoved):
2614         (WebCore::boundaryTextNodesMerged):
2615         (WebCore::boundaryTextNodesSplit):
2616         (WebCore::Range::expand):
2617         (WebCore::checkForDifferentRootContainer): Deleted.
2618         (WebCore::highestAncestorUnderCommonRoot): Deleted.
2619         (WebCore::childOfCommonRootBeforeOffset): Deleted.
2620         (WebCore::deleteCharacterData): Deleted.
2621         (WebCore::Range::toString): Deleted.
2622         (WebCore::Range::toHTML): Deleted.
2623         (WebCore::Range::text): Deleted.
2624         (WebCore::Range::cloneRange): Deleted.
2625         (WebCore::Range::absoluteTextRects): Deleted.
2626         (WebCore::Range::absoluteTextQuads): Deleted.
2627         (WebCore::boundaryNodeChildrenChanged): Deleted.
2628         (WebCore::boundaryNodeWillBeRemoved): Deleted.
2629         (WebCore::Range::nodeWillBeRemoved): Deleted.
2630         (WebCore::boundaryTextRemoved): Deleted.
2631         (WebCore::Range::getBoundingClientRect): Deleted.
2632         (WebCore::Range::getBorderAndTextQuads): Deleted.
2633         * dom/Range.h:
2634         * dom/Range.idl:
2635         * dom/RangeBoundaryPoint.h:
2636         (WebCore::RangeBoundaryPoint::set):
2637         (WebCore::RangeBoundaryPoint::setToStartOfNode):
2638         (WebCore::RangeBoundaryPoint::setToEndOfNode):
2639         * editing/AlternativeTextController.cpp:
2640         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2641         * editing/ApplyStyleCommand.cpp:
2642         (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
2643         * editing/Editor.cpp:
2644         (WebCore::Editor::advanceToNextMisspelling):
2645         (WebCore::Editor::rangeOfString):
2646         (WebCore::isFrameInRange):
2647         (WebCore::Editor::countMatchesForText):
2648         * editing/EditorCommand.cpp:
2649         (WebCore::unionDOMRanges):
2650         (WebCore::executeDeleteToMark):
2651         (WebCore::executeSelectToMark):
2652         * editing/FormatBlockCommand.cpp:
2653         (WebCore::FormatBlockCommand::formatRange):
2654         * editing/FrameSelection.cpp:
2655         (WebCore::FrameSelection::respondToNodeModification):
2656         * editing/InsertListCommand.cpp:
2657         (WebCore::InsertListCommand::doApplyForSingleParagraph):
2658         * editing/TextCheckingHelper.cpp:
2659         (WebCore::TextCheckingParagraph::offsetTo):
2660         * editing/TextIterator.cpp:
2661         (WebCore::CharacterIterator::range):
2662         (WebCore::BackwardsCharacterIterator::range):
2663         (WebCore::TextIterator::rangeFromLocationAndLength):
2664         (WebCore::TextIterator::getLocationAndLengthFromRange):
2665         (WebCore::findPlainText):
2666         * editing/VisiblePosition.cpp:
2667         (WebCore::setStart):
2668         (WebCore::setEnd):
2669         * editing/VisibleSelection.cpp:
2670         (WebCore::makeSearchRange):
2671         * editing/VisibleUnits.cpp:
2672         (WebCore::previousBoundary):
2673         (WebCore::nextBoundary):
2674         * editing/htmlediting.cpp:
2675         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2676         (WebCore::isNodeVisiblyContainedWithin):
2677         * editing/htmlediting.h:
2678         * editing/mac/EditorMac.mm:
2679         (WebCore::Editor::adjustedSelectionRange):
2680         * page/ContextMenuController.cpp:
2681         (WebCore::ContextMenuController::contextMenuItemSelected):
2682         * page/DOMSelection.cpp:
2683         (WebCore::DOMSelection::addRange):
2684         * page/DragController.cpp:
2685         (WebCore::selectElement):
2686         * page/EventHandler.cpp:
2687         (WebCore::EventHandler::dispatchMouseEvent):
2688         * page/Page.cpp:
2689         (WebCore::Page::findStringMatchingRanges):
2690         * page/TextIndicator.cpp:
2691         (WebCore::hasNonInlineOrReplacedElements):
2692         * rendering/RenderNamedFlowThread.cpp:
2693         (WebCore::RenderNamedFlowThread::getRanges):
2694
2695 2016-04-21  Chris Dumez  <cdumez@apple.com>
2696
2697         Drop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
2698         https://bugs.webkit.org/show_bug.cgi?id=156797
2699
2700         Reviewed by Youenn Fablet.
2701
2702         * html/DOMURL.cpp:
2703         (WebCore::DOMURL::create):
2704         * html/DOMURL.h:
2705         * html/DOMURL.idl:
2706
2707 2016-04-21  Claudio Saavedra  <csaavedra@igalia.com>
2708
2709         [GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
2710         https://bugs.webkit.org/show_bug.cgi?id=156847
2711
2712         Reviewed by Carlos Garcia Campos.
2713
2714         The Language and Logging implementation don't really need glib, so
2715         rework them and move them to a new platform/unix directory so that
2716         they can be shared among Unix ports.
2717
2718         * PlatformEfl.cmake: Use the unix version.
2719         * PlatformGTK.cmake: Same.
2720         * platform/efl/LanguageEfl.cpp: Removed.
2721         * platform/efl/LoggingEfl.cpp: Removed.
2722         * platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
2723         (WebCore::platformLanguage):
2724         (WebCore::platformUserPreferredLanguages):
2725         * platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
2726         (WebCore::logLevelString):
2727
2728 2016-04-21  Nan Wang  <n_wang@apple.com>
2729
2730         AX: stringForTextMarkerRange returning empty string for document range
2731         https://bugs.webkit.org/show_bug.cgi?id=156819
2732
2733         Reviewed by Chris Fleizach.
2734
2735         Set text marker data with CharacterOffset when VisiblePosition is having PositionIsAfterAnchor
2736         or PositionIsAfterChildren anchor type, so that the character offset corresponds to the anchored
2737         node.
2738
2739         Test: accessibility/mac/text-marker-string-for-document-range.html
2740
2741         * accessibility/AXObjectCache.cpp:
2742         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2743
2744 2016-04-20  Chris Dumez  <cdumez@apple.com>
2745
2746         Crash under WebCore::TextIterator::subrange()
2747         https://bugs.webkit.org/show_bug.cgi?id=156809
2748         <rdar://problem/21102730>
2749
2750         Reviewed by Ryosuke Niwa.
2751
2752         TextIterator::rangeFromLocationAndLength() may return null. However, we
2753         failed to do a null check before calling TextIterator::subrange() with
2754         that range.
2755
2756         No new tests, do not know how to reproduce.
2757
2758         * editing/AlternativeTextController.cpp:
2759         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2760
2761 2016-04-20  Brady Eidson  <beidson@apple.com>
2762
2763         Modern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an IDBServerConnection around.
2764         https://bugs.webkit.org/show_bug.cgi?id=156826
2765
2766         Reviewed by Alex Christensen.
2767
2768         No new tests (No behavior change, existing tests pass).
2769
2770         This doesn't appear to do much but make things a little more complicated, but it's the first of a few 
2771         small pushes in the right direction.
2772         
2773         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2774         (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest):
2775         (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest):
2776         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
2777         (WebCore::IDBOpenDBRequest::onSuccess):
2778         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2779         (WebCore::IDBOpenDBRequest::requestCompleted):
2780         (WebCore::IDBOpenDBRequest::createDeleteRequest): Deleted.
2781         (WebCore::IDBOpenDBRequest::createOpenRequest): Deleted.
2782         * Modules/indexeddb/IDBOpenDBRequest.h:
2783         
2784         * Modules/indexeddb/IDBRequest.cpp:
2785         (WebCore::IDBRequest::IDBRequest):
2786         (WebCore::IDBRequest::connectionToServer):
2787         * Modules/indexeddb/IDBRequest.h:
2788         (WebCore::IDBRequest::connection): Deleted.
2789         
2790         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2791         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
2792         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
2793         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2794         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2795         * Modules/indexeddb/client/IDBConnectionProxy.h:
2796         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier):
2797         
2798         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2799         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
2800         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2801
2802 2016-04-20  John Wilander  <wilander@apple.com>
2803
2804         Add Subresource Integrity as "Under consideration".
2805         https://bugs.webkit.org/show_bug.cgi?id=156800
2806
2807         Reviewed by Alexey Proskuryakov.
2808
2809         No new tests needed.
2810
2811         * features.json:
2812             Added an entry for Subresource Integrity.
2813
2814 2016-04-20  Anders Carlsson  <andersca@apple.com>
2815
2816         Get rid of a couple of uses of ApplicationCacheStorage::singleton()
2817         https://bugs.webkit.org/show_bug.cgi?id=156818
2818
2819         Reviewed by Geoffrey Garen.
2820
2821         * loader/appcache/ApplicationCache.cpp:
2822         (WebCore::ApplicationCache::addResource):
2823         * loader/appcache/ApplicationCacheGroup.h:
2824         (WebCore::ApplicationCacheGroup::storage):
2825         * testing/Internals.cpp:
2826         (WebCore::Internals::resetToConsistentState):
2827         (WebCore::Internals::setApplicationCacheOriginQuota):
2828
2829 2016-04-20  Brady Eidson  <beidson@apple.com>
2830
2831         Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
2832         https://bugs.webkit.org/show_bug.cgi?id=156810
2833
2834         Reviewed by Alex Christensen.
2835
2836         No new tests (Covered by changes to existing tests).
2837
2838         Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
2839         * Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
2840         (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
2841         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
2842         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
2843         * Modules/indexeddb/client/IDBConnectionProxy.h: 
2844         
2845         Add pure virtual IDBConnectionProxy accessor:
2846         * dom/ScriptExecutionContext.h: 
2847
2848         Implement it:
2849         * dom/Document.cpp:
2850         (WebCore::Document::idbConnectionProxy):
2851         * dom/Document.h:
2852         
2853         Implement it:
2854         * workers/WorkerGlobalScope.cpp:
2855         (WebCore::WorkerGlobalScope::idbConnectionProxy):
2856         * workers/WorkerGlobalScope.h:
2857         
2858         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2859         (WebCore::DOMWindowIndexedDatabase::indexedDB):
2860
2861
2862         Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
2863         * Modules/indexeddb/IDBFactory.cpp:
2864         (WebCore::IDBFactory::create):
2865         (WebCore::IDBFactory::IDBFactory):
2866         (WebCore::IDBFactory::open):
2867         (WebCore::IDBFactory::openInternal):
2868         (WebCore::IDBFactory::deleteDatabase):
2869         * Modules/indexeddb/IDBFactory.h:
2870         * Modules/indexeddb/IDBFactory.idl:
2871
2872         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
2873         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
2874
2875         * Modules/indexeddb/client/IDBConnectionToServer.h:
2876
2877         * inspector/InspectorIndexedDBAgent.cpp:
2878
2879         * CMakeLists.txt:
2880         * WebCore.xcodeproj/project.pbxproj:
2881
2882 2016-04-20  Chris Dumez  <cdumez@apple.com>
2883
2884         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
2885         https://bugs.webkit.org/show_bug.cgi?id=156796
2886
2887         Reviewed by Anders Carlsson.
2888
2889         Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
2890         (with invalid value of -1). m_orderIndex a vector index and therefore
2891         is in the range of an unsigned (type used internally by Vector, even
2892         though the index is exposed as size_t). Therefore, assigning it to an
2893         int is unsafe as it may overflow.
2894
2895         This may fix <rdar://problem/23410338> which is a top crasher.
2896
2897         * rendering/OrderIterator.cpp:
2898         (WebCore::OrderIterator::next):
2899         (WebCore::OrderIterator::reset):
2900         * rendering/OrderIterator.h:
2901
2902 2016-04-20  Chris Dumez  <cdumez@apple.com>
2903
2904         Crash under needsAppleMailPaginationQuirk()
2905         https://bugs.webkit.org/show_bug.cgi?id=156806
2906         <rdar://problem/23323479>
2907
2908         Reviewed by Simon Fraser.
2909
2910         Add check for element()->hasID() before calling element()->idForStyleResolution()
2911         so that we don't dereference a potentially null element()->elementData().
2912         Also stop repeatedly atomizing "messageContentContainer" and leverage
2913         the operator==(const AtomicString&, const char*) instead for performance.
2914
2915         * rendering/RenderBlockFlow.cpp:
2916         (WebCore::needsAppleMailPaginationQuirk):
2917
2918 2016-04-20  Brady Eidson  <beidson@apple.com>
2919
2920         Attempt to fix non-INDEXED_DATABASE_IN_WORKERS builds after r199779
2921
2922         * testing/InternalSettings.cpp:
2923         (WebCore::InternalSettings::Backup::Backup):
2924         (WebCore::InternalSettings::Backup::restoreTo):
2925         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
2926         * testing/InternalSettings.h:
2927
2928 2016-04-20  Chris Dumez  <cdumez@apple.com>
2929
2930         Potential overflow in RenderLayer::hitTestList()
2931         https://bugs.webkit.org/show_bug.cgi?id=156804
2932
2933         Reviewed by Simon Fraser.
2934
2935         Use size_t type instead of int to iterate over the Vector to make sure
2936         we don't overflow. This is a speculative fix for <rdar://problem/23249479>.
2937
2938         * rendering/RenderLayer.cpp:
2939         (WebCore::RenderLayer::hitTestList):
2940
2941 2016-04-20  Brady Eidson  <beidson@apple.com>
2942
2943         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
2944         https://bugs.webkit.org/show_bug.cgi?id=156782
2945
2946         Reviewed by Alex Christensen.
2947
2948         Test: storage/indexeddb/modern/workers-disabled.html
2949               storage/indexeddb/modern/workers-enable.html
2950
2951         * Configurations/FeatureDefines.xcconfig:
2952
2953         ScriptExecutionContext shouldn't really be supplementable:
2954         * dom/ScriptExecutionContext.h:
2955
2956         WorkerGlobalScope should be supplementable.
2957         Also modernize this archaic header (pragma once, and re-indent):
2958         * workers/WorkerGlobalScope.h:
2959         
2960         Update for WorkerGlobalScope now being directly supplementable:
2961         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
2962         (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
2963         (WebCore::WorkerGlobalScopeIndexedDatabase::from):
2964         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
2965         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
2966         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
2967         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
2968         (WebCore::WorkerGlobalScopeNotifications::WorkerGlobalScopeNotifications):
2969         (WebCore::WorkerGlobalScopeNotifications::from):
2970         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
2971         * Modules/notifications/WorkerGlobalScopeNotifications.h:
2972         
2973         Expose IndexedDBWorkers to RuntimeEnabledFeatures:
2974         * bindings/generic/RuntimeEnabledFeatures.cpp:
2975         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2976         * bindings/generic/RuntimeEnabledFeatures.h:
2977         (WebCore::RuntimeEnabledFeatures::setIndexedDBWorkersEnabled):
2978         (WebCore::RuntimeEnabledFeatures::indexedDBWorkersEnabled):
2979
2980         Expose IndexedDBWorkers to InternalSettings:
2981         * testing/InternalSettings.cpp:
2982         (WebCore::InternalSettings::Backup::Backup):
2983         (WebCore::InternalSettings::Backup::restoreTo):
2984         (WebCore::InternalSettings::setIndexedDBWorkersEnabled):
2985         * testing/InternalSettings.h:
2986         * testing/InternalSettings.idl:
2987
2988 2016-04-20  Dave Hyatt  <hyatt@apple.com>
2989
2990         Hangable punctuation measurement using the wrong indices.
2991         https://bugs.webkit.org/show_bug.cgi?id=155899
2992
2993         Reviewed by Simon Fraser.
2994
2995         New tests in fast/text.
2996
2997         * rendering/RenderBlockFlow.cpp:
2998         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2999         * rendering/RenderText.cpp:
3000         (WebCore::RenderText::hangablePunctuationStartWidth):
3001         (WebCore::RenderText::hangablePunctuationEndWidth):
3002         (WebCore::RenderText::isHangableStopOrComma):
3003
3004 2016-04-20  Chris Dumez  <cdumez@apple.com>
3005
3006         Drop [UsePointersEvenForNonNullableObjectArguments] from several Canvas interfaces
3007         https://bugs.webkit.org/show_bug.cgi?id=156781
3008
3009         Reviewed by Darin Adler.
3010
3011         * html/canvas/CanvasRenderingContext2D.cpp:
3012         (WebCore::CanvasRenderingContext2D::fill):
3013         (WebCore::CanvasRenderingContext2D::stroke):
3014         (WebCore::CanvasRenderingContext2D::clip):
3015         (WebCore::CanvasRenderingContext2D::isPointInPath):
3016         (WebCore::CanvasRenderingContext2D::isPointInStroke):
3017         (WebCore::size):
3018         (WebCore::CanvasRenderingContext2D::drawImage):
3019         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
3020         (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
3021         * html/canvas/CanvasRenderingContext2D.h:
3022         * html/canvas/CanvasRenderingContext2D.idl:
3023         * html/canvas/DOMPath.h:
3024         * html/canvas/DOMPath.idl:
3025         * html/canvas/WebGLDebugShaders.cpp:
3026         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
3027         * html/canvas/WebGLDebugShaders.h:
3028         * html/canvas/WebGLDebugShaders.idl:
3029
3030 2016-04-20  Chris Dumez  <cdumez@apple.com>
3031
3032         Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio
3033         https://bugs.webkit.org/show_bug.cgi?id=156777
3034
3035         Reviewed by Darin Adler.
3036
3037         Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio and
3038         modernize the interface a bit.
3039
3040         There is no major Web-exposed behavioral change except for
3041         the exception type thrown when passing null (now always TypeError).
3042         Tests were updated to add coverage for this.
3043
3044         * Modules/webaudio/AsyncAudioDecoder.cpp:
3045         (WebCore::AsyncAudioDecoder::decodeAsync):
3046         (WebCore::AsyncAudioDecoder::DecodingTask::DecodingTask):
3047         (WebCore::AsyncAudioDecoder::DecodingTask::decode): Deleted.
3048         * Modules/webaudio/AsyncAudioDecoder.h:
3049         (WebCore::AsyncAudioDecoder::DecodingTask::audioData):
3050         * Modules/webaudio/AudioContext.cpp:
3051         (WebCore::AudioContext::lazyInitialize):
3052         (WebCore::AudioContext::createBuffer):
3053         (WebCore::AudioContext::decodeAudioData):
3054         (WebCore::AudioContext::createBufferSource):
3055         (WebCore::AudioContext::createMediaElementSource):
3056         (WebCore::AudioContext::createMediaStreamSource):
3057         (WebCore::AudioContext::createMediaStreamDestination):
3058         (WebCore::AudioContext::createScriptProcessor):
3059         (WebCore::AudioContext::createBiquadFilter):
3060         (WebCore::AudioContext::createWaveShaper):
3061         (WebCore::AudioContext::createPanner):
3062         (WebCore::AudioContext::createConvolver):
3063         (WebCore::AudioContext::createDynamicsCompressor):
3064         (WebCore::AudioContext::createAnalyser):
3065         (WebCore::AudioContext::createGain):
3066         (WebCore::AudioContext::createDelay):
3067         (WebCore::AudioContext::createChannelSplitter):
3068         (WebCore::AudioContext::createChannelMerger):
3069         (WebCore::AudioContext::createOscillator):
3070         (WebCore::AudioContext::createPeriodicWave):
3071         (WebCore::AudioContext::derefFinishedSourceNodes):
3072         (WebCore::AudioContext::refNode):
3073         (WebCore::AudioContext::derefNode):
3074         (WebCore::AudioContext::notifyNodeFinishedProcessing): Deleted.
3075         (WebCore::AudioContext::derefUnfinishedSourceNodes): Deleted.
3076         (WebCore::AudioContext::lock): Deleted.
3077         * Modules/webaudio/AudioContext.h:
3078         * Modules/webaudio/AudioContext.idl:
3079         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3080         (WebCore::MediaElementAudioSourceNode::create):
3081         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
3082         (WebCore::MediaElementAudioSourceNode::process):
3083         * Modules/webaudio/MediaElementAudioSourceNode.h:
3084         (WebCore::MediaElementAudioSourceNode::mediaElement):
3085         * Modules/webaudio/OscillatorNode.idl:
3086
3087 2016-04-20  Brady Eidson  <beidson@apple.com>
3088
3089         Addressing additional review feedback for:
3090         Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
3091         https://bugs.webkit.org/show_bug.cgi?id=156760
3092
3093         * Modules/indexeddb/IDBVersionChangeEvent.h:
3094
3095 2016-04-20  Frederic Wang  <fwang@igalia.com>
3096
3097         Use OpenType MATH fonts by default
3098         https://bugs.webkit.org/show_bug.cgi?id=133603
3099
3100         Reviewed by Alejandro G. Castro.
3101
3102         No new tests. This is already tested by pixel tests like roots.xhtml.
3103         However, new math fonts are not used during test execution.
3104
3105         * css/mathml.css:
3106         (math): We use only a list of known OpenType fonts with a MATH table but keep some pre-installed fallback fonts for OS X and iOS.
3107
3108 2016-04-20  Claudio Saavedra  <csaavedra@igalia.com>
3109
3110         [GTK] Move GTK+-independent platform code to platform/glib
3111         https://bugs.webkit.org/show_bug.cgi?id=156787
3112
3113         Reviewed by Carlos Garcia Campos.
3114
3115         There is plenty of code in platform/gtk that is independent from the GTK+ library.
3116         Move those files to platform/glib so that they can be reused by other GLib-based ports.
3117
3118         Also clean some style warnings in those files.
3119
3120         * PlatformGTK.cmake: Move the files.
3121         * platform/glib/EventLoopGlib.cpp: Renamed from Source/WebCore/platform/gtk/EventLoopGtk.cpp.
3122         (WebCore::EventLoop::cycle):
3123         * platform/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/gtk/FileSystemGtk.cpp.
3124         (WebCore::filenameToString):
3125         (WebCore::unescapedFilename):
3126         (WebCore::fileSystemRepresentation):
3127         (WebCore::filenameForDisplay):
3128         (WebCore::fileExists):
3129         (WebCore::deleteFile):
3130         (WebCore::deleteEmptyDirectory):
3131         (WebCore::getFileStat):
3132         (WebCore::getFileSize):
3133         (WebCore::getFileCreationTime):
3134         (WebCore::getFileModificationTime):
3135         (WebCore::getFileMetadata):
3136         (WebCore::pathByAppendingComponent):
3137         (WebCore::makeAllDirectories):
3138         (WebCore::homeDirectoryPath):
3139         (WebCore::pathGetFileName):
3140         (WebCore::applicationDirectoryPath):
3141         (WebCore::sharedResourcesPath):
3142         (WebCore::getVolumeFreeSizeForPath):
3143         (WebCore::directoryName):
3144         (WebCore::listDirectory):
3145         (WebCore::openTemporaryFile):
3146         (WebCore::openFile):
3147         (WebCore::closeFile):
3148         (WebCore::seekFile):
3149         (WebCore::writeToFile):
3150         (WebCore::readFromFile):
3151         (WebCore::unloadModule):
3152         (WebCore::hardLinkOrCopyFile):
3153         * platform/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/gtk/GamepadsGtk.cpp.
3154         (WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
3155         (WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
3156         (WebCore::GamepadDeviceGlib::readCallback):
3157         (WebCore::GamepadsGlib::GamepadsGlib):
3158         (WebCore::GamepadsGlib::~GamepadsGlib):
3159         (WebCore::GamepadsGlib::registerDevice):
3160         (WebCore::GamepadsGlib::unregisterDevice):
3161         (WebCore::GamepadsGlib::updateGamepadList):
3162         (WebCore::GamepadsGlib::onUEventCallback):
3163         (WebCore::GamepadsGlib::isGamepadDevice):
3164         (WebCore::sampleGamepads):
3165         * platform/glib/SharedBufferGlib.cpp: Renamed from Source/WebCore/platform/gtk/SharedBufferGtk.cpp.
3166         (WebCore::SharedBuffer::createFromReadingFile):
3167
3168 2016-04-20  Frederic Wang  <fwang@igalia.com>
3169
3170         Refactor RenderMathMLSpace to avoid using flexbox
3171         https://bugs.webkit.org/show_bug.cgi?id=155168
3172
3173         Reviewed by Martin Robinson.
3174
3175         No new tests, already covered by existing tests. The behavior of mspace-prefered-width-expected is not specified by the MathML recommendation, we update that test to match our new behavior.
3176
3177         * rendering/mathml/RenderMathMLSpace.cpp: Implement layout functions without passing by flebox.
3178         (WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Implement this function.
3179         (WebCore::RenderMathMLSpace::layoutBlock): Implement this function.
3180         (WebCore::RenderMathMLSpace::computeIntrinsicLogicalWidths): Deleted.
3181         (WebCore::RenderMathMLSpace::updateLogicalWidth): Deleted.
3182         (WebCore::RenderMathMLSpace::updateLogicalHeight): Deleted.
3183         * rendering/mathml/RenderMathMLSpace.h: Update function declarations.
3184
3185 2016-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3186
3187         [Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
3188         https://bugs.webkit.org/show_bug.cgi?id=156785
3189
3190         Reviewed by Žan Doberšek.
3191
3192         This happens for example when view state changes to focus and paint is called from
3193         FrameView::updateControlTints() with a graphics context that doesn't have a platform context. Layout test
3194         fast/images/image-map-outline-with-scale-transform.html sometimes crashes because of this.
3195
3196         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3197         (WebCore::GraphicsContext::drawFocusRing): Return early if painting is disabled.
3198
3199 2016-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3200
3201         REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782
3202         https://bugs.webkit.org/show_bug.cgi?id=156690
3203
3204         Reviewed by Michael Catanzaro.
3205
3206         The assertion is wrong, because it assumes that ImageDecoder::create() always returns a valid pointer, which is
3207         only true for the CG implementation. The non CG implementation can return nullptr if there isn't enough data to
3208         figure out the image format or if the image format is not supported. This is causing several crashes in the
3209         debug bots.
3210
3211         * platform/graphics/ImageSource.cpp:
3212         (WebCore::ImageSource::setData): Remove the invalid ASSERT and return early if we fail to create the decoder.
3213         (WebCore::ImageSource::ensureDecoderIsCreated): Deleted.
3214         * platform/graphics/ImageSource.h:
3215
3216 2016-04-19  Brent Fulgham  <bfulgham@apple.com>
3217
3218         Remove remaining bits of dynamic <link> rel='icon' loading
3219         https://bugs.webkit.org/show_bug.cgi?id=156727
3220
3221         Reviewed by Darin Adler.
3222
3223         Don't call 'shouldLoadLink' for 'icon' link types. It performs no
3224         useful checks for 'icon' types, and emits the non-standard
3225         'onbeforeload' event.
3226
3227         This work finishes up https://webkit.org/b/153151, where we removed
3228         FrameLoaderClient::dispatchDidChangeIcons() and related code.
3229
3230         Test: webarchive/test-link-rel-subresource-beforeload.html
3231
3232         * loader/LinkLoader.cpp:
3233         (WebCore::LinkLoader::loadLink): Remove unneeded call to 'shouldLoadLink'.
3234
3235 2016-04-19  Chris Dumez  <cdumez@apple.com>
3236
3237         AudioBufferSourceNode.buffer should be nullable
3238         https://bugs.webkit.org/show_bug.cgi?id=156769
3239
3240         Reviewed by Darin Adler.
3241
3242         AudioBufferSourceNode.buffer should be nullable as per the
3243         specification:
3244         https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode
3245
3246         Our implementation was initially returning null when getting
3247         AudioBufferSourceNode.buffer, which is correct. However, it would
3248         throw a TypeError when trying to set the attribute to null. Our
3249         implementation setter actually supported setting the buffer to
3250         null but the custom bindings for the setter would not.
3251
3252         This patch does the following:
3253         - Get rid of the custom bindings for the AudioBufferSourceNode.buffer
3254           setter. We can have the bindings generator generate the same code
3255           by using [StrictTypeChecking]. The custom bindinds were also throwing
3256           a TypeError if the input AudioBuffer had too many channels but this
3257           does not seem to be possible.
3258         - Mark AudioBufferSourceNode.buffer as nullable in the IDL so that
3259           we no longer throw when the JS tries to assign null, but instead
3260           calls AudioBufferSourceNode::setBuffer(nullptr)
3261
3262         No new test, updated webaudio/audiobuffersource-channels.html
3263
3264         * CMakeLists.txt:
3265         * Modules/webaudio/AudioBufferSourceNode.cpp:
3266         (WebCore::AudioBufferSourceNode::setBuffer):
3267         * Modules/webaudio/AudioBufferSourceNode.h:
3268         * Modules/webaudio/AudioBufferSourceNode.idl:
3269         * Modules/webaudio/AudioContext.h:
3270         * WebCore.xcodeproj/project.pbxproj:
3271         * bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed.
3272
3273 2016-04-19  Brady Eidson  <beidson@apple.com>
3274
3275         Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
3276         https://bugs.webkit.org/show_bug.cgi?id=156760
3277
3278         Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).
3279
3280         Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html
3281
3282         Add WorkerGlobalScopeConstructors to the xcodeproj:
3283         * WebCore.xcodeproj/project.pbxproj:
3284
3285         Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
3286         * page/DOMWindow.idl:
3287
3288         Remove the poor way most objects were exposed on the WorkerGlobalScope:
3289         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
3290
3291         Expose most of the objects on the WorkerGlobalScope the correct way:
3292         * Modules/indexeddb/IDBCursor.idl:
3293         * Modules/indexeddb/IDBCursorWithValue.idl:
3294         * Modules/indexeddb/IDBDatabase.idl:
3295         * Modules/indexeddb/IDBFactory.idl:
3296         * Modules/indexeddb/IDBIndex.idl:
3297         * Modules/indexeddb/IDBKeyRange.idl:
3298         * Modules/indexeddb/IDBObjectStore.idl:
3299         * Modules/indexeddb/IDBOpenDBRequest.idl:
3300         * Modules/indexeddb/IDBRequest.idl:
3301         * Modules/indexeddb/IDBTransaction.idl:
3302
3303         Make IDBVersionChangeEvent constructible:        
3304         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
3305         (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
3306         (WebCore::IDBVersionChangeEvent::newVersion): Deleted.
3307         * Modules/indexeddb/IDBVersionChangeEvent.h:
3308         * Modules/indexeddb/IDBVersionChangeEvent.idl:
3309
3310         * bindings/js/JSDictionary.h:
3311         (WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
3312           handles Optional<>s.
3313
3314 2016-04-19  Alex Christensen  <achristensen@webkit.org>
3315
3316         Build fix after r199738
3317
3318         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3319         (WebCore::GraphicsContext3D::GraphicsContext3D):
3320         * platform/graphics/win/GraphicsContext3DWin.cpp:
3321         (WebCore::GraphicsContext3D::GraphicsContext3D):
3322
3323 2016-04-19  Keith Miller  <keith_miller@apple.com>
3324
3325         ObjcInstance::stringValue should not call NSObject's description method
3326         https://bugs.webkit.org/show_bug.cgi?id=156758
3327
3328         Reviewed by Geoffrey Garen.
3329
3330         This patch makes it so that we no longer call NSObject's description method without first
3331         swizzling the implementation for WebScriptObjects. We restore the incomming NSObject's
3332         description method once we have finished generating the string.
3333
3334         Test: platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html
3335
3336         * bridge/objc/objc_instance.mm:
3337         (swizzleNSObjectDescription):
3338         (ObjcInstance::stringValue):
3339
3340 2016-04-19  Alex Christensen  <achristensen@webkit.org>
3341
3342         Update ANGLE
3343         https://bugs.webkit.org/show_bug.cgi?id=156755
3344
3345         Reviewed by Dean Jackson.
3346
3347         * CMakeLists.txt:
3348         * platform/graphics/ANGLEWebKitBridge.h:
3349         (WebCore::ANGLEWebKitBridge::getResources):
3350         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3351         (WebCore::GraphicsContext3D::GraphicsContext3D):
3352         Continue to compile successfully with new ANGLE.
3353
3354 2016-04-19  Chris Dumez  <cdumez@apple.com>
3355
3356         Mark more classes as WTF_MAKE_FAST_ALLOCATED
3357         https://bugs.webkit.org/show_bug.cgi?id=156732
3358
3359         Reviewed by Darin Adler.
3360
3361         * css/CSSImageGeneratorValue.h:
3362         * css/DocumentRuleSets.h:
3363         * css/MediaQueryMatcher.h:
3364         * css/RuleFeature.h:
3365         * css/StyleResolver.h:
3366         * dom/ActiveDOMCallbackMicrotask.h:
3367         * dom/DocumentSharedObjectPool.h:
3368         * dom/MutationObserver.cpp:
3369         * dom/MutationObserverInterestGroup.h:
3370         * dom/MutationObserverRegistration.h:
3371         * dom/ScriptExecutionContext.cpp:
3372         * dom/SlotAssignment.h:
3373         * html/HTMLCollection.h:
3374         * html/canvas/CanvasRenderingContext2D.cpp:
3375         * html/parser/HTMLToken.h:
3376         * html/parser/XSSAuditorDelegate.h:
3377         * loader/FrameLoader.cpp:
3378         * loader/SubframeLoader.h:
3379         * page/AutoscrollController.h:
3380         * page/csp/ContentSecurityPolicySource.h:
3381         * platform/cf/RunLoopObserver.h:
3382         * platform/graphics/FloatQuad.h:
3383         * platform/graphics/FloatRoundedRect.h:
3384         * platform/graphics/IntSize.h:
3385         * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
3386         * platform/graphics/cg/ImageDecoderCG.h:
3387         * platform/graphics/cocoa/IOSurface.h:
3388         * platform/graphics/displaylists/DisplayList.h:
3389         * platform/graphics/mac/ComplexTextController.h:
3390         * platform/graphics/mac/FontCustomPlatformData.h:
3391         * platform/mac/PowerObserverMac.h:
3392         * platform/network/DataURLDecoder.cpp:
3393         * platform/text/PlatformLocale.h:
3394         * rendering/TextAutosizer.h:
3395         * style/StyleUpdate.h:
3396         * xml/XMLHttpRequestUpload.h:
3397
3398 2016-04-18  Ada Chan  <adachan@apple.com>
3399
3400         Context menu items related to fullscreen should be specific to standard fullscreen
3401         https://bugs.webkit.org/show_bug.cgi?id=156723
3402         <rdar://problem/25452632>
3403
3404         Reviewed by Darin Adler.
3405
3406         Introduce HTMLMediaElement::isStandardFullscreen() that the HitTestResult code can use
3407         when handling the validation and selection of fullscreen-related context menu items.
3408
3409         * html/HTMLMediaElement.cpp:
3410         (WebCore::HTMLMediaElement::isStandardFullscreen):
3411         (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
3412         Renamed to make it clear that it's for toggling standard fullscreen. Call the new
3413         HTMLMediaElement::isStandardFullscreen().
3414         * html/HTMLMediaElement.h:
3415         * rendering/HitTestResult.cpp:
3416         (WebCore::HitTestResult::mediaIsInFullscreen):
3417         Use HTMLMediaElement::isStandardFullscreen().
3418         (WebCore::HitTestResult::toggleMediaFullscreenState):
3419         Call the renamed HTMLMediaElement::toggleStandardFullscreenState().
3420
3421 2016-04-19  Brady Eidson  <beidson@apple.com>
3422
3423         Modern IDB: ObjectStore Blob Support.
3424         https://bugs.webkit.org/show_bug.cgi?id=143193
3425
3426         Reviewed by Alex Christensen.
3427
3428         Tests: imported/blink/storage/indexeddb/blob-basics-metadata.html
3429                imported/blink/storage/indexeddb/blob-delete-objectstore-db.html
3430                imported/blink/storage/indexeddb/blob-valid-after-deletion.html
3431                imported/blink/storage/indexeddb/blob-valid-before-commit.html
3432                imported/blink/storage/indexeddb/empty-blob-file.html
3433                storage/indexeddb/modern/blob-simple.html
3434
3435         Most of the work has been done already.
3436         
3437         Besides a handful of tweaks to that work, all this really does is remove the clause
3438         that prevents blob URLs from going into the database.
3439
3440         * Modules/indexeddb/IDBObjectStore.cpp:
3441         (WebCore::IDBObjectStore::putOrAdd): Only disallow blobs if private browsing is enabled
3442           (Making that work is already covered by another bug)
3443           
3444         * Modules/indexeddb/IDBTransaction.cpp:
3445         (WebCore::IDBTransaction::putOrAddOnServer):
3446
3447         * Modules/indexeddb/IDBValue.cpp:
3448         (WebCore::IDBValue::IDBValue):
3449
3450         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3451         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
3452         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
3453
3454         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
3455         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
3456
3457         * platform/network/BlobRegistryImpl.cpp:
3458         (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
3459
3460         * platform/sql/SQLiteFileSystem.cpp:
3461         (WebCore::SQLiteFileSystem::deleteDatabaseFile): Delete all database-related files 
3462           now that we use WAL mode.
3463
3464 2016-04-19  Sergio Villar Senin  <svillar@igalia.com>
3465
3466         [css-grid] Use the margin box for non-auto minimum sizes
3467         https://bugs.webkit.org/show_bug.cgi?id=156711
3468
3469         Reviewed by Darin Adler.
3470
3471         When computing the min-size of items with non-auto minimum height/width we are incorrectly
3472         returning the size of the border box, and thus incorrectly ignoring the margins of the item.
3473
3474         This is a follow up patch of r199153 were we added the missing border and paddings for
3475         heights. Contrary to that, we were not including margins for both axis.
3476
3477         This CL requires 3 different interrelated changes:
3478         - Add the margins to the min-size returned by minSizeForChild (might require a layout).
3479         - Refactor and extract width computations from logicalHeightForChild(); not totally
3480         mandatory but pretty logical and helpful.
3481         - Use a new update function to isolate the computation of the override width.
3482
3483         Test: fast/css-grid-layout/min-width-margin-box.html
3484
3485         * rendering/RenderBox.cpp:
3486         (WebCore::RenderBox::computeInlineDirectionMargins): Added const to a parameter.
3487         * rendering/RenderBox.h:
3488         * rendering/RenderGrid.cpp:
3489         (WebCore::RenderGrid::computeTrackSizesForDirection): Initialize the sizingOperation.
3490         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Ditto.
3491         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
3492         (WebCore::RenderGrid::logicalHeightForChild): Renamed from logicalContentHeightForChild as
3493         it no longer returns the content size but the outer size.
3494         (WebCore::RenderGrid::minSizeForChild):
3495         (WebCore::RenderGrid::updateOverrideContainingBlockContentLogicalWidthForChild): Extracted
3496         from logicalHeightForChild().
3497         (WebCore::RenderGrid::minContentForChild): Update override width if needed.
3498         (WebCore::RenderGrid::maxContentForChild): Ditto.
3499         (WebCore::RenderGrid::computeMarginLogicalSizeForChild): Generalized from
3500         computeMarginLogicalHeightForChild(), it can now compute also margins for the inline
3501         direction.
3502         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
3503         (WebCore::RenderGrid::logicalContentHeightForChild): Deleted.
3504         (WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted.
3505         * rendering/RenderGrid.h:
3506
3507 2016-04-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3508
3509         [Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
3510         https://bugs.webkit.org/show_bug.cgi?id=156742
3511
3512         Reviewed by Martin Robinson.
3513
3514         We are rendering the focus ring differently depending on whether a path is used or a vector of rectangles. This
3515         is causing that some reftests fail because they assume we always render the focus ring the same way. For example
3516         fast/images/image-map-outline-in-positioned-container.html, when rendering the test
3517         GraphicsContext::drawFocusRing is called with a path, and when rendering the reference it's called with a vector
3518         of rectangles, producing different results.
3519
3520         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3521         (WebCore::GraphicsContext::drawFocusRing): When receiving a vector of rectangles, build a Path from the given
3522         rectangles and call drawFocusRing() with the built path to ensure consistency.
3523
3524 2016-04-19  Antti Koivisto  <antti@apple.com>
3525
3526         Move FontSelectorClient to a file of its own
3527         https://bugs.webkit.org/show_bug.cgi?id=156738
3528
3529         Reviewed by Carlos Garcia Campos.
3530
3531         So modifying FontSelector does not trigger world rebuild via Document.h.
3532
3533         * WebCore.xcodeproj/project.pbxproj:
3534         * css/CSSFontSelector.cpp:
3535         * dom/Document.h:
3536         * html/canvas/CanvasRenderingContext2D.h:
3537         * platform/graphics/FontSelector.h:
3538         (WebCore::FontSelectorClient::~FontSelectorClient): Deleted.
3539         * platform/graphics/FontSelectorClient.h: Added.
3540         (WebCore::FontSelectorClient::~FontSelectorClient):
3541
3542 2016-04-19  Joanmarie Diggs  <jdiggs@igalia.com>
3543
3544         [GTK] accessibility/gtk/entry-and-password.html is failing since r194847
3545         https://bugs.webkit.org/show_bug.cgi?id=153062
3546
3547         Reviewed by Carlos Garcia Campos.
3548
3549         The changes in r194847 include using WebCore's rendering for the CapsLock indicator.
3550         As a side effect, password inputs gained a TextControlInnerTextElement child from
3551         the Shadow DOM. If we include that child in the accessibility tree, the child will
3552         emit focus and text notifications that suggest the user is no longer in the control.
3553         This can be especially problematic for screen reader users with key echo enabled
3554         when typing in a password input. To fix this, prune TextControlInnerTextElement
3555         children from the accessibility tree for ATK.
3556
3557         No new tests as existing coverage caught this regression. Also modified the
3558         auto-fill-crash.html test whose expectations include the children count for
3559         a text input.
3560
3561         * accessibility/atk/AccessibilityObjectAtk.cpp:
3562         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
3563
3564 2016-04-18  Brady Eidson  <beidson@apple.com>
3565
3566         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
3567         https://bugs.webkit.org/show_bug.cgi?id=156640
3568
3569         Reviewed by Alex Christensen.
3570
3571         No new tests (No change in behavior, as blobs in IDB are not yet enabled,
3572                       but when they are enabled testing will cover this).
3573
3574         * Modules/indexeddb/shared/IDBResultData.h: Export some stuff
3575         
3576         * fileapi/ThreadableBlobRegistry.cpp:
3577         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Account for 
3578           BlobRegistry change described below.
3579         
3580         * platform/network/BlobRegistry.h: Change registerBlobURLOptionallyFileBacked to take a 
3581           BlobDataFileReference instead of a raw path, to allow WK2 to include a sandbox extension.
3582         
3583         * platform/network/BlobRegistryImpl.cpp:
3584         (WebCore::BlobRegistryImpl::registerBlobURL): Account for BlobRegistry change described above.
3585         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked): Use the passed in 
3586           BlobDataFileHandle, and also register the BlobResourceHandle constructor.
3587         * platform/network/BlobRegistryImpl.h:
3588
3589 2016-04-18  Alex Christensen  <achristensen@webkit.org>
3590
3591         Fix iOS build after r199701
3592
3593         * platform/ios/WebAVPlayerController.mm:
3594
3595 2016-04-18  Darin Adler  <darin@apple.com>
3596
3597         Updated binding test result to reflect the change to not use Deprecated::ScriptValue.
3598
3599         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated with new script.
3600
3601 2016-04-18  Darin Adler  <darin@apple.com>
3602
3603         Remove all use of Deprecated::ScriptValue in generated bindings
3604         https://bugs.webkit.org/show_bug.cgi?id=156706
3605
3606         Reviewed by Brady Eidson.
3607
3608         * Modules/indexeddb/IDBCursor.idl: Removed unneeded [ImplementationReturnType=JSValue].
3609         * Modules/indexeddb/IDBCursorWithValue.idl: Ditto.
3610
3611         * Modules/indexeddb/IDBKeyRange.cpp:
3612         (WebCore::IDBKeyRange::lowerValue): Deleted.
3613         (WebCore::IDBKeyRange::upperValue): Deleted.
3614         (WebCore::IDBKeyRange::only): Changed to take ExecState since the old code just used
3615         the ScriptExecutionContext to get back to the (potentially wrong) ExecState. Also kept
3616         one overload that takes ScriptExecutionContext because I could not change all callers.
3617         (WebCore::IDBKeyRange::lowerBound): Ditto.
3618         (WebCore::IDBKeyRange::upperBound): Ditto.
3619         (WebCore::IDBKeyRange::bound): Ditto.
3620
3621         * Modules/indexeddb/IDBKeyRange.h: Updated for above.
3622
3623         * Modules/indexeddb/IDBKeyRange.idl: Use [ImplementationReturnType=IDBKey].
3624         Use ScriptState instead of ScriptExecutionContext.
3625
3626         * Modules/streams/ReadableStreamSource.h: Take JSValue instead of Deprecated::ScriptValue
3627         for the ignored argument to the cancel function.
3628
3629         * bindings/js/IDBBindingUtilities.cpp:
3630         (WebCore::toJS): Renamed idbKeyToJSValue to this, the traditional name used in the
3631         bindings generator for all these functions. Also changed to take references.
3632         (WebCore::injectIDBKeyIntoScriptValue): Updated to call with the new name and types.
3633         (WebCore::idbKeyDataToScriptValue): Ditto.
3634
3635         * bindings/js/IDBBindingUtilities.h: Added declaration of toJS for IDBKey.
3636
3637         * bindings/scripts/CodeGeneratorJS.pm: Use JSC::JSValue instead of Deprecated::ScriptValue
3638         for the "any" type.
3639         (JSValueToNative): Just return the value with no transformation when type is "any".
3640         (NativeToJSValue): Changed default behavior for "any" to just pass the value as is with
3641         no transfomration. Removed unused ImplementationReturnType case for inside Document.
3642         Removed JSValue case since it's the default now. Added IDBKey case that matches the
3643         IDBKeyPath case (still wondering if we can do those without an attribute). Removed bogus
3644         second check for type "any".
3645
3646 2016-04-18  Martin Robinson  <mrobinson@igalia.com>
3647
3648         [GTK] Possible off-by-one in hyphenation code
3649         https://bugs.webkit.org/show_bug.cgi?id=156661
3650
3651         Reviewed by Michael Catanzaro.
3652
3653         No new tests. This is covered by older tests.
3654
3655         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3656         (WebCore::lastHyphenLocation): Fix an off by one error in hyphen location.
3657
3658 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
3659
3660         [OSX] AVKit is not available on all systems
3661         https://bugs.webkit.org/show_bug.cgi?id=156724
3662         <rdar://problem/25501587>
3663
3664         Reviewed by Dean Jackson.
3665
3666         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Add _OPTIONAL to all
3667           AVKit softlink macros.
3668         * platform/ios/WebAVPlayerController.mm: Ditto.
3669         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Ditto.
3670         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
3671         * platform/mac/WebPlaybackSessionInterfaceMac.mm: Ditto.
3672         * platform/mac/WebVideoFullscreenInterfaceMac.mm: Ditto.
3673
3674 2016-04-18  Gavin Barraclough  <barraclough@apple.com>
3675
3676         WebKit should adopt journal_mode=wal for all SQLite databases.
3677         https://bugs.webkit.org/show_bug.cgi?id=133496
3678
3679         Reviewed by Brady Eidson.
3680
3681         Enabling sqlite3 WAL mode on iOS causes a test failure, but appears just be something that should fail still failing, only in a different way.
3682         Enabling & marking test as failing for now. Tracking test failure here:
3683             https://bugs.webkit.org/show_bug.cgi?id=156718
3684
3685         * platform/sql/SQLiteDatabase.cpp:
3686         (WebCore::SQLiteDatabase::open):
3687             - enable on iOS.
3688
3689 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
3690
3691         Remove support for X-Frame-Options in `<meta>`
3692         https://bugs.webkit.org/show_bug.cgi?id=156625
3693         <rdar://problem/25748714>
3694
3695         Rubberstamped by Darin Adler.
3696
3697         * dom/Document.cpp:
3698         (WebCore::Document::processHttpEquiv): Revise messaging based on Darin's comments.
3699
3700 2016-04-18  Chris Dumez  <cdumez@apple.com>
3701
3702         Crash in ElementDescendantIterator::operator--() when calling m_ancestorSiblingStack.last()
3703         https://bugs.webkit.org/show_bug.cgi?id=156715
3704         <rdar://problem/25750864>
3705
3706         Reviewed by Antti Koivisto.
3707
3708         Fix correctness of ElementDescendantIterator::operator--(). The last element
3709         in the m_ancestorSiblingStack stack is nullptr. However, if our parent does
3710         not have a sibling, m_current->nextSibling() == m_ancestorSiblingStack.last()
3711         would be true and we would end up removing the nullptr element from
3712         m_ancestorSiblingStack. We would crash on a follow-up call to operator--()
3713         because m_ancestorSiblingStack.last() would do an out-of-bound access, given
3714         that m_ancestorSiblingStack is empty.
3715
3716         Test: fast/dom/collection-backward-traversal-crash.html
3717
3718         * dom/ElementDescendantIterator.h:
3719         (WebCore::ElementDescendantIterator::operator--):
3720
3721 2016-04-18  Anders Carlsson  <andersca@apple.com>
3722
3723         Fix build with newer versions of clang.
3724         rdar://problem/25749769
3725
3726         Forward declare performClose:.
3727
3728         * platform/mac/WebCoreFullScreenWindow.mm:
3729
3730 2016-04-18  Tina Liu  <iting_liu@apple.com>
3731
3732         Declare a virtual function in PluginStrategy to be implemented by subclasses.
3733         https://bugs.webkit.org/show_bug.cgi?id=156540
3734
3735         Reviewed by Anders Carlsson.
3736
3737         * plugins/PluginStrategy.h:
3738
3739 2016-04-18  Eric Carlson  <eric.carlson@apple.com>
3740
3741         [iOS] don't toggle playback when media engine rate changes
3742         https://bugs.webkit.org/show_bug.cgi?id=156705
3743         <rdar://problem/25779175>
3744
3745         Reviewed by Jer Noble.
3746
3747         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3748         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Don't send the play/pause command
3749           unless the player item state is >= MediaPlayerAVPlayerItemStatusPlaybackBufferFull and
3750           the rate change is unexpected.
3751
3752 2016-04-18  Chris Dumez  <cdumez@apple.com>
3753
3754         Unreviewed, fix iOS9 build after r199682.
3755
3756         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
3757         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
3758
3759 2016-04-18  Chris Dumez  <cdumez@apple.com>
3760
3761         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
3762         https://bugs.webkit.org/show_bug.cgi?id=156639
3763         <rdar://problem/25765848>
3764
3765         Reviewed by Alex Christensen.
3766
3767         Only adjust network responses' MIME type for QuickLook in the context of a main
3768         resource load since we can only preview main resources with QuickLook. This
3769         avoids doing unnecessary work during page load. Also, this makes it a lot less
3770         likely to dlopen() the QuickLook library during page load since we now only
3771         adjust MIME type for QuickLook for main resources, and main resources usually
3772         have the well-known 'text/html' MIME type for which we know we will not use
3773         QuickLook.
3774
3775         After this change, we no longer need to dlopen() the QuickLook library in the
3776         NetworkProcess in the context of the PLT. We would previously dlopen() the
3777         library during the first page load, thus significantly slowing it down. As a
3778         result, we see a ~22% speed up in the PLT's first page load and a 0.9-1% overall
3779         PLT progression.
3780
3781         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3782         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3783         Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.
3784
3785         * platform/network/ios/WebCoreURLResponseIOS.mm:
3786         (WebCore::adjustMIMETypeIfNecessary):
3787         Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.
3788
3789         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
3790         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
3791         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
3792         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
3793         Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.
3794
3795         * platform/network/mac/WebCoreURLResponse.h:
3796         * platform/network/mac/WebCoreURLResponse.mm:
3797         (WebCore::adjustMIMETypeIfNecessary):
3798
3799 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
3800
3801         CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
3802         https://bugs.webkit.org/show_bug.cgi?id=153151
3803         <rdar://problem/24383176>
3804
3805         Reviewed by Darin Adler.
3806
3807         Remove the unused dynamic favicon code and tests.
3808
3809         * loader/EmptyClients.h:
3810         * loader/FrameLoaderClient.h:
3811         * loader/LinkLoader.cpp:
3812         (WebCore::LinkLoader::loadLink):
3813
3814 2016-04-15  Jer Noble  <jer.noble@apple.com>
3815
3816         [Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
3817         https://bugs.webkit.org/show_bug.cgi?id=156633
3818
3819         Reviewed by Eric Carlson.
3820
3821         Pass through the existing "outputObscuredDueToInsufficientExternalProtection" status as an
3822         error, similarly to what we do for CDMSessionMediaSourceAVFObjC.
3823
3824         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
3825         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC): Deleted.
3826         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3827         (SOFT_LINK_CLASS):
3828         (-[WebCDMSessionAVFoundationObjCListener initWithParent:player:]):
3829         (-[WebCDMSessionAVFoundationObjCListener invalidate]):
3830         (-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]):
3831         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
3832         (WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
3833         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
3834         (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
3835         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3836         (WebCore::MediaPlayerPrivateAVFoundationObjC::avPlayer):
3837
3838 2016-04-18  Chris Dumez  <cdumez@apple.com>
3839
3840         Unreviewed, rolling out r199644.
3841
3842         Seems to have caused a 1-2% regression on warm PLT
3843
3844         Reverted changeset:
3845
3846         "[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
3847         https://bugs.webkit.org/show_bug.cgi?id=156639
3848         http://trac.webkit.org/changeset/199644
3849
3850 2016-04-17  Darin Adler  <darin@apple.com>
3851
3852         Get rid of IDBAny
3853         https://bugs.webkit.org/show_bug.cgi?id=156681
3854
3855         Reviewed by Brady Eidson.
3856
3857         IDBAny is not part of the public interface of Indexed Database.
3858         It was an implementation technique used to help create language bindings for
3859         functions that have to deal with types that aren't easly expressed with the
3860         normal IDL and C++ type system.
3861
3862         What was particularly dangerous about IDBAny is that it can be used to store
3863         arbitrary JavaScript objects and it's not easy to handle garbage collection and
3864         reference cycles when they are hidden behind this class's abstraction. It's also
3865         a needless extra layer, a reference counted object just to carry the types from
3866         the bindings to the C++ DOM implementation.
3867
3868         Ths patch also does many small style tweaks.
3869
3870         * CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
3871         * DerivedSources.cpp: Ditto.
3872         * DerivedSources.make: Ditto.
3873         * WebCore.xcodeproj/project.pbxproj: Ditto.
3874
3875         * Modules/indexeddb/IDBAny.cpp: Removed.
3876         * Modules/indexeddb/IDBAny.h: Removed.
3877         * Modules/indexeddb/IDBAny.idl: Removed.
3878
3879         * Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
3880         include as much.
3881         (WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
3882         (WebCore::IDBCursor::directionToString): Ditto.
3883         (WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
3884         (WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
3885         (WebCore::IDBCursor::key): Moved this function to the header.
3886         (WebCore::IDBCursor::primaryKey): Ditto.
3887         (WebCore::IDBCursor::value): Ditto.
3888         (WebCore::IDBCursor::source): Deleted this function; replaced with multiple
3889         type-specific functions; all but one will return null.
3890         (WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
3891         (WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
3892         Fell prey to the confusion because "unsigned long" in IDL means "unsigned" in C++.
3893         (WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
3894         (WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
3895         (WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
3896         ScriptExecutionContext here instead of inside the binding utilities functions.
3897
3898         * Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
3899         Changed key, primaryKey, and value to no longer take an unneeded ExecState.
3900         Made more functions private.
3901
3902         * Modules/indexeddb/IDBCursor.idl: Changed type of "source" to "any", which matches
3903         the IDB specification, rather than "IDBAny". Added [CustomGetter] so we can write the
3904         getter that understands the multiple possible values. Removed unneeded
3905         [CallWith=ScriptState] from key and primaryKey attributes.
3906
3907         * Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
3908         * Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
3909         from the value attribute.
3910
3911         * Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
3912         * Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!
3913
3914         * Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
3915         (WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
3916         (WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
3917         (WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
3918         (WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
3919         Also removed unneeded typecast.
3920
3921         * Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
3922         Removed the getDatabaseNames function. We still need a solution here, but there is
3923         no reason to keep the placeholder function that returns nullptr here.
3924
3925         * Modules/indexeddb/IDBIndex.cpp:
3926         (WebCore::IDBIndex::keyPathAny): Removed.
3927         (WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
3928         (WebCore::IDBIndex::count): Ditto.
3929         (WebCore::IDBIndex::openKeyCursor): Ditto.
3930         (WebCore::IDBIndex::get): Ditto.
3931         (WebCore::IDBIndex::getKey): Ditto.
3932
3933         * Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
3934         including itself. Marked class final. Updated for above changes.
3935
3936         * Modules/indexeddb/IDBIndex.idl: Changed type of "keyPath" to "any", which matches
3937         the IDB specification, rather than "IDBAny". Specified [ImplementationReturnType=IDBKeyPath]
3938         so the code generator creates the appropriate code to convert from an IDBKeyPath.
3939         In the future, we may find a way to do this without an explicit attribute in the IDL
3940         file but this is fine for now.
3941
3942         * Modules/indexeddb/IDBKeyRange.cpp:
3943         (WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
3944         of enums because all the call sites outside this class are using booleans.
3945         (WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
3946         (WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
3947         (WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
3948         (WebCore::IDBKeyRange::upperValue): Ditto.
3949         (WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
3950         (WebCore::IDBKeyRange::lowerBound): Updated for above changes.
3951         (WebCore::IDBKeyRange::upperBound): Ditto.
3952         (WebCore::IDBKeyRange::bound): Ditto.
3953         (WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
3954         there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.
3955
3956         * Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
3957         instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.
3958
3959         * Modules/indexeddb/IDBKeyRangeData.cpp:
3960         (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.
3961
3962         * Modules/indexeddb/IDBObjectStore.cpp:
3963         (WebCore::IDBObjectStore::name): Changed return type to const String& to cut down on
3964         reference count churn.
3965         (WebCore::IDBObjectStore::keyPathAny): Deleted.
3966         (WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath& to cut down on
3967         unnecessary copies.
3968         (WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
3969         (WebCore::IDBObjectStore::get): Ditto.
3970         (WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
3971         (WebCore::IDBObjectStore::deleteFunction): Ditto.
3972         (WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
3973         (WebCore::IDBObjectStore::count): Ditto.
3974
3975         * Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
3976         above in the cpp file function descriptions.
3977
3978         * Modules/indexeddb/IDBObjectStore.idl: Changed type of "keyPath" to "any" and
3979         specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.
3980
3981         * Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
3982         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
3983         that depend on how m_result is implemented, which changed.
3984         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
3985         instead of setting m_result directly.
3986         (WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
3987         m_readyState directly.
3988         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
3989         m_transaction instead of peculiar adoptRef/leakRef.
3990         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
3991         instead of setting m_result directly.
3992
3993         * Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
3994         and made more things private.
3995
3996         * Modules/indexeddb/IDBRequest.cpp:
3997         (WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
3998         m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
3999         even when passed an IDBCursor.
4000         (WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
4001         if it's a cursor. The logic is now simply a null check.
4002         (WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
4003         (WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
4004         (WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
4005         (WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
4006         instead of setting m_source.
4007         (WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
4008         (WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
4009         m_indexSource instead of using m_source. To preserve current behavior, this this does not
4010         use m_cursorSource since the old code did not handle IDBCursor.
4011         (WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
4012         current behavior.
4013         (WebCore::IDBRequest::requestedIndexRecordType): Ditto.
4014         (WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
4015         (WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
4016         have to repeat the code to clear result pointers. Also take a reference.
4017         (WebCore::IDBRequest::setResultToStructuredClone): Ditto.
4018         (WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
4019         instead of m_result.
4020         (WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
4021         (WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
4022         (WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
4023         Also call setResultToUndefined instead of setting m_result.
4024         (WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
4025         instead of setting m_result.
4026         (WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
4027         (WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.
4028
4029         * Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
4030         since that's now done with strings. Added cursorResult, databaseResult, scriptResult,