2adc881329ae4224b5fa4e96a017e190152929b3
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-07-25  Nan Wang  <n_wang@apple.com>
2
3         AX: AccessibilityRenderObject is adding duplicated children when CSS first-letter is being used.
4         https://bugs.webkit.org/show_bug.cgi?id=160155
5
6         Reviewed by Chris Fleizach.
7
8         We were adding the same text node twice if CSS first-letter selector was being used. Added a
9         check for the inline continuation so that we only add it once. 
10
11         Test: accessibility/mac/css-first-letter-children.html
12
13         * accessibility/AccessibilityRenderObject.cpp:
14         (WebCore::firstChildConsideringContinuation):
15
16 2016-07-25  Wenson Hsieh  <wenson_hsieh@apple.com>
17
18         Media controls on apple.com don't disappear when movie finishes playing
19         https://bugs.webkit.org/show_bug.cgi?id=160068
20         <rdar://problem/26668526>
21
22         Reviewed by Darin Adler.
23
24         When a video ends, it should cause media controls to hide. While current logic
25         mostly accounts for this, it does not account for programmatic seeks causing
26         the video to lose its 'ended' status before querying for whether or not to
27         show media controls.
28
29         Three new API tests: large-video-seek-after-ending.html
30         large-video-hides-controls-after-seek-to-end.html
31         large-video-seek-to-beginning-and-play-after-ending.html
32
33         * html/HTMLMediaElement.cpp:
34         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
35         (WebCore::HTMLMediaElement::setPlaying):
36         * html/MediaElementSession.cpp:
37         (WebCore::MediaElementSession::canControlControlsManager):
38         * html/MediaElementSession.h:
39
40 2016-07-25  Frederic Wang  <fwang@igalia.com>
41
42         Introduce a MathMLOperatorElement class
43         https://bugs.webkit.org/show_bug.cgi?id=160034
44
45         Reviewed by Darin Adler.
46
47         No new tests, rendering is unchaned.
48
49         * CMakeLists.txt: Add MathMLOperatorElement to the build file.
50         * WebCore.xcodeproj/project.pbxproj: Ditto.
51         * mathml/MathMLAllInOne.cpp: Ditto.
52         * mathml/MathMLOperatorElement.cpp: New DOM class for <mo> element.
53         (WebCore::MathMLOperatorElement::MathMLOperatorElement):
54         (WebCore::MathMLOperatorElement::create):
55         (WebCore::MathMLOperatorElement::parseAttribute): Handle mo attributes.
56         (WebCore::MathMLOperatorElement::createElementRenderer): Create RenderMathMLOperator.
57         * mathml/MathMLOperatorElement.h: Declare a class deriving from MathMLTextElement.
58         * mathml/MathMLTextElement.cpp: Remove all the RenderMathMLOperator parts.
59         (WebCore::MathMLTextElement::MathMLTextElement): Remove inline keyword so that the class can
60         be overriden.
61         (WebCore::MathMLTextElement::parseAttribute): Remove code handled in MathMLOperatorElement.
62         (WebCore::MathMLTextElement::createElementRenderer): Ditto.
63         * mathml/MathMLTextElement.h: Make class and members overridable.
64         * mathml/mathtags.in: Map mo to MathMLOperatorElement.
65         * rendering/mathml/RenderMathMLOperator.cpp:
66         (WebCore::RenderMathMLOperator::RenderMathMLOperator): Make the constructor take a
67         MathMLOperatorElement.
68         * rendering/mathml/RenderMathMLOperator.h: Ditto.
69
70 2016-07-25  Darin Adler  <darin@apple.com>
71
72         Speed up make process slightly by improving "list of files" idiom
73         https://bugs.webkit.org/show_bug.cgi?id=160164
74
75         Reviewed by Mark Lam.
76
77         * DerivedSources.make: Change rules that build lists of files to only run when
78         DerivedSources.make has been modified since the last time they were run. Since the
79         list of files are inside this file, this is safe, and this is faster than always
80         comparing and regenerating the file containing the list of files each time.
81
82 2016-07-24  Wenson Hsieh  <wenson_hsieh@apple.com>
83
84         The web process hangs when computing elements-based snap points for a container with large max scroll offset
85         https://bugs.webkit.org/show_bug.cgi?id=152605
86         <rdar://problem/25353661>
87
88         Reviewed by Simon Fraser.
89
90         Fixes a bug in the computation of axis snap points. The ScrollSnapPoints object, which tracks
91         snap points along a particular axis, has two flags, hasRepeat and usesElements. For elements-
92         based snapping, both flags would be turned on, since StyleBuilderConverter::convertScrollSnapPoints
93         short-circuits for elements-based snapping and does not default usesRepeat to false. To address this,
94         we make ScrollSnapPoints not repeat(100%) by default.
95
96         Test: css3/scroll-snap/scroll-snap-elements-container-larger-than-children.html
97
98         * css/StyleBuilderConverter.h:
99         (WebCore::StyleBuilderConverter::convertScrollSnapPoints): Deleted.
100         * rendering/style/StyleScrollSnapPoints.cpp:
101         (WebCore::ScrollSnapPoints::ScrollSnapPoints):
102
103 2016-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
104
105         REGRESSION(r200931): Invalid cast in highestAncestorToWrapMarkup()
106         https://bugs.webkit.org/show_bug.cgi?id=160163
107
108         Reviewed by Michael Catanzaro.
109
110         Since r200931 the result of enclosingNodeOfType() in highestAncestorToWrapMarkup() is downcasted to Element, but
111         the result of enclosingNodeOfType() can be a Node that is not an Element, in this case is Text. The cast is not
112         needed at all since that node is passed to editingIgnoresContent() and selectionFromContentsOfNode() and both
113         receive a Node not an Element.
114
115         * editing/markup.cpp:
116         (WebCore::highestAncestorToWrapMarkup): Remove invalid cast.
117
118 2016-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
119
120         [Coordinated Graphics] ASSERTION FAILED: m_coordinator->isFlushingLayerChanges() in fast/repaint/animation-after-layer-scroll.html
121         https://bugs.webkit.org/show_bug.cgi?id=160156
122
123         Reviewed by Michael Catanzaro.
124
125         So, we fixed an assertion in r203663, but now is hitting the next one. As explained in bug #160142, flush
126         compositing state can be triggered in tests by RenderLayerCompositor::layerTreeAsText(), without the coordinator
127         even noticing it, so the assert can be just removed.
128
129         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
130         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): Remove incorrect assert.
131
132 2016-07-25  Zalan Bujtas  <zalan@apple.com>
133
134         EllipsisBox ctor's isVertical parameter should read isHorizontal.
135         https://bugs.webkit.org/show_bug.cgi?id=160153
136
137         Reviewed by Andreas Kling.
138
139         It indicates whether the ellipsis box is horizontal. (both the callsites
140         and the parent class use isHorizontal)
141
142         No change in functionality.
143
144         * rendering/EllipsisBox.cpp:
145         (WebCore::EllipsisBox::EllipsisBox):
146         * rendering/EllipsisBox.h:
147
148 2016-07-25  Sergio Villar Senin  <svillar@igalia.com>
149
150         [css-grid] Implement repeat(auto-fit)
151         https://bugs.webkit.org/show_bug.cgi?id=159771
152
153         Reviewed by Darin Adler.
154
155         The auto-fit keyword works exactly as the already implemented auto-fill except that all
156         empty tracks collapse (became 0px). Absolutely positioned items do not participate on the
157         layout of the grid so they are not considered (a grid with only absolutely positioned items
158         is considered an empty grid).
159
160         Whenever a track collapses the gutters on either side do also collapse. When a collapsed
161         track's gutters collapse, they coincide exactly. If one side of a collapsed track does not
162         have a gutter then collapsing its gutters results in no gutter on either "side" of the
163         collapsed track.
164
165         In practice this means that is not possible to know the gap between 2 consecutive auto
166         repeat tracks without examining some others whenever there are collapsed tracks.
167
168         Uncommented the auto-fit cases from Mozilla tests. They have to be adapted as the reftest
169         machinery requires all the content to be rendered in the original 800x600 viewport.
170
171         Tests: fast/css-grid-layout/grid-auto-fit-columns.html
172         fast/css-grid-layout/grid-auto-fit-rows.html
173         fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005-part-1.html
174         fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005-part-2.html
175
176         * css/CSSComputedStyleDeclaration.cpp:
177         (WebCore::valueForGridTrackList): Use the newly added trackSizesForComputedStyle().
178         * rendering/RenderGrid.cpp:
179         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
180         (WebCore::RenderGrid::computeTrackSizesForDirection):
181         (WebCore::RenderGrid::isEmptyAutoRepeatTrack):
182         (WebCore::RenderGrid::gridGapForDirection): Returns the gap directly from the style.
183         (WebCore::RenderGrid::guttersSize): Computes the gap between a startLine and an
184         endLine. This method may need to inspect some other surrounding tracks to compute the gap.
185         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
186         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
187         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
188         (WebCore::RenderGrid::gridTrackSize):
189         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
190         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
191         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat): Returns a Vector with the auto
192         repeat tracks that are going to be collapsed because they're empty.
193         (WebCore::RenderGrid::placeItemsOnGrid):
194         (WebCore::RenderGrid::trackSizesForComputedStyle): Used by ComputedStyle logic to print the
195         size of tracks. Added in order to hide the actual contents of m_columnPositions and
196         m_rowPositions to the outter world.
197         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
198         (WebCore::RenderGrid::gridAreaBreadthForChild):
199         (WebCore::RenderGrid::populateGridPositionsForDirection): Added some extra code to compute
200         gaps as they cannot be directly added between tracks in case of having collapsed tracks.
201         (WebCore::RenderGrid::columnAxisOffsetForChild):
202         (WebCore::RenderGrid::rowAxisOffsetForChild):
203         (WebCore::RenderGrid::offsetBetweenTracks): Deleted.
204         * rendering/RenderGrid.h: Made some API private. Added new required methods/attributes.
205
206         * css/CSSComputedStyleDeclaration.cpp:
207         (WebCore::valueForGridTrackList):
208         * rendering/RenderGrid.cpp:
209         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
210         (WebCore::RenderGrid::computeTrackSizesForDirection):
211         (WebCore::RenderGrid::hasAutoRepeatEmptyTracks):
212         (WebCore::RenderGrid::isEmptyAutoRepeatTrack):
213         (WebCore::RenderGrid::gridGapForDirection):
214         (WebCore::RenderGrid::guttersSize):
215         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
216         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
217         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
218         (WebCore::RenderGrid::gridTrackSize):
219         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
220         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
221         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
222         (WebCore::RenderGrid::placeItemsOnGrid):
223         (WebCore::RenderGrid::trackSizesForComputedStyle):
224         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
225         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
226         (WebCore::RenderGrid::gridAreaBreadthForChild):
227         (WebCore::RenderGrid::populateGridPositionsForDirection):
228         (WebCore::RenderGrid::columnAxisOffsetForChild):
229         (WebCore::RenderGrid::rowAxisOffsetForChild):
230         (WebCore::RenderGrid::offsetBetweenTracks): Deleted.
231         * rendering/RenderGrid.h:
232
233 2016-07-24  Frederic Wang  <fwang@igalia.com>
234
235         Move parsing of display, displaystyle and mathvariant attributes into MathML element classes
236         https://bugs.webkit.org/show_bug.cgi?id=159623
237
238         Reviewed by Brent Fulgham.
239
240         No new tests, already covered by existing tests.
241
242         * mathml/MathMLElement.cpp:
243         (WebCore::MathMLElement::parseMathVariantAttribute): Move helper function to parse the
244         mathvariant attribute.
245         (WebCore::MathMLElement::getSpecifiedDisplayStyle): Helper function to set the displaystyle
246         value from the attribute specified on the MathML element.
247         (WebCore::MathMLElement::getSpecifiedMathVariant): Helper function to set the mathvariant
248         value from the attribute specified on the MathML element.
249         * mathml/MathMLElement.h: Move the enum for mathvariant values and declare new members.
250         (WebCore::MathMLElement::acceptsDisplayStyleAttribute): Indicate whether the element accepts
251         displaystyle attribute (false for most of them).
252         (WebCore::MathMLElement::acceptsMathVariantAttribute): Indicate whether the element accepts
253         mathvariant attribute (false for most of them).
254         * mathml/MathMLInlineContainerElement.cpp:
255         (WebCore::MathMLInlineContainerElement::acceptsDisplayStyleAttribute): Add mstyle and mtable
256         to the list of elements accepting the displaystyle attribute.
257         (WebCore::MathMLInlineContainerElement::acceptsMathVariantAttribute): Add mstyle to the list
258         of elements accepting the mathvariant attribute.
259         (WebCore::MathMLInlineContainerElement::parseAttribute): Mark displaystyle and mathvariant
260         dirty if necessary. Also use the new accepts*Attribute function.
261         * mathml/MathMLInlineContainerElement.h: Declare overridden accepts*Attribute members.
262         * mathml/MathMLMathElement.cpp:
263         (WebCore::MathMLMathElement::getSpecifiedDisplayStyle): Override acceptsDisplayStyleAttribute
264         so that the display attribute is also used to set the default value if the displaystyle
265         attribute is absent.
266         (WebCore::MathMLMathElement::parseAttribute): Mark displaystyle and mathvariant dirty if
267         necessary. We directly MathMLElement::parseAttribute to avoid duplicate work.
268         * mathml/MathMLMathElement.h: Add the math tag to the list of elements accepting the
269         displaystyle and mathvariant attributes. Declare overridden getSpecifiedDisplayStyle.
270         * mathml/MathMLTextElement.cpp:
271         (WebCore::MathMLTextElement::parseAttribute): Mark mathvariant as dirty.
272         * mathml/MathMLTextElement.h: Add token elements to the list of elements accepting the
273         mathvariant attribute.
274         * rendering/mathml/MathMLStyle.cpp:
275         (WebCore::MathMLStyle::updateStyleIfNeeded): Use the new MathMLElement::MathVariant enum.
276         (WebCore::MathMLStyle::resolveMathMLStyle):  We no longer parse the display value to
277         initialize the default value on the math tag, because this is handled in
278         getSpecifiedDisplayStyle. In general, we also just call getSpecifiedDisplayStyle and
279         getSpecifiedMathVariant on the MathML elements instead of parsing the displaystyle and
280         mathvariant attributes here.
281         (WebCore::MathMLStyle::parseMathVariant): Deleted. This is moved into MathMLElement.
282         * rendering/mathml/MathMLStyle.h: Use the new MathMLElement::MathVariant enum.
283         * rendering/mathml/RenderMathMLToken.cpp: Ditto.
284         (WebCore::mathVariant): Ditto.
285         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
286
287 2016-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
288
289         Unreviewed. Remove unneeded header includes from CoordinatedGraphicsLayer.
290
291         Not only thjey are not needed, they are a layer violation, CoordinatedGraphicsLayer shouldn't know anything
292         about Page, Frame and FrameView.
293
294         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
295         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
296
297 2016-07-24  Youenn Fablet  <youenn@apple.com>
298
299         [Fetch API] Request should be created with any HeadersInit data
300         https://bugs.webkit.org/show_bug.cgi?id=159672
301
302         Reviewed by Sam Weinig.
303
304         Made Request use JSBuiltinConstructor.
305         This allows initializing newly created Request with a JS built-in function, initializeFetchRequest.
306         initializeFetchRequest can call @fillFetchHeaders internal built-in to handle any HeadersInit data.
307         Future effort should be made to migrate more initialization code in initializeFetchRequest.
308
309         Made window and worker fetch function as a JS built-in.
310         This becomes more handy as these new functions can construct the Request object.
311         They can then call a single private function that takes a Request object as input.
312         Updated DOMWindowFetch and WorkerGlobalScopeFetch code accordingly.
313
314         To enable this, the binding generator is updated to support runtime-enabled JS built-in functions and
315         private functions atttached to global objects.
316
317         Covered by existing and modified tests.
318         Binding generator test covered by updated binding tests.
319
320         * CMakeLists.txt: Adding DOMWindowFetch.js, FetchRequest.js and WorkerGlobalScopeFetch.js built-in files.
321         * DerivedSources.make: Ditto.
322         * Modules/fetch/DOMWindowFetch.cpp: Removed overloaded fetch and updated according new signature.
323         (WebCore::DOMWindowFetch::fetch):
324         * Modules/fetch/DOMWindowFetch.h: Ditto.
325         * Modules/fetch/DOMWindowFetch.idl: Making fetch a JS built-in and adding a @fetchRequest private function.
326         * Modules/fetch/DOMWindowFetch.js: Added.
327         (fetch):
328         * Modules/fetch/FetchHeaders.h:
329         (WebCore::FetchHeaders::setGuard): Used by FetchRequest when initializing headers.
330         * Modules/fetch/FetchRequest.cpp: 
331         (WebCore::buildHeaders): Removed as implemented in JS.
332         (WebCore::FetchRequest::initializeOptions): Added to handle most of the dictionary initialization.
333         (WebCore::FetchRequest::initializeWith): Method called from built-in constructor function.
334         (WebCore::FetchRequest::setBody): Corresponding to @setBody private method.
335         (WebCore::buildBody): Deleted.
336         * Modules/fetch/FetchRequest.h:
337         * Modules/fetch/FetchRequest.idl:
338         * Modules/fetch/FetchRequest.js: Added.
339         (initializeFetchRequest): Implements fetch Request(input, init) constructor.
340         * Modules/fetch/FetchResponse.cpp:
341         (WebCore::FetchResponse::fetch): Removed the construction of FetchRequest in fetch method since it is done by JS built-in code.
342         * Modules/fetch/FetchResponse.h:
343         * Modules/fetch/WorkerGlobalScopeFetch.cpp: Removed overloaded fetch and updated according new signature.
344         (WebCore::WorkerGlobalScopeFetch::fetch):
345         * Modules/fetch/WorkerGlobalScopeFetch.h: Ditto.
346         * Modules/fetch/WorkerGlobalScopeFetch.idl: Making fetch a JS built-in and adding a @fetchRequest private function.
347         * Modules/fetch/WorkerGlobalScopeFetch.js: Added.
348         (fetch):
349         * bindings/js/WebCoreBuiltinNames.h: Adding fetchRequest, setBody and Request private identifiers.
350         * bindings/scripts/CodeGenerator.pm:
351         (WK_lcfirst): Replacing dOM by dom.
352         * bindings/scripts/CodeGeneratorJS.pm:
353         (GenerateImplementation): Adding support for runtime-enabled built-in methods and private methods.
354         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
355         (WebCore::JSTestGlobalObject::finishCreation):
356         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
357         * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm:
358         (-[DOMTestGlobalObject testJSBuiltinFunction]):
359         * bindings/scripts/test/TestGlobalObject.idl: Adding tests for runtime-enabled global built-in methods and private methods.
360
361 2016-07-24  Nan Wang  <n_wang@apple.com>
362
363         AX: Video Controls: Volume cannot be adjusted using VO.
364         https://bugs.webkit.org/show_bug.cgi?id=160107
365
366         Reviewed by Dean Jackson.
367
368         The volume slider in video tag had 0.01 step which caused the screen reader adjusting it slowly.
369         Changed the step to 0.05 and added the aria-valuetext attribute to the slider, so that the value
370         is spoken in percentage. 
371
372         Test: accessibility/mac/video-volume-slider-accessibility.html
373
374         * Modules/mediacontrols/mediaControlsApple.js:
375         (Controller.prototype.createControls):
376         (Controller.prototype.handleVolumeSliderInput):
377         (Controller.prototype.updateVolume):
378
379 2016-07-24  David Kilzer  <ddkilzer@apple.com>
380
381         REGRESSION (r203106): Crash in WebCore::MathMLElement::parseMathMLLength()
382         <https://webkit.org/b/160111>
383         <rdar://problem/27506489>
384
385         Reviewed by Chris Dumez.
386
387         Test: mathml/mpadded-crash.html
388
389         * mathml/MathMLElement.cpp:
390         (WebCore::skipLeadingAndTrailingWhitespace): Change to take
391         StringView parameter instead of String to avoid creating a
392         temporary String that's released on return.
393
394 2016-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
395
396         [Coordinated Graphics] ASSERTION FAILED: !m_flushingLayers in fast/repaint/animation-after-layer-scroll.html
397         https://bugs.webkit.org/show_bug.cgi?id=160142
398
399         Reviewed by Michael Catanzaro.
400
401         This only happens in layout tests, because it happens when RenderLayerCompositor::layerTreeAsText() is
402         called. The thing is that CoordinatedGraphicsLayer::flushCompositingState() calls notifyFlushRequired() that
403         checks if the coordinator is flusing layers and if not it calls RenderLayerCompositor::notifyFlushRequired() and
404         returns early. This normally works because the coodinator is the one starting the layer flush, so that when
405         RenderLayerCompositor::flushPendingLayerChanges() is called the coordinator is always flusing layers. But
406         RenderLayerCompositor::layerTreeAsText() calls RenderLayerCompositor::flushPendingLayerChanges() directly, so at
407         that moment the coordinator is not flusing layers, what causes that
408         CoordinatedGraphicsLayer::flushCompositingState() ends up calling RenderLayerCompositor::notifyFlushRequired()
409         that schedules a new flush while flusing layers causing the
410         assertion. CoordinatedGraphicsLayer::flushCompositingState() is always called from
411         CompositingCoordinator::flushPendingLayerChanges() or RenderLayerCompositor::flushPendingLayerChanges() so we
412         never need to call RenderLayerCompositor::notifyFlushRequired() from there.
413
414         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
415         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): This is void now since the return value is not checked anywhere.
416         (WebCore::CoordinatedGraphicsLayer::flushCompositingState): Remove the call to notifyFlushRequired().
417         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
418
419 2016-07-24  Darin Adler  <darin@apple.com>
420
421         Adding a new WebCore JavaScript built-in source file does not trigger rebuild of WebCoreJSBuiltins*
422         https://bugs.webkit.org/show_bug.cgi?id=160115
423
424         Reviewed by Youenn Fablet.
425
426         * DerivedSources.make: Added a missing dependency so the rule that builds WebCore_BUILTINS_WRAPPERS
427         kicks in when the list of WebCore_BUILTINS_SOURCES is modified. Also added another missing dependency
428         so that changes to the JavaScript built-ins Python scripts will also trigger WebCore_BUILTINS_WRAPPERS.
429
430         * make-generated-sources.sh: Removed. Was unused.
431
432 2016-07-23  Zalan Bujtas  <zalan@apple.com>
433
434         Stop isEmpty() from leaking out of SVG.
435         https://bugs.webkit.org/show_bug.cgi?id=160121
436
437         Reviewed by Simon Fraser.
438
439         It's unclear what isEmpty() actually means and it doesn't bring any value to Render* classes.
440
441         No change in functionality.
442
443         * editing/CompositeEditCommand.cpp:
444         (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
445         * rendering/RenderElement.h:
446         * rendering/RenderListItem.cpp:
447         (WebCore::RenderListItem::isEmpty): Deleted.
448         * rendering/RenderListItem.h:
449         * rendering/RenderObject.h:
450         (WebCore::RenderObject::isEmpty): Deleted.
451         * rendering/RenderRubyRun.cpp:
452         (WebCore::RenderRubyRun::removeChild):
453         (WebCore::RenderRubyRun::isEmpty): Deleted.
454         * rendering/RenderRubyRun.h:
455         * rendering/mathml/RenderMathMLFenced.cpp:
456         (WebCore::RenderMathMLFenced::updateFromElement):
457         (WebCore::RenderMathMLFenced::addChild):
458         * rendering/mathml/RenderMathMLRoot.cpp:
459         (WebCore::RenderMathMLRoot::paint):
460         * rendering/svg/RenderSVGShape.h:
461
462 2016-07-23  Zalan Bujtas  <zalan@apple.com>
463
464         table*BorderAdjoiningCell and borderAdjoiningCell* should take reference instead of RenderTableCell*.
465         https://bugs.webkit.org/show_bug.cgi?id=160123
466
467         Reviewed by Simon Fraser.
468
469         No change in functionality.
470
471         * rendering/RenderTable.cpp:
472         (WebCore::RenderTable::tableStartBorderAdjoiningCell):
473         (WebCore::RenderTable::tableEndBorderAdjoiningCell):
474         * rendering/RenderTable.h:
475         * rendering/RenderTableCell.cpp:
476         (WebCore::RenderTableCell::computeCollapsedStartBorder):
477         (WebCore::RenderTableCell::computeCollapsedEndBorder):
478         * rendering/RenderTableCell.h:
479         (WebCore::RenderTableCell::borderAdjoiningCellBefore):
480         (WebCore::RenderTableCell::borderAdjoiningCellAfter):
481         * rendering/RenderTableCol.cpp:
482         (WebCore::RenderTableCol::borderAdjoiningCellStartBorder):
483         (WebCore::RenderTableCol::borderAdjoiningCellEndBorder):
484         (WebCore::RenderTableCol::borderAdjoiningCellBefore):
485         (WebCore::RenderTableCol::borderAdjoiningCellAfter):
486         * rendering/RenderTableCol.h:
487         * rendering/RenderTableRow.cpp:
488         (WebCore::RenderTableRow::borderAdjoiningStartCell):
489         (WebCore::RenderTableRow::borderAdjoiningEndCell):
490         * rendering/RenderTableRow.h:
491         * rendering/RenderTableSection.cpp:
492         (WebCore::RenderTableSection::borderAdjoiningStartCell):
493         (WebCore::RenderTableSection::borderAdjoiningEndCell):
494         * rendering/RenderTableSection.h:
495
496 2016-07-23  Zalan Bujtas  <zalan@apple.com>
497
498         Remove unused enum and stale comment from RenderObject.
499         https://bugs.webkit.org/show_bug.cgi?id=160122
500
501         Reviewed by Simon Fraser.
502
503         No change in functionality.
504
505         * rendering/RenderBox.h:
506
507 2016-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
508
509         [Coordinated Graphics] Lots of flaky tests
510         https://bugs.webkit.org/show_bug.cgi?id=160118
511
512         Reviewed by Michael Catanzaro.
513
514         Since the GTK+ ported to threaded compositor (coordinated graphics) there are a lot of flaky tests in the
515         bots. In manu of the cases the diff shows a different size in the FrameView layer.
516
517         This happens for tests run in the same WTR after fast/fixed-layout/fixed-layout.html. This is what happens:
518
519          1.- Test fast/fixed-layout/fixed-layout.html runs and sets fixed layout to true and fixed layout size to 400x400
520          2.- When it finishes TestController::resetStateToConsistentValues() is called.
521          3.- Blank URL is loaded after state has been updated
522          4.- Then Reset message is handled in the web process and Internals::resetToConsistentState() resets the fixed
523              layout state and size.
524          5.- onresize happens and the handler set in fast/fixed-layout/fixed-layout.html is invoked setting the fixed
525              layout to true and size to 400x400 again.
526          6.- about_blank is then loaded with the fixed layout enabled, as well as other tests after this one.
527
528         In addition to this, coordinated graphics uses a fixedVisibleContentRect in ScrollView that is never reset.
529
530         * platform/ScrollView.cpp:
531         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea): Only use m_fixedVisibleContentRect when
532         fixed layout is enabled.
533         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize): Ditto.
534         (WebCore::ScrollView::visibleContentRectInternal): Ditto.
535         * testing/Internals.cpp:
536         (WebCore::Internals::resetToConsistentState): Reset also the m_fixedVisibleContentRect.
537
538 2016-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
539
540         [Coordinated Graphics] Test imported/blink/svg/custom/svg-image-layers-crash.html crashes
541         https://bugs.webkit.org/show_bug.cgi?id=160078
542
543         Reviewed by Michael Catanzaro.
544
545         This is a merge of Blink r155373.
546         https://chromiumcodereview.appspot.com/20789004
547
548         Disable accelerated compositing for SVGImage content layers. SVGImageChromeClient does not support it.
549
550         Fixes imported/blink/svg/custom/svg-image-layers-crash.html.
551
552         * svg/graphics/SVGImage.cpp:
553         (WebCore::SVGImage::dataChanged):
554
555 2016-07-23  Commit Queue  <commit-queue@webkit.org>
556
557         Unreviewed, rolling out r203641.
558         https://bugs.webkit.org/show_bug.cgi?id=160116
559
560         It broke make-based builds (Requested by youenn on #webkit).
561
562         Reverted changeset:
563
564         "[Fetch API] Request should be created with any HeadersInit
565         data"
566         https://bugs.webkit.org/show_bug.cgi?id=159672
567         http://trac.webkit.org/changeset/203641
568
569 2016-07-23  Youenn Fablet  <youenn@apple.com>
570
571         [Fetch API] Request should be created with any HeadersInit data
572         https://bugs.webkit.org/show_bug.cgi?id=159672
573
574         Reviewed by Sam Weinig.
575
576         Made Request use JSBuiltinConstructor.
577         This allows initializing newly created Request with a JS built-in function, initializeFetchRequest.
578         initializeFetchRequest can call @fillFetchHeaders internal built-in to handle any HeadersInit data.
579         Future effort should be made to migrate more initialization code in initializeFetchRequest.
580
581         Made window and worker fetch function as a JS built-in.
582         This becomes more handy as these new functions can construct the Request object.
583         They can then call a single private function that takes a Request object as input.
584         Updated DOMWindowFetch and WorkerGlobalScopeFetch code accordingly.
585
586         To enable this, the binding generator is updated to support runtime-enabled JS built-in functions and
587         private functions atttached to global objects.
588
589         Covered by existing and modified tests.
590         Binding generator test covered by updated binding tests.
591
592         * CMakeLists.txt: Adding DOMWindowFetch.js, FetchRequest.js and WorkerGlobalScopeFetch.js built-in files.
593         * DerivedSources.make: Ditto.
594         * Modules/fetch/DOMWindowFetch.cpp: Removed overloaded fetch and updated according new signature.
595         (WebCore::DOMWindowFetch::fetch):
596         * Modules/fetch/DOMWindowFetch.h: Ditto.
597         * Modules/fetch/DOMWindowFetch.idl: Making fetch a JS built-in and adding a @fetchRequest private function.
598         * Modules/fetch/DOMWindowFetch.js: Added.
599         (fetch):
600         * Modules/fetch/FetchHeaders.h:
601         (WebCore::FetchHeaders::setGuard): Used by FetchRequest when initializing headers.
602         * Modules/fetch/FetchRequest.cpp: 
603         (WebCore::buildHeaders): Removed as implemented in JS.
604         (WebCore::FetchRequest::initializeOptions): Added to handle most of the dictionary initialization.
605         (WebCore::FetchRequest::initializeWith): Method called from built-in constructor function.
606         (WebCore::FetchRequest::setBody): Corresponding to @setBody private method.
607         (WebCore::buildBody): Deleted.
608         * Modules/fetch/FetchRequest.h:
609         * Modules/fetch/FetchRequest.idl:
610         * Modules/fetch/FetchRequest.js: Added.
611         (initializeFetchRequest): Implements fetch Request(input, init) constructor.
612         * Modules/fetch/FetchResponse.cpp:
613         (WebCore::FetchResponse::fetch): Removed the construction of FetchRequest in fetch method since it is done by JS built-in code.
614         * Modules/fetch/FetchResponse.h:
615         * Modules/fetch/WorkerGlobalScopeFetch.cpp: Removed overloaded fetch and updated according new signature.
616         (WebCore::WorkerGlobalScopeFetch::fetch):
617         * Modules/fetch/WorkerGlobalScopeFetch.h: Ditto.
618         * Modules/fetch/WorkerGlobalScopeFetch.idl: Making fetch a JS built-in and adding a @fetchRequest private function.
619         * Modules/fetch/WorkerGlobalScopeFetch.js: Added.
620         (fetch):
621         * bindings/js/WebCoreBuiltinNames.h: Adding fetchRequest, setBody and Request private identifiers.
622         * bindings/scripts/CodeGenerator.pm:
623         (WK_lcfirst): Replacing dOM by dom.
624         * bindings/scripts/CodeGeneratorJS.pm:
625         (GenerateImplementation): Adding support for runtime-enabled built-in methods and private methods.
626         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
627         (WebCore::JSTestGlobalObject::finishCreation):
628         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
629         * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm:
630         (-[DOMTestGlobalObject testJSBuiltinFunction]):
631         * bindings/scripts/test/TestGlobalObject.idl: Adding tests for runtime-enabled global built-in methods and private methods.
632
633 2016-07-23  Frederic Wang  <fwang@igalia.com>
634
635         Reset font-style on the <math> element
636         https://bugs.webkit.org/show_bug.cgi?id=160074
637
638         Reviewed by Darin Adler.
639
640         Mathematical formulas with italic font-style render poorly (slanted operators, mathvariant
641         italic etc). We align on Gecko and make the user agent stylesheet reset the font-style to
642         'normal' by default. This addresses the concrete use case of formula inside theorem or
643         proposition statements, which are often written in italic.
644
645         Test: mathml/presentation/math-font-style.html
646
647         * css/mathml.css:
648         (math): Reset the font-style to normal.
649
650 2016-07-23  Frederic Wang  <fwang@igalia.com>
651
652         [MathML] PaintInfo state is not properly restored after applyTransform.
653         https://bugs.webkit.org/show_bug.cgi?id=160077
654
655         Reviewed by Simon Fraser.
656
657         PaintInfo::applyTransform modifies PaintInfo::rect and the original state is not properly
658         restored by GraphicsContextStateSaver. To avoid some weird rendering bugs in MathOperator
659         and RenderMathMLMenclose, we follow what is done in SVG renderers and make a copy of the
660         original PaintInfo before applying the transform.
661
662         Test: mathml/presentation/bug160077.html
663
664         * rendering/mathml/MathOperator.cpp:
665         (WebCore::MathOperator::paint):
666         * rendering/mathml/RenderMathMLMenclose.cpp:
667         (WebCore::RenderMathMLMenclose::paint):
668
669 2016-07-23  Youenn Fablet  <youenn@apple.com>
670
671         [Fetch API] Fetch response stream should enqueue Uint8Array
672         https://bugs.webkit.org/show_bug.cgi?id=160083
673
674         Reviewed by Sam Weinig.
675
676         Covered by updated tests.
677
678         Before enqueuing, ReadableStreamController::enqueue will convert ArrayBuffer as Uint8Array.
679         It also returns a boolean whether the operation is successful or not.
680
681         If returned value is false, calling code will stop loading or if everything is loaded it will refrain from closing the stream.
682         The enqueuing should be succesful except in OutOfMemory cases. This case is not yet handled in test cases.
683
684         Updated the code to remove templated enqueuing as Fetch has no use of it.
685
686         * Modules/fetch/FetchBody.cpp:
687         (WebCore::FetchBody::consumeAsStream): Do not close the stream if enqueuing failed.
688         * Modules/fetch/FetchBodyOwner.cpp:
689         (WebCore::FetchBodyOwner::blobChunk): Stop blob loading if enqueuing failed.
690         * Modules/fetch/FetchResponse.cpp:
691         (WebCore::FetchResponse::BodyLoader::didReceiveData): Stop resource loading if enqueuing failed.
692         (WebCore::FetchResponse::consumeBodyAsStream): Ditto.
693         * Modules/fetch/FetchResponseSource.h:
694         * bindings/js/ReadableStreamController.h:
695         (WebCore::ReadableStreamController::enqueue):
696         (WebCore::ReadableStreamController::enqueue<RefPtr<JSC::ArrayBuffer>>): Deleted.
697
698 2016-07-22  Youenn Fablet  <youenn@apple.com>
699
700         Use a private property to implement FetchResponse.body getter
701         https://bugs.webkit.org/show_bug.cgi?id=159808
702
703         Reviewed by Sam Weinig.
704
705         Covered by existing test sets.
706
707         Previously, body was handled as a CachedAttribute.
708         Using a private property will allow direct use of this property from JS built-ins which will allow easier
709         handling of ReadableStream cloning in Response.clone.
710         Also, this allows removing some binding custom code.
711
712         Updated redirect and error static methods to take NewObject keyword, as this removes a search into cached wrappers.
713         Ditto for createReadableStreamSource.
714
715         * CMakeLists.txt: Removing JSFetchResponseCustom.cpp.
716         * Modules/fetch/FetchResponse.idl: Adding createReadableStreamSource and isDisturbed private functions.
717         Making body getter a JSBuiltin.
718         * Modules/fetch/FetchResponse.js:
719         (body): Adding getter which will call createReadableStreamSource if needed.
720         * WebCore.xcodeproj/project.pbxproj: Removing JSFetchResponseCustom.cpp.
721         * bindings/js/JSFetchResponseCustom.cpp: Removed.
722         * bindings/js/ReadableStreamController.cpp:
723         (WebCore::createReadableStream): Deleted.
724         (WebCore::getReadableStreamReader): Deleted.
725         * bindings/js/ReadableStreamController.h: Removing unneeded ReadableStream helper routine now that they can be
726         handled within JS built-in code.
727         * bindings/js/WebCoreBuiltinNames.h: Adding @createReadableStreamSource, @isDisturbed  and @Response identifiers.
728
729 2016-07-22  Zalan Bujtas  <zalan@apple.com>
730
731         Handle cases when IOSurface initialization fails.
732         https://bugs.webkit.org/show_bug.cgi?id=160006
733         <rdar://problem/27495102>
734
735         Reviewed by Tim Horton and Simon Fraser.
736
737         This is an additional fix to r203514 to check if IOSurface initialization was successful.
738
739         Unable to test.
740
741         * platform/graphics/cg/ImageBufferCG.cpp:
742         (WebCore::ImageBuffer::ImageBuffer):
743         * platform/graphics/cocoa/IOSurface.h: Merge 2 c'tors.
744         * platform/graphics/cocoa/IOSurface.mm: Remove redundant IOSurface::create() code.  
745         (WebCore::IOSurface::create):
746         (WebCore::IOSurface::createFromImage):
747         (WebCore::IOSurface::IOSurface):
748         (WebCore::IOSurface::convertToFormat):
749
750 2016-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
751
752         Media controls should be displayed for media in media documents
753         https://bugs.webkit.org/show_bug.cgi?id=160104
754         <rdar://problem/27438936>
755
756         Reviewed by Myles C. Maxfield.
757
758         Make videos that would otherwise not have been large enough or have the right
759         aspect ratio cause media controls to appear. This is because media elements in
760         a media document are implied to be main content.
761
762         Added a new API test.
763
764         * html/MediaElementSession.cpp:
765         (WebCore::MediaElementSession::canControlControlsManager):
766
767 2016-07-22  Myles C. Maxfield  <mmaxfield@apple.com>
768
769         All dancers with bunny ears are female
770         https://bugs.webkit.org/show_bug.cgi?id=160102
771         <rdar://problem/27453479>
772
773         Reviewed by Simon Fraser.
774
775         In r203330 I added support for new emoji group candidates. I accidentally
776         missed one of the new emoji code points.
777
778         Tests: editing/deleting/delete-emoji.html:
779                fast/text/emoji-gender-2-9.html:
780                fast/text/emoji-gender-9.html:
781                fast/text/emoji-gender-fe0f-9.html:
782
783         * platform/text/CharacterProperties.h:
784         (WebCore::isEmojiGroupCandidate):
785
786 2016-07-22  Chris Dumez  <cdumez@apple.com>
787
788         Parameter to HTMLCollection.item() / namedItem() should be mandatory
789         https://bugs.webkit.org/show_bug.cgi?id=160099
790
791         Reviewed by Sam Weinig.
792
793         Parameter to HTMLCollection.item() / namedItem() should be mandatory:
794         - https://dom.spec.whatwg.org/#interface-htmlcollection
795         - https://html.spec.whatwg.org/multipage/infrastructure.html#htmlformcontrolscollection
796         - https://html.spec.whatwg.org/multipage/infrastructure.html#the-htmloptionscollection-interface
797
798         Firefox and Chrome agree with the specification.
799
800         No new tests, rebaselined existing tests.
801
802         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
803         (WebCore::JSHTMLFormControlsCollection::namedItem):
804         * html/HTMLCollection.idl:
805         * html/HTMLFormControlsCollection.idl:
806         * html/HTMLOptionsCollection.idl:
807
808 2016-07-22  Chris Dumez  <cdumez@apple.com>
809
810         First parameter to Window.getComputedStyle() should be mandatory and non-nullable
811         https://bugs.webkit.org/show_bug.cgi?id=160097
812
813         Reviewed by Ryosuke Niwa.
814
815         First parameter to Window.getComputedStyle() should be mandatory and
816         non-nullable:
817         - https://drafts.csswg.org/cssom/#extensions-to-the-window-interface
818
819         Firefox and Chrome agree with the specification.
820
821         Test: fast/dom/Window/getComputedStyle-missing-parameter.html
822
823         * css/CSSComputedStyleDeclaration.cpp:
824         (WebCore::ComputedStyleExtractor::ComputedStyleExtractor):
825         (WebCore::CSSComputedStyleDeclaration::CSSComputedStyleDeclaration):
826         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
827         (WebCore::CSSComputedStyleDeclaration::copyProperties):
828         (WebCore::CSSComputedStyleDeclaration::length):
829         (WebCore::CSSComputedStyleDeclaration::item):
830         (WebCore::CSSComputedStyleDeclaration::getPropertyValue):
831         * css/CSSComputedStyleDeclaration.h:
832         * dom/Document.idl:
833         * inspector/InspectorCSSAgent.cpp:
834         (WebCore::InspectorCSSAgent::getComputedStyleForNode):
835         * page/DOMWindow.cpp:
836         (WebCore::DOMWindow::getComputedStyle):
837         * page/DOMWindow.h:
838         * page/DOMWindow.idl:
839         * testing/Internals.cpp:
840         (WebCore::Internals::computedStyleIncludingVisitedInfo):
841         * testing/Internals.h:
842         * testing/Internals.idl:
843
844 2016-07-22  Brady Eidson  <beidson@apple.com>
845
846         Removing IndexedDatabases that have stored blobs doesn't remove the blob files.
847         https://bugs.webkit.org/show_bug.cgi?id=160089
848
849         Reviewed by Darin Adler.
850
851         Tested by API test IndexedDB.StoreBlobThenDelete.
852
853         Blob filenames exist in the IDB directory with the name "[0-9]+.blob".
854         
855         That is, one or more digits, followed by ".blob".
856         
857         So when we delete an IndexedDB.sqlite3 and related files, we should delete those blob files as well.
858         
859         * Modules/indexeddb/server/IDBServer.cpp:
860         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
861
862 2016-07-22  Chris Dumez  <cdumez@apple.com>
863
864         Fix default parameter values for window.alert() / prompt() / confirm()
865         https://bugs.webkit.org/show_bug.cgi?id=160085
866
867         Reviewed by Ryosuke Niwa.
868
869         Fix default parameter values for window.alert() / prompt() / confirm() to
870         match the specification:
871         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
872
873         They should default to the empty string, not the string "undefined".
874
875         Firefox and chrome agree with the specification.
876
877         No new tests, updated existing test.
878
879         * page/DOMWindow.h:
880         * page/DOMWindow.idl:
881
882 2016-07-22  Daniel Bates  <dabates@apple.com>
883
884         CSP: object-src and plugin-types directives are not respected for plugin replacements
885         https://bugs.webkit.org/show_bug.cgi?id=159761
886         <rdar://problem/27365724>
887
888         Reviewed by Brent Fulgham.
889
890         Apply the Content Security Policy (CSP) object-src and plugin-types directives to content that will
891         load with a plugin replacement.
892
893         Tests: security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html
894                security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html
895                security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html
896                security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html
897                security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html
898                security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html
899                security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html
900                security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html
901
902         * html/HTMLPlugInImageElement.cpp:
903         (WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent): Added.
904         (WebCore::HTMLPlugInImageElement::requestObject): Only request loading plugin content if we
905         are allowed to load such content.
906         * html/HTMLPlugInImageElement.h:
907         * loader/SubframeLoader.cpp:
908         (WebCore::SubframeLoader::pluginIsLoadable): Removed code to check CSP as we will check CSP
909         earlier in HTMLPlugInImageElement::requestObject().
910         (WebCore::SubframeLoader::requestPlugin): Ditto.
911         (WebCore::SubframeLoader::isPluginContentAllowedByContentSecurityPolicy): Deleted; moved implementation
912         to HTMLPlugInImageElement::allowedToLoadPluginContent().
913         (WebCore::SubframeLoader::requestObject): Deleted.
914         * loader/SubframeLoader.h:
915         * page/csp/ContentSecurityPolicy.cpp:
916         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded): Changed signature from a non-const
917         function to a const function since these functions do not modify |this|.
918         * page/csp/ContentSecurityPolicy.h: 
919
920 2016-07-22  Chris Dumez  <cdumez@apple.com>
921
922         Parameters to Node.replaceChild() / insertBefore() should be mandatory
923         https://bugs.webkit.org/show_bug.cgi?id=160091
924
925         Reviewed by Darin Adler.
926
927         Parameters to Node.replaceChild() / insertBefore() should be mandatory:
928         - https://dom.spec.whatwg.org/#node
929
930         The compatibility risk should be low since Firefox and Chrome both agree
931         with the specification and because it does not make much sense to omit
932         parameters when using this API.
933
934         No new tests, rebaselined existing tests.
935
936         * bindings/js/JSNodeCustom.cpp:
937         (WebCore::JSNode::insertBefore):
938         (WebCore::JSNode::replaceChild):
939
940 2016-07-22  Chris Dumez  <cdumez@apple.com>
941
942         Parameter to Node.contains() should be mandatory
943         https://bugs.webkit.org/show_bug.cgi?id=160084
944
945         Reviewed by Darin Adler.
946
947         Parameter to Node.contains() should be mandatory as per the
948         specification:
949         - https://dom.spec.whatwg.org/#node
950
951         The compatibility risk should be low because both Firefox and Chrome
952         both agree with the specification. Also, it does not make much sense
953         to call this API without parameter.
954
955         No new tests, rebaselined existing tests.
956
957         * dom/Node.idl:
958
959 2016-07-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
960
961         [iOS] REGRESSION(203378): PDFDocumentImage::updateCachedImageIfNeeded() uses the unscaled size when deciding whether to cache the PDF image
962         https://bugs.webkit.org/show_bug.cgi?id=159933
963
964         Reviewed by Simon Fraser.
965
966         We need to use the scaled size when deciding whether to cache the PDF image
967         or not. This is because ImageBuffer takes the display resolution into account
968         which gives higher resolution for the image when zooming.
969
970         * platform/graphics/cg/PDFDocumentImage.cpp:
971         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
972
973 2016-07-22  Chris Dumez  <cdumez@apple.com>
974
975         First parameter to getElementById() should be mandatory
976         https://bugs.webkit.org/show_bug.cgi?id=160087
977
978         Reviewed by Darin Adler.
979
980         First parameter to getElementById() should be mandatory:
981         - https://dom.spec.whatwg.org/#nonelementparentnode
982         - https://www.w3.org/TR/SVG/struct.html#InterfaceSVGSVGElement
983
984         Both Firefox and Chrome agree with the specification.
985
986         Test: svg/dom/SVGSVGElement-getElementById.html
987
988         * dom/NonElementParentNode.idl:
989         * svg/SVGSVGElement.idl:
990
991 2016-07-22  Chris Dumez  <cdumez@apple.com>
992
993         Parameter to Node.lookupPrefix() / lookupNamespaceURI() / isDefaultNamespace() should be mandatory
994         https://bugs.webkit.org/show_bug.cgi?id=160086
995
996         Reviewed by Darin Adler.
997
998         Parameter to Node.lookupPrefix() / lookupNamespaceURI() / isDefaultNamespace()
999         should be mandatory:
1000         - https://dom.spec.whatwg.org/#node
1001
1002         Firefox and Chrome both agree with the specification.
1003
1004         No new tests, rebaselined existing tests.
1005
1006         * dom/Node.idl:
1007
1008 2016-07-22  Chris Dumez  <cdumez@apple.com>
1009
1010         Parameter to Node.compareDocumentPosition() should be mandatory and non-nullable
1011         https://bugs.webkit.org/show_bug.cgi?id=160071
1012
1013         Reviewed by Ryosuke Niwa.
1014
1015         
1016         Parameter to Node.compareDocumentPosition() should be mandatory and
1017         non-nullable:
1018         - https://dom.spec.whatwg.org/#interface-node
1019
1020         Firefox and Chrome agree with the specification so the compatibility
1021         risk should be low. Also, it does not make much sense to call this
1022         operation without parameter.
1023
1024         No new tests, rebaselined existing tests.
1025
1026         * accessibility/AccessibilityObject.cpp:
1027         (WebCore::rangeClosestToRange):
1028         * dom/AuthorStyleSheets.cpp:
1029         (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode):
1030         * dom/Node.cpp:
1031         (WebCore::compareDetachedElementsPosition):
1032         (WebCore::Node::compareDocumentPosition):
1033         * dom/Node.h:
1034         * dom/Node.idl:
1035         * dom/Position.h:
1036         (WebCore::operator<):
1037         * html/HTMLFormElement.cpp:
1038         (WebCore::HTMLFormElement::formElementIndexWithFormAttribute):
1039         (WebCore::HTMLFormElement::formElementIndex):
1040         * rendering/RenderNamedFlowThread.cpp:
1041         (WebCore::RenderNamedFlowThread::nextRendererForElement):
1042         (WebCore::compareRenderNamedFlowFragments):
1043         (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
1044
1045 2016-07-22  Konstantin Tokarev  <annulen@yandex.ru>
1046
1047         [cmake] Removed obsolete plugins/win directory
1048         https://bugs.webkit.org/show_bug.cgi?id=160081
1049
1050         Reviewed by Per Arne Vollan.
1051
1052         It was removed in r178219.
1053
1054         No new tests needed.
1055
1056         * PlatformWin.cmake:
1057
1058 2016-07-22  Youenn Fablet  <youenn@apple.com>
1059
1060         run-builtins-generator-tests should be able to test WebCore builtins wrapper with more than one file
1061         https://bugs.webkit.org/show_bug.cgi?id=159921
1062
1063         Reviewed by Brian Burg.
1064
1065         Covered by existing and added built-ins tests.
1066
1067         Updating built system according ---wrappers-only new meaning.
1068         builtin generator is now called for each individual built-in file plus once for WebCore wrapper files.
1069         WebCore wrapper files allow handling things like conditionally guarded features.
1070         They also remove the need to use built-ins macros outside generated code.
1071
1072         * CMakeLists.txt:
1073         * DerivedSources.make:
1074
1075 2016-07-21  Frederic Wang  <fwang@igalia.com>
1076
1077         Move parsing of accentunder and accent attributes from renderer to element classes
1078         https://bugs.webkit.org/show_bug.cgi?id=159625
1079
1080         Reviewed by Brent Fulgham.
1081
1082         We introduce a new MathMLUnderOverElement that is used for elements munder, mover and
1083         munderover in order to create RenderMathMLUnderOver and parse and expose the values of the
1084         accent and accentunder attributes. This is one more step toward moving MathML attribute
1085         parsing to the DOM (bug 156536). We also do minor clean-up for this and previous renderer
1086         classes that no longer do attribute parsing: the MathMLNames namespace is no longer necessary
1087         and constructors can take a more accurate element type.
1088
1089         No new tests, already covered by existing test.
1090
1091         * CMakeLists.txt: Add MathMLUnderOverElement files.
1092         * WebCore.xcodeproj/project.pbxproj: Ditto.
1093         * mathml/MathMLAllInOne.cpp: Ditto.
1094         * mathml/MathMLElement.cpp:
1095         (WebCore::MathMLElement::cachedBooleanAttribute): Add parsing of boolean attributes.
1096         * mathml/MathMLElement.h: New type and helper functions for boolean attributes.
1097         * mathml/MathMLInlineContainerElement.cpp:
1098         (WebCore::MathMLInlineContainerElement::createElementRenderer): Remove handling of
1099         under/over/underover elements.
1100         * mathml/MathMLScriptsElement.cpp:
1101         (WebCore::MathMLScriptsElement::MathMLScriptsElement): Remove inline keyword to avoid link
1102         errors now that MathMLUnderOverElement overrides that class.
1103         * mathml/MathMLScriptsElement.h: Allow MathMLUnderOverElement to override this class.
1104         * mathml/MathMLUnderOverElement.cpp:
1105         (WebCore::MathMLUnderOverElement::MathMLUnderOverElement):
1106         (WebCore::MathMLUnderOverElement::create):
1107         (WebCore::MathMLUnderOverElement::accent): Helper function to access the accent value.
1108         (WebCore::MathMLUnderOverElement::accentUnder): Helper function to access the accentunder value.
1109         (WebCore::MathMLUnderOverElement::parseAttribute): Make accent and accentunder dirty.
1110         (WebCore::MathMLUnderOverElement::createElementRenderer): Create RenderMathMLUnderOver
1111         * mathml/MathMLUnderOverElement.h:
1112         * mathml/mathtags.in: Map under/over/underover to MathMLUnderOverElement.
1113         * rendering/mathml/RenderMathMLFraction.cpp: Remove MathMLNames and make the constructor
1114         take a MathMLFractionElement.
1115         (WebCore::RenderMathMLFraction::RenderMathMLFraction):
1116         * rendering/mathml/RenderMathMLFraction.h:
1117         * rendering/mathml/RenderMathMLPadded.cpp: Remove MathMLNames and make the constructor
1118         take a MathMLPaddedElement.
1119         (WebCore::RenderMathMLPadded::RenderMathMLPadded):
1120         * rendering/mathml/RenderMathMLPadded.h:
1121         * rendering/mathml/RenderMathMLScripts.cpp: Remove MathMLNames and make the constructor
1122         take a MathMLScriptsElement. Also rename scriptsElement() to element().
1123         (WebCore::RenderMathMLScripts::RenderMathMLScripts):
1124         (WebCore::RenderMathMLScripts::element):
1125         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
1126         (WebCore::RenderMathMLScripts::scriptsElement): Deleted.
1127         * rendering/mathml/RenderMathMLScripts.h:
1128         * rendering/mathml/RenderMathMLUnderOver.cpp: Remove MathMLNames and make the constructor
1129         take a RenderMathMLUnderOver.
1130         (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver):
1131         (WebCore::RenderMathMLUnderOver::element):
1132         (WebCore::RenderMathMLUnderOver::hasAccent): Use the helper functions for accent and accentunder.
1133         * rendering/mathml/RenderMathMLUnderOver.h:
1134
1135 2016-07-21  Chris Dumez  <cdumez@apple.com>
1136
1137         Parameter to Node.isSameNode() / isEqualNode() should be mandatory
1138         https://bugs.webkit.org/show_bug.cgi?id=160070
1139
1140         Reviewed by Ryosuke Niwa.
1141
1142         Parameter to Node.isSameNode() / isEqualNode() should be mandatory as
1143         per the specification:
1144         - https://dom.spec.whatwg.org/#interface-node
1145
1146         Chrome and Firefox agree with the specification (although Firefox does
1147         not support isSameNode()).
1148
1149         No new tests, rebaselined existing tests.
1150
1151         * dom/Node.idl:
1152
1153 2016-07-21  Chris Dumez  <cdumez@apple.com>
1154
1155         Parameter to Document.createEvent() should be mandatory
1156         https://bugs.webkit.org/show_bug.cgi?id=160065
1157
1158         Reviewed by Darin Adler.
1159
1160         Parameter to Document.createEvent() should be mandatory as per the
1161         specification:
1162         - https://dom.spec.whatwg.org/#document
1163
1164         We already throw anyway when the parameter is omitted because we use
1165         "undefined" as event type, which is invalid. However, we throw the
1166         wrong exception.
1167
1168         Firefox and Chrome agree with the specification here.
1169
1170         No new tests, rebaselined existing tests.
1171
1172         * dom/Document.idl:
1173
1174 2016-07-21  Brian Burg  <bburg@apple.com>
1175
1176         REGRESSION(r62549): Objective-C DOM bindings sometimes fail to regenerate when CodeGenerator.pm is modified
1177         https://bugs.webkit.org/show_bug.cgi?id=160031
1178
1179         Reviewed by Darin Adler.
1180
1181         This bug was caused by a refactoring 6 years ago. Not all uses of a variable
1182         were renamed, so the ObjC bindings target pattern was not specifying any
1183         build scripts as target dependencies.
1184
1185         * DerivedSources.make: Standardize on {COMMON,JS,DOM}_BINDINGS_SCRIPTS.
1186
1187 2016-07-21  Darin Adler  <darin@apple.com>
1188
1189         Remove unneeded content attribute name "playsinline"
1190         https://bugs.webkit.org/show_bug.cgi?id=160069
1191
1192         Reviewed by Chris Dumez.
1193
1194         * html/HTMLVideoElement.idl: Removed explicit content attribute name on Reflect
1195         attribute since it is the same as the name that the code generator will generate.
1196
1197 2016-07-21  Chris Dumez  <cdumez@apple.com>
1198
1199         Make parameters to Element.getElementsBy*() operations mandatory
1200         https://bugs.webkit.org/show_bug.cgi?id=160060
1201
1202         Reviewed by Darin Adler.
1203
1204         Make parameters to Element.getElementsBy*() operations mandatory to
1205         match the specification:
1206         - https://dom.spec.whatwg.org/#interface-element
1207
1208         Firefox and Chrome agree with the specification so the compatibility
1209         risk should be low.
1210
1211         It makes very little sense to call these operations without parameter,
1212         especially considering WebKit uses the string "undefined" if the
1213         parameter is omitted.
1214
1215         No new tests, rebaselined existing tests.
1216
1217         * dom/Element.idl:
1218
1219 2016-07-21  Chris Dumez  <cdumez@apple.com>
1220
1221         Make parameters mandatory for attribute-related API on Element
1222         https://bugs.webkit.org/show_bug.cgi?id=160059
1223
1224         Reviewed by Ryosuke Niwa.
1225
1226         Make parameters mandatory for attribute-related API on Element to match
1227         the specification:
1228         - https://dom.spec.whatwg.org/#element
1229
1230         Firefox and Chrome agree with the specification. Calling this API
1231         without the parameters does not make much sense, especially considering
1232         WebKit uses the string "undefined" when the parameter is omitted.
1233
1234         No new tests, rebaselined existing tests.
1235
1236         * dom/Element.idl:
1237
1238 2016-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
1239
1240         Remove support for deprecated SPI inlineMediaPlaybackRequiresPlaysInlineAttribute
1241         https://bugs.webkit.org/show_bug.cgi?id=160066
1242
1243         Reviewed by Dean Jackson.
1244
1245         r203520 deprecated inlineMediaPlaybackRequiresPlaysInlineAttribute in favor of
1246         allowsInlineMediaPlaybackWithPlaysInlineAttribute and
1247         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute. The old
1248         inlineMediaPlaybackRequiresPlaysInlineAttribute is SPI and was never released
1249         to the public. Therefore, it can be removed safely.
1250
1251         No new tests because there is no behavior change.
1252
1253         * page/Settings.cpp:
1254         * page/Settings.in:
1255         * testing/InternalSettings.cpp:
1256         (WebCore::InternalSettings::Backup::Backup): Deleted.
1257         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
1258         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute): Deleted.
1259         * testing/InternalSettings.h:
1260         * testing/InternalSettings.idl:
1261
1262 2016-07-21  Dean Jackson  <dino@apple.com>
1263
1264         REGRESSION (r202927): The internal size of the ImageBuffer is scaled twice by the context scaleFactor
1265         https://bugs.webkit.org/show_bug.cgi?id=159981
1266         <rdar://problem/27429465>
1267
1268         Reviewed by Myles Maxfield.
1269
1270         The change to propagate color spaces through ImageBuffers created an
1271         alternate version of createCompatibleBuffer. This version accidentally
1272         attempted to take the display resolution (i.e. hidpi) into account
1273         when creating the buffer, which meant it was being applied twice.
1274
1275         The fix is simply to remove that logic. The caller of the method
1276         will take the resolution into account, the same way they did
1277         with the old createCompatibleBuffer method.
1278
1279         Test: fast/hidpi/pdf-image-scaled.html
1280
1281         * platform/graphics/cg/ImageBufferCG.cpp:
1282         (WebCore::ImageBuffer::createCompatibleBuffer): Don't calculate
1283         a resolution - just use the value of 1.0.
1284
1285 2016-07-21  John Wilander  <wilander@apple.com>
1286
1287         Block mixed content synchronous XHR
1288         https://bugs.webkit.org/show_bug.cgi?id=105462
1289         <rdar://problem/13666424>
1290
1291         Reviewed by Brent Fulgham.
1292
1293         Test: http/tests/security/mixedContent/insecure-xhr-sync-in-main-frame.html
1294
1295         * loader/DocumentThreadableLoader.cpp:
1296         (WebCore::DocumentThreadableLoader::loadRequest):
1297
1298 2016-07-21  Chris Dumez  <cdumez@apple.com>
1299
1300         Make parameters to Document.getElementsBy*() operations mandatory
1301         https://bugs.webkit.org/show_bug.cgi?id=160050
1302
1303         Reviewed by Daniel Bates.
1304
1305         Make parameters to Document.getElementsBy*() operations mandatory to
1306         match the specification:
1307         - https://dom.spec.whatwg.org/#interface-document
1308
1309         Firefox and Chrome agree with the specification so the compatibility
1310         risk should be low.
1311
1312         It makes very little sense to call these operations without parameter,
1313         especially considering WebKit uses the string "undefined" if the
1314         parameter is omitted.
1315
1316         No new tests, rebaselined existing tests.
1317
1318         * dom/Document.idl:
1319
1320 2016-07-21  Nan Wang  <n_wang@apple.com>
1321
1322         AX: aria-label not being used correctly in accessible name calculation of heading
1323         https://bugs.webkit.org/show_bug.cgi?id=160009
1324
1325         Reviewed by Chris Fleizach.
1326
1327         Actually we are exposing the correct information for heading objects. On macOS, 
1328         VoiceOver should handle the logic that picks the right information to speak.
1329         On iOS, VoiceOver is speaking the static text child instead of the heading object.
1330         So we should set the accessibilityLabel of the static text based on the parent's 
1331         alternate label.
1332
1333         Test: accessibility/ios-simulator/heading-with-aria-label.html
1334
1335         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1336         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1337
1338 2016-07-21  Saam Barati  <sbarati@apple.com>
1339
1340         op_add/ValueAdd should be an IC in all JIT tiers
1341         https://bugs.webkit.org/show_bug.cgi?id=159649
1342
1343         Reviewed by Benjamin Poulain.
1344
1345         * ForwardingHeaders/jit/JITMathICForwards.h: Added.
1346
1347 2016-07-21  Chris Dumez  <cdumez@apple.com>
1348
1349         Make parameters mandatory for Document.create*() operations
1350         https://bugs.webkit.org/show_bug.cgi?id=160047
1351
1352         Reviewed by Ryosuke Niwa.
1353
1354         Make parameters mandatory for Document.create*() operations:
1355         createTextNode(), createComment(), createCDataSection(),
1356         createAttribute() and createProcessingInstruction().
1357
1358         This matches the specification:
1359         - https://dom.spec.whatwg.org/#interface-document
1360
1361         Firefox and Chrome both agree with the specification so the
1362         compatibility risk should be low. Also WebKit uses the string
1363         "undefined" when the parameter is omitted, which is not very
1364         helpful.
1365
1366         No new tests, rebaselined existing tests.
1367
1368         * dom/Document.idl:
1369
1370 2016-07-21  Chris Dumez  <cdumez@apple.com>
1371
1372         Fix null handling of SVGAngle/SVGLength.valueAsString attribute
1373         https://bugs.webkit.org/show_bug.cgi?id=160025
1374
1375         Reviewed by Ryosuke Niwa.
1376
1377         Fix null handling of SVGAngle/SVGLength.valueAsString attribute
1378         to match the specification:
1379         - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGAngle
1380         - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGLength
1381
1382         In particular, this patch drops [TreatNullAs=EmptyString] IDL
1383         extended attribute from this attribute. This is not supposed
1384         to change behavior given that both "" and "null" are invalid
1385         numbers and the specification says to throw a SYNTAX_ERR in
1386         this case.
1387
1388         However, WebKit currently ignores assignments to "" instead
1389         of throwing. As a result, assigning to null will now throw
1390         instead of being ignored. The compatibility risk should be
1391         low because both Firefox and Chrome throw when assigning
1392         null.
1393
1394         I did not change the behavior when assigning to "" because
1395         it is a bit out of scope for this patch and browsers to not
1396         seem to agree:
1397         - Firefox throws
1398         - Chrome set value to "0"
1399         - WebKit ignores the assignment
1400
1401         The specification seems to agree with Firefox as far as I
1402         can tell given that "" is not a valid number as per:
1403         - https://www.w3.org/TR/css3-values/#numbers
1404
1405         Test: svg/dom/valueAsString-null.html
1406
1407         * svg/SVGAngle.idl:
1408         * svg/SVGLength.idl:
1409
1410 2016-07-21  Chris Dumez  <cdumez@apple.com>
1411
1412         Fix null handling of HTMLFontElement.color
1413         https://bugs.webkit.org/show_bug.cgi?id=160036
1414
1415         Reviewed by Ryosuke Niwa.
1416
1417         Fix null handling of HTMLFontElement.color to match the specification:
1418         - https://html.spec.whatwg.org/#htmlfontelement
1419
1420         We are supposed to treat null as the empty string. Both Firefox and
1421         Chrome agree with the specification.
1422
1423         No new tests, rebaselined existing tests.
1424
1425         * html/HTMLFontElement.idl:
1426
1427 2016-07-21  Chris Dumez  <cdumez@apple.com>
1428
1429         Fix null handling for several HTMLTableElement attributes
1430         https://bugs.webkit.org/show_bug.cgi?id=160041
1431
1432         Reviewed by Ryosuke Niwa.
1433
1434         Fix null handling for several HTMLTableElement attributes to match the
1435         specification:
1436         - https://html.spec.whatwg.org/#HTMLTableElement-partial
1437
1438         The attributes in question are 'bicolor', 'cellSpacing' and
1439         'cellPadding'. We are supposed to treat null as the empty string for
1440         these attributes.
1441
1442         Firefox and Chrome both agree with the specification.
1443
1444         No new tests, rebaselined existing tests.
1445
1446         * html/HTMLTableElement.idl:
1447
1448 2016-07-21  Chris Dumez  <cdumez@apple.com>
1449
1450         Fix null handling for HTMLObjectElement.border
1451         https://bugs.webkit.org/show_bug.cgi?id=160040
1452
1453         Reviewed by Ryosuke Niwa.
1454
1455         Fix null handling for HTMLObjectElement.border to match the specification:
1456         - https://html.spec.whatwg.org/#HTMLObjectElement-partial
1457
1458         We are supposed to treat null as the empty string.
1459
1460         Both Firefox and Chrome agree with the specification.
1461
1462         No new tests, rebaselined existing tests.
1463
1464         * html/HTMLObjectElement.idl:
1465
1466 2016-07-21  Chris Dumez  <cdumez@apple.com>
1467
1468         Fix null handling for td.bgColor / tr.bgColor
1469         https://bugs.webkit.org/show_bug.cgi?id=160043
1470
1471         Reviewed by Ryosuke Niwa.
1472
1473         Fix null handling for td.bgColor / tr.bgColor to match the
1474         specification:
1475         - https://html.spec.whatwg.org/#HTMLTableCellElement-partial
1476         - https://html.spec.whatwg.org/#HTMLTableRowElement-partial
1477
1478         We are supposed to treat null as the empty string.
1479
1480         Firefox and Chrome both agree with the specification.
1481
1482         No new tests, rebaselined existing tests.
1483
1484         * html/HTMLTableCellElement.idl:
1485         * html/HTMLTableRowElement.idl:
1486
1487 2016-07-21  Chris Dumez  <cdumez@apple.com>
1488
1489         Fix null handling for several HTMLBodyElement attributes
1490         https://bugs.webkit.org/show_bug.cgi?id=160044
1491
1492         Reviewed by Ryosuke Niwa.
1493
1494         Fix null handling for several HTMLBodyElement attributes to match the
1495         specification:
1496         - https://html.spec.whatwg.org/#HTMLBodyElement-partial
1497
1498         The attributes in question are: 'text', 'link', 'vlink', 'alink' and
1499         'bgcolor'.
1500
1501         We are supposed to treat null as the empty string for these attributes.
1502
1503         Firefox and Chrome both agree with the specification.
1504
1505         No new tests, rebaselined existing tests.
1506
1507         * html/HTMLBodyElement.idl:
1508
1509 2016-07-21  Chris Dumez  <cdumez@apple.com>
1510
1511         Fix null handling for HTMLIFrameElement.marginWidth / marginHeight
1512         https://bugs.webkit.org/show_bug.cgi?id=160037
1513
1514         Reviewed by Ryosuke Niwa.
1515
1516         Fix null handling for HTMLIFrameElement.marginWidth / marginHeight to
1517         match the specification:
1518         - https://html.spec.whatwg.org/#HTMLIFrameElement-partial
1519
1520         We are supposed to treat null as the empty string. Both Firefox and
1521         Chrome agree with the specification.
1522
1523         No new tests, rebaselined existing tests.
1524
1525         * html/HTMLIFrameElement.idl:
1526
1527 2016-07-21  Chris Dumez  <cdumez@apple.com>
1528
1529         Fix null handling for HTMLImageElement.border
1530         https://bugs.webkit.org/show_bug.cgi?id=160039
1531
1532         Reviewed by Ryosuke Niwa.
1533
1534         Fix null handling for HTMLImageElement.border to match the specification:
1535         - https://html.spec.whatwg.org/#HTMLImageElement-partial
1536
1537         We are supposed to treat null as the empty string.
1538
1539         Both Firefox and Chrome agree with the specification.
1540
1541         No new tests, rebaselined existing tests.
1542
1543         * html/HTMLImageElement.idl:
1544
1545 2016-07-21  Daniel Bates  <dabates@apple.com>
1546
1547         REGRESSION: Plugin replaced YouTube Flash videos always have the same width
1548         https://bugs.webkit.org/show_bug.cgi?id=159998
1549         <rdar://problem/27462285>
1550
1551         Reviewed by Simon Fraser.
1552
1553         Fixes an issue where the width of a plugin replaced YouTube video loaded via an HTML embed
1554         element would always have the same width regardless of value of the width attribute.
1555
1556         For YouTube Flash videos the YouTube plugin replacement substitutes a shadow DOM subtree
1557         for the default renderer of an HTML embed element. The root of this shadow DOM subtree
1558         is an HTML div element. Currently we set inline styles on this <div> when it is instantiated.
1559         In particular, we set inline display and position to "inline-block" and "relative", respectively,
1560         and set an invalid height and width (we specify a font weight value instead of a CSS length value
1561         - this causes an ASSERT_NOT_REACHED() assertion failure in StyleBuilderConverter::convertLengthSizing()
1562         in a debug build). These styles never worked as intended and we ultimately created an inline
1563         renderer (ignoring display "inline-block") that had auto width and height. Instead it is sufficient
1564         to remove all these inline styles and create a RenderBlockFlow renderer for this <div> so that it
1565         renders as a block, non-replaced element to achieve the intended illusion that the <embed> is a
1566         single element.
1567
1568         * html/shadow/YouTubeEmbedShadowElement.cpp: Remove unused header HTMLEmbedElement.h and include
1569         header RenderBlockFlow.h. Also update copyright in license block.
1570         (WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement): Remove inline styles as these
1571         never worked as intended.
1572         (WebCore::YouTubeEmbedShadowElement::createElementRenderer): Override; create a block-flow
1573         renderer for us so that we layout as a block, non-replaced element.
1574         * html/shadow/YouTubeEmbedShadowElement.h:
1575
1576 2016-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
1577
1578         [iPhone] Playing a video on tudou.com plays only sound, no video
1579         https://bugs.webkit.org/show_bug.cgi?id=159967
1580         <rdar://problem/26964090>
1581
1582         Reviewed by Jon Lee, Jeremy Jones, and Anders Carlsson.
1583
1584         WebKit recently starting honoring the playsinline and webkit-playsinline
1585         attribute on iPhones. However, because these attributes previously did
1586         nothing, some sites (such as Todou) were setting them on their content
1587         and expecting that they are not honored. In this specific case, the
1588         video is absolutely positioned to be 1 pixel x 1 pixel.
1589
1590         Previously, with iOS 9, apps could set the allowsInlineMediaPlayback
1591         property on their WKWebView, which would honor the webkit-playsinline
1592         attribute. Safari on iPhones didn't do this.
1593
1594         In order to not break these existing apps, it's important that the
1595         allowsInlineMediaPlayback preference still allows webkit-playsinline
1596         videos to play inline in apps using WKWebView. However, in Safari, these
1597         videos should play fullscreen. (Todou videos have webkit-playsinline
1598         but not playsinline.)
1599
1600         Therefore, in Safari, videos with playsinline should be inline, but
1601         videos with webkit-playsinline should be fullscreen. In apps using
1602         WKWebViews, if the app sets allowsInlineMediaPlayback, then videos with
1603         playsinline should be inline, and videos with webkit-playsinline should
1604         also be inline. Videos on iPad and Mac should all be inline by default.
1605
1606         We can create some truth tables for the cases which need to be covered:
1607
1608         All apps on Mac / iPad:
1609         Presence of playsinline | Presence of webkit-playsinline | Result
1610         ========================|================================|===========
1611         Not present             | Not present                    | Inline
1612         Present                 | Not present                    | Inline
1613         Not Present             | Present                        | Inline
1614         Present                 | Present                        | Inline
1615
1616         Safari on iPhone:
1617         Presence of playsinline | Presence of webkit-playsinline | Result
1618         ========================|================================|===========
1619         Not present             | Not present                    | Fullscreen
1620         Present                 | Not present                    | Inline
1621         Not Present             | Present                        | Fullscreen
1622         Present                 | Present                        | Inline
1623
1624         App on iPhone which sets allowsInlineMediaPlayback:
1625         Presence of playsinline | Presence of webkit-playsinline | Result
1626         ========================|================================|===========
1627         Not present             | Not present                    | Fullscreen
1628         Present                 | Not present                    | Inline
1629         Not Present             | Present                        | Inline
1630         Present                 | Present                        | Inline
1631
1632         The way to distinguish Safari from another app is to create an SPI
1633         boolean preference which Safari can set. This is already how the
1634         iPhone and iPad are differentiated using the requiresPlayInlineAttribute
1635         which Safari sets but other apps don't. However, this preference is
1636         no longer sufficient because Safari should now be discriminating
1637         between the playsinline and webkit-playsinline attributes. Therefore,
1638         this preference should be extended to two boolean preferences, which
1639         this patch adds:
1640
1641         allowsInlineMediaPlaybackWithPlaysInlineAttribute
1642         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute
1643
1644         Safari on iPhone will set
1645         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to true,
1646         and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to
1647         false. Other apps on iPhone will get their defaults values (because they
1648         are SPI) which means they will both be true. On iPad and Mac, apps will
1649         use the defaults values where both are false.
1650
1651         This patch adds support for these two preferences, but does not remove
1652         the existing inlineMediaPlaybackRequiresPlaysInlineAttribute preference.
1653         I will remove the exising preference as soon as I update Safari to migrate
1654         off of it.
1655
1656         Test: media/video-playsinline.html
1657
1658         * html/MediaElementSession.cpp:
1659         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
1660         * page/Settings.cpp:
1661         * page/Settings.in:
1662         * testing/InternalSettings.cpp:
1663         (WebCore::InternalSettings::Backup::Backup):
1664         (WebCore::InternalSettings::Backup::restoreTo):
1665         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
1666         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
1667         * testing/InternalSettings.h:
1668         * testing/InternalSettings.idl:
1669
1670 2016-07-21  Ryosuke Niwa  <rniwa@webkit.org>
1671
1672         Crash accessing null renderer inside WebCore::DeleteSelectionCommand::doApply
1673         https://bugs.webkit.org/show_bug.cgi?id=160011
1674
1675         Reviewed by Chris Dumez.
1676
1677         Add a null pointer check for renderer() call.
1678
1679         Unfortunately no new tests since we don't have a reproduction.
1680
1681         * editing/DeleteSelectionCommand.cpp:
1682         (WebCore::DeleteSelectionCommand::doApply):
1683
1684 2016-07-21  Chris Dumez  <cdumez@apple.com>
1685
1686         The 2 first parameters to DOMImplementation.createDocument() should be mandatory
1687         https://bugs.webkit.org/show_bug.cgi?id=160030
1688
1689         Reviewed by Sam Weinig.
1690
1691         The 2 first parameters to DOMImplementation.createDocument() should be mandatory
1692         as per the specification:
1693         - https://dom.spec.whatwg.org/#domimplementation
1694
1695         Firefox and Chrome both agree with the specification. However, those
1696         parameters were marked as optional in WebKit. Calling this function
1697         without parameters would create a document element whose tag is the
1698         string "undefined", which does not seem helpful. This patch thus
1699         aligns our behavior with the specification and other browsers.
1700
1701         No new tests, rebaselined existing tests.
1702
1703         * dom/DOMImplementation.idl:
1704
1705 2016-07-21  Chris Dumez  <cdumez@apple.com>
1706
1707         Kill legacy valueToStringWithNullCheck() utility function
1708         https://bugs.webkit.org/show_bug.cgi?id=159991
1709
1710         Reviewed by Sam Weinig.
1711
1712         Kill legacy valueToStringWithNullCheck() utility function. Treating null as
1713         a null string is legacy behavior so drop this function so that people are
1714         not tempted to use it. We should be using either:
1715         1. JSValue::toWTFString() for non-nullable DOMStrings
1716         2. valueToStringWithUndefinedOrNullCheck() for nullable DOMStrings
1717         3. valueToStringTreatingNullAsEmptyString() for strings with [TreatNullAs=EmptyString]
1718
1719         No new tests, no web-exposed behavior change.
1720
1721         * bindings/js/JSDOMBinding.cpp:
1722         (WebCore::valueToStringWithNullCheck): Deleted.
1723         * bindings/js/JSDOMBinding.h:
1724         * bindings/js/JSHTMLFrameElementCustom.cpp:
1725         (WebCore::JSHTMLFrameElement::setLocation):
1726         * html/HTMLFrameElement.idl:
1727
1728 2016-07-21  Zalan Bujtas  <zalan@apple.com>
1729
1730         Do not keep invalid IOSurface in ImageBufferData.
1731         https://bugs.webkit.org/show_bug.cgi?id=160005
1732         <rdar://problem/27208636>
1733
1734         Reviewed by Simon Fraser.
1735
1736         When we fail to initialize the IOSurface for the accelerated context, we switch over to
1737         the non-accelerated code path. Since ImageBufferData::surface is used to indicate whether
1738         the graphics context is in accelerated mode, we need to reset it when the initialization fails.
1739
1740         Unable to create a test case.
1741
1742         * platform/graphics/cg/ImageBufferCG.cpp:
1743         (WebCore::ImageBuffer::ImageBuffer):
1744
1745 2016-07-21  Chris Dumez  <cdumez@apple.com>
1746
1747         playsInline IDL attribute has the wrong casing
1748         https://bugs.webkit.org/show_bug.cgi?id=160029
1749         <rdar://problem/27474031>
1750
1751         Reviewed by Jon Lee.
1752
1753         Fix case from video.playsinline to video.playsInline in order to match
1754         the specification:
1755         - https://html.spec.whatwg.org/multipage/embedded-content.html#the-video-element:dom-video-playsinline
1756
1757         It still reflects the "playsinline" content attribute though, as per
1758         the specification:
1759         - https://html.spec.whatwg.org/multipage/embedded-content.html#dom-video-playsinline
1760
1761         No new tests, updated existing test.
1762
1763         * html/HTMLVideoElement.idl:
1764
1765 2016-07-21  Chris Dumez  <cdumez@apple.com>
1766
1767         Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
1768         https://bugs.webkit.org/show_bug.cgi?id=160026
1769
1770         Reviewed by Sam Weinig.
1771
1772         Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
1773         attribute as it does not match the specification:
1774         - https://html.spec.whatwg.org/multipage/scripting.html#canvascompositing
1775
1776         It does not change web-exposed behavior because assigning to "" or "null"
1777         gets ignored as those are not valid operations.
1778
1779         Test: fast/canvas/context-globalCompositeOperation-null.html
1780
1781         * html/canvas/CanvasRenderingContext2D.idl:
1782
1783 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1784
1785         [GTK][Threaded Compositor] Overlay scrollbars shouldn't be a requirement of the threaded compositor
1786         https://bugs.webkit.org/show_bug.cgi?id=160020
1787
1788         Reviewed by Michael Catanzaro.
1789
1790         It has been a requirement only because we didn't really know why frame scrollbars were not rendered when using
1791         the threaded compositor. The reason is that RenderView doesn't use layers for FrameView scrollbars by default,
1792         unless using overlay scrollbars. When using the threaded compositor we really need layers for the FrameView
1793         scrollbars even when not using overlay scrollbars.
1794
1795         * platform/gtk/ScrollbarThemeGtk.cpp:
1796         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Stop enforcing overlay scrollbars when threaded compositor is enabled.
1797         * rendering/RenderLayerCompositor.cpp:
1798         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls): Always use layers for scrollbars when
1799         threaded compositor is enabled.
1800
1801 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1802
1803         [Cairo] Fix a crash in fast/canvas/canvas-getImageData-invalid-result-buffer-crash.html
1804         https://bugs.webkit.org/show_bug.cgi?id=160014
1805
1806         Reviewed by Michael Catanzaro.
1807
1808         In r202887 some null checks were added for JSArray::createUninitialized (and related) but not for the
1809         ImageBuffer cairo implementation.
1810
1811         * platform/graphics/cairo/ImageBufferCairo.cpp:
1812         (WebCore::getImageData): Return early if Uint8ClampedArray::createUninitialized() returns nullptr.
1813
1814 2016-07-21  Miguel Gomez  <magomez@igalia.com>
1815
1816         [GTK] The GSTREAMER_GL path in MediaPlayerPrivateGStreamerBase::paintToTextureMapper() is missing a mutex lock
1817         https://bugs.webkit.org/show_bug.cgi?id=160018
1818
1819         Reviewed by Philippe Normand.
1820
1821         Lock the video sample mutex while accessing it.
1822
1823         Covered by existent tests.
1824
1825         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1826         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
1827
1828 2016-07-21  Miguel Gomez  <magomez@igalia.com>
1829
1830         [Threaded Compositor] Flickering when zooming in/out in maps.google.com
1831         https://bugs.webkit.org/show_bug.cgi?id=154069
1832
1833         Reviewed by Carlos Garcia Campos.
1834
1835         Add a new extra buffer to GraphicsContext3D when using the Threaded Compositor,
1836         so it doesn't have to reuse the buffers that are still waiting for composition.
1837
1838         Covered by existing tests.
1839
1840         * platform/graphics/GraphicsContext3D.h:
1841         Add a new texture to use for the rendering. Remove the compositor fbo we were using.
1842         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1843         (WebCore::GraphicsContext3D::GraphicsContext3D):
1844         Initialize the new texture and remove the previous fbo related code.
1845         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1846         Properly destroy the new texture and remove the previous fbo related code.
1847         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1848         (WebCore::GraphicsContext3D::reshapeFBOs):
1849         Allocate the new texture and remove the previous fbo allocation.
1850         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1851         (WebCore::GraphicsContext3D::prepareTexture):
1852         Use a single fbo with three textures instead of two fbos with a texture each.
1853         Rotate the three textures usage so:
1854         - m_texture becomes m_compositorTexture to be pushed to the compositor.
1855         - m_intermediateTexture becomes m_texture to receive the next rendering.
1856         - m_compositorTexture becomes m_intermediateTexture.
1857         And add a glFlush() to ensure that the gl commands are sent to the pipeline.
1858         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1859         (WebCore::GraphicsContext3D::reshapeFBOs):
1860         Allocate the new texture.
1861
1862 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1863
1864         [GTK][Threaded Compositor] Web view background colors don't work
1865         https://bugs.webkit.org/show_bug.cgi?id=159465
1866
1867         Reviewed by Michael Catanzaro.
1868
1869         * rendering/RenderLayerBacking.cpp:
1870         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Initialize frame view layer opacity for platforms not
1871         using the tiled cache layer.
1872
1873 2016-07-20  Youenn Fablet  <youenn@apple.com>
1874
1875         [XHR] Cache response JS object in case of arraybuffer and blob response types
1876         https://bugs.webkit.org/show_bug.cgi?id=128903
1877
1878         Reviewed by Alex Christensen.
1879
1880         Covered by existing and modified tests.
1881
1882         Making response getter a JS builtin that caches response in @response private slot.
1883         Handling invalidation of cached response with @responseCacheIsValid new private method.
1884         Handling creation of cached response with @retrieveResponse new private method which reuses most of
1885         JSXMLHttpRequest::response previous code.
1886
1887         Caching of responses is activated whenever load ended without any error for blob and arraybuffer response types.
1888
1889         Caching of response for document is also activated in case the response getter is used but not if responseXML getter is used.
1890
1891         * CMakeLists.txt: Adding XMLHttpRequest.js.
1892         * DerivedSources.make: Ditto.
1893         * bindings/js/JSXMLHttpRequestCustom.cpp:
1894         (WebCore::JSXMLHttpRequest::retrieveResponse): Implements creation of to-be-cached response.
1895         (WebCore::JSXMLHttpRequest::response): Deleted.
1896         * bindings/js/WebCoreBuiltinNames.h: Adding new private names.
1897         * xml/XMLHttpRequest.cpp:
1898         (WebCore::XMLHttpRequest::didCacheResponse): Renamed from didCacheResponseJSON as all response types are now cached.
1899         (WebCore::XMLHttpRequest::didCacheResponseJSON): Deleted.
1900         * xml/XMLHttpRequest.h:
1901         * xml/XMLHttpRequest.idl:
1902
1903 2016-07-20  Youenn Fablet  <youenn@apple.com>
1904
1905         Remove crossOriginRequestPolicy from ThreadableLoaderOptions
1906         https://bugs.webkit.org/show_bug.cgi?id=159417
1907
1908         Reviewed by Alex Christensen.
1909
1910         No observable change.
1911
1912         * Modules/fetch/FetchLoader.cpp:
1913         (WebCore::FetchLoader::start): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
1914         * fileapi/FileReaderLoader.cpp:
1915         (WebCore::FileReaderLoader::start): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
1916         * inspector/InspectorNetworkAgent.cpp:
1917         (WebCore::InspectorNetworkAgent::loadResource): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
1918         * loader/DocumentThreadableLoader.cpp:
1919         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
1920         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): UseAccessControl -> FetchOptions::Mode::Cors.
1921         (WebCore::DocumentThreadableLoader::redirectReceived): Ditto.
1922         (WebCore::DocumentThreadableLoader::didReceiveResponse): Ditto.
1923         (WebCore::DocumentThreadableLoader::loadRequest): Use NoCors as option passed to ResourceLoader. This allows
1924         desactivating ResourceLoader CORS checks as they are done in DocumentThreadableLoader right now. In the future,
1925         these checks should be moved to ResourceLoader and DocumentThreadableLoader should directly pass the fetch mode
1926         option.
1927         (WebCore::DocumentThreadableLoader::isAllowedRedirect): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
1928         * loader/ThreadableLoader.cpp:
1929         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing CrossOriginRequestPolicy.
1930         * loader/ThreadableLoader.h: Ditto.
1931         * loader/WorkerThreadableLoader.cpp:
1932         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Ditto.
1933         * page/EventSource.cpp:
1934         (WebCore::EventSource::connect): UseAccessControl -> FetchOptions::Mode::Cors.
1935         * workers/Worker.cpp:
1936         (WebCore::Worker::create): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
1937         * workers/WorkerGlobalScope.cpp:
1938         (WebCore::WorkerGlobalScope::importScripts): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
1939         * workers/WorkerScriptLoader.cpp:
1940         (WebCore::WorkerScriptLoader::loadSynchronously):
1941         (WebCore::WorkerScriptLoader::loadAsynchronously):
1942         * workers/WorkerScriptLoader.h:
1943         * xml/XMLHttpRequest.cpp:
1944         (WebCore::XMLHttpRequest::createRequest):
1945
1946 2016-07-20  Chris Dumez  <cdumez@apple.com>
1947
1948         Fix null handling of several Document attributes
1949         https://bugs.webkit.org/show_bug.cgi?id=159997
1950
1951         Reviewed by Ryosuke Niwa.
1952
1953         Fix null handling of the following Document attributes: title, cookie
1954         and domain.
1955
1956         In WebKit, they were all marked as [TreatNullAs=EmptyString], which
1957         does not match the specification:
1958         - https://html.spec.whatwg.org/multipage/dom.html#document
1959
1960         Details for each attribute:
1961         - title: null is now treated as the string "null", thus setting the
1962           document title to "null". This matches Firefox and Chrome.
1963         - cookie: adds a "null" cookie instead of being a no-op. This matches
1964                   both Firefox and Chrome.
1965         - domain: Calls setDomain(String("null")) instead of
1966                   setDomain(String()). This throws an exception because "null"
1967                   is not a suffix of the effective domain name. The behavior
1968                   is the same in Firefox and Chrome. Previously, we were
1969                   already throwing an exception since setting the domain to
1970                   the empty string throws, as per the specification.
1971
1972         Test: http/tests//dom/document-attributes-null-handling.html
1973
1974         * dom/Document.idl:
1975
1976 2016-07-20  Commit Queue  <commit-queue@webkit.org>
1977
1978         Unreviewed, rolling out r203471.
1979         https://bugs.webkit.org/show_bug.cgi?id=160003
1980
1981         many iOS-simulator tests are failing (Requested by litherum on
1982         #webkit).
1983
1984         Reverted changeset:
1985
1986         "[iPhone] Playing a video on tudou.com plays only sound, no
1987         video"
1988         https://bugs.webkit.org/show_bug.cgi?id=159967
1989         http://trac.webkit.org/changeset/203471
1990
1991 2016-07-19  Ryosuke Niwa  <rniwa@webkit.org>
1992
1993         iOS: Cannot paste images in RTF content
1994         https://bugs.webkit.org/show_bug.cgi?id=159964
1995         <rdar://problem/27442806>
1996
1997         Reviewed by Enrica Casucci.
1998
1999         The bug was caused by setDefersLoading(true) not deferring image loading for the parsed fragment.
2000         Worked around this bug by disabling image loading while parsing the document fragment.
2001
2002         * editing/ios/EditorIOS.mm:
2003         (WebCore::Editor::createFragmentAndAddResources):
2004
2005 2016-07-20  Brady Eidson  <beidson@apple.com>
2006
2007         Address a small FIXME in IDB code.
2008         https://bugs.webkit.org/show_bug.cgi?id=159999
2009
2010         Reviewed by Andy Estes.
2011
2012         No new tests (No behavior change).
2013
2014         * Modules/indexeddb/IDBRequest.cpp:
2015         (WebCore::IDBRequest::IDBRequest):
2016         
2017         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2018         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier): Deleted.
2019         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2020
2021 2016-07-20  Brady Eidson  <beidson@apple.com>
2022
2023         Remove some "modernFoo"s from IndexedDB code.
2024         https://bugs.webkit.org/show_bug.cgi?id=159985
2025
2026         Reviewed by Andy Estes.
2027
2028         No new tests (No known behavior change).
2029
2030         * Modules/indexeddb/IDBCursor.cpp:
2031         (WebCore::IDBCursor::IDBCursor):
2032         (WebCore::IDBCursor::~IDBCursor):
2033         (WebCore::IDBCursor::sourcesDeleted):
2034         (WebCore::IDBCursor::effectiveObjectStore):
2035         (WebCore::IDBCursor::transaction):
2036         (WebCore::IDBCursor::direction):
2037         (WebCore::IDBCursor::update):
2038         (WebCore::IDBCursor::advance):
2039         (WebCore::IDBCursor::continueFunction):
2040         (WebCore::IDBCursor::uncheckedIterateCursor):
2041         (WebCore::IDBCursor::deleteFunction):
2042         (WebCore::IDBCursor::setGetResult):
2043         
2044         * Modules/indexeddb/IDBIndex.cpp:
2045         (WebCore::IDBIndex::IDBIndex):
2046         (WebCore::IDBIndex::~IDBIndex):
2047         (WebCore::IDBIndex::hasPendingActivity):
2048         (WebCore::IDBIndex::name):
2049         (WebCore::IDBIndex::objectStore):
2050         (WebCore::IDBIndex::keyPath):
2051         (WebCore::IDBIndex::unique):
2052         (WebCore::IDBIndex::multiEntry):
2053         (WebCore::IDBIndex::openCursor):
2054         (WebCore::IDBIndex::doCount):
2055         (WebCore::IDBIndex::openKeyCursor):
2056         (WebCore::IDBIndex::doGet):
2057         (WebCore::IDBIndex::doGetKey):
2058         (WebCore::IDBIndex::markAsDeleted):
2059         * Modules/indexeddb/IDBIndex.h:
2060         
2061         * Modules/indexeddb/IDBObjectStore.cpp:
2062         (WebCore::IDBObjectStore::transaction):
2063         (WebCore::IDBObjectStore::deleteFunction): Deleted.
2064         (WebCore::IDBObjectStore::modernDelete): Deleted.
2065         * Modules/indexeddb/IDBObjectStore.h:
2066         
2067         * bindings/js/JSIDBIndexCustom.cpp:
2068         (WebCore::JSIDBIndex::visitAdditionalChildren):
2069
2070 2016-07-20  Chris Dumez  <cdumez@apple.com>
2071
2072         Stop using valueToStringWithNullCheck() in JSCSSStyleDeclaration::putDelegate()
2073         https://bugs.webkit.org/show_bug.cgi?id=159982
2074
2075         Reviewed by Ryosuke Niwa.
2076
2077         valueToStringWithNullCheck() treats null as the null String() which is
2078         legacy / non standard behavior. The specification says we should treat
2079         null as the empty string:
2080         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
2081
2082         Therefore, we should be using valueToStringTreatingNullAsEmptyString() instead.
2083
2084         In practice, there is no web-exposed behavior change because
2085         MutableStyleProperties::setProperty() removes the property wether the
2086         value is the null String or the empty String.
2087
2088         This behavior is correct since the specification says that we should
2089         remove the property if the value is the empty string:
2090         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty (step 4)
2091
2092         I added test coverage to make sure we behave according to specification.
2093         This test is passing in Firefox, Chrome and in WebKit (before and after
2094         my change).
2095
2096         Test: fast/css/CSSStyleDeclaration-property-setter.html
2097
2098         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2099         (WebCore::JSCSSStyleDeclaration::putDelegate):
2100
2101 2016-07-20  Chris Dumez  <cdumez@apple.com>
2102
2103         Fix null handling of HTMLFrameElement.marginWidth / marginHeight
2104         https://bugs.webkit.org/show_bug.cgi?id=159987
2105
2106         Reviewed by Ryosuke Niwa.
2107
2108         Fix null handling of HTMLFrameElement.marginWidth / marginHeight:
2109         - https://html.spec.whatwg.org/multipage/obsolete.html#htmlframeelement
2110
2111         We are supposed to treat null as the empty string but we treat it as
2112         the string "null".
2113
2114         Firefox and Chrome both match the specification.
2115
2116         No new tests, updated existing tests.
2117
2118         * html/HTMLFrameElement.idl:
2119
2120 2016-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2121
2122         Pausing autoplayed media should not remove all restrictions for that media element
2123         https://bugs.webkit.org/show_bug.cgi?id=159988
2124
2125         Reviewed by Jon Lee.
2126
2127         Localizes the removal of behavior restrictions introduced in r203464 upon pausing an
2128         autoplaying video to just affect the hiding or showing of the media controller. This
2129         prevents pages from using Javascript to start playing autoplaying videos that have
2130         been paused by the user.
2131
2132         * html/HTMLMediaElement.cpp:
2133         (WebCore::HTMLMediaElement::pause):
2134
2135 2016-07-20  Myles C. Maxfield  <mmaxfield@apple.com>
2136
2137         [iPhone] Playing a video on tudou.com plays only sound, no video
2138         https://bugs.webkit.org/show_bug.cgi?id=159967
2139         <rdar://problem/26964090>
2140
2141         Reviewed by Jon Lee.
2142
2143         WebKit recently starting honoring the playsinline and webkit-playsinline
2144         attribute on iPhones. However, because these attributes previously did
2145         nothing, some sites (such as Todou) were setting them on their content
2146         and expecting that they are not honored. In this specific case, the
2147         video is absolutely positioned to be 1 pixel x 1 pixel.
2148
2149         Previously, with iOS 9, apps could set the allowsInlineMediaPlayback
2150         property on their WKWebView, which would honor the webkit-playsinline
2151         attribute. Safari on iPhones didn't do this.
2152
2153         In order to not break these existing apps, it's important that the
2154         allowsInlineMediaPlayback preference still allows webkit-playsinline
2155         videos to play inline in apps using WKWebView. However, in Safari, these
2156         videos should play fullscreen. (Todou videos have webkit-playsinline
2157         but not playsinline.)
2158
2159         Therefore, in Safari, videos with playsinline should be inline, but
2160         videos with webkit-playsinline should be fullscreen. In apps using
2161         WKWebViews, if the app sets allowsInlineMediaPlayback, then videos with
2162         playsinline should be inline, and videos with webkit-playsinline should
2163         also be inline. Videos on iPad and Mac should all be inline by default.
2164
2165         We can create some truth tables for the cases which need to be covered:
2166
2167         All apps on Mac / iPad:
2168         Presence of playsinline | Presence of webkit-playsinline | Result
2169         ========================|================================|===========
2170         Not present             | Not present                    | Inline
2171         Present                 | Not present                    | Inline
2172         Not Present             | Present                        | Inline
2173         Present                 | Present                        | Inline
2174
2175         Safari on iPhone:
2176         Presence of playsinline | Presence of webkit-playsinline | Result
2177         ========================|================================|===========
2178         Not present             | Not present                    | Fullscreen
2179         Present                 | Not present                    | Inline
2180         Not Present             | Present                        | Fullscreen
2181         Present                 | Present                        | Inline
2182
2183         App on iPhone which sets allowsInlineMediaPlayback:
2184         Presence of playsinline | Presence of webkit-playsinline | Result
2185         ========================|================================|===========
2186         Not present             | Not present                    | Fullscreen
2187         Present                 | Not present                    | Inline
2188         Not Present             | Present                        | Inline
2189         Present                 | Present                        | Inline
2190
2191         The way to distinguish Safari from another app is to create an SPI
2192         boolean preference which Safari can set. This is already how the
2193         iPhone and iPad are differentiated using the requiresPlayInlineAttribute
2194         which Safari sets but other apps don't. However, this preference is
2195         no longer sufficient because Safari should now be discriminating
2196         between the playsinline and webkit-playsinline attributes. Therefore,
2197         this preference should be extended to two boolean preferences, which
2198         this patch adds:
2199
2200         allowsInlineMediaPlaybackWithPlaysInlineAttribute
2201         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute
2202
2203         Safari on iPhone will set
2204         allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to true,
2205         and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to
2206         false. Other apps on iPhone will get their defaults values (because they
2207         are SPI) which means they will both be true. On iPad and Mac, apps will
2208         use the defaults values where both are false.
2209
2210         This patch adds support for these two preferences, but does not remove
2211         the existing inlineMediaPlaybackRequiresPlaysInlineAttribute preference.
2212         I will remove the exising preference as soon as I update Safari to migrate
2213         off of it.
2214
2215         Test: media/video-playsinline.html
2216
2217         * html/MediaElementSession.cpp:
2218         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2219         * page/Settings.cpp:
2220         * page/Settings.in:
2221         * testing/InternalSettings.cpp:
2222         (WebCore::InternalSettings::Backup::Backup):
2223         (WebCore::InternalSettings::Backup::restoreTo):
2224         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
2225         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
2226         * testing/InternalSettings.h:
2227         * testing/InternalSettings.idl:
2228
2229 2016-07-20  Chris Dumez  <cdumez@apple.com>
2230
2231         Get rid of custom bindings code for XMLHttpRequest.open()
2232         https://bugs.webkit.org/show_bug.cgi?id=159984
2233
2234         Reviewed by Ryosuke Niwa.
2235
2236         Get rid of custom bindings code for XMLHttpRequest.open() as the
2237         bindings generator is able to generate it.
2238
2239         Relevant specification:
2240         - https://xhr.spec.whatwg.org/#xmlhttprequest
2241
2242         The issue is that legacy content prevents treating the 'async' argument
2243         being undefined identical from it being omitted. However, this can be
2244         achieved by using overloading in IDL, like in the specification.
2245
2246         No new tests, already covered by the following tests:
2247         - http/tests/xmlhttprequest/basic-auth.html
2248         - http/tests/xmlhttprequest/open-async-overload.html
2249
2250         * bindings/js/JSXMLHttpRequestCustom.cpp:
2251         (WebCore::SendFunctor::SendFunctor): Deleted.
2252         (WebCore::SendFunctor::line): Deleted.
2253         (WebCore::SendFunctor::column): Deleted.
2254         (WebCore::SendFunctor::url): Deleted.
2255         (WebCore::SendFunctor::operator()): Deleted.
2256         * xml/XMLHttpRequest.cpp:
2257         (WebCore::XMLHttpRequest::open):
2258         * xml/XMLHttpRequest.h:
2259         * xml/XMLHttpRequest.idl:
2260
2261 2016-07-20  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
2262
2263         Mark overriden methods in WebCore/svg final classes as final
2264         https://bugs.webkit.org/show_bug.cgi?id=159966
2265
2266         Reviewed by Michael Catanzaro.
2267
2268         Update WebCore/svg classes so that overriden methods in final classes are marked final.
2269
2270         * svg/SVGAElement.h:
2271         * svg/SVGAltGlyphDefElement.h:
2272         * svg/SVGAltGlyphItemElement.h:
2273         * svg/SVGAnimateTransformElement.h:
2274         * svg/SVGAnimatedColor.h:
2275         * svg/SVGCircleElement.h:
2276         * svg/SVGClipPathElement.h:
2277         * svg/SVGCursorElement.h:
2278         * svg/SVGDefsElement.h:
2279         * svg/SVGDescElement.h:
2280         * svg/SVGEllipseElement.h:
2281         * svg/SVGFEMergeNodeElement.h:
2282         * svg/SVGFilterElement.h:
2283         * svg/SVGFontElement.h:
2284         * svg/SVGFontFaceElement.h:
2285         * svg/SVGFontFaceFormatElement.h:
2286         * svg/SVGFontFaceNameElement.h:
2287         * svg/SVGFontFaceSrcElement.h:
2288         * svg/SVGFontFaceUriElement.h:
2289         * svg/SVGForeignObjectElement.h:
2290         * svg/SVGGElement.h:
2291         * svg/SVGGlyphElement.h:
2292         * svg/SVGGlyphRefElement.h:
2293         * svg/SVGHKernElement.h:
2294         * svg/SVGImageElement.h:
2295         * svg/SVGLineElement.h:
2296         * svg/SVGMPathElement.h:
2297         * svg/SVGMaskElement.h:
2298         * svg/SVGMetadataElement.h:
2299         * svg/SVGMissingGlyphElement.h:
2300         * svg/SVGPathBuilder.h:
2301         * svg/SVGPathByteStreamBuilder.h:
2302         * svg/SVGPathByteStreamSource.h:
2303         * svg/SVGPathElement.h:
2304         * svg/SVGPathSegArcAbs.h:
2305         * svg/SVGPathSegArcRel.h:
2306         * svg/SVGPathSegClosePath.h:
2307         * svg/SVGPathSegCurvetoCubicAbs.h:
2308         * svg/SVGPathSegCurvetoCubicRel.h:
2309         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
2310         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
2311         * svg/SVGPathSegCurvetoQuadraticAbs.h:
2312         * svg/SVGPathSegCurvetoQuadraticRel.h:
2313         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
2314         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
2315         * svg/SVGPathSegLinetoAbs.h:
2316         * svg/SVGPathSegLinetoHorizontalAbs.h:
2317         * svg/SVGPathSegLinetoHorizontalRel.h:
2318         * svg/SVGPathSegLinetoRel.h:
2319         * svg/SVGPathSegLinetoVerticalAbs.h:
2320         * svg/SVGPathSegLinetoVerticalRel.h:
2321         * svg/SVGPathSegListBuilder.h:
2322         * svg/SVGPathSegListSource.h:
2323         * svg/SVGPathSegMovetoAbs.h:
2324         * svg/SVGPathSegMovetoRel.h:
2325         * svg/SVGPathStringSource.h:
2326         * svg/SVGPathTraversalStateBuilder.h:
2327         * svg/SVGPatternElement.h:
2328         * svg/SVGRectElement.h:
2329         * svg/SVGScriptElement.h:
2330         * svg/SVGStopElement.h:
2331         * svg/SVGStyleElement.h:
2332         * svg/SVGSwitchElement.h:
2333         * svg/SVGTRefElement.cpp:
2334         * svg/SVGTitleElement.h:
2335         * svg/SVGToOTFFontConversion.cpp:
2336         * svg/SVGUnknownElement.h:
2337         * svg/SVGVKernElement.h:
2338         * svg/SVGViewElement.h:
2339         * svg/SVGZoomEvent.h:
2340         * svg/animation/SVGSMILElement.cpp:
2341         * svg/graphics/SVGImage.h:
2342         * svg/graphics/SVGImageClients.h:
2343         * svg/graphics/SVGImageForContainer.h:
2344         * svg/graphics/filters/SVGFEImage.h:
2345         * svg/graphics/filters/SVGFilter.h:
2346         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
2347         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2348         * svg/properties/SVGAnimatedPropertyTearOff.h:
2349         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
2350         * svg/properties/SVGMatrixTearOff.h:
2351         * svg/properties/SVGPathSegListPropertyTearOff.h:
2352
2353 2016-07-20  Brady Eidson  <beidson@apple.com>
2354
2355         Transition most IDB interfaces from ScriptExecutionContext to ExecState.
2356         https://bugs.webkit.org/show_bug.cgi?id=159975
2357
2358         Reviewed by Alex Christensen.
2359
2360         No new tests (No known behavior change).
2361
2362         * Modules/indexeddb/IDBCursor.cpp:
2363         (WebCore::IDBCursor::continueFunction):
2364         (WebCore::IDBCursor::deleteFunction):
2365         * Modules/indexeddb/IDBCursor.h:
2366         * Modules/indexeddb/IDBCursor.idl:
2367
2368         * Modules/indexeddb/IDBDatabase.idl:
2369
2370         * Modules/indexeddb/IDBFactory.cpp:
2371         (WebCore::IDBFactory::cmp):
2372         * Modules/indexeddb/IDBFactory.h:
2373         * Modules/indexeddb/IDBFactory.idl:
2374
2375         * Modules/indexeddb/IDBIndex.cpp:
2376         (WebCore::IDBIndex::openCursor):
2377         (WebCore::IDBIndex::count):
2378         (WebCore::IDBIndex::doCount):
2379         (WebCore::IDBIndex::openKeyCursor):
2380         (WebCore::IDBIndex::get):
2381         (WebCore::IDBIndex::doGet):
2382         (WebCore::IDBIndex::getKey):
2383         (WebCore::IDBIndex::doGetKey):
2384         * Modules/indexeddb/IDBIndex.h:
2385         * Modules/indexeddb/IDBIndex.idl:
2386
2387         * Modules/indexeddb/IDBKeyRange.cpp:
2388         (WebCore::IDBKeyRange::only): Deleted.
2389         * Modules/indexeddb/IDBKeyRange.h:
2390
2391         * Modules/indexeddb/IDBObjectStore.cpp:
2392         (WebCore::IDBObjectStore::openCursor):
2393         (WebCore::IDBObjectStore::get):
2394         (WebCore::IDBObjectStore::putOrAdd):
2395         (WebCore::IDBObjectStore::deleteFunction):
2396         (WebCore::IDBObjectStore::doDelete):
2397         (WebCore::IDBObjectStore::modernDelete):
2398         (WebCore::IDBObjectStore::clear):
2399         (WebCore::IDBObjectStore::createIndex):
2400         (WebCore::IDBObjectStore::count):
2401         (WebCore::IDBObjectStore::doCount):
2402         * Modules/indexeddb/IDBObjectStore.h:
2403         * Modules/indexeddb/IDBObjectStore.idl:
2404
2405         * Modules/indexeddb/IDBTransaction.cpp:
2406         (WebCore::IDBTransaction::requestOpenCursor):
2407         (WebCore::IDBTransaction::doRequestOpenCursor):
2408         (WebCore::IDBTransaction::requestGetRecord):
2409         (WebCore::IDBTransaction::requestGetValue):
2410         (WebCore::IDBTransaction::requestGetKey):
2411         (WebCore::IDBTransaction::requestIndexRecord):
2412         (WebCore::IDBTransaction::requestCount):
2413         (WebCore::IDBTransaction::requestDeleteRecord):
2414         (WebCore::IDBTransaction::requestClearObjectStore):
2415         (WebCore::IDBTransaction::requestPutOrAdd):
2416         * Modules/indexeddb/IDBTransaction.h:
2417
2418         * inspector/InspectorIndexedDBAgent.cpp:
2419
2420 2016-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2421
2422         Media controls don't appear when pausing a small autoplaying video
2423         https://bugs.webkit.org/show_bug.cgi?id=159972
2424         <rdar://problem/27180657>
2425
2426         Reviewed by Beth Dakin.
2427
2428         When pausing an autoplaying video, remove behavior restrictions for the
2429         initial user gesture and show media controls.
2430
2431         New WebKit API test. See VideoControlsManagerSingleSmallAutoplayingVideo.
2432
2433         * html/HTMLMediaElement.cpp:
2434         (WebCore::HTMLMediaElement::pause):
2435
2436 2016-07-20  Chris Dumez  <cdumez@apple.com>
2437
2438         Fix null handling of HTMLMediaElement.mediaGroup
2439         https://bugs.webkit.org/show_bug.cgi?id=159974
2440
2441         Reviewed by Eric Carlson.
2442
2443         Fix null handling of HTMLMediaElement.mediaGroup to match the specification:
2444         - https://www.w3.org/TR/html5/embedded-content-0.html#media-elements
2445
2446         null is supposed to be treated as the String "null". This patch aligns
2447         our behavior with the specification. I tested Firefox and Chrome but both
2448         do not have this attribute on HTMLMediaElement.
2449
2450         Also remove support for [TreatNullAs=LegacyNullString] from our bindings
2451         generator as HTMLMediaElement.mediaGroup was the last user.
2452
2453         No new tests, rebaselined existing test.
2454
2455         * bindings/scripts/CodeGeneratorJS.pm:
2456         (JSValueToNative):
2457         * bindings/scripts/IDLAttributes.txt:
2458         * html/HTMLMediaElement.idl:
2459
2460 2016-07-20  Chris Dumez  <cdumez@apple.com>
2461
2462         CSSStyleDeclaration.setProperty() should be able to unset "important" on a property
2463         https://bugs.webkit.org/show_bug.cgi?id=159959
2464
2465         Reviewed by Alexey Proskuryakov.
2466
2467         CSSStyleDeclaration.setProperty() should be able to unsert "important"
2468         on a property as per the latest specification:
2469         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
2470         - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute
2471
2472         Firefox and Chrome match the specification here but WebKit was ignoring calls
2473         to setProperty() if there is already an "important" property wit this name
2474         and if the new property does not have the "important" flag set.
2475
2476         This behavior was added a long time ago via Bug 60007. However, it does not
2477         match the latest specification or other browsers.
2478
2479         Test: fast/css/CSSStyleDeclaration-setProperty-unset-important.html
2480
2481         * css/StyleProperties.cpp:
2482         (WebCore::MutableStyleProperties::addParsedProperty):
2483         Drop code that was added via Bug 60007 as this behavior no longer matches the
2484         specification or other browsers. The layout test added in Bug 60007 fails in
2485         other browsers and was updated in this patch to match the specification.
2486
2487 2016-07-20  Commit Queue  <commit-queue@webkit.org>
2488
2489         Unreviewed, rolling out r203423.
2490         https://bugs.webkit.org/show_bug.cgi?id=159977
2491
2492         The test for this change is failing on Mac Release WK2
2493         (Requested by ryanhaddad on #webkit).
2494
2495         Reverted changeset:
2496
2497         "HTMLVideoElement frames do not update on iOS when src is a
2498         MediaStream blob"
2499         https://bugs.webkit.org/show_bug.cgi?id=159833
2500         http://trac.webkit.org/changeset/203423
2501
2502 2016-07-20  Chris Dumez  <cdumez@apple.com>
2503
2504         Fix null handling of HTMLSelectElement.value attribute
2505         https://bugs.webkit.org/show_bug.cgi?id=159925
2506
2507         Reviewed by Benjamin Poulain.
2508
2509         Fix null handling of HTMLSelectElement.value attribute:
2510         - https://html.spec.whatwg.org/multipage/forms.html#htmlselectelement
2511
2512         We were treating null as the null String which would end up setting
2513         selectedIndex to -1. However, we should treat null as the String "null"
2514         which would set the selectedIndex to the index of the <option> element
2515         whose value is "null".
2516
2517         Firefox and Chrome match the specification.
2518
2519         Test: fast/dom/HTMLSelectElement/value-null-handling.html
2520
2521         * html/HTMLSelectElement.cpp:
2522         (WebCore::HTMLSelectElement::setValue):
2523         * html/HTMLSelectElement.idl:
2524
2525 2016-07-20  Chris Dumez  <cdumez@apple.com>
2526
2527         PostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspender is alive
2528         https://bugs.webkit.org/show_bug.cgi?id=159962
2529         <rdar://problem/21439264>
2530
2531         Reviewed by David Kilzer.
2532
2533         PostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspender
2534         is alive. We have both PostResolutionCallbackDisabler and ResourceLoadSuspender that
2535         call LoaderStrategy::suspendPendingRequests() / LoaderStrategy::resumePendingRequests().
2536         However, PostResolutionCallbackDisabler and ResourceLoadSuspender are not aware of each
2537         other. It is therefore possible for a PostResolutionCallbackDisabler object to get
2538         destroyed, causing LoaderStrategy::resumePendingRequests() to be called while a
2539         ResourceLoadSuspender object is alive.
2540
2541         This leads to hard to investigate crashes where we end up re-entering WebKit and killing
2542         the style resolver.
2543
2544         This patch drops ResourceLoadSuspender and uses PostResolutionCallbackDisabler instead.
2545         There was only one user of ResourceLoadSuspender and PostResolutionCallbackDisabler
2546         is better because it manages a resolutionNestingDepth counter internally to make sure
2547         it only calls LoaderStrategy::resumePendingRequests() once all
2548         PostResolutionCallbackDisabler instances are destroyed.
2549
2550         No new tests, there is no easy way to reproduce the crashes.
2551
2552         * dom/Document.cpp:
2553         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
2554         * loader/LoaderStrategy.cpp:
2555         (WebCore::ResourceLoadSuspender::ResourceLoadSuspender): Deleted.
2556         (WebCore::ResourceLoadSuspender::~ResourceLoadSuspender): Deleted.
2557         * loader/LoaderStrategy.h:
2558
2559 2016-07-19  Youenn Fablet  <youenn@apple.com>
2560
2561         [Fetch API] Add a JS builtin to implement https://fetch.spec.whatwg.org/#concept-headers-fill
2562         https://bugs.webkit.org/show_bug.cgi?id=159932
2563
2564         Reviewed by Alex Christensen.
2565
2566         Covered by existing tests.
2567
2568         Refactoring Headers initializeWith to use the new built-in internal that implements
2569         https://fetch.spec.whatwg.org/#concept-headers-fill.
2570
2571         Refactoring Response constructor to put more checks in the JS builtin fucntion called within constructor.
2572         Making use of the new built-in internal that implements https://fetch.spec.whatwg.org/#concept-headers-fill.
2573
2574         * CMakeLists.txt: Adding FetchHeadersInternals.js
2575         * DerivedSources.make: Ditto.
2576         * Modules/fetch/FetchHeaders.js:
2577         (initializeFetchHeaders): Using fillFetchHeaders new built-in internal.
2578         * Modules/fetch/FetchInternals.js: Added.
2579         (fillFetchHeaders):
2580         * Modules/fetch/FetchResponse.cpp: Refactoring to do more in the JS built-in. Splitting of initializeWith so
2581         that the checks are done in the order defined by the spec.
2582         (WebCore::FetchResponse::setStatus):
2583         (WebCore::FetchResponse::initializeWith):
2584         (WebCore::isNullBodyStatus): Deleted.
2585         * Modules/fetch/FetchResponse.h:
2586         * Modules/fetch/FetchResponse.idl:
2587         * Modules/fetch/FetchResponse.js:
2588         (initializeFetchResponse): New built-in internal.
2589         * WebCore.xcodeproj/project.pbxproj:
2590         * bindings/js/WebCoreBuiltinNames.h:
2591
2592 2016-07-19  Chris Dumez  <cdumez@apple.com>
2593
2594         Fix null handling of SVGScriptElement.type attribute
2595         https://bugs.webkit.org/show_bug.cgi?id=159927
2596
2597         Reviewed by Benjamin Poulain.
2598
2599         Fix null handling of SVGScriptElement.type attribute:
2600         - https://www.w3.org/TR/SVG2/interact.html#InterfaceSVGScriptElement
2601
2602         We were treating null as the null String which would end up removing
2603         the 'type' content attribute. However, we should treat null as the
2604         String "null".
2605
2606         Firefox and Chrome match the specification.
2607
2608         No new tests, updated existing test.
2609
2610         * svg/SVGScriptElement.idl:
2611
2612 2016-07-19  Chris Dumez  <cdumez@apple.com>
2613
2614         Fix null handling of several HTMLDocument attributes
2615         https://bugs.webkit.org/show_bug.cgi?id=159923
2616
2617         Reviewed by Benjamin Poulain.
2618
2619         Fix null handling of several HTMLDocument attributes:
2620         - https://html.spec.whatwg.org/multipage/dom.html#document
2621         - https://html.spec.whatwg.org/multipage/obsolete.html#document-partial
2622
2623         In particular, null handling was incorrect in WebKit for 'dir',
2624         'bgColor', 'fgColor', 'alinkColor', 'linkColor' and 'vlinkColor'.
2625
2626         Firefox and Chrome match the specification.
2627
2628         Test: fast/dom/HTMLDocument/null-handling.html
2629
2630         * html/HTMLDocument.idl:
2631
2632 2016-07-19  Chris Dumez  <cdumez@apple.com>
2633
2634         Document.createElementNS() / createAttributeNS() parameters should be mandatory
2635         https://bugs.webkit.org/show_bug.cgi?id=159938
2636
2637         Reviewed by Benjamin Poulain.
2638
2639         Document.createElementNS() / createAttributeNS() parameters should be mandatory:
2640         - https://dom.spec.whatwg.org/#document
2641
2642         They were optional in WebKit. However, Firefox and Chrome both match the
2643         specification.
2644
2645         No new tests, rebaselined existing tests.
2646
2647         * dom/Document.idl:
2648
2649 2016-07-19  Benjamin Poulain  <bpoulain@apple.com>
2650
2651         Use getElementById for attribute matching if the attribute name is html's id
2652         https://bugs.webkit.org/show_bug.cgi?id=159960
2653
2654         Reviewed by Chris Dumez.
2655
2656         Elliott Sprehn discovered YUI makes heavy uses of querySelector with [id=value]
2657         (https://bugs.chromium.org/p/chromium/issues/detail?id=627242).
2658
2659         If we are not in quirks mode, IdForStyleResolution has the same value
2660         as the Id attribute. We can use the same optimization for both cases.
2661
2662         Tests: fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks.html
2663                fast/selectors/id-attribute-querySelector-used-as-id-selector.html
2664
2665         * dom/SelectorQuery.cpp:
2666         (WebCore::canBeUsedForIdFastPath):
2667         (WebCore::findIdMatchingType):
2668         (WebCore::SelectorDataList::SelectorDataList):
2669         (WebCore::selectorForIdLookup):
2670         (WebCore::filterRootById):
2671
2672 2016-07-19  Chris Dumez  <cdumez@apple.com>
2673
2674         Drop SVGElement.xmlbase attribute
2675         https://bugs.webkit.org/show_bug.cgi?id=159926
2676
2677         Reviewed by Benjamin Poulain.
2678
2679         Drop SVGElement.xmlbase attribute as it is no longer part of the
2680         specification:
2681         - https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement
2682
2683         Both Firefox and Chrome have already dropped support for
2684         SVGElement.xmlbase.
2685
2686         Chrome's intent to remove:
2687         https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TfwMq4d25hk/C-v_iC_wKfAJ
2688
2689         Test: svg/dom/SVGElement-xmlbase.html
2690
2691         * svg/SVGElement.cpp:
2692         (WebCore::SVGElement::removedFrom): Deleted.
2693         * svg/SVGElement.h:
2694         * svg/SVGElement.idl:
2695
2696 2016-07-19  Chris Dumez  <cdumez@apple.com>
2697
2698         Align CSSStyleDeclaration.setProperty() with the specification
2699         https://bugs.webkit.org/show_bug.cgi?id=159955
2700
2701         Reviewed by Benjamin Poulain.
2702
2703         Align CSSStyleDeclaration.setProperty() with the specification:
2704         - https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface
2705
2706         In particular, the following changes were needed:
2707         1. The 'value' parameter should not be optional
2708         2. The 'priority' parameter should treat null as the empty string
2709            rather than the string "null".
2710         3. The 'priority' parameter's default value should be the empty string,
2711            not the string "undefined".
2712         4. CSSStyleDeclaration.setProperty() should return early if 'priority'
2713            is not the empty string and is not an ASCII case-insensitive match
2714            for the string "important".
2715
2716         Chrome matches the specification entirely.
2717         Firefox matches the specification with the exception that it does a
2718         case-sensitive match for "important".
2719
2720         Test: fast/css/CSSStyleDeclaration-setProperty.html
2721
2722         * css/CSSStyleDeclaration.idl:
2723         * css/PropertySetCSSStyleDeclaration.cpp:
2724         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2725
2726 2016-07-19  Daniel Bates  <dabates@apple.com>
2727
2728         CSP: Improve support for multiple policies to more closely conform to the CSP Level 2 spec.
2729         https://bugs.webkit.org/show_bug.cgi?id=159841
2730         <rdar://problem/27381684>
2731
2732         Reviewed by Brent Fulgham.
2733
2734         Implement a first pass at sending multiple violation reports so as to more closely
2735         conform to section Enforcing multiple policies of the Content Security Policy Level 2 spec.,
2736         <https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 25 April 2016).
2737
2738         Tests: http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.php
2739                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.php
2740                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.php
2741                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php
2742                http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
2743                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.php
2744                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy2.php
2745                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
2746                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
2747                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
2748                http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
2749                http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only.html
2750                http/tests/security/contentSecurityPolicy/1.1/scripthash-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html
2751                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy.php
2752                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2.php
2753                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php
2754                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
2755                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.php
2756                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2.php
2757                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
2758                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
2759                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
2760                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
2761                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only.html
2762                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html
2763                http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies.html
2764
2765         * page/csp/ContentSecurityPolicy.cpp:
2766         (WebCore::ContentSecurityPolicy::allPoliciesWithDispositionAllow): Added. Returns whether the resource
2767         is allowed by all of the policies with the specified disposition.
2768         (WebCore::ContentSecurityPolicy::allPoliciesAllow): Added. Returns whether the resource is allowed by
2769         all of the enforced policies.
2770         (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Formerly named foundHashOfContentInAllPolicies.
2771         Modified to return a ("has found hash in all enforced policies, "has found hash in all report-only policies)-pair
2772         so that we can differentiate whether the hash violated an enforced policy or a report-only policy.
2773         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Write in terms of ContentSecurityPolicy::allPoliciesAllow().
2774         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
2775         (WebCore::ContentSecurityPolicy::allowScriptWithNonce): For now only accept a nonce if it is allowed by
2776         all enforced policies. As a side effect of this change is that we only send a CSP violation report when a
2777         nonce violates a report-only policy only if the nonce also violates one or more enforced policies. We will
2778         address this limitation in <https://bugs.webkit.org/show_bug.cgi?id=159830>.
2779         (WebCore::ContentSecurityPolicy::allowStyleWithNonce): Ditto.
2780         (WebCore::ContentSecurityPolicy::allowInlineScript): Differentiate between a hash/'unsafe-inline' that
2781         matches/is contained in all enforce policies and a hash/'unsafe-inline' that matches/is contained in all
2782         report-only policies so that we only allow the resource for the former. As a side effect of this change
2783         we may report that a resource violated a policy even if it contained the hash. See <https://bugs.webkit.org/show_bug.cgi?id=159832>
2784         for more details.
2785         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
2786         (WebCore::ContentSecurityPolicy::allowEval): Write in terms of ContentSecurityPolicy::allPoliciesAllow().
2787         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
2788         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
2789         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
2790         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
2791         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
2792         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
2793         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
2794         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
2795         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
2796         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
2797         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
2798         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
2799         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
2800         (WebCore::ContentSecurityPolicy::foundHashOfContentInAllPolicies): Deleted.
2801         * page/csp/ContentSecurityPolicy.h:
2802         (WebCore::ContentSecurityPolicy::violatedDirectiveInAnyPolicy): Deleted.
2803
2804 2016-07-19  Chris Dumez  <cdumez@apple.com>
2805
2806         Fix null handling of HTMLScriptElement.text attribute
2807         https://bugs.webkit.org/show_bug.cgi?id=159943
2808
2809         Reviewed by Benjamin Poulain.
2810
2811         Fix null handling of HTMLScriptElement.text attribute:
2812         - https://html.spec.whatwg.org/multipage/scripting.html#the-script-element
2813
2814         We should treat null as the "null" String but we were treating it as
2815         the empty string.
2816
2817         Firefox and Chrome match the specification.
2818
2819         No new tests, rebaselined existing test.
2820
2821         * html/HTMLScriptElement.idl:
2822
2823 2016-07-19  Chris Dumez  <cdumez@apple.com>
2824
2825         autocapitalize attribute should not use [TreatNullAs=LegacyNullString]
2826         https://bugs.webkit.org/show_bug.cgi?id=159934
2827
2828         Reviewed by Benjamin Poulain.
2829
2830         autocapitalize attribute should not use [TreatNullAs=LegacyNullString]. This is
2831         non-standard and we want to drop support for it from the bindings generator.
2832
2833         Instead, use [TreatNullAs=EmptyString] in order to maintain existing behavior
2834         given that both a missing/empty attribute result in using the default
2835         autocapitalization mode and that autocapitalize returns the empty string by
2836         default.
2837
2838         Test: platform/ios-simulator/ios/fast/forms/autocapitalize-null.html
2839
2840         * html/HTMLFormElement.idl:
2841         * html/HTMLInputElement.idl:
2842         * html/HTMLTextAreaElement.idl:
2843
2844 2016-07-19  Zalan Bujtas  <zalan@apple.com>
2845
2846         REGRESSION(r203415): ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()
2847         https://bugs.webkit.org/show_bug.cgi?id=159952
2848
2849         Reviewed by Simon Fraser.
2850
2851         Update ASSERTs to reflect new functionality, that is, now we can end up in a state
2852         where the container (RenderView) of one of the dirty subtrees is dirty.
2853         See r203415.
2854  
2855         Covered by editing/pasteboard/drag-drop-input-in-svg.svg
2856
2857         * page/FrameView.cpp:
2858         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2859
2860 2016-07-19  Dean Jackson  <dino@apple.com>
2861
2862         REGRESSION(202927): The first slide is the only displayed slide when Quicklooking a Keynote file
2863         https://bugs.webkit.org/show_bug.cgi?id=159948
2864         <rdar://problem/27391012>
2865
2866         Reviewed by Simon Fraser.
2867
2868         There is an iOS bug (<rdar://problem/27416744>) that is causing us
2869         to not always get a color space on CGContextRefs. Investigation of this
2870         exposed some optimizations we can take when we are creating ImageBuffers.
2871         In particular, if we have a bitmap context or an IOSurfaceContext we
2872         can simply copy their color space using API. Otherwise we stick with
2873         the existing CGContextCopyDeviceColorSpace.
2874
2875         Lastly, if for some reason we are unable to copy the device color space,
2876         we should fall back to sRGB.
2877
2878         * platform/graphics/cg/ImageBufferCG.cpp:
2879         (WebCore::ImageBuffer::createCompatibleBuffer):
2880         * platform/spi/cg/CoreGraphicsSPI.h: Add some SPI and enums.
2881
2882
2883 2016-07-19  George Ruan  <gruan@apple.com>
2884
2885         HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
2886         https://bugs.webkit.org/show_bug.cgi?id=159833
2887         <rdar://problem/27379487>
2888
2889         Reviewed by Eric Carlson.
2890
2891         Test: fast/mediastream/MediaStream-video-element-displays-buffer.html
2892
2893         * WebCore.xcodeproj/project.pbxproj:
2894         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
2895         of RefPtr<T>
2896         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
2897         MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
2898         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
2899         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
2900         observers and AVSampleBufferDisplayLayer
2901         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
2902         is available.
2903         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
2904         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
2905         for enqueuing sample buffers to the active video track.
2906         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
2907         exists.
2908         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
2909         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
2910         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
2911         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
2912         new SampleBuffer is available.
2913         (WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
2914         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
2915         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
2916         MediaPlayerPrivateMediaSourceAVFObjC.mm
2917         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
2918         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
2919         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
2920         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
2921         * platform/mediastream/MediaStreamPrivate.cpp:
2922         (WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
2923         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2924         (WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
2925         is available.
2926         * platform/mediastream/MediaStreamTrackPrivate.h:
2927         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStream that
2928         a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
2929         * platform/mediastream/RealtimeMediaSource.cpp:
2930         (WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
2931         * platform/mediastream/RealtimeMediaSource.h:
2932         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2933         (WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.
2934
2935 2016-07-19  Anders Carlsson  <andersca@apple.com>
2936
2937         Get rid of a #define private public hack in WebCore
2938         https://bugs.webkit.org/show_bug.cgi?id=159953
2939
2940         Reviewed by Dan Bernstein.
2941
2942         Use @package instead.
2943
2944         * bindings/objc/DOMInternal.h:
2945         * bindings/objc/DOMObject.h:
2946
2947 2016-07-19  Andreas Kling  <akling@apple.com>
2948
2949         Fix SharedBuffer leak in MockContentFilter::replacementData().
2950         <https://webkit.org/b/159945>
2951
2952         Reviewed by Andy Estes.
2953
2954         Spotted on leaks bot. This code was pretty explicit about how it's going to leak.
2955         Since this is in the mock filter, it only affected layout tests.
2956
2957         * testing/MockContentFilter.cpp:
2958         (WebCore::MockContentFilter::replacementData):
2959
2960 2016-07-19  Zalan Bujtas  <zalan@apple.com>
2961
2962         theguardian.co.uk crossword puzzles are sometimes not displaying text
2963         https://bugs.webkit.org/show_bug.cgi?id=159924
2964         <rdar://problem/27409483>
2965
2966         Reviewed by Simon Fraser.
2967
2968         This patch fixes the case when
2969         - 2 disjoint subtrees are dirty
2970         - RenderView is also dirty.
2971         and we end up not laying out one of the 2 subtrees.
2972
2973         In FrameView::scheduleRelayoutOfSubtree, we assume that when the RenderView is dirty
2974         we already have a pending full layout which means that any previous subtree layouts have already been
2975         converted to full layouts.
2976         However this assumption is incorrect. RenderView can get dirty without checking if there's
2977         already a pending subtree layout.
2978         One option to solve this problem would be to override RenderObject::setNeedsLayout in RenderView
2979         so that when the RenderView gets dirty, we could also convert any pending subtree layout to full layout.
2980         However RenderObject::setNeedsLayout is a hot function and making it virtual would impact performance.
2981         The other option is to always normalize subtree layouts in FrameView::scheduleRelayoutOfSubtree().
2982         This patch implements the second option.
2983
2984         Test: fast/misc/subtree-layouts.html
2985
2986         * page/FrameView.cpp:
2987         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2988
2989 2016-07-19  Anders Carlsson  <andersca@apple.com>
2990
2991         Some payment authorization status values should keep the sheet active
2992         https://bugs.webkit.org/show_bug.cgi?id=159936
2993         rdar://problem/26756701
2994
2995         Reviewed by Tim Horton.
2996
2997         * Modules/applepay/ApplePaySession.cpp:
2998         (WebCore::ApplePaySession::completePayment):
2999         Keep the sheet active if the status isn't a final state status.
3000
3001         * Modules/applepay/PaymentAuthorizationStatus.h:
3002         (WebCore::isFinalStateStatus):
3003         Add a new helper function that returns whether a given payment authorization status is "final",
3004         meaning that once that status has been passed to completePayment, the session is finished.
3005
3006 2016-07-19  Nan Wang  <n_wang@apple.com>
3007
3008         AX: Incorrect behavior for word related text marker functions when there's collapsed whitespace
3009         https://bugs.webkit.org/show_bug.cgi?id=159910
3010
3011         Reviewed by Chris Fleizach.
3012
3013         We are getting a bad CharacterOffset when there's collapsed whitespace. Added a TraverseOptionValidateOffset
3014         option to make sure we are getting the correct CharacterOffset based on the corresponding Range offset. And
3015         fixed a word navigation issue based on that.
3016
3017         Test: accessibility/mac/text-marker-word-nav-collapsed-whitespace.html
3018
3019         * accessibility/AXObjectCache.cpp:
3020         (WebCore::AXObjectCache::traverseToOffsetInRange):
3021         (WebCore::AXObjectCache::rangeForNodeContents):
3022         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
3023         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
3024         (WebCore::AXObjectCache::rightWordRange):
3025         (WebCore::AXObjectCache::previousBoundary):
3026         * accessibility/AXObjectCache.h:
3027         (WebCore::AXObjectCache::isNodeInUse):
3028
3029 2016-07-19  Youenn Fablet  <youenn@apple.com>
3030
3031         [Streams API] ReadableStreamController methods should throw if its stream is not readable
3032         https://bugs.webkit.org/show_bug.cgi?id=159871
3033
3034         Reviewed by Xabier Rodriguez-Calvar.
3035
3036         Spec now mandates close and enqueue to throw if ReadableStream is not readable.
3037         Covered by rebased and/or modified tests.
3038
3039         * Modules/streams/ReadableStreamController.js:
3040         (enqueue): Throwing a TypeError if controlled stream is not readable.
3041         (close): Ditto.
3042
3043 2016-07-19  Simon Fraser  <simon.fraser@apple.com>
3044
3045         Bubbles appear split for a brief moment in Messages
3046         https://bugs.webkit.org/show_bug.cgi?id=159915
3047         rdar://problem/27182267
3048
3049         Reviewed by David Hyatt.
3050
3051         RenderView::repaintRootContents() had a long-standing bug in WebView when the
3052         view is scrolled. repaint() uses visualOverflowRect() but, for the 
3053         RenderView, the visualOverflowRect() is the initial containing block
3054         which is anchored at 0,0. When the view is scrolled it's clipped out and
3055         calls to repaintRootContents() have no effect.
3056         
3057         Change repaintRootContents() to use layoutOverflowRect(). ScrollView::repaintContentRectangle()
3058         will clip it to the view if necessary.
3059
3060         Test: fast/repaint/scrolled-view-full-repaint.html
3061
3062         * rendering/RenderView.cpp:
3063         (WebCore::RenderView::repaintRootContents):
3064
3065 2016-07-19  Dan Bernstein  <mitz@apple.com>
3066
3067         <rdar://problem/27420308> WebCore-7602.1.42 fails to build: error: unused parameter 'vm'
3068
3069         * bindings/js/JSDOMGlobalObject.cpp:
3070         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Fixed the !ENABLE(STREAMS_API) build.
3071
3072 2016-07-19  Youenn Fablet  <youenn@apple.com>
3073
3074         [Streams API] Make ReadableStream properties not enumerable
3075         https://bugs.webkit.org/show_bug.cgi?id=159868
3076
3077         Reviewed by Darin Adler.
3078
3079         Covered by rebased tests.
3080
3081         Uopdating IDL definitions to mark all functions/attributes as not enumerable.
3082         Updating IDL constructor definitions to correctly compute constructor length.
3083         Updating built-in implementation to correctly compute pipeTo length to 1 (second parameter being optional).
3084
3085         * Modules/streams/ReadableStream.idl:
3086         * Modules/streams/ReadableStream.js:
3087         * Modules/streams/ReadableStreamController.idl:
3088         * Modules/streams/ReadableStreamReader.idl:
3089
3090 2016-07-19  Chris Dumez  <cdumez@apple.com>
3091
3092         form.enctype / encoding / method should treat null as "null" string
3093         https://bugs.webkit.org/show_bug.cgi?id=159916
3094
3095         Reviewed by Ryosuke Niwa.
3096
3097         form.enctype / encoding / method should treat null as "null" string:
3098         - https://html.spec.whatwg.org/multipage/forms.html#htmlformelement
3099
3100         Previously, WebKit would treat null as the null String, which would
3101         end up removing the existing attribute.
3102
3103         Firefox and Chrome match the specification.
3104
3105         Test: fast/dom/HTMLFormElement/null-handling.html
3106
3107         * html/HTMLFormElement.h:
3108         * html/HTMLFormElement.idl:
3109
3110 2016-07-18  Csaba Osztrogon√°c  <ossy@webkit.org>
3111
3112         All-in-one buildfix after r202439
3113         https://bugs.webkit.org/show_bug.cgi?id=159877
3114
3115         Reviewed by Chris Dumez.
3116
3117         * Modules/webaudio/AudioDestinationNode.h:
3118         (WebCore::AudioDestinationNode::resume):
3119         (WebCore::AudioDestinationNode::suspend):
3120         (WebCore::AudioDestinationNode::close):
3121
3122 2016-07-18  Frederic Wang  <fwang@igalia.com>
3123
3124         Move parsing of subscriptshift and superscriptshift from rendering to element classes
3125         https://bugs.webkit.org/show_bug.cgi?id=159622
3126
3127         Reviewed by Darin Adler.
3128
3129         We introduce a new MathMLScriptsElement that is used for elements msub, msup, msubsup and
3130         mmultiscripts in order to create RenderMathMLScripts and parse and expose the values of the
3131         subscriptshift and superscriptshift attributes. This is one more step toward moving MathML
3132         attribute parsing to the DOM (bug 156536).
3133
3134         No new tests, rendering is unchanged.
3135
3136         * CMakeLists.txt: Add MathMLScriptsElement files.
3137         * WebCore.xcodeproj/project.pbxproj: Ditto.
3138         * mathml/MathMLAllInOne.cpp: Ditto.
3139         * mathml/MathMLInlineContainerElement.cpp: Remove handling of scripts.
3140         (WebCore::MathMLInlineContainerElement::createElementRenderer): Deleted.
3141         * mathml/MathMLScriptsElement.cpp: Added. New class to handle scripted elements supporting
3142         parsing for the subscriptshift and superscriptshift MathML lengths.
3143         (WebCore::MathMLScriptsElement::MathMLScriptsElement):
3144         (WebCore::MathMLScriptsElement::create):
3145         (WebCore::MathMLScriptsElement::subscriptShift): Expose the cached length for the shift,
3146         parsing the attribute again if necessary.
3147         (WebCore::MathMLScriptsElement::superscriptShift): Ditto.
3148         (WebCore::MathMLScriptsElement::parseAttribute): Mark attributes dirty.
3149         (WebCore::MathMLScriptsElement::createElementRenderer): Create RenderMathMLScripts.
3150         * mathml/MathMLScriptsElement.h: Ditto.
3151         * mathml/mathtags.in: Map msub, msup, msubsup and mmultiscripts to MathMLScriptsElement.
3152         * rendering/mathml/RenderMathMLScripts.cpp:
3153         (WebCore::RenderMathMLScripts::scriptsElement): Helper function to cast the node to a
3154         MathMLScriptsElement.
3155         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Resolve the attributes
3156         using the functions from the MathMLScriptsElement class.
3157         * rendering/mathml/RenderMathMLScripts.h: Declare scriptsElement.
3158
3159 2016-07-18  Frederic Wang  <fwang@igalia.com>
3160
3161         Do not store gap and shift parameters on RenderMathMLFraction
3162         https://bugs.webkit.org/show_bug.cgi?id=159876
3163
3164         Reviewed by Darin Adler.
3165
3166         After r203285, the stack and fraction layout parameters are only used in layoutBlock so we
3167         do not need to store them on the class. We remove them and split updateLayoutParameters into
3168         three functions: one to update the linethickness and two others to retrieve the fraction and
3169         stack respectively.
3170
3171         No new tests, rendering is unchanged.
3172
3173         * rendering/mathml/RenderMathMLFraction.cpp:
3174         (WebCore::RenderMathMLFraction::updateLineThickness): Move code to update thickness members here.
3175         (WebCore::RenderMathMLFraction::getFractionParameters): Move code to retrieve fraction parameters here.
3176         (WebCore::RenderMathMLFraction::getStackParameters): Move code to retrieve stack parameters here.
3177         (WebCore::RenderMathMLFraction::layoutBlock): Use the new helper functions and local variables
3178         for fraction and stack parameters.
3179         (WebCore::RenderMathMLFraction::updateLayoutParameters): Deleted.
3180         * rendering/mathml/RenderMathMLFraction.h: Declare new helper functions and remove members
3181         for stack and fraction parameters.
3182
3183 2016-07-18  Chris Dumez  <cdumez@apple.com>
3184
3185         input.formEnctype / formMethod and button.formEnctype / formMethod / type should treat null as "null"
3186         https://bugs.webkit.org/show_bug.cgi?id=159908
3187
3188         Reviewed by Alex Christensen.
3189
3190         input.formEnctype / formMethod and button.formEnctype / formMethod / type
3191         should treat null as "null" String:
3192         - https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement
3193         - https://html.spec.whatwg.org/multipage/forms.html#htmlbuttonelement
3194
3195         In WebKit, we would treat null as a null String which would end up
3196         removing the corresponding attribute. This does not match the
3197         specification. Firefox and Chrome match the specification here.
3198
3199         Tests:
3200         - fast/dom/HTMLButtonElement/null-handling.html
3201         - fast/dom/HTMLInputElement/null-handling.html
3202
3203         * html/HTMLButtonElement.idl:
3204         * html/HTMLInputElement.idl:
3205
3206 2016-07-18  Alex Christensen  <achristensen@webkit.org>
3207
3208         webbookmarksd needs to use the same AppCache directory as MobileSafari
3209         https://bugs.webkit.org/show_bug.cgi?id=159912
3210
3211         Reviewed by Alexey Proskuryakov.
3212
3213         No new tests.  This only changes behavior for webbookmarksd.
3214
3215         * platform/RuntimeApplicationChecks.h:
3216         * platform/RuntimeApplicationChecks.mm:
3217         (WebCore::IOSApplication::isWebBookmarksD): Added.
3218
3219 2016-07-18  Chris Dumez  <cdumez@apple.com>
3220
3221         EventTarget.dispatchEvent() parameter should not be nullable
3222         https://bugs.webkit.org/show_bug.cgi?id=159897
3223
3224         Reviewed by Benjamin Poulain.
3225
3226         EventTarget.dispatchEvent() parameter should not be nullable:
3227         - https://dom.spec.whatwg.org/#interface-eventtarget
3228
3229         Even though the parameter was marked as nullable in our IDL, our
3230         implementation does a null check and we already throw a TypeError
3231         when calling dispatchEvent(null).
3232
3233         Update our IDL so that it matches the specification and so that
3234         the null check is generated in the bindings instead.
3235
3236         No new tests, rebaseline existing tests.
3237
3238         * dom/EventTarget.cpp:
3239         (WebCore::EventTarget::dispatchEventForBindings):
3240         * dom/EventTarget.h:
3241         * dom/EventTarget.idl:
3242
3243 2016-07-18  Chris Dumez  <cdumez@apple.com>
3244
3245         DocType's publicId / systemId should not be nullable
3246         https://bugs.webkit.org/show_bug.cgi?id=159901
3247
3248         Reviewed by Benjamin Poulain.
3249
3250         DocType's publicId / systemId should not be nullable. While they were
3251         not marked as nullable in our IDL, they could be stored as null Strings
3252         in our implementation depending on how the Node was constructed. This
3253         led to subtle bugs where String() != emptyString().
3254
3255         In particular, Node.isEqualNode() would return false when DocumentType
3256         nodes would mismatch because of their publicId / systemId being null
3257         instead of the emptyString.
3258
3259         Serialization would DocumentType nodes would also be wrong when
3260         publicId / systemId were empty Strings instead of null strings. The
3261         new behavior now matches:
3262         - https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-doctype (steps 7-9)
3263
3264         To address these issues, we now always store publicId / systemId as
3265         non-null Strings inside the DocumentType class.
3266
3267         Test: fast/dom/DocumentType/isEqualNode.html
3268
3269         * dom/DocumentType.cpp:
3270         (WebCore::DocumentType::DocumentType):
3271         * editing/MarkupAccumulator.cpp:
3272         (WebCore::MarkupAccumulator::appendDocumentType):
3273
3274 2016-07-18  Jeremy Jones  <jeremyj@apple.com>
3275
3276         If previous media session interruptions were prevented, still allow subsequent interruptions to try.
3277         https://bugs.webkit.org/show_bug.cgi?id=157553
3278         rdar://problem/25740804
3279
3280         Reviewed by Eric Carlson.
3281
3282         Test: platform/ios-simulator/media/video-interruption-suspendunderlock.html
3283
3284         When suspending under lock on iOS, there is first a resign active event, then a
3285         suspend under lock. PiP prevents resign active from interrupting playback. But it should allow the
3286         suspend under lock to interrupt playback.
3287
3288         Currently if there are nested interruptions only the first one is acted upon.
3289
3290         This change allows subsequent, nested interruptions to have a chance to interrupt playback if the
3291         previous interruptions were ignored.
3292
3293         This test is for iPad only, so it must be run manually.
3294
3295         * html/HTMLMediaElement.cpp:
3296         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
3297         * platform/audio/PlatformMediaSession.cpp:
3298         (WebCore::PlatformMediaSession::beginInterruption):
3299         * testing/Internals.cpp:
3300         (WebCore::Internals::beginMediaSessionInterruption):
3301
3302 2016-07-18  Brent Fulgham  <bfulgham@apple.com>
3303
3304         Don't associate form-associated elements with forms in other trees.
3305         https://bugs.webkit.org/show_bug.cgi?id=119451
3306         <rdar://problem/27382946>
3307
3308         Change is based on the Blink change (patch by <adamk@chromium.org>):
3309         <https://chromium.googlesource.com/chromium/blink/+/0b33128be67e7845d495d5219614c02ccfe7a414>
3310
3311         Reviewed by Chris Dumez.
3312
3313         Prevent elements from being associated with forms that are not part of the same home subtree.
3314         This brings us in line with the WhatWG HTML specification as of September, 2013.
3315
3316         Tests: fast/forms/image-disconnected-during-parse.html
3317                fast/forms/input-disconnected-during-parse.html
3318
3319         * dom/Element.h:
3320         (WebCore::Node::rootElement): Added.
3321         * html/FormAssociatedElement.cpp:
3322         (WebCore::FormAssociatedElement::insertedInto): If the element is associated with a form that
3323         is not part of the same tree, remove the association.
3324         * html/HTMLImageElement.cpp:
3325         (WebCore::HTMLImageElement::insertedInto): Ditto.
3326
3327 2016-07-18  Anders Carlsson  <andersca@apple.com>
3328
3329         WebKit nightly fails to build on macOS Sierra
3330         https://bugs.webkit.org/show_bug.cgi?id=159902
3331         rdar://problem/27365672
3332
3333         Reviewed by Tim Horton.
3334
3335         * Modules/applepay/cocoa/PaymentCocoa.mm:
3336         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3337         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
3338         * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
3339         Use new PassKitSPI header.
3340
3341         * WebCore.xcodeproj/project.pbxproj:
3342         Add new PassKitSPI header.
3343
3344         * icu/unicode/ucurr.h: Added.
3345         Add ucurr.h from ICU.
3346
3347         * platform/spi/cocoa/PassKitSPI.h: Added.
3348         Add new PassKitSPI header.
3349
3350 2016-07-18  Dean Jackson  <dino@apple.com>
3351
3352         REGRESSION (r202950): Image zoom animations are broken at medium.com (159861)
3353         https://bugs.webkit.org/show_bug.cgi?id=159906
3354         <rdar://problem/27391725>
3355
3356         Reviewed by Simon Fraser.
3357
3358         The fix for webkit.org/b/157569 in r200769 broke AMP pages.
3359         The followup fix for webkit.org/b/159450 in r202950 broke Medium pages.
3360
3361         Revert them both until we have better testing.
3362
3363         * css/CSSParser.cpp:
3364         (WebCore::CSSParser::addPropertyWithPrefixingVariant):
3365         (WebCore::CSSParser::parseValue):
3366         (WebCore::CSSParser::parseAnimationShorthand):
3367         (WebCore::CSSParser::parseTransitionShorthand): Deleted.
3368         * css/CSSPropertyNames.in:
3369         * css/PropertySetCSSStyleDeclaration.cpp:
3370         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
3371         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue):
3372         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
3373         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
3374         * css/StyleProperties.cpp:
3375         (WebCore::MutableStyleProperties::removeShorthandProperty):
3376         (WebCore::MutableStyleProperties::removeProperty):
3377         (WebCore::MutableStyleProperties::removePrefixedOrUnprefixedProperty):
3378         (WebCore::MutableStyleProperties::setProperty):
3379         (WebCore::getIndexInShorthandVectorForPrefixingVariant):
3380         (WebCore::MutableStyleProperties::appendPrefixingVariantProperty):
3381         (WebCore::MutableStyleProperties::setPrefixingVariantProperty):
3382         (WebCore::StyleProperties::asText): Deleted.
3383         * css/StyleProperties.h:
3384
3385 2016-07-18  Andreas Kling  <akling@apple.com>
3386
3387         There should be a way to simulate memory pressure in layout tests
3388         <https://webkit.org/b/159743>
3389
3390         Reviewed by Simon Fraser.
3391
3392         Add three window.internal APIs:
3393
3394             - boolean isUnderMemoryPressure (readonly attribute)
3395             - void beginSimulatedMemoryPressure()
3396             - void endSimulatedMemoryPressure()
3397
3398         These make it possible to write tests that exercise behaviors that only
3399         occur during memory pressure situations.
3400
3401         I also implemented the "org.WebKit.lowMemory" notification handler using the new API.
3402
3403         Test: memory/memory-pressure-simulation.html
3404
3405         * platform/MemoryPressureHandler.cpp:
3406         (WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
3407         (WebCore::MemoryPressureHandler::endSimulatedMemoryPressure):
3408         * platform/MemoryPressureHandler.h:
3409         (WebCore::MemoryPressureHandler::isUnderMemoryPressure):
3410         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3411         (WebCore::MemoryPressureHandler::platformReleaseMemory):
3412         (WebCore::MemoryPressureHandler::install):
3413         * testing/Internals.cpp:
3414         (WebCore::Internals::isUnderMemoryPressure):
3415         (WebCore::Internals::beginSimulatedMemoryPressure):
3416         (WebCore::Internals::endSimulatedMemoryPressure):
3417         * testing/Internals.h:
3418         * testing/Internals.idl:
3419
3420 2016-07-18  Said Abou-Hallawa  <sabouhallawa@apple,com>
3421
3422         [iOS] PDFDocumentImage should cache only a sub image of the PDF when caching the whole image is expensive
3423         https://bugs.webkit.org/show_bug.cgi?id=158715
3424
3425         Reviewed by Dean Jackson.
3426
3427         Test: fast/images/displaced-non-cached-pdf.html
3428
3429         For iOS, we need to ensure the size of the cached PDF images will not
3430         exceed some limit. Also we should be caching only a sub image of the PDF
3431         if caching the whole image will exceed the memory limit.
3432
3433         * page/Settings.cpp:
3434         (WebCore::Settings::Settings):
3435         (WebCore::Settings::setCachedPDFImageEnabled):
3436         * page/Settings.h:
3437         (WebCore::Settings::isCachedPDFImageEnabled):
3438             Add an option to disable caching the PDF images.
3439
3440         * platform/graphics/cg/PDFDocumentImage.cpp:
3441         (WebCore::PDFDocumentImage::setCachedPDFImageEnabled):
3442             Allow the caller of draw() to disable caching the PDF images.
3443         
3444         (WebCore::PDFDocumentImage::cacheParametersMatch):
3445             Match the context dirty rectangle with the cached image rectangle.
3446         
3447         (WebCore::transformContextForPainting):
3448             When preparing the context for drawing the PDF, take the location 
3449             of the destination rectangle into account. We do not need to scale
3450             the location of the source rectangle because we scale the size of
3451             the rectangle but we don't scale the whole coordinate system.
3452
3453         (WebCore::cachedImageRect):
3454             Calculate the rectangle of the cached image such that it does not
3455             exceed the limit. Start from the center of the dirty rectangle and
3456             then expand around it.
3457             
3458         (WebCore::PDFDocumentImage::decodedSizeChanged):
3459             In addition to notifying the ImageObserver, it keeps track of the size
3460             of all the cached PDF images.
3461
3462         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
3463             Ensure the size of all the cached images does not exceed the limit
3464             
3465         (WebCore::PDFDocumentImage::destroyDecodedData):
3466         * platform/graphics/cg/PDFDocumentImage.h:
3467
3468         * rendering/RenderImage.cpp:
3469         (WebCore::RenderImage::paintIntoRect):
3470             Pass the option to disable caching the PDF images to PDFDocumentImage.
3471
3472         * testing/InternalSettings.cpp:
3473         (WebCore::InternalSettings::Backup::Backup):
3474         (WebCore::InternalSettings::Backup::restoreTo):
3475         (WebCore::InternalSettings::setCachedPDFImageEnabled):
3476         * testing/InternalSettings.h:
3477         * testing/InternalSettings.idl:
3478             Add an internal option to disable caching the PDF images.
3479
3480 2016-07-18  Chris Dumez  <cdumez@apple.com>
3481
3482         The 2 first parameters to addEventListener() / removeEventListener() should be mandatory
3483         https://bugs.webkit.org/show_bug.cgi?id=158008
3484
3485         Reviewed by Darin Adler.
3486
3487         The 2 first parameters to addEventListener() / removeEventListener() should be
3488         mandatory:
3489         - https://dom.spec.whatwg.org/#interface-eventtarget
3490
3491         Firefox 46 and Chrome 50 both match the specification and throw an exception when those
3492         parameters are omitted. However, those parameters were marked as optional in WebKit and
3493         the calls were no-ops if those parameters were omitted. This patch aligns our behavior
3494         with the specification and other browsers.
3495
3496         Test: fast/dom/eventtarget-api-parameters.html
3497
3498         * bindings/scripts/CodeGeneratorJS.pm:
3499         (GetFunctionLength): Deleted.
3500         * dom/EventTarget.idl:
3501
3502 2016-07-18  Brent Fulgham  <bfulgham@apple.com>
3503
3504         Unreviewed, rolling out r203373.
3505
3506         Unaddressed
3507
3508         Reverted changeset:
3509
3510         "Don't associate form-associated elements with forms in other
3511         trees."
3512         https://bugs.webkit.org/show_bug.cgi?id=119451
3513         http://trac.webkit.org/changeset/203373
3514
3515 2016-07-18  Brent Fulgham  <bfulgham@apple.com>
3516
3517         Don't associate form-associated elements with forms in other trees.
3518         https://bugs.webkit.org/show_bug.cgi?id=119451
3519         <rdar://problem/27382946>
3520
3521         Change is based on the Blink change (patch by <adamk@chromium.org>):
3522         <https://chromium.googlesource.com/chromium/blink/+/0b33128be67e7845d495d5219614c02ccfe7a414>
3523
3524         Reviewed by Zalan Bujtas.
3525
3526         Prevent elements from being associated with forms that are not part of the same home subtree.
3527         This brings us in line with the WhatWG HTML specification as of September, 2013.
3528
3529         Tests: fast/forms/image-disconnected-during-parse.html
3530                fast/forms/input-disconnected-during-parse.html
3531
3532         * dom/NodeTraversal.h:
3533         (WebCore::NodeTraversal::highestAncestorOrSelf): Added.
3534         * html/FormAssociatedElement.cpp:
3535         (WebCore::FormAssociatedElement::insertedInto): If the element is associated with a form that
3536         is not part of the same tree, remove the association.
3537         * html/HTMLImageElement.cpp:
3538         (WebCore::HTMLImageElement::insertedInto): Ditto.
3539
3540 2016-07-18  George Ruan  <gruan@apple.com>
3541
3542         Move MediaSampleAVFObjC into its own file
3543         https://bugs.webkit.org/show_bug.cgi?id=159796
3544         <rdar://problem/27362488>
3545
3546         In preparation for a feature that uses MediaSampleAVFObjC, but does
3547         not need SourceBufferPrivateAVFObjC, it is beneficial to move
3548         MediaSampleAVFObjC to its own file.
3549
3550         Reviewed by Eric Carlson.
3551
3552         * WebCore.xcodeproj/project.pbxproj:
3553         * platform/MediaSample.h: Allow setting trackID to associate
3554         MediaSample id with MediaStreamTrackPrivate id.
3555         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Added.
3556         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: Moved
3557         from MediaSampleAVFObjC
3558         (WebCore::MediaSampleAVFObjC::presentationTime):
3559         (WebCore::MediaSampleAVFObjC::decodeTime):
3560         (WebCore::MediaSampleAVFObjC::duration):
3561         (WebCore::MediaSampleAVFObjC::sizeInBytes):
3562         (WebCore::MediaSampleAVFObjC::platformSample):
3563         (WebCore::CMSampleBufferIsRandomAccess):
3564         (WebCore::MediaSampleAVFObjC::flags):
3565         (WebCore::MediaSampleAVFObjC::presentationSize):
3566         (WebCore::MediaSampleAVFObjC::dump):
3567         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
3568         (WebCore::MediaSampleAVFObjC::setTimestamps):
3569         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3570         Moved MediaSampleAVFObjC to its own file.
3571         (WebCore::MediaSampleAVFObjC::platformSample): Deleted.
3572         (WebCore::CMSampleBufferIsRandomAccess): Deleted.
3573         (WebCore::MediaSampleAVFObjC::flags): Deleted.
3574         (WebCore::MediaSampleAVFObjC::presentationSize): Deleted.
3575         (WebCore::MediaSampleAVFObjC::dump): Deleted.
3576         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy): Deleted.
3577         (WebCore::MediaSampleAVFObjC::setTimestamps): Deleted.
3578         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3579
3580 2016-07-18  Eric Carlson  <eric.carlson@apple.com>
3581
3582         [MSE][Mac] Pass AVSampleBufferDisplayLayer HDCP status to a newly created key session
3583         https://bugs.webkit.org/show_bug.cgi?id=159812
3584         <rdar://problem/27371624>
3585
3586         Reviewed by Jon Lee.
3587
3588         No new tests, it isn't possible to test this with our current testing infrastructure.
3589
3590         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3591         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3592         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): Call layerDidReceiveError if there has
3593         been an HDCP error.
3594         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Remember an HDCP error.
3595
3596 2016-07-18  Yoav Weiss  <yoav@yoav.ws>
3597
3598         Add preload to features.json
3599         https://bugs.webkit.org/show_bug.cgi?id=159872
3600
3601         Reviewed by Darin Adler.
3602
3603         No new tests but no functional change.
3604
3605         * features.json:
3606
3607 2016-07-18  Youenn Fablet  <youenn@apple.com>
3608
3609         [Streams API] ReadableStream should throw a RangeError in case of NaN highWaterMark
3610         https://bugs.webkit.org/show_bug.cgi?id=159870
3611
3612         Reviewed by Xabier Rodriguez-Calvar.
3613
3614         Covered by rebased test.
3615
3616         * Modules/streams/StreamInternals.js:
3617         (validateAndNormalizeQueuingStrategy): Throwing a RangeError in lieu of a TypeError in case of NaN highWaterMark.
3618
3619 2016-07-18  Csaba Osztrogon√°c  <ossy@webkit.org>
3620
3621         Windows buildfix after r203338
3622         https://bugs.webkit.org/show_bug.cgi?id=159875
3623
3624         Unreviewed buildfix.
3625
3626         * dom/UserGestureIndicator.h:
3627         (WebCore::UserGestureToken::addDestructionObserver):
3628
3629 2016-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3630
3631         MemoryPressureHandler doesn't work if cgroups aren't present in Linux
3632         https://bugs.webkit.org/show_bug.cgi?id=155255
3633
3634         Reviewed by Sergio Villar Senin.
3635
3636         Allow to pass an eventFD file descriptor to the MemoryPressureHandler to be monitorized in case cgroups are not
3637         available.
3638
3639         * platform/MemoryPressureHandler.h:
3640         * platform/linux/MemoryPressureHandlerLinux.cpp:
3641
3642 2016-07-17  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3643
3644         Clean up PassRefPtr uses in Modules/encryptedmedia, Modules/speech, and Modules/quota
3645         https://bugs.webkit.org/show_bug.cgi?id=159701
3646
3647         Reviewed by Alex Christensen.
3648
3649         No new tests, no behavior changes.
3650
3651         * Modules/encryptedmedia/CDM.h:
3652         * Modules/encryptedmedia/MediaKeySession.h:
3653         * Modules/encryptedmedia/MediaKeys.h:
3654         * Modules/quota/DOMWindowQuota.cpp:
3655         * Modules/quota/StorageErrorCallback.cpp:
3656         (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
3657         * Modules/quota/StorageErrorCallback.h:
3658         * Modules/quota/StorageInfo.h:
3659         * Modules/quota/StorageQuota.h:
3660         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
3661         * Modules/speech/SpeechSynthesis.cpp:
3662         (WebCore::SpeechSynthesis::getVoices):
3663         (WebCore::SpeechSynthesis::startSpeakingImmediately):
3664         (WebCore::SpeechSynthesis::speak):
3665         (WebCore::SpeechSynthesis::cancel):
3666         (WebCore::SpeechSynthesis::handleSpeakingCompleted):
3667         (WebCore::SpeechSynthesis::boundaryEventOccurred):
3668         (WebCore::SpeechSynthesis::didStartSpeaking):
3669         (WebCore::SpeechSynthesis::didPauseSpeaking):
3670         (WebCore::SpeechSynthesis::didResumeSpeaking):
3671         (WebCore::SpeechSynthesis::didFinishSpeaking):
3672         (WebCore::SpeechSynthesis::speakingErrorOccurred):
3673         * Modules/speech/SpeechSynthesis.h:
3674         * Modules/speech/SpeechSynthesisEvent.h:
3675         * Modules/speech/SpeechSynthesisUtterance.h:
3676         * Modules/speech/SpeechSynthesisVoice.cpp:
3677         (WebCore::SpeechSynthesisVoice::create):
3678         (WebCore::SpeechSynthesisVoice::SpeechSynthesisVoice):
3679         * Modules/speech/SpeechSynthesisVoice.h:
3680         * platform/PlatformSpeechSynthesizer.h:
3681         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
3682         (WebCore::PlatformSpeechSynthesisProviderEfl::fireSpeechEvent):
3683         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
3684         (WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
3685         (WebCore::PlatformSpeechSynthesizerMock::speak):
3686         (WebCore::PlatformSpeechSynthesizerMock::cancel):
3687         (WebCore::PlatformSpeechSynthesizerMock::pause):
3688         (WebCore::PlatformSpeechSynthesizerMock::resume):
3689
3690 2016-07-16  Sam Weinig  <sam@webkit.org>
3691
3692         [WebKit API] Add SPI to track multiple navigations caused by a single user gesture
3693         <rdar://problem/26554137>
3694         https://bugs.webkit.org/show_bug.cgi?id=159856
3695
3696         Reviewed by Dan Bernstein.
3697
3698         - Adds a new RefCounted object to represent a unique user gesture, called UserGestureToken.
3699         - Makes UserGestureIndicator track UserGestureToken.
3700         - Refines UserGestureIndicator's interface to use Optional and a smaller enum set
3701           to represent the different initial states.
3702         - Stores UserGestureTokens on objects that want to forward user gesture state (DOMTimer, 
3703           postMessage, and ScheduledNavigation) rather than just a boolean.
3704
3705         * accessibility/AccessibilityNodeObject.cpp:
3706         (WebCore::AccessibilityNodeObject::increment):
3707         (WebCore::AccessibilityNodeObject::decrement):
3708         * accessibility/AccessibilityObject.cpp:
3709         (WebCore::AccessibilityObject::press):
3710         * bindings/js/ScriptController.cpp:
3711         (WebCore::ScriptController::executeScriptInWorld):
3712         (WebCore::ScriptController::executeScript):
3713         Update for new UserGestureIndicator interface.
3714
3715         * dom/UserGestureIndicator.cpp:
3716         (WebCore::currentToken):
3717         (WebCore::UserGestureToken::~UserGestureToken):
3718         (WebCore::UserGestureIndicator::UserGestureIndicator):
3719         (WebCore::UserGestureIndicator::~UserGestureIndicator):
3720         (WebCore::UserGestureIndicator::currentUserGesture):
3721         (WebCore::UserGestureIndicator::processingUserGesture):
3722         (WebCore::UserGestureIndicator::processingUserGestureForMedia):
3723         (WebCore::isDefinite): Deleted.
3724         * dom/UserGestureIndicator.h:
3725         (WebCore::UserGestureToken::create):
3726         (WebCore::UserGestureToken::state):
3727         (WebCore::UserGestureToken::processingUserGesture):
3728         (WebCore::UserGestureToken::processingUserGestureForMedia):
3729         (WebCore::UserGestureToken::addDestructionObserver):
3730         (WebCore::UserGestureToken::UserGestureToken):
3731         Add UserGestureToken and track the current one explicitly.
3732
3733         * html/HTMLMediaElement.cpp:
3734         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
3735         * inspector/InspectorFrontendClientLocal.cpp:
3736         (WebCore::InspectorFrontendClientLocal::openInNewTab):
3737         * inspector/InspectorFrontendHost.cpp:
3738         * inspector/InspectorPageAgent.cpp:
3739         (WebCore::InspectorPageAgent::navigate):
3740         Update for new UserGestureIndicator interface.
3741
3742         * loader/NavigationAction.cpp:
3743         (WebCore::NavigationAction::NavigationAction):
3744         * loader/NavigationAction.h:
3745         (WebCore::NavigationAction::userGestureToken):
3746         (WebCore::NavigationAction::processingUserGesture):
3747         * loader/NavigationScheduler.cpp:
3748         (WebCore::ScheduledNavigation::ScheduledNavigation):
3749         (WebCore::ScheduledNavigation::~ScheduledNavigation):
3750         (WebCore::ScheduledNavigation::lockBackForwardList):
3751         (WebCore::ScheduledNavigation::wasDuringLoad):
3752         (WebCore::ScheduledNavigation::isLocationChange):
3753         (WebCore::ScheduledNavigation::userGestureToForward):
3754         (WebCore::ScheduledNavigation::clearUserGesture):
3755         (WebCore::NavigationScheduler::mustLockBackForwardList):
3756         (WebCore::NavigationScheduler::scheduleFormSubmission):
3757         (WebCore::ScheduledNavigation::wasUserGesture): Deleted.
3758         * page/DOMTimer.cpp:
3759         (WebCore::shouldForwardUserGesture):
3760         (WebCore::userGestureTokenToForward):
3761         (WebCore::DOMTimer::DOMTimer):
3762         (WebCore::DOMTimer::fired):
3763         * page/DOMTimer.h:
3764         * page/DOMWindow.cpp:
3765         (WebCore::PostMessageTimer::PostMessageTimer):
3766         Store the active UserGestureToken rather than just a bit.
3767
3768         * page/EventHandler.cpp:
3769         (WebCore::EventHandler::handleMousePressEvent):
3770         (WebCore::EventHandler::handleMouseDoubleClickEvent):
3771         (WebCore::EventHandler::handleMouseReleaseEvent):
3772         (WebCore::EventHandler::keyEvent):
3773         (WebCore::EventHandler::handleTouchEvent):
3774         * rendering/HitTestResult.cpp:
3775         (WebCore::HitTestResult::toggleMediaFullscreenState):
3776         (WebCore::HitTestResult::enterFullscreenForVideo):
3777         (WebCore::HitTestResult::toggleEnhancedFullscreenForVideo):
3778         Update for new UserGestureIndicator interface.
3779
3780 2016-07-17  Ryosuke Niwa  <rniwa@webkit.org>
3781
3782         Rename fastHasAttribute to hasAttributeWithoutSynchronization
3783         https://bugs.webkit.org/show_bug.cgi?id=159864
3784
3785         Reviewed by Chris Dumez.
3786
3787         Renamed Rename fastHasAttribute to hasAttributeWithoutSynchronization for clarity.
3788
3789         * accessibility/AccessibilityListBoxOption.cpp:
3790         (WebCore::AccessibilityListBoxOption::isEnabled):
3791         * accessibility/AccessibilityObject.cpp:
3792         (WebCore::AccessibilityObject::hasAttribute):
3793         (WebCore::AccessibilityObject::getAttribute):
3794         * accessibility/AccessibilityRenderObject.cpp:
3795         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3796         * bindings/scripts/CodeGenerator.pm:
3797         (GetterExpression):
3798         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3799         * bindings/scripts/test/JS/JSTestObj.cpp:
3800         (WebCore::jsTestObjReflectedBooleanAttr):
3801         (WebCore::jsTestObjReflectedCustomBooleanAttr):
3802         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3803         (-[DOMTestObj reflectedBooleanAttr]):
3804         (-[DOMTestObj setReflectedBooleanAttr:]):
3805         (-[DOMTestObj reflectedCustomBooleanAttr]):
3806         (-[DOMTestObj setReflectedCustomBooleanAttr:]):
3807         * dom/Document.cpp:
3808         (WebCore::Document::hasManifest):
3809         (WebCore::Document::doctype):
3810         * dom/Element.h:
3811         (WebCore::Node::parentElement):
3812         (WebCore::Element::hasAttributeWithoutSynchronization):
3813         (WebCore::Element::fastHasAttribute): Deleted.
3814         * editing/ApplyStyleCommand.cpp:
3815         (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
3816         * editing/DeleteSelectionCommand.cpp:
3817         (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
3818         * editing/markup.cpp:
3819         (WebCore::createMarkupInternal):
3820         * html/ColorInputType.cpp:
3821         (WebCore::ColorInputType::shouldShowSuggestions):
3822         * html/FileInputType.cpp:
3823         (WebCore::FileInputType::handleDOMActivateEvent):
3824         (WebCore::FileInputType::receiveDroppedFiles):
3825         * html/FormAssociatedElement.cpp:
3826         (WebCore::FormAssociatedElement::didMoveToNewDocument):
3827         (WebCore::FormAssociatedElement::insertedInto):
3828         (WebCore::FormAssociatedElement::removedFrom):
3829         (WebCore::FormAssociatedElement::formAttributeChanged):
3830         * html/FormController.cpp:
3831         (WebCore::ownerFormForState):
3832         * html/GenericCachedHTMLCollection.cpp:
3833         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
3834         * html/HTMLAnchorElement.cpp:
3835         (WebCore::HTMLAnchorElement::draggable):
3836         (WebCore::HTMLAnchorElement::href):
3837         (WebCore::HTMLAnchorElement::sendPings):
3838         * html/HTMLAppletElement.cpp:
3839         (WebCore::HTMLAppletElement::rendererIsNeeded):
3840         * html/HTMLElement.cpp:
3841         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
3842         (WebCore::elementAffectsDirectionality):
3843         (WebCore::setHasDirAutoFlagRecursively):
3844         * html/HTMLEmbedElement.cpp:
3845         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3846         * html/HTMLFieldSetElement.cpp:
3847         (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
3848         (WebCore::HTMLFieldSetElement::disabledAttributeChanged):
3849         (WebCore::HTMLFieldSetElement::disabledStateChanged):
3850         (WebCore::HTMLFieldSetElement::childrenChanged):
3851         * html/HTMLFormControlElement.cpp:
3852         (WebCore::HTMLFormControlElement::formNoValidate):
3853         (WebCore::HTMLFormControlElement::formAction):
3854         (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor):
3855         (WebCore::shouldAutofocus):
3856         * html/HTMLFormElement.cpp:
3857         (WebCore::HTMLFormElement::formElementIndex):
3858         (WebCore::HTMLFormElement::noValidate):
3859         * html/HTMLFrameElement.cpp:
3860         (WebCore::HTMLFrameElement::noResize):
3861         (WebCore::HTMLFrameElement::didAttachRenderers):
3862         * html/HTMLFrameElementBase.cpp:
3863         (WebCore::HTMLFrameElementBase::parseAttribute):
3864         (WebCore::HTMLFrameElementBase::location):
3865         * html/HTMLHRElement.cpp:
3866         (WebCore::HTMLHRElement::collectStyleForPresentationAttribute):
3867         * html/HTMLImageElement.cpp:
3868         (WebCore::HTMLImageElement::isServerMap):
3869         * html/HTMLInputElement.cpp:
3870         (WebCore::HTMLInputElement::finishParsingChildren):
3871         (WebCore::HTMLInputElement::matchesDefaultPseudoClass):
3872         (WebCore::HTMLInputElement::isActivatedSubmit):
3873         (WebCore::HTMLInputElement::reset):
3874         (WebCore::HTMLInputElement::multiple):
3875         (WebCore::HTMLInputElement::setSize):
3876         (WebCore::HTMLInputElement::shouldUseMediaCapture):
3877         * html/HTMLMarqueeElement.cpp:
3878         (WebCore::HTMLMarqueeElement::minimumDelay):
3879         * html/HTMLMediaElement.cpp:
3880         (WebCore::HTMLMediaElement::insertedInto):
3881         (WebCore::HTMLMediaElement::selectMediaResource):
3882         (WebCore::HTMLMediaElement::loadResource):
3883         (WebCore::HTMLMediaElement::autoplay):
3884         (WebCore::HTMLMediaElement::preload):
3885         (WebCore::HTMLMediaElement::loop):
3886         (WebCore::HTMLMediaElement::setLoop):
3887         (WebCore::HTMLMediaElement::controls):
3888         (WebCore::HTMLMediaElement::setControls):
3889         (WebCore::HTMLMediaElement::muted):
3890         (WebCore::HTMLMediaElement::setMuted):
3891         (WebCore::HTMLMediaElement::selectNextSourceChild):
3892         (WebCore::HTMLMediaElement::sourceWasAdded):
3893         (WebCore::HTMLMediaElement::mediaSessionTitle):
3894         * html/HTMLObjectElement.cpp:
3895         (WebCore::HTMLObjectElement::parseAttribute):
3896         * html/HTMLOptGroupElement.cpp:
3897         (WebCore::HTMLOptGroupElement::isDisabledFormControl):
3898         (WebCore::HTMLOptGroupElement::isFocusable):
3899         * html/HTMLOptionElement.cpp:
3900         (WebCore::HTMLOptionElement::matchesDefaultPseudoClass):
3901         (WebCore::HTMLOptionElement::text):
3902         * html/HTMLProgressElement.cpp:
3903         (WebCore::HTMLProgressElement::isDeterminate):
3904         (WebCore::HTMLProgressElement::didElementStateChange):
3905         * html/HTMLScriptElement.cpp:
3906         (WebCore::HTMLScriptElement::async):
3907         (WebCore::HTMLScriptElement::setCrossOrigin):
3908         (WebCore::HTMLScriptElement::asyncAttributeValue):
3909         (WebCore::HTMLScriptElement::deferAttributeValue):
3910         (WebCore::HTMLScriptElement::hasSourceAttribute):
3911         (WebCore::HTMLScriptElement::dispatchLoadEvent):
3912         * html/HTMLSelectElement.cpp:
3913         (WebCore::HTMLSelectElement::reset):
3914         * html/HTMLTrackElement.cpp:
3915         (WebCore::HTMLTrackElement::isDefault):
3916         (WebCore::HTMLTrackElement::ensureTrack):
3917         (WebCore::HTMLTrackElement::loadTimerFired):
3918         * html/MediaElementSession.cpp:
3919         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
3920         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3921         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading):
3922         * html/SearchInputType.cpp:
3923         (WebCore::SearchInputType::searchEventsShouldBeDispatched):
3924         (WebCore::SearchInputType::didSetValueByUserEdit):
3925         * inspector/InspectorDOMAgent.cpp:
3926         (WebCore::InspectorDOMAgent::buildObjectForNode):
3927         * loader/FrameLoader.cpp:
3928         (WebCore::FrameLoader::shouldTreatURLAsSrcdocDocument):
3929         (WebCore::FrameLoader::findFrameForNavigation):
3930         * loader/ImageLoader.cpp:
3931         (WebCore::ImageLoader::notifyFinished):
3932         * mathml/MathMLSelectElement.cpp:
3933         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
3934         * rendering/RenderTableCell.cpp:
3935         (WebCore::RenderTableCell::computePreferredLogicalWidths):
3936         * rendering/RenderThemeIOS.mm:
3937         (WebCore::RenderThemeIOS::adjustMenuListButtonStyle):
3938         * rendering/SimpleLineLayout.cpp:
3939         (WebCore::SimpleLineLayout::canUseForWithReason):
3940         * rendering/svg/RenderSVGResourceClipper.cpp:
3941         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
3942         * svg/SVGAnimateMotionElement.cpp:
3943         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
3944         * svg/SVGAnimationElement.cpp:
3945         (WebCore::SVGAnimationElement::startedActiveInterval):
3946         (WebCore::SVGAnimationElement::updateAnimation):
3947         * svg/animation/SVGSMILElement.cpp:
3948         (WebCore::SVGSMILElement::insertedInto):
3949
3950 2016-07-17  Brady Eidson  <beidson@apple.com>
3951
3952         Exceptions logged to the JS console should use toString().
3953         https://bugs.webkit.org/show_bug.cgi?id=159855
3954
3955         Reviewed by Darin Adler.
3956
3957         No new tests (No change in behavior).
3958
3959         * bindings/js/JSDOMBinding.cpp:
3960         (WebCore::reportException):
3961
3962         * dom/DOMCoreException.h:
3963         (WebCore::DOMCoreException::DOMCoreException):
3964
3965         * dom/ExceptionBase.cpp:
3966         (WebCore::ExceptionBase::ExceptionBase):
3967         (WebCore::ExceptionBase::toString):
3968         (WebCore::ExceptionBase::consoleErrorMessage): Deleted.
3969         * dom/ExceptionBase.h:
3970         (WebCore::ExceptionBase::description): Deleted.
3971
3972         * svg/SVGException.h:
3973
3974         * xml/XPathException.h:
3975         (WebCore::XPathException::XPathException):
3976
3977 2016-07-17  Brady Eidson  <beidson@apple.com>
3978
3979         Update DOMCoreException to use the description in toString().
3980         https://bugs.webkit.org/show_bug.cgi?id=159857
3981
3982         Reviewed by Darin Adler.
3983
3984         No new tests (Covered by changes to existing tests).
3985
3986         * bindings/js/JSDOMBinding.cpp:
3987         (WebCore::createDOMException):