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