[iOS] remote command should be considered user events
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-04-13  Eric Carlson  <eric.carlson@apple.com>
2
3         [iOS] remote command should be considered user events
4         https://bugs.webkit.org/show_bug.cgi?id=156546
5         <rdar://problem/25560877>
6
7         Reviewed by Jer Noble.
8
9         Test: media/remote-control-command-is-user-gesture.html
10
11         * html/HTMLMediaElement.cpp:
12         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Increment/decrement 
13           m_processingRemoteControlCommand around calling remote command method.
14         (WebCore::HTMLMediaElement::processingUserGesture): Return true if called while handling
15           a remote control command.
16         * html/HTMLMediaElement.h:
17
18 2016-04-13  Antonio Gomes  <tonikitoo@webkit.org>
19
20         Non-resizable text field looks resizable
21         https://bugs.webkit.org/show_bug.cgi?id=152271
22
23         Reviewed by Darin Adler.
24
25         The 'resizability' of an HTML element is controlled by its 'resize' CSS property value.
26         By default it is 'none', but certain HTML elements, including <textarea>, have it
27         set to 'both' by default (defined in html.css). These values mean no resize at all, and
28         resizable in both vertical and horizontal axis, respectively.
29         Additionally, 'vertical' and 'horizontal' values are also valid.
30
31         Problem here is that the way WebKit handles the 'resize' property on single line
32         input elements (e.g. <input>) is different than other engines (read Gecko, Blink and Presto):
33
34         - Match: WebKit, Firefox, Presto and Blink all force single line input elements to be non-resizable,
35         regardless of either the 'resize' properly is set or not.
36
37         - Mismatch: WebKit is the only engine that actually paints the resize control on single line
38         input elements, even it having no effect.
39
40         On WebKit, this happens because the 'resize' property is wrongly implemented as 'inheritable',
41         differently from other engines. In the way WebKit contructs its RenderTree, 'resize' property
42         ends up spilling out of <input> and entering its shadow representation, carrying the 'resize'
43         property on.
44
45         Patch fixes this by making the 'resize' properly be non-inherited, matching other vendors
46         and the spec [1].
47
48         [1] https://drafts.csswg.org/css-ui/#resize
49
50         Tests: fast/css/resize-not-inherited.html
51                fast/css/resize-single-line-input-no-paint.html
52
53         * rendering/style/RenderStyle.h:
54         * rendering/style/StyleRareInheritedData.cpp:
55         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
56         (WebCore::StyleRareInheritedData::operator==):
57         * rendering/style/StyleRareInheritedData.h:
58         * rendering/style/StyleRareNonInheritedData.cpp:
59         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
60         (WebCore::StyleRareNonInheritedData::operator==):
61         * rendering/style/StyleRareNonInheritedData.h:
62
63 2016-04-13  Darin Adler  <darin@apple.com>
64
65         Remove UsePointersEvenForNonNullableObjectArguments from DataTransfer
66         https://bugs.webkit.org/show_bug.cgi?id=156495
67
68         Reviewed by Chris Dumez.
69
70         * dom/DataTransfer.idl: Removed UsePointersEvenForNonNullableObjectArguments
71         and marked the element argument to setDragImage as nullable.
72
73 2016-04-13  Brady Eidson  <beidson@apple.com>
74
75         Modern IDB (Blob support): Support deleting stored blob files.
76         https://bugs.webkit.org/show_bug.cgi?id=156523
77
78         Reviewed by Alex Christensen.
79
80         No new tests (No testable change in behavior yet, current tests pass).
81
82         There's 3 points in time when we need to delete blob files (and records of them):
83         1 - When deleting a specific object store record.
84         2 - When deleting an entire object store.
85         3 - When deleting a whole database.
86         
87         This patch does those three things.
88
89         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
90         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
91         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
92         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
93         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
94         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
95         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
96         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
97
98         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
99         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
100         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
101         (WebCore::IDBServer::SQLiteIDBTransaction::addRemovedBlobFile):
102         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
103
104 2016-04-13  Frederic Wang  <fwang@igalia.com>
105
106         Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
107         https://bugs.webkit.org/show_bug.cgi?id=156538
108
109         Reviewed by Darin Adler.
110
111         We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
112         for the <math> and <msqrt> tags.
113
114         The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
115         conditional is never executed. The tag does not create any anonymous
116         wrapper so we do not need a special case for it anyway.
117
118         The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
119         wrapper behaving as a RenderMathMLRow is actually the last child, not
120         the first one.
121
122         No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
123         Note that for some reason the coding error for <msqrt> only shows up
124         after the refactoring of bug 152244.
125
126         * mathml/MathMLInlineContainerElement.cpp:
127         (WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.
128
129 2016-04-12  Chris Dumez  <cdumez@apple.com>
130
131         Attr.value should not be nullable
132         https://bugs.webkit.org/show_bug.cgi?id=156515
133
134         Reviewed by Benjamin Poulain.
135
136         Update Attr.value so that it is no longer nullable, as per:
137         https://dom.spec.whatwg.org/#interface-attr
138
139         This aligns our behavior with Firefox and Chrome as well.
140
141         Test: fast/dom/Attr/value-not-nullable.html
142
143         * dom/Attr.cpp:
144         (WebCore::Attr::setValueForBindings):
145         (WebCore::Attr::setNodeValue):
146         (WebCore::Attr::setValue):
147         * dom/Attr.h:
148         * dom/Attr.idl:
149
150 2016-04-12  Konstantin Tokarev  <annulen@yandex.ru>
151
152         Fixed uninitialization of Node::DataUnion with GCC 4.8.
153         https://bugs.webkit.org/show_bug.cgi?id=156507
154
155         Reviewed by Michael Catanzaro.
156
157         This change fixes run time crashes caused by access to uninitialized
158         memory in Node::renderer().
159
160         No new tests needed.
161
162         * dom/Node.h:
163
164 2016-04-12  Eric Carlson  <eric.carlson@apple.com>
165
166         [iOS] do not exit AirPlay when the screen locks
167         https://bugs.webkit.org/show_bug.cgi?id=156502
168         <rdar://problem/24616592>
169
170         Reviewed by Jer Noble.
171
172         * html/HTMLMediaElement.cpp:
173         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
174         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge 
175           data if it is playing to a wireless target because that will drop the connection.
176
177         * html/MediaElementSession.cpp:
178         (WebCore::MediaElementSession::playbackPermitted): Add logging.
179         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't 
180           have an explicit playbackTarget, don't test for it.
181         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
182
183 2016-04-12  Gavin Barraclough  <barraclough@apple.com>
184
185         WebKit should adopt journal_mode=wal for all SQLite databases.
186         https://bugs.webkit.org/show_bug.cgi?id=133496
187
188         Rubber stamped by Chris Dumez.
189
190         Temporarily disable on iOS - this broke a test.
191         (storage/websql/alter-to-info-table.html)
192
193         * platform/sql/SQLiteDatabase.cpp:
194         (WebCore::SQLiteDatabase::open):
195
196 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
197
198         Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
199         https://bugs.webkit.org/show_bug.cgi?id=111193
200         <rdar://problem/13325889>
201
202         Reviewed by Timothy Hatcher.
203
204         * inspector/InspectorClient.h:
205         (WebCore::InspectorClient::elementSelectionChanged):
206         * inspector/InspectorDOMAgent.cpp:
207         (WebCore::InspectorDOMAgent::setSearchingForNode):
208         Inform the client when element selection changes.
209
210 2016-04-12  Chris Dumez  <cdumez@apple.com>
211
212         Regression(r199360): assertion hit in Element::fastGetAttribute()
213         https://bugs.webkit.org/show_bug.cgi?id=156509
214
215         Reviewed by Ryosuke Niwa.
216
217         Stop using fastGetAttribute() / setAttributeWithoutSynchronization()
218         given that DOMTokenList is used for the class attribute and we need
219         to synchronize in this case.
220
221         No new tests, already covered by existing tests.
222
223         * html/DOMTokenList.cpp:
224         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
225         (WebCore::DOMTokenList::tokens):
226
227 2016-04-12  Myles C. Maxfield  <mmaxfield@apple.com>
228
229         [RTL Scrollbars] Overlay scrollbars push contents inwards
230         https://bugs.webkit.org/show_bug.cgi?id=156225
231         <rdar://problem/25137040>
232
233         Reviewed by Darin Adler.
234
235         The contents should be pushed in by the occupied width of the
236         scrollbar, which is 0 for overlay scrollbars.
237
238         Test: fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html
239
240         * rendering/RenderLayer.cpp:
241         (WebCore::RenderLayer::computeScrollDimensions):
242
243 2016-04-12  Myles C. Maxfield  <mmaxfield@apple.com>
244
245         [OS X] Flakey crash after ScrollAnimatorMac destruction
246         https://bugs.webkit.org/show_bug.cgi?id=156372
247
248         Reviewed by Darin Adler.
249
250         Previously, we were disabling the mock scrollbars using JavaScript after
251         the WebView was created. However, enabling these mock scrollbars can be
252         triggered with a bit of state inside the WebPreferences object, which
253         means WebKit clients can change it at any point. DumpRenderTree is doing
254         this during the document's lifetime.
255
256         This means that the creation of the Scrollbar objects saw a non-mock
257         ScrollbarTheme, but the destruction of the Scrollbar objects saw a mock
258         ScrollbarTheme. Therefore, the non-mock ScrollbarTheme doesn't get
259         cleaned up correctly (ScrollAnimatorMac::willRemoveVerticalScrollbar()
260         returns early because it sees that there is nothing to deregister
261         due to the ScrollbarTheme being mocked).
262
263         This cleanup is necessary because it sets the NSScrollerImp's delegate
264         to nil before the NSScrollerImpDelegate gets destroyed. Because the
265         cleanup wasn't happening, the delegate pointer wasn't getting set to
266         nil, so the pointer was dangling, and AppKit was following it and
267         crashing.
268
269         Because the clients of this bit of state can change it at any time,
270         it is incorrect to change it in JavaScript. Instead, the client must
271         manage this bit of state (so the client and the web process are always
272         in sync). Therefore, the correct way to set this bit of state must be
273         done in the test runner rather than Javascript internals. The mechanism
274         we have to do that is the <!-- webkit-test-runner --> comment at the
275         beginning of the test. This patch migrates to this mechanism and removes
276         the old internals method.
277
278         Test: fast/scrolling/rtl-scrollbars-animation-property.html
279
280         * page/Settings.cpp:
281         * testing/Internals.cpp:
282         (WebCore::Internals::setMockScrollbarsEnabled): Deleted.
283         * testing/Internals.h:
284         * testing/Internals.idl:
285
286 2016-04-12  Darin Adler  <darin@apple.com>
287
288         Remove UsePointersEvenForNonNullableObjectArguments from SVG lists
289         https://bugs.webkit.org/show_bug.cgi?id=156494
290
291         Reviewed by Chris Dumez.
292
293         * bindings/scripts/CodeGenerator.pm:
294         (ShouldPassWrapperByReference): For now, don't do this for any tear-off classes.
295         This includes the items stored in most SVG list classes.
296
297         * svg/SVGLengthList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
298         * svg/SVGNumberList.idl: Ditto.
299         * svg/SVGPointList.idl: Ditto.
300         * svg/SVGTransformList.idl: Ditto.
301
302         * svg/SVGPathSegList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
303         Marked the arguments nullable, and added FIXMEs about returning later since they
304         don't really need to be nullable. But fixing this requires some reworking of the
305         SVG list template and it's not urgent at this time. Preserves behavior where we
306         get an exception when passing null, it's just an SVG exception instead of TypeError.
307
308 2016-04-12  Chris Dumez  <cdumez@apple.com>
309
310         Lazily update tokens in DOMTokenList when the associated attribute value changes
311         https://bugs.webkit.org/show_bug.cgi?id=156474
312
313         Reviewed by Ryosuke Niwa.
314
315         Lazily update tokens in DOMTokenList when the associated attribute value
316         changes for performance. Constructing the sanitized vector of tokens
317         every time the associated Element attribute changes is too expensive.
318         Instead, we mark the vector as dirty whenever the attribute changes, and
319         we only construct the sanitized vector when it is actually required.
320
321         Also do some renaming for clarity.
322
323         There is no web-exposed behavior change.
324
325         * dom/Element.cpp:
326         (WebCore::Element::classAttributeChanged):
327         * html/DOMTokenList.cpp:
328         (WebCore::DOMTokenList::contains):
329         (WebCore::DOMTokenList::addInternal):
330         (WebCore::DOMTokenList::removeInternal):
331         (WebCore::DOMTokenList::toggle):
332         (WebCore::DOMTokenList::value):
333         (WebCore::DOMTokenList::setValue):
334         (WebCore::DOMTokenList::updateTokensFromAttributeValue):
335         (WebCore::DOMTokenList::associatedAttributeValueChanged):
336         (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
337         (WebCore::DOMTokenList::tokens):
338         (WebCore::DOMTokenList::DOMTokenList): Deleted.
339         * html/DOMTokenList.h:
340         (WebCore::DOMTokenList::tokens):
341         (WebCore::DOMTokenList::length):
342         (WebCore::DOMTokenList::item):
343         * html/HTMLAnchorElement.cpp:
344         (WebCore::HTMLAnchorElement::parseAttribute):
345         * html/HTMLIFrameElement.cpp:
346         (WebCore::HTMLIFrameElement::parseAttribute):
347         * html/HTMLLinkElement.cpp:
348         (WebCore::HTMLLinkElement::parseAttribute):
349         * html/HTMLOutputElement.cpp:
350         (WebCore::HTMLOutputElement::parseAttribute):
351
352 2016-04-12  Darin Adler  <darin@apple.com>
353
354         Remove UsePointersEvenForNonNullableObjectArguments from HTMLMediaElement
355         https://bugs.webkit.org/show_bug.cgi?id=156492
356
357         Reviewed by Chris Dumez.
358
359         * html/HTMLMediaElement.idl: Removed UsePointersEvenForNonNullableObjectArguments,
360         sorted remaining class attributes, simplified #if around canPlayType a bit,
361         removed comment that is not all that useful, made the argument to
362         webkitSetMediaKeys nullable since the implementation supports that.
363
364 2016-04-12  Eric Carlson  <eric.carlson@apple.com>
365
366         [iOS] media title sometimes remain in Control Center after tab is closed
367         https://bugs.webkit.org/show_bug.cgi?id=156243
368         <rdar://problem/20167445>
369
370         Reviewed by Darin Adler.
371
372         * Modules/webaudio/AudioContext.h: Implement characteristics.
373
374         * html/HTMLMediaElement.cpp:
375         (WebCore::HTMLMediaElement::mediaLoadingFailed): Call mediaSession->clientCharacteristicsChanged.
376         (WebCore::HTMLMediaElement::setReadyState): Ditto.
377         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
378         (WebCore::HTMLMediaElement::stop): Call mediaSession->stopSession.
379         (WebCore::HTMLMediaElement::characteristics): New, return current characteristics.
380         * html/HTMLMediaElement.h:
381
382         * platform/audio/PlatformMediaSession.cpp:
383         (WebCore::PlatformMediaSession::stopSession): Suspend playback, and remove the session 
384           from the manager, it will never play again.
385         (WebCore::PlatformMediaSession::characteristics): Return client characteristics.
386         (WebCore::PlatformMediaSession::clientCharacteristicsChanged):
387         * platform/audio/PlatformMediaSession.h:
388
389         * platform/audio/PlatformMediaSessionManager.cpp:
390         (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Call stopSession 
391           instead of pauseSession to signal that playback will never start again.
392         * platform/audio/PlatformMediaSessionManager.h:
393
394         * platform/audio/ios/MediaSessionManagerIOS.h:
395         * platform/audio/ios/MediaSessionManagerIOS.mm:
396         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Add logging.
397         (WebCore::MediaSessionManageriOS::removeSession): Update NowPlaying.
398         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Add logging.
399         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Update NowPlaying.
400         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): New, return the first session
401           that is an audio or video element with playable audio. WebAudio is not currently controllable
402           so it isn't appropriate to show it in the NowPlaying info center.
403         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Remember the last state passed to
404           NowPlaying so we can call it only when something has changed.
405
406 2016-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>
407
408         [GTK] Rework scrollbars theming code for GTK+ 3.20
409         https://bugs.webkit.org/show_bug.cgi?id=156462
410
411         Reviewed by Michael Catanzaro.
412
413         In r199292, we reworked the theming code to ensure it works with the new GTK+ CSS theming system. The same is
414         needed for scrollbars, this patch uses the RenderThemeGadget classes introduced in r199292 to render the native
415         scrollbars. The code is now split in 3 parts: stub methods for GTK+2 (since this file is compiled for
416         WebCoreGTK, but not used), the implementation for GTK+ < 3.20 and the implementation for GTK+ >= 3.20. This
417         reduces the amount of ifdefed code, and ensures that changes in new code don't break the rendering with older
418         versions of GTK+. I noticed that we were overriding both, the specific paint methods to render scrollbars
419         parts and the global paint method that renders all the scrollbar parts. We don't really need the specific paint
420         methods, so I've removed the implemention leaving only the paint method. This also allows us to get rid of the
421         GtkStyleContext cache.
422
423         * platform/gtk/RenderThemeGadget.cpp:
424         (WebCore::RenderThemeGadget::create): Handle scrollbars gadgets.
425         (WebCore::appendElementToPath): In case of scrollbar gadget, use the scrollbar GType when creating the path to
426         be able to get non-CSS style properties.
427         (WebCore::RenderThemeGadget::opacity): Add method to get the opacity CSS style property.
428         (WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget): Initialize m_steppers option set with the
429         steppers used by the theme.
430         * platform/gtk/RenderThemeGadget.h:
431         * platform/gtk/ScrollbarThemeGtk.cpp:
432         (WebCore::themeChangedCallback):
433         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
434         (WebCore::createStyleContext):
435         (WebCore::createChildStyleContext):
436         (WebCore::ScrollbarThemeGtk::themeChanged):
437         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
438         (WebCore::scrollbarPartStateFlags):
439         (WebCore::scrollbarGadgetForLayout):
440         (WebCore::contentsGadgetForLayout):
441         (WebCore::ScrollbarThemeGtk::trackRect):
442         (WebCore::ScrollbarThemeGtk::hasThumb):
443         (WebCore::ScrollbarThemeGtk::backButtonRect):
444         (WebCore::ScrollbarThemeGtk::forwardButtonRect):
445         (WebCore::ScrollbarThemeGtk::paint):
446         (WebCore::paintStepper):
447         (WebCore::adjustRectAccordingToMargin):
448         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
449         (WebCore::ScrollbarThemeGtk::minimumThumbLength):
450         * platform/gtk/ScrollbarThemeGtk.h:
451
452 2016-03-17  Sergio Villar Senin  <svillar@igalia.com>
453
454         [css-grid] Add parsing support for <auto-repeat> syntax
455         https://bugs.webkit.org/show_bug.cgi?id=155583
456
457         Reviewed by Antti Koivisto.
458
459         The repeat() notation allows now to specify auto-fill or auto-fit instead of
460         a fixed number of repetitions meaning that it will be automatically computed
461         depending on the available space.
462
463         This patch just adds the parsing support, the expansion of the repeat notation
464         will be implemented in a follow up patch because it cannot be done at
465         parsing level (since it requires knowledge about the available space).
466
467         Test: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
468
469         * CMakeLists.txt:
470         * css/CSSGridAutoRepeatValue.cpp: Added.
471         (WebCore::CSSGridAutoRepeatValue::customCSSText):
472         * css/CSSGridAutoRepeatValue.h: Added.
473         (WebCore::CSSGridAutoRepeatValue::create):
474         (WebCore::CSSGridAutoRepeatValue::autoRepeatID):
475         (WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue):
476         * css/CSSParser.cpp:
477         (WebCore::allTracksAreFixedSized):
478         (WebCore::CSSParser::parseGridTrackList):
479         (WebCore::CSSParser::parseGridTrackRepeatFunction):
480         (WebCore::CSSParser::parseGridTrackSize):
481         (WebCore::CSSParser::parseGridBreadth):
482         * css/CSSParser.h:
483         * css/CSSValue.cpp:
484         (WebCore::CSSValue::equals):
485         (WebCore::CSSValue::cssText):
486         (WebCore::CSSValue::destroy):
487         * css/CSSValue.h:
488         (WebCore::CSSValue::isGridAutoRepeatValue):
489         * css/CSSValueKeywords.in:
490
491 2016-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
492
493         [JSC] addStaticGlobals should emit SymbolTableEntry watchpoints to encourage constant folding in DFG
494         https://bugs.webkit.org/show_bug.cgi?id=155110
495
496         Reviewed by Saam Barati.
497
498         * bindings/js/JSDOMWindowBase.cpp:
499         (WebCore::JSDOMWindowBase::updateDocument):
500
501 2016-04-12  Sergio Villar Senin  <svillar@igalia.com>
502
503         [css-grid] Pass GridSizingData instead of columnTracks to track sizing methods
504         https://bugs.webkit.org/show_bug.cgi?id=156466
505
506         Reviewed by Darin Adler.
507
508         Several methods used to compute the items' size contribution to the tracks they span in, get
509         as an argument a vector with the sizes of the column tracks.
510
511         In order to support grids with orthogonal flows (among other things) it's much better to
512         pass the GridSizingData struct and let those methods decide whether to use the columns or
513         the rows.
514
515         No new tests as this is just a minor refactoring with no change in behavior.
516
517         * rendering/RenderGrid.cpp:
518         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
519         (WebCore::RenderGrid::logicalContentHeightForChild):
520         (WebCore::RenderGrid::minSizeForChild):
521         (WebCore::RenderGrid::minContentForChild):
522         (WebCore::RenderGrid::maxContentForChild):
523         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
524         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
525         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
526         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
527         * rendering/RenderGrid.h:
528
529 2016-04-11  Darin Adler  <darin@apple.com>
530
531         Remove UsePointersEvenForNonNullableObjectArguments from HTMLOptionsCollection
532         https://bugs.webkit.org/show_bug.cgi?id=156491
533
534         Reviewed by Chris Dumez.
535
536         * html/HTMLOptionsCollection.cpp:
537         (WebCore::HTMLOptionsCollection::add): Take a reference instead of a pointer.
538         * html/HTMLOptionsCollection.h: Removed unneeded forward declaration. Changed
539         add to take a reference instead of a pointer for the element to add. Used
540         final instead of override on virtual functions.
541         * html/HTMLOptionsCollection.idl: Removed now-unneeded attribute
542         UsePointersEvenForNonNullableObjectArguments; the only function affected was
543         add, and the overloading code was already checking for null.
544
545 2016-04-11  Darin Adler  <darin@apple.com>
546
547         Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
548         https://bugs.webkit.org/show_bug.cgi?id=156458
549
550         Reviewed by Chris Dumez.
551
552         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
553         (WebCore::JSHTMLOptionsCollection::remove): Updated to call remove with a reference
554         rather than a pointer.
555
556         * bindings/js/JSHTMLSelectElementCustom.cpp:
557         (WebCore::JSHTMLSelectElement::remove): Updated to call remove with a reference
558         rather than a pointer.
559         (WebCore::selectIndexSetter): Updated to call setOption with a reference rather
560         than a pointer.
561
562         * bindings/scripts/CodeGeneratorGObject.pm:
563         (GenerateFunction): Added basic support for passing wrappers by reference.
564         GObject bindings already check arguments for null, so didn't add any new checks.
565
566         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
567         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
568         * bindings/scripts/test/GObject/WebKitDOMTestCallbackFunction.cpp:
569         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
570         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
571         Updated.
572
573         * editing/FrameSelection.cpp: Updated includes.
574
575         * html/HTMLOptionElement.cpp:
576         (WebCore::HTMLOptionElement::setSelected): Pass reference when calling
577         HTMLSelectElement::optionSelectionStateChanged.
578         (WebCore::HTMLOptionElement::insertedInto): Ditto.
579
580         * html/HTMLOptionsCollection.cpp:
581         (WebCore::HTMLOptionsCollection::add): Moved null checking behavior here.
582         Preserves existing "silently do nothing if null".
583         (WebCore::HTMLOptionsCollection::remove): Changed function to take a reference
584         instead of a pointer.
585
586         * html/HTMLOptionsCollection.h: Updated include. Changed remove to take a
587         reference instead of a pointer.
588
589         * html/HTMLSelectElement.cpp:
590         (WebCore::HTMLSelectElement::add): Changed to take a reference instead of
591         a pointer. Also removed unneeded protect code, since insertBefore already
592         protects itself, and unneeded call to updateValidity, since the
593         HTMLSelectElement::childrenChanged function already calls updateValidity.
594         (WebCore::HTMLSelectElement::remove): Changed to take a reference instead
595         of a pointer.
596         (WebCore::HTMLSelectElement::setOption): Changed to take a reference
597         instead of a pointer.
598         (WebCore::HTMLSelectElement::setLength): Renamed "newLen" to "newLength".
599         Use Ref instead of RefPtr for result of createElement, which makes the
600         argument passed to add be a reference rather than a pointer.
601         (WebCore::HTMLSelectElement::willRespondToMouseClickEvents): Put the #if
602         for this here instead of in the header.
603         (WebCore::HTMLSelectElement::optionSelectionStateChanged): Changed to take
604         a reference instead of a pointer for the option element.
605
606         * html/HTMLSelectElement.h: Removed unneeded includes. Derive privately
607         from TypeAheadDataSource instead of publicly. Make all overrides final
608         except for the one that is actually overridden by a derived class.
609         Changed the arguments of the add, remove, setOption, and
610         optionSelectionStateChanged functions to be references instead of pointers.
611         Tweaked formatting a bit and used nullptr instead of 0. Override
612         willRespondToMouseClickEvents on all platforms, not just iOS.
613
614         * html/HTMLSelectElement.idl: Removed UsePointersEvenForNonNullableObjectArguments.
615         Removed a comment that is no longer needed. Made some types nullable to match
616         the specification, in places that currently have no effect on code generation.
617         Added a FIXME comment about the argument to setCustomValidity incorrectly being
618         marked as nullable.
619
620 2016-04-11  Brent Fulgham  <bfulgham@apple.com>
621
622         Use WeakPtrs to avoid using deallocated Widgets and ScrollableAreas
623         https://bugs.webkit.org/show_bug.cgi?id=156420
624         <rdar://problem/25637378>
625
626         Reviewed by Darin Adler.
627
628         Avoid the risk of using deallocated Widgets and ScrollableAreas by using WeakPtrs instead of
629         bare pointers. This allows us to remove some explicit calls to get ScrollableArea and Widget
630         members in the event handling logic. Instead, null checks are sufficient to ensure we never
631         accidentally dereference a deleted element.
632
633         1. Modify the ScrollableArea class to support vending WeakPtrs.
634         2. Modify the Event Handling code to use WeakPtrs to hold ScrollableArea and RenderWidget
635            objects, and to null-check these elements after event handling dispatching is finished
636            to handle cases where these objects are destroyed.
637
638         Test: fast/events/wheel-event-destroys-frame.html
639               fast/events/wheel-event-destroys-overflow.html
640
641         * page/EventHandler.cpp:
642         (WebCore::EventHandler::platformPrepareForWheelEvents): Change signature for WeakPtr.
643         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
644         (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
645         (WebCore::widgetForElement): Change to return a WeakPtr.
646         (WebCore::EventHandler::handleWheelEvent): Use WeakPtrs to hold elements that might be destroyed
647         during event handling.
648         * page/EventHandler.h:
649         * page/mac/EventHandlerEfl.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
650         * page/mac/EventHandlerGtk.cpp: Ditto.
651         * page/mac/EventHandlerIOS.mm: Ditto.
652         * page/mac/EventHandlerMac.mm:
653         (WebCore::scrollableAreaForEventTarget): Renamed from scrollViewForEventTarget. Return
654         a WeakPtr rather than a bare pointer.
655         (WebCore::scrollableAreaForContainerNode): Return WeakPtr rather than bare pointer.
656         (WebCore::EventHandler::completeWidgetWheelEvent): Added.
657         (WebCore::EventHandler::passWheelEventToWidget): Deleted.
658         (WebCore::EventHandler::platformPrepareForWheelEvents): Convert to WeakPtrs.
659         (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
660         (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Ditto.
661         (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
662         (WebCore::EventHandler::widgetDidHandleWheelEvent): Renamed from passWheelEventToWidget.
663         (WebCore::EventHandler::widgetForEventTarget): Converted from static function to static
664         method so it can be shared with EventHandlerMac.
665         (WebCore::scrollViewForEventTarget): Deleted.
666         * page/mac/EventHandlerWin.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
667         * platform/ScrollableArea.cpp:
668         * platform/ScrollableArea.h:
669         (WebCore::ScrollableArea::createWeakPtr): Added.
670         * platform/Widget.h:
671         (WebCore::ScrollableArea::createWeakPtr): Added.
672
673 2016-04-11  Dean Jackson  <dino@apple.com>
674
675         putImageData needs to premultiply input
676         https://bugs.webkit.org/show_bug.cgi?id=156488
677         <rdar://problem/25672675>
678
679         Reviewed by Zalan Bujtas.
680
681         I made a mistake in r187534 as I was converting get and putImageData
682         to use Accelerate. The incoming data is unmultiplied, and should
683         be premultiplied before copying into the backing store. I was
684         accidentally unmultiplying unmultiplied data, which caused
685         some pretty psychedelic results.
686
687         Test: fast/canvas/putImageData-unmultiplied.html
688
689         * platform/graphics/cg/ImageBufferDataCG.cpp:
690         (WebCore::ImageBufferData::putData): Call premultiply, not unpremultiply.
691
692 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
693
694         When clearing cache, also clear AVFoundation cache.
695         https://bugs.webkit.org/show_bug.cgi?id=155783
696         rdar://problem/25252541
697
698         Reviewed by Darin Adler.
699
700         Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
701         can then be used to manage the cache storage used by AVFoundation. It is used to query the
702         contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
703         clearMediaCache() and clearMediaCacheForOrigins().
704
705         Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
706
707         * html/HTMLMediaElement.cpp:
708         (WebCore::sharedMediaCacheDirectory): Added.
709         (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
710         (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
711         (WebCore::HTMLMediaElement::originsInMediaCache): Added.
712         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
713         (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
714         (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
715         (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
716         (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
717         * html/HTMLMediaElement.h:
718         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
719         * platform/graphics/MediaPlayer.cpp:
720         (WebCore::addMediaEngine): Add new cache methods.
721         (WebCore::addToHash): Added.
722         (WebCore::MediaPlayer::originsInMediaCache): Added.
723         (WebCore::MediaPlayer::clearMediaCache): Added parameter.
724         (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
725         (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
726         (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
727         * platform/graphics/MediaPlayer.h:
728         (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
729         * platform/graphics/MediaPlayerPrivate.h:
730         (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
731         (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
732         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
733         (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
734         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
735         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
736         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
737         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
738         (WebCore::assetCacheForPath): Added.
739         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
740         (WebCore::toSystemClockTime): Added.
741         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
742         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
743         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
744         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
745         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
746         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
747         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
748         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
749         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
750         (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
751         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
752         * platform/spi/mac/AVFoundationSPI.h:
753
754 2016-04-11  Commit Queue  <commit-queue@webkit.org>
755
756         Unreviewed, rolling out r199310.
757         https://bugs.webkit.org/show_bug.cgi?id=156483
758
759         This change turns many indexeddb tests into crashes (Requested
760         by jwtan on #webkit).
761
762         Reverted changeset:
763
764         "Clean up IDBBindingUtilities."
765         https://bugs.webkit.org/show_bug.cgi?id=156472
766         http://trac.webkit.org/changeset/199310
767
768 2016-04-11  Commit Queue  <commit-queue@webkit.org>
769
770         Unreviewed, rolling out r199315.
771         https://bugs.webkit.org/show_bug.cgi?id=156482
772
773         This change broke the OS X Yosemite build. (Requested by jwtan
774         on #webkit).
775
776         Reverted changeset:
777
778         "When clearing cache, also clear AVFoundation cache."
779         https://bugs.webkit.org/show_bug.cgi?id=155783
780         http://trac.webkit.org/changeset/199315
781
782 2016-04-11  Brian Burg  <bburg@apple.com>
783
784         Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
785         https://bugs.webkit.org/show_bug.cgi?id=156407
786         <rdar://problem/25627659>
787
788         Reviewed by Joseph Pecoraro.
789
790         * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
791
792 2016-04-11  Commit Queue  <commit-queue@webkit.org>
793
794         Unreviewed, rolling out r198909.
795         https://bugs.webkit.org/show_bug.cgi?id=156479
796
797         made double-click-and-drag on text drag instead of
798         highlighting (Requested by alexchristensen_ on #webkit).
799
800         Reverted changeset:
801
802         "eventMayStartDrag() does not check for shiftKey or
803         isOverLink"
804         https://bugs.webkit.org/show_bug.cgi?id=155746
805         http://trac.webkit.org/changeset/198909
806
807 2016-04-11  Chris Dumez  <cdumez@apple.com>
808
809         [WebIDL] Add support for [ImplementedAs] for EventHandler attributes
810         https://bugs.webkit.org/show_bug.cgi?id=156421
811
812         Reviewed by Darin Adler.
813
814         Add support for [ImplementedAs] for EventHandler attributes so we can
815         get rid of some ugly name hard-coding in the bindings generator.
816
817         * Modules/notifications/Notification.idl:
818         * bindings/scripts/CodeGeneratorJS.pm:
819         (EventHandlerAttributeEventName):
820         * bindings/scripts/test/JS/JSTestObj.cpp:
821         (WebCore::jsTestObjOnwebkitfoo):
822         (WebCore::setJSTestObjOnwebkitfoo):
823         * bindings/scripts/test/TestObj.idl:
824         * dom/Element.idl:
825         * page/DOMWindow.idl:
826
827 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
828
829         When clearing cache, also clear AVFoundation cache.
830         https://bugs.webkit.org/show_bug.cgi?id=155783
831         rdar://problem/25252541
832
833         Reviewed by Darin Adler.
834
835         Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
836         can then be used to manage the cache storage used by AVFoundation. It is used to query the
837         contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
838         clearMediaCache() and clearMediaCacheForOrigins().
839
840         Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
841
842         * html/HTMLMediaElement.cpp:
843         (WebCore::sharedMediaCacheDirectory): Added.
844         (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
845         (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
846         (WebCore::HTMLMediaElement::originsInMediaCache): Added.
847         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
848         (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
849         (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
850         (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
851         (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
852         * html/HTMLMediaElement.h:
853         (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
854         * platform/graphics/MediaPlayer.cpp:
855         (WebCore::addMediaEngine): Add new cache methods.
856         (WebCore::addToHash): Added.
857         (WebCore::MediaPlayer::originsInMediaCache): Added.
858         (WebCore::MediaPlayer::clearMediaCache): Added parameter.
859         (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
860         (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
861         (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
862         * platform/graphics/MediaPlayer.h:
863         (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
864         * platform/graphics/MediaPlayerPrivate.h:
865         (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
866         (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
867         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
868         (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
869         (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
870         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
871         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
872         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
873         (WebCore::assetCacheForPath): Added.
874         (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
875         (WebCore::toSystemClockTime): Added.
876         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
877         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
878         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
879         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
880         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
881         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
882         (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
883         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
884         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
885         (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
886         (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
887         * platform/spi/mac/AVFoundationSPI.h:
888
889 2016-04-11  Antoine Quint  <graouts@apple.com>
890
891         [WebGL2] Use Open GL ES 3.0 to back WebGL2 contexts
892         https://bugs.webkit.org/show_bug.cgi?id=141178
893
894         Reviewed by Dean Jackson.
895
896         We add a new `useGLES3` attribute when creating a GraphicsContext3D in the event that the
897         context type is "webgl2". This attribute is then read by the GraphicsContext3D constructor
898         to request an Open GL ES 3.0 backend when creating the EAGLContext on iOS.
899
900         * html/canvas/WebGLRenderingContextBase.cpp:
901         (WebCore::WebGLRenderingContextBase::create):
902         * platform/graphics/GraphicsContext3D.h:
903         (WebCore::GraphicsContext3D::Attributes::Attributes):
904         * platform/graphics/mac/GraphicsContext3DMac.mm:
905         (WebCore::GraphicsContext3D::GraphicsContext3D):
906
907 2016-04-11  Jiewen Tan  <jiewen_tan@apple.com>
908
909         fast/loader/opaque-base-url.html crashing during mac and ios debug tests
910         https://bugs.webkit.org/show_bug.cgi?id=156179
911         <rdar://problem/25507719>
912
913         Reviewed by Ryosuke Niwa.
914
915         Navigate to about:blank if the provided src of an iframe/frame cannot be
916         resolved to a valid URL.
917
918         Test: fast/loader/iframe-src-invalid-url.html
919
920         * loader/SubframeLoader.cpp:
921         (WebCore::SubframeLoader::requestFrame):
922
923 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
924
925         Merge CG ImageSource and non CG ImageSource implementation in one file
926         https://bugs.webkit.org/show_bug.cgi?id=155456
927
928         Reviewed by Darin Adler.
929
930         ImageSource for CG and CG code paths look very similar. All the platform
931         specific code can be moved to ImageDecoder classes for CG and non CG. And
932         we can have the ImageSource be platform independent and we get rid of
933         ImageSourceCG.cpp.
934
935         Test: fast/images/image-subsampling.html
936
937         * CMakeLists.txt:
938         * PlatformAppleWin.cmake:
939         * PlatformMac.cmake:
940         * WebCore.xcodeproj/project.pbxproj:
941         Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
942         CMakeLists.txt.
943         
944         * platform/Cursor.cpp:
945         (WebCore::determineHotSpot):
946         * platform/graphics/BitmapImage.cpp:
947         (WebCore::BitmapImage::hotSpot):
948         (WebCore::BitmapImage::getHotSpot): Deleted.
949         * platform/graphics/BitmapImage.h:
950         * platform/graphics/Image.h:
951         (WebCore::Image::hotSpot):
952         (WebCore::Image::getHotSpot): Deleted.
953         Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
954         
955         * platform/graphics/ImageSource.cpp:
956         (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
957         (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
958         (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
959         
960         (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
961         const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
962         The value of const static int CG ImageDecoder::m_maxNumPixels will be set
963         based on IMAGE_DECODER_DOWN_SAMPLING.
964         
965         (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
966         
967         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
968         subsampling level allowed for an image.
969         
970         (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
971         SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
972         a particular image.
973         
974         (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
975         of encoded bytes which can determine the image properties. For non CG it's
976         zero. For CG it is a maximum value which can be corrected later.
977         
978         (WebCore::ImageSource::isSizeAvailable):
979         (WebCore::ImageSource::sizeRespectingOrientation):
980         (WebCore::ImageSource::frameCount):
981         (WebCore::ImageSource::repetitionCount):
982         (WebCore::ImageSource::filenameExtension):
983         (WebCore::ImageSource::getHotSpot):
984         (WebCore::ImageSource::frameIsCompleteAtIndex):
985         (WebCore::ImageSource::frameHasAlphaAtIndex):
986         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
987         (WebCore::ImageSource::frameSizeAtIndex):
988         (WebCore::ImageSource::frameBytesAtIndex):
989         (WebCore::ImageSource::frameDurationAtIndex):
990         (WebCore::ImageSource::orientationAtIndex):
991         (WebCore::ImageSource::createFrameImageAtIndex):
992         These are wrappers for the ImageDecoder APIs. The purpose of these functions
993         is to ensure the ImageDecoder is created.
994         
995         (WebCore::ImageSource::dump): Called from BitmapImage::dump().
996         
997         (WebCore::ImageSource::getHotSpot): Deleted.
998         
999         * platform/graphics/ImageSource.h:
1000         (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
1001         
1002         (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
1003         (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
1004         Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
1005         
1006         * platform/graphics/cg/ImageDecoderCG.cpp:
1007         (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
1008
1009         (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
1010         The code was moved to ImageSource::subsamplingLevelForScale().
1011         
1012         * platform/graphics/cg/ImageDecoderCG.h:
1013         (WebCore::ImageDecoder::create): Make the prototype of this function
1014         suitable for CG and non CG cases.
1015         (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
1016         
1017         * platform/graphics/cg/ImageSourceCG.cpp: Removed.
1018         
1019         * platform/image-decoders/ImageDecoder.cpp:
1020         (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
1021         whether the frame decoding is complete or not.
1022         
1023         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
1024         
1025         (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
1026         ImageSource::frameDurationAtIndex() in ImageSource.cpp.
1027         
1028         (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
1029         ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
1030         
1031         * platform/image-decoders/ImageDecoder.h:
1032         (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
1033         (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
1034         (WebCore::ImageDecoder::setData): Change the type of the argument from
1035         SharedBuffer* to SharedBuffer&.
1036         (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
1037         so it can have the same prototype as CG.
1038         (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
1039         
1040         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
1041         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
1042         (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
1043         and return the default values so we do not have to add directive compiled
1044         non CG blocks in ImageSource.cpp.
1045
1046         (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
1047         
1048         (WebCore::ImageDecoder::orientation): Deleted.
1049         (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
1050         
1051         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1052         (WebCore::BMPImageDecoder::setData):
1053         * platform/image-decoders/bmp/BMPImageDecoder.h:
1054         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1055         (WebCore::GIFImageDecoder::setData):
1056         (WebCore::GIFImageDecoder::decode):
1057         * platform/image-decoders/gif/GIFImageDecoder.h:
1058         * platform/image-decoders/gif/GIFImageReader.h:
1059         (GIFImageReader::setData):
1060         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1061         (WebCore::ICOImageDecoder::setData):
1062         Use reference SharedBuffer instead of pointer SharedBuffer.
1063         
1064         (WebCore::ICOImageDecoder::hotSpot):
1065         (WebCore::ICOImageDecoder::hotSpotAtIndex):
1066         Change hotSpot() to return Optional<IntPoint>.
1067         * platform/image-decoders/ico/ICOImageDecoder.h:
1068                 
1069         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1070         Pass reference SharedBuffer instead of pointer SharedBuffer.
1071
1072 2016-04-08  Said Abou-Hallawa  <sabouhallawa@apple,com>
1073
1074         Timing attack on SVG feComposite filter circumvents same-origin policy
1075         https://bugs.webkit.org/show_bug.cgi?id=154338
1076
1077         Reviewed by Oliver Hunt.
1078
1079         Ensure the FEComposite arithmetic filter is clamping the resulted color
1080         components in a constant time.
1081
1082         * platform/graphics/filters/FEComposite.cpp:
1083         (WebCore::clampByte):
1084         (WebCore::computeArithmeticPixels):
1085
1086 2016-04-11  Brady Eidson  <beidson@apple.com>
1087
1088         Clean up IDBBindingUtilities.
1089         https://bugs.webkit.org/show_bug.cgi?id=156472
1090
1091         Reviewed by Alex Christensen.
1092
1093         No new tests (No change in behavior).
1094
1095         - Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
1096         - Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
1097         - Make more functions deal in JSValue instead of Deprecated::ScriptValue.
1098
1099         * bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
1100           JSValues instead of Deprecated::ScriptState
1101         * bindings/scripts/CodeGeneratorJS.pm:
1102         (NativeToJSValue): Use that new attribute.
1103         
1104         * Modules/indexeddb/IDBAny.cpp:
1105         (WebCore::IDBAny::IDBAny):
1106         (WebCore::IDBAny::scriptValue):
1107         * Modules/indexeddb/IDBAny.h:
1108         (WebCore::IDBAny::create):
1109         * Modules/indexeddb/IDBCursor.cpp:
1110         (WebCore::IDBCursor::key):
1111         (WebCore::IDBCursor::primaryKey):
1112         (WebCore::IDBCursor::value):
1113         (WebCore::IDBCursor::update):
1114         (WebCore::IDBCursor::continueFunction):
1115         (WebCore::IDBCursor::deleteFunction):
1116         (WebCore::IDBCursor::setGetResult):
1117         * Modules/indexeddb/IDBCursor.h:
1118         * Modules/indexeddb/IDBCursor.idl:
1119         * Modules/indexeddb/IDBCursorWithValue.idl:
1120         * Modules/indexeddb/IDBFactory.cpp:
1121         (WebCore::IDBFactory::cmp):
1122         * Modules/indexeddb/IDBIndex.cpp:
1123         (WebCore::IDBIndex::count):
1124         (WebCore::IDBIndex::get):
1125         (WebCore::IDBIndex::getKey):
1126         * Modules/indexeddb/IDBKeyRange.cpp:
1127         (WebCore::IDBKeyRange::lowerValue):
1128         (WebCore::IDBKeyRange::upperValue):
1129         (WebCore::IDBKeyRange::only):
1130         (WebCore::IDBKeyRange::lowerBound):
1131         (WebCore::IDBKeyRange::upperBound):
1132         (WebCore::IDBKeyRange::bound):
1133         * Modules/indexeddb/IDBKeyRange.h:
1134         * Modules/indexeddb/IDBKeyRange.idl:
1135         * Modules/indexeddb/IDBObjectStore.cpp:
1136         (WebCore::IDBObjectStore::get):
1137         (WebCore::IDBObjectStore::modernDelete):
1138         (WebCore::IDBObjectStore::count):
1139         * Modules/indexeddb/IDBRequest.cpp:
1140         (WebCore::IDBRequest::setResult):
1141         (WebCore::IDBRequest::setResultToStructuredClone):
1142         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1143         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
1144         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
1145         * bindings/js/IDBBindingUtilities.cpp:
1146         (WebCore::idbKeyPathFromValue):
1147         (WebCore::deserializeIDBValueDataToJSValue):
1148         (WebCore::scriptValueToIDBKey):
1149         (WebCore::idbKeyDataToScriptValue):
1150         (WebCore::idbKeyDataToJSValue): Deleted.
1151         (WebCore::injectIDBKeyIntoScriptValue): Deleted.
1152         (WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
1153         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
1154         (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
1155         (WebCore::deserializeIDBValue): Deleted.
1156         (WebCore::deserializeIDBValueData): Deleted.
1157         (WebCore::deserializeIDBValueBuffer): Deleted.
1158         (WebCore::idbValueDataToJSValue): Deleted.
1159         (WebCore::idbKeyToScriptValue): Deleted.
1160         * bindings/js/IDBBindingUtilities.h:
1161         * bindings/js/JSIDBAnyCustom.cpp:
1162         (WebCore::toJS):
1163         * bindings/js/JSIDBDatabaseCustom.cpp:
1164         (WebCore::JSIDBDatabase::createObjectStore):
1165         * bindings/js/JSIDBObjectStoreCustom.cpp:
1166         (WebCore::JSIDBObjectStore::createIndex):
1167         * dom/ScriptExecutionContext.cpp:
1168         (WebCore::ScriptExecutionContext::execState):
1169         * dom/ScriptExecutionContext.h:
1170         * inspector/InspectorIndexedDBAgent.cpp:
1171
1172 2016-04-09  Gavin Barraclough  <barraclough@apple.com>
1173
1174         WebKit should adopt journal_mode=wal for all SQLite databases.
1175         https://bugs.webkit.org/show_bug.cgi?id=133496
1176
1177         Reviewed by Darin Adler.
1178
1179         The statement intended to enable WAL mode is always failing because it is missing a
1180         prepare(). Fix this. We were also previously permitting SQLITE_OK results - this
1181         was in error (we were only getting these because stepping the unprepared statement
1182         returned SQLITE_OK). Also set the SQLITE_OPEN_AUTOPROXY flag when opening the
1183         database - this will improve perfomance when the database is accessed via an AFP
1184         mount.
1185
1186         This exposed a bug, that deleteAllDatabases does not actually delete the databases on
1187         iOS, for testing to reset back to a known state between tests it should be doing so.
1188
1189         * Modules/webdatabase/DatabaseTracker.cpp:
1190         (WebCore::DatabaseTracker::deleteAllDatabases):
1191             - force databases to actually be deleted on iOS.
1192               This method is only used from testing code (DumpRenderTree / WebKitTestRunner).
1193         (WebCore::DatabaseTracker::deleteOrigin):
1194             - added IOSDeletionMode.
1195         (WebCore::DatabaseTracker::deleteDatabaseFile):
1196             - added IOSDeletionMode, modified to actually delete if this is set.
1197         * Modules/webdatabase/DatabaseTracker.h:
1198             - added IOSDeletionMode.
1199         * platform/sql/SQLiteDatabase.cpp:
1200         (WebCore::SQLiteDatabase::open):
1201             - call prepareAndStep(), only check for SQLITE_ROW result.
1202         * platform/sql/SQLiteFileSystem.cpp:
1203         (WebCore::SQLiteFileSystem::openDatabase):
1204             - should set SQLITE_OPEN_AUTOPROXY flag when opening database.
1205
1206 2016-04-11  Zalan Bujtas  <zalan@apple.com>
1207
1208         Simplify InlineTextBox::selectionStartEnd()
1209         https://bugs.webkit.org/show_bug.cgi?id=156459
1210
1211         Reviewed by Darin Adler.
1212
1213         No change in functionality.
1214
1215         * rendering/InlineTextBox.cpp:
1216         (WebCore::InlineTextBox::selectionState):
1217         (WebCore::InlineTextBox::paint):
1218         (WebCore::InlineTextBox::selectionStartEnd):
1219         (WebCore::InlineTextBox::paintSelection):
1220         (WebCore::InlineTextBox::paintCompositionBackground):
1221         * rendering/InlineTextBox.h:
1222         * rendering/svg/SVGInlineTextBox.cpp:
1223         (WebCore::SVGInlineTextBox::paintSelectionBackground):
1224         (WebCore::SVGInlineTextBox::paintText):
1225
1226 2016-04-11  Zalan Bujtas  <zalan@apple.com>
1227
1228         REGRESSION (r193857): Text selection causes text to disappear.
1229         https://bugs.webkit.org/show_bug.cgi?id=156448
1230         rdar://problem/25578952
1231
1232         Reviewed by Simon Fraser.
1233
1234         Apparently when the end position of the selection range is smaller than the start position, we need
1235         to repaint the entire text as it indicates selection clearing.
1236
1237         Test: fast/text/text-disappear-on-deselect.html
1238
1239         * rendering/TextPainter.cpp:
1240         (WebCore::TextPainter::paintText):
1241
1242 2016-04-05  Oliver Hunt  <oliver@apple.com>
1243
1244         Remove compile time define for SEPARATED_HEAP
1245         https://bugs.webkit.org/show_bug.cgi?id=155508
1246
1247         Reviewed by Mark Lam.
1248
1249         * Configurations/FeatureDefines.xcconfig:
1250
1251 2016-04-11  Chris Dumez  <cdumez@apple.com>
1252
1253         Merge AttributedDOMTokenList into DOMTokenList
1254         https://bugs.webkit.org/show_bug.cgi?id=156468
1255
1256         Reviewed by Ryosuke Niwa.
1257
1258         Merge AttributedDOMTokenList into DOMTokenList to simplify the code.
1259         DOMTokenList is not constructible and AttributedDOMTokenList is its
1260         only constructible subclass after r196123.
1261
1262         * CMakeLists.txt:
1263         * WebCore.xcodeproj/project.pbxproj:
1264         * dom/Element.cpp:
1265         (WebCore::Element::classList):
1266         * dom/ElementRareData.h:
1267         (WebCore::ElementRareData::classList):
1268         (WebCore::ElementRareData::setClassList):
1269         * html/AttributeDOMTokenList.cpp: Removed.
1270         * html/AttributeDOMTokenList.h: Removed.
1271         * html/DOMTokenList.cpp:
1272         (WebCore::DOMTokenList::DOMTokenList):
1273         (WebCore::DOMTokenList::attributeValueChanged):
1274         (WebCore::DOMTokenList::updateAfterTokenChange):
1275         * html/DOMTokenList.h:
1276         (WebCore::DOMTokenList::ref):
1277         (WebCore::DOMTokenList::deref):
1278         (WebCore::DOMTokenList::element):
1279         (WebCore::DOMTokenList::~DOMTokenList): Deleted.
1280         (WebCore::DOMTokenList::updateAfterTokenChange): Deleted.
1281         * html/HTMLAnchorElement.cpp:
1282         (WebCore::HTMLAnchorElement::relList):
1283         * html/HTMLAnchorElement.h:
1284         * html/HTMLIFrameElement.cpp:
1285         (WebCore::HTMLIFrameElement::sandbox):
1286         * html/HTMLIFrameElement.h:
1287         * html/HTMLLinkElement.cpp:
1288         (WebCore::HTMLLinkElement::sizes):
1289         (WebCore::HTMLLinkElement::relList):
1290         * html/HTMLLinkElement.h:
1291         * html/HTMLOutputElement.cpp:
1292         (WebCore::HTMLOutputElement::htmlFor):
1293         * html/HTMLOutputElement.h:
1294
1295 2016-04-11  Chris Dumez  <cdumez@apple.com>
1296
1297         DOMTokenList.contains() should not throw
1298         https://bugs.webkit.org/show_bug.cgi?id=156453
1299
1300         Reviewed by Ryosuke Niwa.
1301
1302         DOMTokenList.contains() should not throw if the input token is invalid:
1303         https://github.com/whatwg/dom/commit/6d3076e3cbcba662489b272a718bc6b8c0082a74
1304
1305         We now return false in such cases, instead of throwing, which should be
1306         safe with regards to backward compatibility.
1307
1308         No new tests, already covered by existing tests.
1309
1310         * html/DOMTokenList.cpp:
1311         (WebCore::DOMTokenList::contains):
1312         * html/DOMTokenList.h:
1313         * html/DOMTokenList.idl:
1314
1315 2016-04-11  Frederic Wang  <fwang@igalia.com>
1316
1317         Refactor RenderMathMLFraction layout to avoid using flexbox
1318         https://bugs.webkit.org/show_bug.cgi?id=153917
1319
1320         Reviewed by Sergio Villar Senin.
1321
1322         Based on a patch by Alejandro G. Castro <alex@igalia.com>
1323
1324         Implement the layoutBlock method to handle the layout calculations
1325         directly in the class. This also fixes parsing of absolute values for
1326         linethickness attribute (e.g. 10px) and adds support for the AxisHeight
1327         and FractionRuleThickness MATH parameters.
1328
1329         Test: mathml/opentype/fraction-line.html
1330
1331         * accessibility/AccessibilityRenderObject.cpp:
1332         (WebCore::AccessibilityRenderObject::mathLineThickness): Use the thickness relative to the
1333         default line thickness since that's really what is expected by mathml-line-fraction.html
1334         * css/mathml.css: Remove flexbox properties for mfrac.
1335         (mfrac): Deleted.
1336         (mfrac > *): Deleted.
1337         (mfrac[numalign="left"] > :first-child): Deleted.
1338         (mfrac[numalign="right"] > :first-child): Deleted.
1339         (mfrac[denomalign="left"] > :last-child): Deleted.
1340         (mfrac[denomalign="right"] > :last-child): Deleted.
1341         (mfrac > :first-child): Deleted.
1342         (mfrac > :last-child): Deleted.
1343         (mfrac): Deleted.
1344         * rendering/mathml/RenderMathMLBlock.cpp: Introduce a helper function to retrieve the math
1345         axis height.
1346         (WebCore::RenderMathMLBlock::mathAxisHeight):
1347         * rendering/mathml/RenderMathMLBlock.h: Declare mathAxisHeight.
1348         * rendering/mathml/RenderMathMLFraction.cpp:
1349         (WebCore::RenderMathMLFraction::RenderMathMLFraction):
1350         (WebCore::RenderMathMLFraction::parseAlignmentAttribute): Helper function to parse the align
1351         attribute.
1352         (WebCore::RenderMathMLFraction::isValid): Helper function to verify whether the child list
1353         is valid with respect to the MathML specificitation.
1354         (WebCore::RenderMathMLFraction::numerator): Helper function to retrieve the numerator.
1355         (WebCore::RenderMathMLFraction::denominator): Helper function to retrieve the denominator.
1356         (WebCore::RenderMathMLFraction::updateFromElement): Use the FractionRuleThickness parameter
1357         when avaiable to calculate the default linethickness.
1358         Fix computation of linethickness for absolute values (e.g. 10px), the default linethickness
1359         must not be involved for such values.
1360         We no longer need to manage style of anonymous wrappers.
1361         (WebCore::RenderMathMLFraction::unembellishedOperator): Use the helper function and we no
1362         longer care about anonymous wrappers.
1363         (WebCore::RenderMathMLFraction::computePreferredLogicalWidths): Implement this function
1364         without using flexbox.
1365         (WebCore::RenderMathMLFraction::horizontalOffset): Helper function to get the horizontal
1366         offsets of children depending of the alignment.
1367         (WebCore::RenderMathMLFraction::layoutBlock): Implement this function without using flexbox.
1368         (WebCore::RenderMathMLFraction::paint): Do not paint if the fraction is invalid. Use helper
1369         function. Use the width of the renderer (instead of the one of the denominator) as the
1370         length of the fraction bar.
1371         (WebCore::RenderMathMLFraction::firstLineBaseline): Use the helper functions to get children
1372         and axis height.
1373         (WebCore::RenderMathMLFraction::paintChildren): Temporary function to remove in a
1374         follow-up patch.
1375         (WebCore::RenderMathMLFraction::fixChildStyle): Deleted. We no longer need to manage style
1376         of anonymous wrappers.
1377         (WebCore::RenderMathMLFraction::addChild): Deleted. We no longer need to manage
1378         anonymous wrappers.
1379         (WebCore::RenderMathMLFraction::styleDidChange): We no longer need to manage style of
1380         anonymous wrappers.
1381         (WebCore::RenderMathMLFraction::layout): Deleted.
1382         * rendering/mathml/RenderMathMLFraction.h: Replace lineThickness with relativeLineThickness,
1383         as needed by the accessibility code. Update function and members declarations.
1384
1385 2016-04-11  Commit Queue  <commit-queue@webkit.org>
1386
1387         Unreviewed, rolling out r199290.
1388         https://bugs.webkit.org/show_bug.cgi?id=156465
1389
1390         broke 300 tests (Requested by mcatanzaro on #webkit).
1391
1392         Reverted changeset:
1393
1394         "Merge CG ImageSource and non CG ImageSource implementation in
1395         one file"
1396         https://bugs.webkit.org/show_bug.cgi?id=155456
1397         http://trac.webkit.org/changeset/199290
1398
1399 2016-04-11  Frederic Wang  <fwang@igalia.com>
1400
1401         Refactor RenderMathMLUnderOver layout functions to avoid using flexbox
1402         https://bugs.webkit.org/show_bug.cgi?id=153742
1403
1404         Reviewed by Sergio Villar Senin.
1405
1406         Based on a patch by Javier Fernandez <jfernandez@igalia.com>
1407
1408         Refactor the UnderOver renderer to use its own layoutBlock method that
1409         does all the layout calculations without considering the flexbox
1410         restrictions.
1411
1412         * css/mathml.css:
1413         (mo, mfrac, munder, mover, munderover): Delete the underover elements from the line defining
1414         the column direction.
1415         (munder, mover, munderover): Deleted. This flexbox property is no longer needed.
1416         (mover > :last-child, munderover > :last-child): Deleted. This flexbox property is no longer
1417         needed.
1418         * rendering/mathml/RenderMathMLUnderOver.cpp:
1419         (WebCore::RenderMathMLUnderOver::firstLineBaseline): Use ascentForChild.
1420         (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Avoid stretching
1421         operators that are not stretchy.
1422         (WebCore::RenderMathMLUnderOver::isValid): Helper function to ensure that the child list is
1423         valid with respect to the MathML specification.
1424         (WebCore::RenderMathMLUnderOver::base): Added. Helper function.
1425         (WebCore::RenderMathMLUnderOver::under): Added. Helper function.
1426         (WebCore::RenderMathMLUnderOver::over): Added. Helper function.
1427         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Added.
1428         The preferred width is the maximum preferred width of the base, under and over scripts.
1429         (WebCore::RenderMathMLUnderOver::horizontalOffset): Added, helper to calculate the
1430         horizontal position of children (horizontally centered).
1431         (WebCore::RenderMathMLUnderOver::layoutBlock): Added, it lays out the base, underscript and
1432         overscript. It calculates the exact logical width, which may differ from the preferred width when
1433         one child contains stretchy operators. It later sets the locations of children accordingly
1434         and sets the heigth of the render element.
1435         (WebCore::RenderMathMLUnderOver::paintChildren): Added, we have to use the usual traverse
1436         instead of the one that comes from the flexbox. This will be removed in a follow-up patch.
1437         (WebCore::RenderMathMLUnderOver::layout): Deleted.
1438         * rendering/mathml/RenderMathMLUnderOver.h: Added new functions definitions.
1439
1440 2016-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1441
1442         [GTK] Rework the theming code for GTK+ 3.20
1443         https://bugs.webkit.org/show_bug.cgi?id=156333
1444
1445         Reviewed by Michael Catanzaro.
1446
1447         During the 3.19 GTK+ release cycle, the GTK+ css system was reworked, making themes and programs rendering
1448         themed widgets, incompatible with the new system. We were trying to fix our rendering every time GTK+ broke
1449         something, but we were just changing whatever it was needed to make our rendering look like current GTK+ with
1450         the default theme Adwaita. This means that our rendering will be broken for other themes or that changes in
1451         Adwaita can break our rendering. This solution was good enough to ensure WebKitGTK+ 2.12 looked good with GTK+
1452         3.20, but it doesn't work in the long term. We need to ensure that our theming code honors the new GTK+ CSS
1453         properties (max-width, min-width, margin, padding, border, ...) in all the cases, not only the cases where
1454         Adwaita uses them like we currently do.
1455         This patch splits all rendering methods to keep the current code for previous GTK+ versions and adds new code
1456         for GTK+ >= 3.20 using the new RenderThemeGadget classes. This makes the code easier to read, since there aren't
1457         ifdef blocks in the functions, and we ensure we don't break previous rendering.
1458
1459         * PlatformGTK.cmake: Add new files to compilation.
1460         * html/shadow/SpinButtonElement.cpp:
1461         (WebCore::SpinButtonElement::defaultEventHandler): Check the button layout used by the theme to decide the
1462         current buttons state.
1463         * platform/gtk/RenderThemeGadget.cpp: Added.
1464         (WebCore::RenderThemeGadget::create):
1465         (WebCore::createStyleContext):
1466         (WebCore::appendElementToPath):
1467         (WebCore::RenderThemeGadget::RenderThemeGadget):
1468         (WebCore::RenderThemeGadget::~RenderThemeGadget):
1469         (WebCore::RenderThemeGadget::marginBox):
1470         (WebCore::RenderThemeGadget::borderBox):
1471         (WebCore::RenderThemeGadget::paddingBox):
1472         (WebCore::RenderThemeGadget::contentsBox):
1473         (WebCore::RenderThemeGadget::color):
1474         (WebCore::RenderThemeGadget::backgroundColor):
1475         (WebCore::RenderThemeGadget::minimumSize):
1476         (WebCore::RenderThemeGadget::preferredSize):
1477         (WebCore::RenderThemeGadget::render):
1478         (WebCore::RenderThemeGadget::renderFocus):
1479         (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget):
1480         (WebCore::RenderThemeTextFieldGadget::RenderThemeTextFieldGadget):
1481         (WebCore::RenderThemeTextFieldGadget::minimumSize):
1482         (WebCore::RenderThemeToggleGadget::RenderThemeToggleGadget):
1483         (WebCore::RenderThemeToggleGadget::render):
1484         (WebCore::RenderThemeArrowGadget::RenderThemeArrowGadget):
1485         (WebCore::RenderThemeArrowGadget::render):
1486         (WebCore::RenderThemeIconGadget::RenderThemeIconGadget):
1487         (WebCore::RenderThemeIconGadget::gtkIconSizeForPixelSize):
1488         (WebCore::RenderThemeIconGadget::render):
1489         (WebCore::RenderThemeIconGadget::minimumSize):
1490         * platform/gtk/RenderThemeGadget.h: Added.
1491         (WebCore::RenderThemeGadget::context):
1492         * rendering/RenderTheme.h:
1493         (WebCore::RenderTheme::innerSpinButtonLayout): Added this method to allow themes use a different layout for the
1494         buttons.
1495         * rendering/RenderThemeGtk.cpp:
1496         (WebCore::themeChangedCallback): Just moved this code to a common place.
1497         (WebCore::RenderThemeGtk::RenderThemeGtk): Initialize the theme monitor in the constructor.
1498         (WebCore::createStyleContext): Remove the render parts that are specific to GTK+ 3.20.
1499         (WebCore::RenderThemeGtk::adjustRepaintRect): Moved inside a GTK+ < 3.20 ifdef block.
1500         (WebCore::themePartStateFlags): Helper function to get the GtkStateFlags of a theme part for a given RenderObject.
1501         (WebCore::shrinkToMinimumSizeAndCenterRectangle): Move this common code to a helper function.
1502         (WebCore::setToggleSize):
1503         (WebCore::paintToggle):
1504         (WebCore::RenderThemeGtk::paintButton):
1505         (WebCore::RenderThemeGtk::popupInternalPaddingBox):
1506         (WebCore::RenderThemeGtk::paintMenuList):
1507         (WebCore::RenderThemeGtk::adjustTextFieldStyle): For GTK+ 3.20 we need to ensure a minimum size for spin buttons,
1508         so if the text field is for a spin button, we adjust the desired size here.
1509         (WebCore::RenderThemeGtk::paintTextField): In GTK+ 3.20 the CSS gadgets used to render spin buttons are
1510         different, so we check here if this is the entry of a spin button to use the right gadgets.
1511         (WebCore::adjustSearchFieldIconStyle):
1512         (WebCore::RenderThemeGtk::paintTextArea):
1513         (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
1514         (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
1515         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
1516         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
1517         (WebCore::paintSearchFieldIcon):
1518         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
1519         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
1520         (WebCore::centerRectVerticallyInParentInputElement): Moved inside a GTK+ < 3.20 ifdef block.
1521         (WebCore::RenderThemeGtk::paintSliderTrack):
1522         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
1523         (WebCore::RenderThemeGtk::paintSliderThumb):
1524         (WebCore::RenderThemeGtk::progressBarRectForBounds): Ensure a minimum size of progress bars in GTK+ 3.20.
1525         (WebCore::RenderThemeGtk::paintProgressBar):
1526         (WebCore::RenderThemeGtk::innerSpinButtonLayout): Use an horizontal layout for spin buttons.
1527         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1528         (WebCore::RenderThemeGtk::paintInnerSpinButton):
1529         (WebCore::styleColor):
1530         (WebCore::RenderThemeGtk::paintMediaButton):
1531         * rendering/RenderThemeGtk.h:
1532
1533 2016-04-11  Antti Koivisto  <antti@apple.com>
1534
1535         Implement functional :host() pseudo class
1536         https://bugs.webkit.org/show_bug.cgi?id=156397
1537         <rdar://problem/25621445>
1538
1539         Reviewed by Darin Adler.
1540
1541         We already support :host. Add functional syntax too.
1542
1543         * css/CSSGrammar.y.in:
1544
1545             Parse functional :host().
1546
1547         * css/CSSParser.cpp:
1548         (WebCore::CSSParser::detectFunctionTypeToken):
1549         * css/CSSParserValues.cpp:
1550         (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector):
1551         * css/CSSParserValues.h:
1552         * css/ElementRuleCollector.cpp:
1553         (WebCore::ElementRuleCollector::matchedRuleList):
1554         (WebCore::ElementRuleCollector::addMatchedRule):
1555
1556             Factor some shared code here.
1557
1558         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1559
1560             Instead of using the generic paths use a :host specific code path for matching.
1561             This makes it easier to avoid :host matching when it shouldn't.
1562
1563         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1564         * css/ElementRuleCollector.h:
1565         * css/RuleSet.cpp:
1566         (WebCore::computeMatchBasedOnRuleHash):
1567
1568             :host is always handled by the special matching path.
1569
1570         * css/SelectorChecker.cpp:
1571         (WebCore::SelectorChecker::match):
1572         (WebCore::SelectorChecker::matchHostPseudoClass):
1573
1574             Add a function specifically for checking :host. In always fails on the normal code paths.
1575             Check the argument selector if provided.
1576
1577         (WebCore::hasScrollbarPseudoElement):
1578         * css/SelectorChecker.h:
1579
1580 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
1581
1582         Merge CG ImageSource and non CG ImageSource implementation in one file
1583         https://bugs.webkit.org/show_bug.cgi?id=155456
1584
1585         Reviewed by Darin Adler.
1586
1587         ImageSource for CG and CG code paths look very similar. All the platform
1588         specific code can be moved to ImageDecoder classes for CG and non CG. And
1589         we can have the ImageSource be platform independent and we get rid of
1590         ImageSourceCG.cpp.
1591
1592         Test: fast/images/image-subsampling.html
1593
1594         * CMakeLists.txt:
1595         * PlatformAppleWin.cmake:
1596         * PlatformMac.cmake:
1597         * WebCore.xcodeproj/project.pbxproj:
1598         Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
1599         CMakeLists.txt.
1600         
1601         * platform/Cursor.cpp:
1602         (WebCore::determineHotSpot):
1603         * platform/graphics/BitmapImage.cpp:
1604         (WebCore::BitmapImage::hotSpot):
1605         (WebCore::BitmapImage::getHotSpot): Deleted.
1606         * platform/graphics/BitmapImage.h:
1607         * platform/graphics/Image.h:
1608         (WebCore::Image::hotSpot):
1609         (WebCore::Image::getHotSpot): Deleted.
1610         Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
1611         
1612         * platform/graphics/ImageSource.cpp:
1613         (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
1614         (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
1615         (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
1616         
1617         (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
1618         const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
1619         The value of const static int CG ImageDecoder::m_maxNumPixels will be set
1620         based on IMAGE_DECODER_DOWN_SAMPLING.
1621         
1622         (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
1623         
1624         (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
1625         subsampling level allowed for an image.
1626         
1627         (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
1628         SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
1629         a particular image.
1630         
1631         (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
1632         of encoded bytes which can determine the image properties. For non CG it's
1633         zero. For CG it is a maximum value which can be corrected later.
1634         
1635         (WebCore::ImageSource::isSizeAvailable):
1636         (WebCore::ImageSource::sizeRespectingOrientation):
1637         (WebCore::ImageSource::frameCount):
1638         (WebCore::ImageSource::repetitionCount):
1639         (WebCore::ImageSource::filenameExtension):
1640         (WebCore::ImageSource::getHotSpot):
1641         (WebCore::ImageSource::frameIsCompleteAtIndex):
1642         (WebCore::ImageSource::frameHasAlphaAtIndex):
1643         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
1644         (WebCore::ImageSource::frameSizeAtIndex):
1645         (WebCore::ImageSource::frameBytesAtIndex):
1646         (WebCore::ImageSource::frameDurationAtIndex):
1647         (WebCore::ImageSource::orientationAtIndex):
1648         (WebCore::ImageSource::createFrameImageAtIndex):
1649         These are wrappers for the ImageDecoder APIs. The purpose of these functions
1650         is to ensure the ImageDecoder is created.
1651         
1652         (WebCore::ImageSource::dump): Called from BitmapImage::dump().
1653         
1654         (WebCore::ImageSource::getHotSpot): Deleted.
1655         
1656         * platform/graphics/ImageSource.h:
1657         (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
1658         
1659         (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
1660         (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
1661         Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
1662         
1663         * platform/graphics/cg/ImageDecoderCG.cpp:
1664         (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
1665
1666         (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
1667         The code was moved to ImageSource::subsamplingLevelForScale().
1668         
1669         * platform/graphics/cg/ImageDecoderCG.h:
1670         (WebCore::ImageDecoder::create): Make the prototype of this function
1671         suitable for CG and non CG cases.
1672         (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
1673         
1674         * platform/graphics/cg/ImageSourceCG.cpp: Removed.
1675         
1676         * platform/image-decoders/ImageDecoder.cpp:
1677         (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
1678         whether the frame decoding is complete or not.
1679         
1680         (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
1681         
1682         (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
1683         ImageSource::frameDurationAtIndex() in ImageSource.cpp.
1684         
1685         (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
1686         ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
1687         
1688         * platform/image-decoders/ImageDecoder.h:
1689         (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
1690         (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
1691         (WebCore::ImageDecoder::setData): Change the type of the argument from
1692         SharedBuffer* to SharedBuffer&.
1693         (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
1694         so it can have the same prototype as CG.
1695         (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
1696         
1697         (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
1698         (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
1699         (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
1700         and return the default values so we do not have to add directive compiled
1701         non CG blocks in ImageSource.cpp.
1702
1703         (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
1704         
1705         (WebCore::ImageDecoder::orientation): Deleted.
1706         (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
1707         
1708         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1709         (WebCore::BMPImageDecoder::setData):
1710         * platform/image-decoders/bmp/BMPImageDecoder.h:
1711         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1712         (WebCore::GIFImageDecoder::setData):
1713         (WebCore::GIFImageDecoder::decode):
1714         * platform/image-decoders/gif/GIFImageDecoder.h:
1715         * platform/image-decoders/gif/GIFImageReader.h:
1716         (GIFImageReader::setData):
1717         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1718         (WebCore::ICOImageDecoder::setData):
1719         Use reference SharedBuffer instead of pointer SharedBuffer.
1720         
1721         (WebCore::ICOImageDecoder::hotSpot):
1722         (WebCore::ICOImageDecoder::hotSpotAtIndex):
1723         Change hotSpot() to return Optional<IntPoint>.
1724         * platform/image-decoders/ico/ICOImageDecoder.h:
1725                 
1726         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1727         Pass reference SharedBuffer instead of pointer SharedBuffer.
1728
1729 2016-04-11  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
1730
1731         [CMake] Make FOLDER property INHERITED
1732         https://bugs.webkit.org/show_bug.cgi?id=156460
1733
1734         Reviewed by Brent Fulgham.
1735
1736         * CMakeLists.txt:
1737         Set FOLDER property as a directory property not a target property
1738
1739 2016-04-10  Sam Weinig  <sam@webkit.org>
1740
1741         Fix the build.
1742
1743         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1744         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1745
1746 2016-04-08  Sam Weinig  <sam@webkit.org>
1747
1748         Remove support for custom target picker actions
1749         <rdar://problem/24987783>
1750         https://bugs.webkit.org/show_bug.cgi?id=156434
1751
1752         Reviewed by Eric Carlson.
1753
1754         This mostly entailed rolling out r197429 and r197569.
1755
1756         * Modules/mediasession/WebMediaSessionManager.cpp:
1757         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
1758         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
1759         (WebCore::WebMediaSessionManager::clientStateDidChange):
1760         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
1761         (WebCore::WebMediaSessionManager::configureNewClients):
1762         (WebCore::WebMediaSessionManager::customPlaybackActionSelected): Deleted.
1763         * Modules/mediasession/WebMediaSessionManager.h:
1764         * Modules/mediasession/WebMediaSessionManagerClient.h:
1765         * dom/Document.cpp:
1766         (WebCore::Document::removePlaybackTargetPickerClient):
1767         (WebCore::Document::showPlaybackTargetPicker):
1768         (WebCore::Document::playbackTargetPickerClientStateDidChange):
1769         (WebCore::Document::setShouldPlayToPlaybackTarget):
1770         (WebCore::Document::customPlaybackActionSelected): Deleted.
1771         * dom/Document.h:
1772         * html/HTMLMediaElement.cpp:
1773         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
1774         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
1775         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
1776         (WebCore::HTMLMediaElement::customPlaybackActionSelected): Deleted.
1777         (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName): Deleted.
1778         * html/HTMLMediaElement.h:
1779         * html/MediaElementSession.cpp:
1780         (WebCore::MediaElementSession::showPlaybackTargetPicker):
1781         (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
1782         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
1783         (WebCore::MediaElementSession::mediaStateDidChange):
1784         (WebCore::MediaElementSession::customPlaybackActionSelected): Deleted.
1785         * html/MediaElementSession.h:
1786         * page/ChromeClient.h:
1787         * page/Page.cpp:
1788         (WebCore::Page::removePlaybackTargetPickerClient):
1789         (WebCore::Page::showPlaybackTargetPicker):
1790         (WebCore::Page::setShouldPlayToPlaybackTarget):
1791         (WebCore::Page::ensureTestTrigger):
1792         (WebCore::Page::customPlaybackActionSelected): Deleted.
1793         * page/Page.h:
1794         (WebCore::Page::testTrigger):
1795         * platform/audio/PlatformMediaSession.h:
1796         (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
1797         (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
1798         (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
1799         (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected): Deleted.
1800         * platform/graphics/MediaPlaybackTargetClient.h:
1801         * platform/graphics/MediaPlaybackTargetPicker.cpp:
1802         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
1803         (WebCore::MediaPlaybackTargetPicker::addPendingAction):
1804         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
1805         * platform/graphics/MediaPlaybackTargetPicker.h:
1806         (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
1807         (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
1808         (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected): Deleted.
1809         (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected): Deleted.
1810         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1811         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1812         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
1813         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1814         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1815         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1816         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
1817         (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
1818         (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Deleted.
1819         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
1820         (WebCore::MediaPlaybackTargetPickerMock::timerFired):
1821         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
1822         * platform/mock/MediaPlaybackTargetPickerMock.h:
1823         * platform/spi/cocoa/AVKitSPI.h:
1824
1825 2016-04-09  Konstantin Tokarev  <annulen@yandex.ru>
1826
1827         Fixed compilation of JPEGImageDecoder with libjpeg v9.
1828         https://bugs.webkit.org/show_bug.cgi?id=156445
1829
1830         Reviewed by Michael Catanzaro.
1831
1832         ICU defines TRUE and FALSE macros, breaking libjpeg v9 headers.
1833
1834         No new tests needed.
1835
1836         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1837
1838 2016-04-09  Commit Queue  <commit-queue@webkit.org>
1839
1840         Unreviewed, rolling out r199242.
1841         https://bugs.webkit.org/show_bug.cgi?id=156442
1842
1843         Caused many many leaks (Requested by ap on #webkit).
1844
1845         Reverted changeset:
1846
1847         "Web Inspector: get rid of InspectorBasicValue and
1848         InspectorString subclasses"
1849         https://bugs.webkit.org/show_bug.cgi?id=156407
1850         http://trac.webkit.org/changeset/199242
1851
1852 2016-04-09  Commit Queue  <commit-queue@webkit.org>
1853
1854         Unreviewed, rolling out r199268.
1855         https://bugs.webkit.org/show_bug.cgi?id=156440
1856
1857         Broke Windows build (Requested by ap on #webkit).
1858
1859         Reverted changeset:
1860
1861         "Implement functional :host() pseudo class"
1862         https://bugs.webkit.org/show_bug.cgi?id=156397
1863         http://trac.webkit.org/changeset/199268
1864
1865 2016-04-09  Antti Koivisto  <antti@apple.com>
1866
1867         Implement functional :host() pseudo class
1868         https://bugs.webkit.org/show_bug.cgi?id=156397
1869         <rdar://problem/25621445>
1870
1871         Reviewed by Darin Adler.
1872
1873         We already support :host. Add functional syntax too.
1874
1875         * css/CSSGrammar.y.in:
1876
1877             Parse functional :host().
1878
1879         * css/CSSParser.cpp:
1880         (WebCore::CSSParser::detectFunctionTypeToken):
1881         * css/CSSParserValues.cpp:
1882         (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector):
1883         * css/CSSParserValues.h:
1884         * css/ElementRuleCollector.cpp:
1885         (WebCore::ElementRuleCollector::matchedRuleList):
1886         (WebCore::ElementRuleCollector::addMatchedRule):
1887
1888             Factor some shared code here.
1889
1890         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1891
1892             Instead of using the generic paths use a :host specific code path for matching.
1893             This makes it easier to avoid :host matching when it shouldn't.
1894
1895         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1896         * css/ElementRuleCollector.h:
1897         * css/RuleSet.cpp:
1898         (WebCore::computeMatchBasedOnRuleHash):
1899
1900             :host is always handled by the special matching path.
1901
1902         * css/SelectorChecker.cpp:
1903         (WebCore::SelectorChecker::match):
1904         (WebCore::SelectorChecker::matchHostPseudoClass):
1905
1906             Add a function specifically for checking :host. In always fails on the normal code paths.
1907             Check the argument selector if provided.
1908
1909         (WebCore::hasScrollbarPseudoElement):
1910         * css/SelectorChecker.h:
1911
1912 2016-04-07  Darin Adler  <darin@apple.com>
1913
1914         Improve IDL support for object arguments that are neither optional nor nullable
1915         https://bugs.webkit.org/show_bug.cgi?id=156149
1916
1917         Reviewed by Chris Dumez.
1918
1919         After this patch, we are almost ready to change some more DOM functions to
1920         use references instead of pointers. Remaining blocking issue is lack of support
1921         for ShouldPassWrapperByReference in the gobject bindings.
1922
1923         * bindings/objc/ExceptionHandlers.h: Add NO_RETURN to raiseDOMException.
1924         Added a new raiseTypeErrorException. Re-indented header and removed unneeded
1925         include and forward declarations.
1926
1927         * bindings/objc/ExceptionHandlers.mm:
1928         (WebCore::raiseDOMException): Added RELEASE_ASSERT_NOT_REACHED so the compiler
1929         will understand this is NO_RETURN. Also updated FIXME comment.
1930         (WebCore::raiseTypeErrorException): Added.
1931
1932         * bindings/scripts/CodeGenerator.pm: Removed unneeded code that allows the type
1933         "AtomicString" in IDL files.
1934         (ShouldPassWrapperByReference): Added. Contains the logic from the function in
1935         the JavaScript code generator that was named IsPointerParameterPassedByReference,
1936         minus a couple checks that are unneeded. For use in other code generators so they
1937         are all consistent about how they call the DOM implementation.
1938
1939         * bindings/scripts/CodeGeneratorGObject.pm:
1940         (SkipFunction): Removed support for unused CustomBinding extended attribute.
1941
1942         * bindings/scripts/CodeGeneratorJS.pm:
1943         (GenerateHeader): Removed support for unused CustomBinding extended attribute.
1944         (GenerateImplementation): Ditto. Also changed type checking code to throw a
1945         type error in a more efficient way, using throwVMTypeError directly.
1946         (GenerateParametersCheck): Rearranged code a bit so that arguments that need to
1947         be passed in unusual ways are handled all in one place. Use WTFMove for newly
1948         created NodeFilter objects. Simplified the reference logic so it doesn't need
1949         to do an additional check to see if a type is a callback. Also changed type
1950         checking code to throw a type error in a more efficient way, using throwVMTypeError
1951         directly. Also corrected mistake where null checking code was throwing
1952         TYPE_MISMATCH_ERR instead of a type error.
1953         (GetNativeType): Coding style tweak.
1954         (ShouldPassWrapperByReference): Renamed from IsPointerParameterPassedByReference.
1955         Changed to call underlying ShouldPassWrapperByReference function in the language-
1956         independent code generator.
1957         (GenerateConstructorDefinition): Updated for name change.
1958
1959         * bindings/scripts/CodeGeneratorObjC.pm:
1960         (SkipFunction): Removed support for unused CustomBinding extended attribute.
1961         (GenerateImplementation): Added code to null check and pass a reference when
1962         ShouldPassWrapperByReference returns true.
1963
1964         * bindings/scripts/IDLAttributes.txt: Sorted in the AppleCopyright and
1965         UsePointersEvenForNonNullableObjectArguments arguments. Removed the unused
1966         CPPPureInterface and CustomBinding attributes.
1967
1968         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Regenerated test results.
1969         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
1970         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
1971         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
1972         * bindings/scripts/test/JS/JSTestObj.h: Ditto.
1973         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
1974         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
1975         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: Ditto.
1976         * bindings/scripts/test/ObjC/DOMTestCallback.mm: Ditto.
1977         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm: Ditto.
1978         * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
1979         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Ditto.
1980         * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
1981
1982         * bindings/scripts/test/TestObj.idl: Removed test for CustomBinding.
1983
1984         * dom/DOMImplementation.idl: Fixed #if so that only the return type is different
1985         between JavaScript and the other bindings. Without this change, the different
1986         bindings got different results for ShouldPassWrapperByReference. Also formatted
1987         functions all on a single line.
1988
1989         * dom/EventListener.idl: Removed CPPPureInterface, since it had no effect.
1990         * dom/EventTarget.idl: Ditto.
1991
1992 2016-04-08  Chris Dumez  <cdumez@apple.com>
1993
1994         [WebIDL] Add support for [ExportMacro=XXX] IDL extended attribute
1995         https://bugs.webkit.org/show_bug.cgi?id=156428
1996
1997         Reviewed by Ryosuke Niwa.
1998
1999         Add support for [ExportMacro=XXX] IDL extended attribute (e.g. [ExportMacro=WEBCORE_EXPORT])
2000         so developers can indicate in the IDL which macro to use to export the generated JS bindings
2001         class.
2002
2003         We previously supported this by hard-coding JS class names in the bindings generator which
2004         was ugly.
2005
2006         * Modules/mediasession/MediaSession.idl:
2007         * Modules/mediasource/SourceBuffer.idl:
2008         * Modules/notifications/Notification.idl:
2009         * Modules/webaudio/AudioContext.idl:
2010         * bindings/scripts/CodeGeneratorJS.pm:
2011         (GetExportMacroForJSClass):
2012         (GenerateHeader):
2013         (AddIncludesForType): Deleted.
2014         (AddToImplIncludes): Deleted.
2015         * bindings/scripts/IDLAttributes.txt:
2016         * bindings/scripts/test/TestInterface.idl:
2017         * bindings/scripts/test/TestNode.idl:
2018         * css/CSSStyleDeclaration.idl:
2019         * dom/ClientRect.idl:
2020         * dom/ClientRectList.idl:
2021         * dom/Document.idl:
2022         * dom/Element.idl:
2023         * dom/Node.idl:
2024         * dom/Range.idl:
2025         * fileapi/File.idl:
2026         * html/DOMURL.idl:
2027         * html/HTMLElement.idl:
2028         * html/HTMLMediaElement.idl:
2029         * html/TimeRanges.idl:
2030         * html/canvas/DOMPath.idl:
2031         * inspector/ScriptProfile.idl:
2032         * inspector/ScriptProfileNode.idl:
2033         * page/DOMWindow.idl:
2034         * page/make_settings.pl:
2035         (generateInternalSettingsIdlFile):
2036         * testing/InternalSettings.idl:
2037         * testing/Internals.idl:
2038         * testing/MallocStatistics.idl:
2039         * testing/MemoryInfo.idl:
2040         * testing/TypeConversions.idl:
2041         * xml/XMLHttpRequest.idl:
2042
2043 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
2044
2045         Web Inspector: XHRs and Web Worker scripts are not searchable
2046         https://bugs.webkit.org/show_bug.cgi?id=154214
2047         <rdar://problem/24643587>
2048
2049         Reviewed by Timothy Hatcher.
2050
2051         Test: inspector/page/searchInResources.html
2052
2053         * inspector/InspectorPageAgent.h:
2054         * inspector/InspectorPageAgent.cpp:
2055         (WebCore::InspectorPageAgent::searchInResource):
2056         (WebCore::InspectorPageAgent::searchInResources):
2057         Let the NetworkAgent handle individual search requests
2058         with a requestId. And provide global search results for
2059         "other" resources and will include requestId properties.
2060
2061         * inspector/InspectorNetworkAgent.h:
2062         * inspector/InspectorNetworkAgent.cpp:
2063         (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
2064         (WebCore::buildObjectForSearchResult):
2065         (WebCore::InspectorNetworkAgent::searchOtherRequests):
2066         (WebCore::InspectorNetworkAgent::searchInRequest):
2067         Search saved "other" resource data content.
2068
2069         * inspector/NetworkResourcesData.h:
2070         * inspector/NetworkResourcesData.cpp:
2071         (WebCore::NetworkResourcesData::resources):
2072         Expose the resources for iteration by the NetworkAgent.
2073
2074 2016-04-08  Joanmarie Diggs  <jdiggs@igalia.com>
2075
2076         AX: "AXLandmarkApplication" is an inappropriate subrole for ARIA "application" since it's no longer a landmark
2077         https://bugs.webkit.org/show_bug.cgi?id=155403
2078
2079         Reviewed by Chris Fleizach.
2080
2081         The new subrole is AXWebApplication and the new role description is "web application".
2082         As part of the fix, the WebCore AccessibilityRole for ARIA's "application" role was
2083         renamed from LandmarkApplicationRole to WebApplicationRole.
2084
2085         The roles-exposed.html and aria-grouping-roles.html test expectations were also updated.
2086
2087         * English.lproj/Localizable.strings:
2088         * accessibility/AccessibilityObject.cpp:
2089         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
2090         (WebCore::AccessibilityObject::isLandmark):
2091         (WebCore::initializeRoleMap):
2092         * accessibility/AccessibilityObject.h:
2093         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2094         (atkRole):
2095         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2096         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2097         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2098         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2099         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
2100         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2101         (createAccessibilityRoleMap):
2102         (-[WebAccessibilityObjectWrapper subrole]):
2103         * platform/LocalizedStrings.cpp:
2104         (WebCore::AXARIAContentGroupText):
2105
2106 2016-04-08  Simon Fraser  <simon.fraser@apple.com>
2107
2108         [iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area
2109         https://bugs.webkit.org/show_bug.cgi?id=156429
2110         rdar://problem/25455111
2111
2112         Reviewed by Tim Horton.
2113
2114         When a WKWebView is expanded to full size, then embedded in UIScrollView, it would
2115         create huge tiles that cover the entire view area (since it considered itself non-scrollable).
2116
2117         Fix to always use 512x512 tiles in this configuration, and to adjust the tile coverage
2118         for the area exposed through the enclosing UIScrollView.
2119
2120         * loader/HistoryController.cpp:
2121         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): setObscuredInset()
2122         moved from FrameView to Page.
2123         * page/FrameView.cpp:
2124         (WebCore::FrameView::adjustTiledBackingScrollability): If we're clipped by an ancestor scrollView,
2125         just assume we're scrollable on both axes.
2126         * page/Page.h:
2127         (WebCore::Page::obscuredInset):
2128         (WebCore::Page::setObscuredInset):
2129         (WebCore::Page::enclosedInScrollView):
2130         (WebCore::Page::setEnclosedInScrollView):
2131         * platform/ScrollView.h:
2132         (WebCore::ScrollView::platformObscuredInset): Deleted.
2133         (WebCore::ScrollView::platformSetObscuredInset): Deleted.
2134
2135 2016-04-08  Joseph Pecoraro  <pecoraro@apple.com>
2136
2137         [iOS Simulator] Build failure (property 'contentsFormat' not found on object of type 'LegacyTileLayer *')
2138         https://bugs.webkit.org/show_bug.cgi?id=156415
2139
2140         Reviewed by Simon Fraser.
2141
2142         * platform/spi/cocoa/QuartzCoreSPI.h:
2143         Provide SPI forward declaration of the CALayer contentsFormat property.
2144
2145 2016-04-08  Alex Christensen  <achristensen@webkit.org>
2146
2147         Progress towards running CMake WebKit2 on Mac
2148         https://bugs.webkit.org/show_bug.cgi?id=156426
2149
2150         Reviewed by Tim Horton.
2151
2152         * CMakeLists.txt:
2153         * PlatformGTK.cmake:
2154         * PlatformMac.cmake:
2155         * PlatformWin.cmake:
2156         On Mac, WTF is a static library that is linked only with JavaScriptCore.
2157
2158 2016-04-08  Jer Noble  <jer.noble@apple.com>
2159
2160         Unreviewed 32-bit build fix; make type of std::min<> explicit.
2161
2162         * platform/audio/ios/AudioDestinationIOS.cpp:
2163         (WebCore::AudioDestinationIOS::render):
2164
2165 2016-04-08  Jer Noble  <jer.noble@apple.com>
2166
2167         CRASH in AudioDestinationNode::render()
2168         https://bugs.webkit.org/show_bug.cgi?id=156308
2169
2170         Reviewed by Eric Carlson.
2171
2172         Yet another math error in AudioDestinationIOS::render(). It is possible for the difference between
2173         m_startSpareFrame and m_endSpareFrame to be greater than the numberOfFrames to be rendered. Protect
2174         against this case by taking the min() of those two values and only advancing m_startSpareFrame by
2175         that amount.  This guarantees that framesThisTime will never underflow, and that data will not be
2176         written past the end of the ioData parameter.
2177
2178         * platform/audio/ios/AudioDestinationIOS.cpp:
2179         (WebCore::AudioDestinationIOS::render):
2180
2181 2016-04-08  Brady Eidson  <beidson@apple.com>
2182
2183         Modern IDB: Use more IDBValue and IDBGetResult in IDBBackingStore.
2184         https://bugs.webkit.org/show_bug.cgi?id=156418
2185
2186         Reviewed by Alex Christensen.
2187
2188         No new tests (Refactor, no change in behavior).
2189
2190         * Modules/indexeddb/IDBValue.cpp:
2191         (WebCore::IDBValue::IDBValue):
2192         * Modules/indexeddb/IDBValue.h:
2193         
2194         * Modules/indexeddb/server/IDBBackingStore.h:
2195         
2196         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2197         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2198         
2199         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2200         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2201         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2202         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2203         
2204         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2205         (WebCore::IDBServer::MemoryObjectStore::addRecord):
2206         * Modules/indexeddb/server/MemoryObjectStore.h:
2207         
2208         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2209         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2210         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2211         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2212         
2213         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2214         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2215         (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
2216
2217 2016-04-08  Brady Eidson  <beidson@apple.com>
2218
2219         Modern IDB: Make IDBGetResult contain an IDBValue instead of a buffer, and remove unused methods.
2220         https://bugs.webkit.org/show_bug.cgi?id=156416
2221
2222         Reviewed by Alex Christensen.
2223
2224         No new tests (Refactor, no change in behavior).
2225
2226         * Modules/indexeddb/IDBCursor.cpp:
2227         (WebCore::IDBCursor::setGetResult):
2228         
2229         * Modules/indexeddb/IDBGetResult.cpp:
2230         (WebCore::IDBGetResult::dataFromBuffer):
2231         (WebCore::IDBGetResult::isolatedCopy):
2232         * Modules/indexeddb/IDBGetResult.h:
2233         (WebCore::IDBGetResult::IDBGetResult):
2234         (WebCore::IDBGetResult::value):
2235         (WebCore::IDBGetResult::encode):
2236         (WebCore::IDBGetResult::decode):
2237         (WebCore::IDBGetResult::valueBuffer): Deleted.
2238         (WebCore::IDBGetResult::setValueBuffer): Deleted.
2239         (WebCore::IDBGetResult::setKeyData): Deleted.
2240         (WebCore::IDBGetResult::setPrimaryKeyData): Deleted.
2241         (WebCore::IDBGetResult::setKeyPath): Deleted.
2242         
2243         * Modules/indexeddb/IDBTransaction.cpp:
2244         (WebCore::IDBTransaction::didGetRecordOnServer):
2245         
2246         * Modules/indexeddb/IDBValue.cpp:
2247         (WebCore::IDBValue::IDBValue):
2248         * Modules/indexeddb/IDBValue.h:
2249         
2250         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2251         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2252
2253 2016-04-08  Zalan Bujtas  <zalan@apple.com>
2254
2255         Focus ring drawn at incorrect location on image map with CSS transform.
2256         https://bugs.webkit.org/show_bug.cgi?id=143527
2257         <rdar://problem/21908735>
2258
2259         Reviewed by Simon Fraser.
2260
2261         Implement pathForFocusRing for HTMLAreaElement. It follows the logic of RenderObject::addFocusRingRects().
2262
2263         Tests: fast/images/image-map-outline-in-positioned-container.html
2264                fast/images/image-map-outline-with-paint-root-offset.html
2265                fast/images/image-map-outline-with-scale-transform.html
2266                fast/images/image-map-outline.html
2267
2268         * html/HTMLAreaElement.cpp:
2269         (WebCore::HTMLAreaElement::pathForFocusRing):
2270         * html/HTMLAreaElement.h:
2271         * rendering/RenderElement.cpp:
2272         (WebCore::RenderElement::paintFocusRing): Move addFocusRingRects() out of focus ring painting.
2273         (WebCore::RenderElement::paintOutline):
2274         * rendering/RenderElement.h:
2275         * rendering/RenderImage.cpp:
2276         (WebCore::RenderImage::paint):
2277         (WebCore::RenderImage::paintAreaElementFocusRing):
2278         * rendering/RenderImage.h:
2279         * rendering/RenderInline.cpp:
2280         (WebCore::RenderInline::paintOutline):
2281
2282 2016-04-08  Brent Fulgham  <bfulgham@apple.com>
2283
2284         [WK1] Wheel event callback removing the window causes crash in WebCore
2285         https://bugs.webkit.org/show_bug.cgi?id=156409
2286         <rdar://problem/25631267>
2287
2288         Reviewed by Simon Fraser.
2289
2290         Null check the Widget before using it, since the iframe may have been removed
2291         from its parent document inside the event handler.
2292
2293         This is the WK1 fix for https://bugs.webkit.org/show_bug.cgi?id=150871.
2294
2295         Tested by fast/events/wheel-event-destroys-frame.html
2296
2297         * page/EventHandler.cpp:
2298         (WebCore::widgetForElement): Added.
2299         (WebCore::EventHandler::handleWheelEvent): Use new helper function to
2300         clean up the code, and allow us to check that the Widget has not been
2301         destroyed during the event handler.
2302
2303 2016-04-08  Said Abou-Hallawa  <sabouhallawa@apple,com>
2304
2305         Timing attack on SVG feComposite filter circumvents same-origin policy
2306         https://bugs.webkit.org/show_bug.cgi?id=154338
2307
2308         Reviewed by Oliver Hunt.
2309
2310         Ensure the FEComposite arithmetic filter is clamping the resulted color
2311         components in a constant time.
2312
2313         * platform/graphics/filters/FEComposite.cpp:
2314         (WebCore::clampByte):
2315         (WebCore::computeArithmeticPixels):
2316
2317 2016-04-08  Brian Burg  <bburg@apple.com>
2318
2319         Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
2320         https://bugs.webkit.org/show_bug.cgi?id=156407
2321         <rdar://problem/25627659>
2322
2323         Reviewed by Timothy Hatcher.
2324
2325         * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
2326
2327 2016-04-08  Beth Dakin  <bdakin@apple.com>
2328
2329         Fix leaks in WebAVMediaSelectionOptionMac and WebPlaybackControlsManager
2330         https://bugs.webkit.org/show_bug.cgi?id=156379
2331
2332         Reviewed by Tim Horton.
2333
2334         These classes should use RetainPtrs.
2335         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2336         (-[WebAVMediaSelectionOptionMac localizedDisplayName]):
2337         (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
2338         (-[WebPlaybackControlsManager timing]):
2339         (-[WebPlaybackControlsManager setTiming:]):
2340         (-[WebPlaybackControlsManager seekableTimeRanges]):
2341         (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
2342         (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
2343         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
2344         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
2345         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
2346         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
2347         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
2348         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
2349         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
2350
2351 2016-04-08  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
2352
2353         Touching any IDL files rebuilds all bindings in CMake Ninja build
2354         https://bugs.webkit.org/show_bug.cgi?id=156400
2355
2356         Reviewed by Brent Fulgham.
2357
2358         * bindings/scripts/preprocess-idls.pl:
2359         (GenerateConstructorAttribute):
2360         WriteFileIfChanged does not work due to flaky results of 'keys'.
2361         Sort results of 'keys'.
2362
2363 2016-04-07  Simon Fraser  <simon.fraser@apple.com>
2364
2365         [iOS WK2] Stop using exposedContentRect for history scroll state restoration
2366         https://bugs.webkit.org/show_bug.cgi?id=156392
2367
2368         Reviewed by Tim Horton.
2369
2370         A future commit will alter the meaning of exposedContentRect on iOS to take into
2371         account clipped out parts of the WKWebView. To achieve this, wean history restoration
2372         off of using exposedContentRect for scroll state restoration. It did this to restore
2373         the page to the same position relative to the view's top-left (to avoid jiggles caused
2374         by changing obscured insets).
2375
2376         Do this by pushing the left/top obscured insets down with visible content rects updates,
2377         storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
2378         for scroll state restoration in WKWebView.
2379
2380         * history/HistoryItem.cpp:
2381         (WebCore::HistoryItem::HistoryItem):
2382         * history/HistoryItem.h:
2383         (WebCore::HistoryItem::obscuredInset):
2384         (WebCore::HistoryItem::setObscuredInset):
2385         * loader/HistoryController.cpp:
2386         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
2387         * platform/ScrollView.h:
2388         (WebCore::ScrollView::platformObscuredInset):
2389         (WebCore::ScrollView::platformSetObscuredInset):
2390
2391 2016-04-08  Brady Eidson  <beidson@apple.com>
2392
2393         Build fix followup to http://trac.webkit.org/changeset/199230
2394
2395         Unreviewed.
2396
2397         * platform/posix/FileSystemPOSIX.cpp:
2398         (WebCore::hardLinkOrCopyFile): Stricter POSIX systems require a umask for O_CREAT opens,
2399           so let's provide one.
2400
2401 2016-04-08  Darin Adler  <darin@apple.com>
2402
2403         Remove 14 more unnecessary uses of UsePointersEvenForNonNullableObjectArguments
2404         https://bugs.webkit.org/show_bug.cgi?id=156405
2405
2406         Reviewed by Chris Dumez.
2407
2408         * Modules/encryptedmedia/MediaKeySession.idl:
2409         * Modules/encryptedmedia/MediaKeys.idl:
2410         * dom/Element.idl:
2411         * dom/NamedNodeMap.idl:
2412         * html/HTMLElement.idl:
2413         * html/canvas/OESVertexArrayObject.idl:
2414         * html/canvas/WebGLRenderingContext.idl:
2415         * page/DOMSelection.idl:
2416         * storage/StorageEvent.idl:
2417         * svg/SVGSVGElement.idl:
2418         * xml/XMLSerializer.idl:
2419         * xml/XPathEvaluator.idl:
2420         * xml/XPathExpression.idl:
2421         * xml/XSLTProcessor.idl:
2422         Removed UsePointersEvenForNonNullableObjectArguments, which was having no effect
2423         in any of these classes. Also tweaked formatting of some of the IDL, merging things
2424         onto single lines, changing paragraphing and indenting a bit, and fixing some typos.
2425
2426 2016-04-08  Brady Eidson  <beidson@apple.com>
2427
2428         Modern IDB (Blob support): Write blobs to temporary files and move them to the correct location when storing them.
2429         https://bugs.webkit.org/show_bug.cgi?id=156321
2430
2431         Reviewed by Alex Christensen, Andy Estes, and Darin Adler.
2432
2433         No new tests (No testable change in behavior yet, current tests pass).
2434
2435         When asked to store a Blob (including Files) in IndexedDB, the Blob is written out to a temporary file.
2436         
2437         Then when the putOrAdd request is received by IDBServer it includes a list of blobURLs and their mappings
2438         to temporary files.
2439         
2440         Finally, as part of storing the Blob value in the database, those temporary files are moved in to place
2441         under the IndexedDB directory for storage and later retrieval.
2442
2443         * Modules/indexeddb/IDBValue.cpp:
2444         (WebCore::IDBValue::IDBValue):
2445
2446         * Modules/indexeddb/server/IDBBackingStore.h:
2447         (WebCore::IDBServer::IDBBackingStoreTemporaryFileHandler::~IDBBackingStoreTemporaryFileHandler):
2448
2449         * Modules/indexeddb/server/IDBServer.cpp:
2450         (WebCore::IDBServer::IDBServer::create):
2451         (WebCore::IDBServer::IDBServer::IDBServer):
2452         (WebCore::IDBServer::IDBServer::createBackingStore):
2453         * Modules/indexeddb/server/IDBServer.h:
2454
2455         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2456         (WebCore::IDBServer::blobRecordsTableSchema):
2457         (WebCore::IDBServer::blobRecordsTableSchemaAlternate):
2458         (WebCore::IDBServer::blobFilesTableSchema):
2459         (WebCore::IDBServer::blobFilesTableSchemaAlternate):
2460         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
2461         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidBlobTables):
2462         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2463         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2464         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2465         (WebCore::IDBServer::SQLiteIDBBackingStore::temporaryFileHandler):
2466
2467         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2468         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
2469         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
2470         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
2471         (WebCore::IDBServer::SQLiteIDBTransaction::reset):
2472         (WebCore::IDBServer::SQLiteIDBTransaction::addBlobFile):
2473         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2474
2475         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2476         (WebCore::InProcessIDBServer::InProcessIDBServer):
2477         (WebCore::InProcessIDBServer::accessToTemporaryFileComplete):
2478         * Modules/indexeddb/shared/InProcessIDBServer.h:
2479
2480         * bindings/js/SerializedScriptValue.cpp:
2481         (WebCore::SerializedScriptValue::blobURLsIsolatedCopy):
2482         * bindings/js/SerializedScriptValue.h:
2483
2484         * platform/FileSystem.h:
2485         * platform/gtk/FileSystemGtk.cpp:
2486         (WebCore::hardLinkOrCopyFile):
2487         * platform/posix/FileSystemPOSIX.cpp:
2488         (WebCore::hardLinkOrCopyFile):
2489
2490 2016-04-08  Joanmarie Diggs  <jdiggs@igalia.com>
2491
2492         AX: [ATK] Crash getting text under element in CSS table
2493         https://bugs.webkit.org/show_bug.cgi?id=156328
2494
2495         Reviewed by Chris Fleizach.
2496
2497         AccessibilityRenderObject::textUnderElement() assumes (and asserts) that
2498         the first and last child of an anonymous block will each have nodes with
2499         which to define positions. This is not the case for CSS Tables and their
2500         anonymous descendants. AccessibilityNodeObject:textUnderElement() is our
2501         fallback for the instances where a text range cannot be created based on
2502         positions, so let it handle anonymous RenderTable parts.
2503
2504         Test: accessibility/generated-content-with-display-table-crash.html
2505
2506         * accessibility/AccessibilityRenderObject.cpp:
2507         (WebCore::AccessibilityRenderObject::textUnderElement):
2508         (WebCore::AccessibilityRenderObject::shouldGetTextFromNode):
2509         * accessibility/AccessibilityRenderObject.h:
2510
2511 2016-04-08  Darin Adler  <darin@apple.com>
2512
2513         Remove unneeded UsePointersEvenForNonNullableObjectArguments from event classes
2514         https://bugs.webkit.org/show_bug.cgi?id=156396
2515
2516         Reviewed by Youenn Fablet.
2517
2518         * dom/CompositionEvent.idl:
2519         * dom/KeyboardEvent.idl:
2520         * dom/MouseEvent.idl:
2521         * dom/MutationEvent.idl:
2522         * dom/TextEvent.idl:
2523         * dom/TouchEvent.idl:
2524         * dom/UIEvent.idl:
2525         * dom/WheelEvent.idl:
2526         Removed UsePointersEvenForNonNullableObjectArguments, which was having no effect.
2527
2528 2016-04-08  Manuel Rego Casasnovas  <rego@igalia.com>
2529
2530         [css-grid] Fix positioned items with grid gaps
2531         https://bugs.webkit.org/show_bug.cgi?id=156288
2532
2533         Reviewed by Darin Adler.
2534
2535         When we place a positioned items in a grid with gaps,
2536         we were not taking into accounts the gutter size.
2537         We've to use that size to properly place and size the item.
2538
2539         Tests: fast/css-grid-layout/grid-positioned-items-gaps-rtl.html
2540                fast/css-grid-layout/grid-positioned-items-gaps.html
2541
2542         * rendering/RenderGrid.cpp:
2543         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2544
2545 2016-04-08  Javier Fernandez  <jfernandez@igalia.com>
2546
2547         [css-grid] Remove unnecessary iteration in populateGridPositions loop
2548         https://bugs.webkit.org/show_bug.cgi?id=156376
2549
2550         Reviewed by Darin Adler.
2551
2552         The populateGridPositions loop limit was set to 'lastLine'. However, the
2553         the position of last track's start line is updated after the loop, since
2554         it does not follow the same pattern; it does not have a content
2555         distribution offset.
2556
2557         So, since we are essentially overwriting the value stored in the last
2558         iteration, we can just lower the loop limit.
2559
2560         No new tests added, because there is no change in the functionality.
2561
2562         * rendering/RenderGrid.cpp:
2563         (WebCore::RenderGrid::populateGridPositions):
2564
2565 2016-04-08  John Wilander  <wilander@apple.com>
2566
2567         CSP: Block XHR when calling XMLHttpRequest.send() and throw network error.
2568         https://bugs.webkit.org/show_bug.cgi?id=153598
2569         <rdar://problem/24391483>
2570
2571         Reviewed by Darin Adler.
2572
2573         No new tests. Changes to existing tests are sufficient.
2574
2575         * xml/XMLHttpRequest.cpp:
2576         (WebCore::XMLHttpRequest::open):
2577         (WebCore::XMLHttpRequest::initSend):
2578             Moved the CSP check from XMLHttpRequest::open() to XMLHttpRequest::initSend().
2579             Changed the thrown error type from Security to Network for synchronous requests.
2580             Changed from throwing an error to firing an error event for asynchronous requests.
2581             These changes are in conformance with connect-src of Content Security Policy Level 2.
2582             https://www.w3.org/TR/CSP2/#directive-connect-src (W3C Candidate Recommendation, 21 July 2015)
2583
2584 2016-04-07  Darin Adler  <darin@apple.com>
2585
2586         FontFaceSet binding does not handle null correctly
2587         https://bugs.webkit.org/show_bug.cgi?id=156141
2588
2589         Reviewed by Youenn Fablet.
2590
2591         * css/FontFaceSet.cpp:
2592         (WebCore::FontFaceSet::FontFaceSet): Pass a reference to add rather than a pointer.
2593         (WebCore::FontFaceSet::has): Take a reference rather than a pointer.
2594         (WebCore::FontFaceSet::add): Ditto.
2595         (WebCore::FontFaceSet::remove): Ditto.
2596         (WebCore::FontFaceSet::load): Initialize ec since we check it. Caller is not required
2597         to do this, nor is the matchingFaces function. Rearranged function to avoid needless
2598         creation/destruction of PendingPromise for the immediate failure case. Removed some
2599         unneeded type casts and local variables.
2600         (WebCore::FontFaceSet::status): Use ASCIILiteral instead of ConstructFromLiteral.
2601         No reason to use the more aggressive optimization.
2602         (WebCore::FontFaceSet::faceFinished): Factored out a common hasReachedTerminalState
2603         check to streamline the logic a bit.
2604         (WebCore::FontFaceSet::load): Moved overload without a string in here; not critical
2605         to inline it.
2606         (WebCore::FontFaceSet::check): Ditto.
2607
2608         * css/FontFaceSet.h: Removed many unneeded includes and forward declarations.
2609         Changed functions to take FontFace& instead of RefPtr<FontFace>. Removed unneeded
2610         WebCore namespace prefixes. Use final instead of override for virtual functions.
2611
2612         * css/FontFaceSet.idl: Removed UsePointersEvenForNonNullableObjectArguments, which
2613         was preserving incorrect behavior for null as demonstrated by the test cases.
2614
2615 2016-04-07  Joseph Pecoraro  <pecoraro@apple.com>
2616
2617         Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
2618         https://bugs.webkit.org/show_bug.cgi?id=156384
2619
2620         Reviewed by Ryosuke Niwa.
2621
2622         * Configurations/FeatureDefines.xcconfig:
2623
2624 2016-04-07  Dean Jackson  <dino@apple.com>
2625
2626         [iOS] Media playback button should use appearance
2627         https://bugs.webkit.org/show_bug.cgi?id=156388
2628         <rdar://problem/25618352>
2629
2630         Reviewed by Simon Fraser.
2631
2632         With the recent change in backdrop appearance, we can
2633         now use the system style directly for the play button.
2634
2635         While I was here I also updated the artwork to the
2636         latest style (slightly rounded corners on the triangle).
2637
2638         Covered by the test in ManualTests/ios/start-playback-button-appearance.html.
2639
2640         * Modules/mediacontrols/mediaControlsiOS.css: Move the clip onto the backdrop
2641         element. Use an appearance insted.
2642         * Modules/mediacontrols/mediaControlsiOS.js: Remove the tint element, and
2643         set the highlight on the glyph instead.
2644
2645 2016-04-07  Ada Chan  <adachan@apple.com>
2646
2647         Roll out the css change in mediaControlsApple.css that has been causing assertions in layout for multiple tests
2648         https://bugs.webkit.org/show_bug.cgi?id=156381
2649
2650         Rubber-stamped by Alexey Proskuryakov.
2651
2652         * Modules/mediacontrols/mediaControlsApple.css:
2653         (::-webkit-media-controls):
2654         Remove overflow: hidden.
2655
2656 2016-04-07  Jiewen Tan  <jiewen_tan@apple.com>
2657
2658         Unreviewed, rolling out r199199.
2659
2660         Revision breaks layout tests
2661
2662         Reverted changeset:
2663
2664         "fast/loader/opaque-base-url.html crashing during mac and ios
2665         debug tests"
2666         https://bugs.webkit.org/show_bug.cgi?id=156179
2667         http://trac.webkit.org/changeset/199199
2668
2669 2016-04-07  Simon Fraser  <simon.fraser@apple.com>
2670
2671         Make it possible to test effect of view exposed rect on tiled backing
2672         https://bugs.webkit.org/show_bug.cgi?id=156365
2673
2674         Reviewed by Tim Horton.
2675
2676         Implement Internals::setViewExposedRect().
2677
2678         When the viewExposedRect is non-null, assume that we're scrollable on both axes
2679         to avoid creation of huge tiles in this scenario.
2680
2681         We also need to call adjustTiledBackingScrollability() when setViewExposedRect()
2682         has been called.
2683
2684         Tests: tiled-drawing/tile-coverage-view-exposed-rect.html
2685                tiled-drawing/tile-size-view-exposed-rect.html
2686
2687         * page/FrameView.cpp:
2688         (WebCore::FrameView::adjustTiledBackingScrollability):
2689         (WebCore::FrameView::setViewExposedRect):
2690         * testing/Internals.cpp:
2691         (WebCore::Internals::setViewExposedRect):
2692         * testing/Internals.h:
2693         * testing/Internals.idl:
2694
2695 2016-04-07  Jiewen Tan  <jiewen_tan@apple.com>
2696
2697         fast/loader/opaque-base-url.html crashing during mac and ios debug tests
2698         https://bugs.webkit.org/show_bug.cgi?id=156179
2699         <rdar://problem/25507719>
2700
2701         Reviewed by Andy Estes.
2702
2703         A relative URL other than "#" with a non-hierarchical base is invalid, but prior to this
2704         change the URL's string would still contain the invalid relative URL. To avoid mistakes
2705         where we might later treat this URL string as a parsed URL string, set the string to
2706         "about:blank" instead.
2707
2708         Test: fast/url/data-uri-based-urls.html
2709
2710         * platform/URL.cpp:
2711         (WebCore::URL::init):
2712
2713 2016-04-07  Brian Burg  <bburg@apple.com>
2714
2715         Web Automation: implement Automation.addSingleCookie
2716         https://bugs.webkit.org/show_bug.cgi?id=156319
2717         <rdar://problem/25589605>
2718
2719         Reviewed by Timothy Hatcher.
2720
2721         * platform/Cookie.h: Document the units used by the 'expires' field.
2722
2723 2016-04-07  Jon Davis  <jond@apple.com>
2724
2725         Add ImageBitmap as under consideration on Feature Status page
2726         https://bugs.webkit.org/show_bug.cgi?id=156362
2727
2728         Reviewed by Timothy Hatcher.
2729
2730         * features.json:
2731
2732 2016-04-07  Jon Davis  <jond@apple.com>
2733
2734         Include Conical Gradients on the Feature Status page.
2735         https://bugs.webkit.org/show_bug.cgi?id=156363
2736
2737         Reviewed by Timothy Hatcher.
2738
2739         * features.json:
2740
2741 2016-04-07  Beth Dakin  <bdakin@apple.com>
2742
2743         Build fix.
2744
2745         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2746
2747 2016-04-07  Jeremy Jones  <jeremyj@apple.com>
2748
2749         In WK1 WebVideoFullscreen interface may be accessed from WK1 main thread instead of UI thread.
2750         https://bugs.webkit.org/show_bug.cgi?id=154252
2751         rdar://problem/22460539
2752
2753         Reviewed by Eric Carlson.
2754
2755         In WebKit1, Javascript can cause enter fullscreen to happen on the main thead, which is not
2756         necessarily the UI thread. This can cause autolayout errors. Move this code to the UI thread.
2757
2758         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2759         (WebVideoFullscreenControllerContext::setUpFullscreen): Move setup to the UI thread.
2760         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2761         (-[WebAVPlayerLayer layoutSublayers]): Move call to resolveBounds to the UI thread.
2762
2763 2016-04-07  Beth Dakin  <bdakin@apple.com>
2764
2765         Build fix.
2766
2767         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2768
2769 2016-04-07  Chris Dumez  <cdumez@apple.com>
2770
2771         [WebIDL] Add support for [EnabledAtRuntime] attributes on non-global objects
2772         https://bugs.webkit.org/show_bug.cgi?id=156346
2773
2774         Reviewed by Ryosuke Niwa.
2775
2776         Add support for [EnabledAtRuntime] attributes on non-global objects by
2777         using the same approach as for [EnabledAtRuntime] operations. This means
2778         we add these attributes to the static property table but they get removed
2779         at runtime in JS*Prototype::finishCreation(), if the feature is disabled,
2780         after the eager reification of the prototype.
2781
2782         * bindings/scripts/CodeGeneratorJS.pm:
2783         (GeneratePropertiesHashTable):
2784         (GenerateImplementation):
2785         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2786         (webkit_dom_test_obj_set_property):
2787         (webkit_dom_test_obj_get_property):
2788         (webkit_dom_test_obj_class_init):
2789         (webkit_dom_test_obj_enabled_at_runtime_operation):
2790         (webkit_dom_test_obj_get_enabled_at_runtime_attribute):
2791         (webkit_dom_test_obj_set_enabled_at_runtime_attribute):
2792         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2793         * bindings/scripts/test/JS/JSTestObj.cpp:
2794         (WebCore::JSTestObjPrototype::finishCreation):
2795         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
2796         (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
2797         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
2798         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
2799         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
2800         * bindings/scripts/test/ObjC/DOMTestObj.h:
2801         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2802         (-[DOMTestObj enabledAtRuntimeAttribute]):
2803         (-[DOMTestObj setEnabledAtRuntimeAttribute:]):
2804         (-[DOMTestObj enabledAtRuntimeOperation:]):
2805         * bindings/scripts/test/TestObj.idl:
2806
2807 2016-04-07  Beth Dakin  <bdakin@apple.com>
2808
2809         Attempted build fix.
2810
2811         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2812         (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
2813         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
2814         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
2815         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
2816         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
2817
2818 2016-04-07  Ada Chan  <adachan@apple.com>
2819
2820         Add WebKitAdditions extension point in HTMLVideoElement::supportsFullscreen()
2821         https://bugs.webkit.org/show_bug.cgi?id=156366
2822
2823         Reviewed by Alex Christensen.
2824
2825         * html/HTMLVideoElement.cpp:
2826         (WebCore::HTMLVideoElement::supportsFullscreen):
2827
2828 2016-04-07  Jon Davis  <jond@apple.com>
2829
2830         Add WOFF2 to the Feature Status page
2831         https://bugs.webkit.org/show_bug.cgi?id=156361
2832
2833         Reviewed by Timothy Hatcher.
2834
2835         * features.json:
2836
2837 2016-04-07  Beth Dakin  <bdakin@apple.com>
2838
2839         WebPlaybackControlsManager should support mediaSelectionOptions
2840         https://bugs.webkit.org/show_bug.cgi?id=156358
2841         -and corresponding-
2842         rdar://problem/25048743
2843
2844         Reviewed by Jer Noble.
2845
2846         This patch just implements 
2847         WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions and 
2848         WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions and passes that 
2849         information on to WebPlaybackControlsManager. If selection options are set via 
2850         the WebPlaybackControlsManager, then it gets the webVideoFullscreenModel() to 
2851         set the new value.
2852
2853         * platform/mac/WebVideoFullscreenInterfaceMac.h:
2854         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2855         (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
2856         (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
2857         (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
2858         (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
2859         (WebCore::mediaSelectionOptions):
2860         (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
2861         (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
2862         (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
2863         (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
2864
2865 2016-04-07  Brent Fulgham  <bfulgham@apple.com>
2866
2867         Wheel event callback removing the window causes crash in WebCore.
2868         https://bugs.webkit.org/show_bug.cgi?id=150871
2869         <rdar://problem/23418283>
2870
2871         Reviewed by Simon Fraser.
2872
2873         Null check the FrameView before using it, since the iframe may have been removed
2874         from its parent document inside the event handler.
2875         
2876         The new test triggered a cross-load side-effect, where wheel event filtering wasn't
2877         reset between page loads. Fix by calling clearLatchedState() in EventHandler::clear(),
2878         which resets the filtering.
2879
2880         Since the Frame destructor invokes EventHandler::clear, which invokes MainFrame methods,
2881         we run the risk of attempting to dereference destroyed MainFrame elements of the current
2882         Frame object. Instead, clear the EventHandler in the MainFrame destructor.
2883
2884         Finally, confirm that the mainFrame member is not being destroyed in the handful of
2885         places that might attempt to access the mainFrame during object destruction (essentially
2886         cleanup methods).
2887
2888         Test: fast/events/wheel-event-destroys-frame.html
2889
2890         * loader/FrameLoader.cpp:
2891         (WebCore::FrameLoader::clear): Protect against accessing mainFrame content during destruction.
2892         * page/EventHandler.cpp:
2893         (WebCore::EventHandler::clear): Call 'clearLatchedState' instead of endFilteringDeltas.
2894         (WebCore::EventHandler::clearLatchedState): Null-check the filter before calling it.
2895         * page/Frame.cpp:
2896         (WebCore::Frame::~Frame): Do not call 'setView' in the destructor for a MainFrame.
2897         (WebCore::Frame::setView): Check for a null event handler before invoking it.
2898         (WebCore::Frame::setMainFrameWasDestroyed): Added. Mark that the MainFrame
2899         member of the Frame is being destroyed (if the current Frame is a MainFrame) and clear
2900         the EventHandler member so that it doesn't attempt to access mainFrame content.
2901         (WebCore::Frame::mainFrame): When accessing the mainFrame member, assert that the
2902         mainFrame is not being destroyed.
2903         * page/MainFrame.cpp:
2904         (WebCore::MainFrame::~MainFrame): Set the m_recentWheelEventDeltaFilter to nullptr to
2905         prevent attempts to access it during object destruction. Call the new 'setMainFrameWasDestroyed'
2906         method to reset eventHandler and mark the MainFrame as being in the process of destruction.
2907         * page/WheelEventDeltaFilter.cpp:
2908         (WebCore::WheelEventDeltaFilter::filteredDelta): Add logging.
2909         * page/mac/EventHandlerMac.mm:
2910         (WebCore::EventHandler::platformCompleteWheelEvent): Add null check.
2911         * rendering/RenderLayer.cpp:
2912         (WebCore::RenderLayer::scrollTo): Add logging.
2913
2914 2016-04-05  Ada Chan  <adachan@apple.com>
2915
2916         Rename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
2917         https://bugs.webkit.org/show_bug.cgi?id=156245
2918
2919         Reviewed by Eric Carlson.
2920
2921         * Modules/mediacontrols/mediaControlsApple.css:
2922         (::-webkit-media-controls):
2923         Match iOS and specify overflow: hidden on the -webkit-media-controls container.
2924         (video::-webkit-media-text-track-container):
2925         Match iOS and specify z-index: 0 on the text track container.
2926
2927         * WebCore.xcodeproj/project.pbxproj:
2928         TextTrackRepresentationiOS.h/mm have been renamed to TextTrackRepresentationCocoa.h/mm.
2929
2930         * platform/graphics/TextTrackRepresentation.cpp:
2931         * platform/graphics/cocoa/TextTrackRepresentationCocoa.h: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h.
2932         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm.
2933         (-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]):
2934         (-[WebCoreTextTrackRepresentationCocoaHelper dealloc]):
2935         (-[WebCoreTextTrackRepresentationCocoaHelper setParent:]):
2936         (-[WebCoreTextTrackRepresentationCocoaHelper parent]):
2937         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
2938         (-[WebCoreTextTrackRepresentationCocoaHelper actionForLayer:forKey:]):
2939         (TextTrackRepresentation::create):
2940         (TextTrackRepresentationCocoa::TextTrackRepresentationCocoa):
2941         (TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa):
2942         (TextTrackRepresentationCocoa::update):
2943         (TextTrackRepresentationCocoa::setContentScale):
2944         (TextTrackRepresentationCocoa::bounds):
2945
2946 2016-04-07  Brian Burg  <bburg@apple.com>
2947
2948         CookieJar should support adding synthetic cookies for developer tools
2949         https://bugs.webkit.org/show_bug.cgi?id=156091
2950         <rdar://problem/25581340>
2951
2952         Reviewed by Timothy Hatcher.
2953
2954         This patch adds an API that can set an arbitrary cookie in cookie storage
2955         in order to support developer tools and automated testing. It delegates storing
2956         the cookie to a platform implementation.
2957
2958         No new tests because the code isn't used by any clients yet.
2959
2960         * loader/CookieJar.cpp:
2961         (WebCore::addCookie): Added.
2962         * loader/CookieJar.h:
2963
2964         * platform/Cookie.h:
2965         Remove an outdated comment. This struct is used in many places.
2966
2967         * platform/CookiesStrategy.h: Add new method.
2968         * platform/network/PlatformCookieJar.h: Add new method.
2969         * platform/network/cf/CookieJarCFNet.cpp:
2970         (WebCore::addCookie): Add a stub.
2971         * platform/network/curl/CookieJarCurl.cpp:
2972         (WebCore::addCookie): Add a stub.
2973         * platform/network/mac/CookieJarMac.mm:
2974         (WebCore::addCookie): Add an implementation that turns the WebCore::Cookie into
2975         an NSHTTPCookie and converts it again to CFHTTPCookie if necessary.
2976
2977         * platform/network/soup/CookieJarSoup.cpp:
2978         (WebCore::addCookie): Add a stub.
2979
2980         * platform/spi/cf/CFNetworkSPI.h:
2981         Add -[NSHTTPCookie _CFHTTPCookie] SPI.
2982
2983 2016-04-07  Commit Queue  <commit-queue@webkit.org>
2984
2985         Unreviewed, rolling out r199128 and r199141.
2986         https://bugs.webkit.org/show_bug.cgi?id=156348
2987
2988         Causes crashes on multiple webpages (Requested by keith_mi_ on
2989         #webkit).
2990
2991         Reverted changesets:
2992
2993         "[ES6] Add support for Symbol.isConcatSpreadable."
2994         https://bugs.webkit.org/show_bug.cgi?id=155351
2995         http://trac.webkit.org/changeset/199128
2996
2997         "Unreviewed, uncomment accidentally commented line in test."
2998         http://trac.webkit.org/changeset/199141
2999
3000 2016-04-07  Daniel Bates  <dabates@apple.com>
3001
3002         CSP: Should only honor CSP policy delivered in meta tag that is a descendent of <head>
3003         https://bugs.webkit.org/show_bug.cgi?id=59858
3004         <rdar://problem/25603538>
3005
3006         Reviewed by Brent Fulgham.
3007
3008         Ignore the Content Security Policy meta tag if it is not a descendent of <head> as per
3009         section HTML meta Element of the Content Security Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/>
3010         (Editor's Draft, 29 August 2015).
3011
3012         Tests: http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head.html
3013                http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head2.html
3014                http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head.html
3015                http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head2.html
3016
3017         * dom/Document.cpp:
3018         (WebCore::Document::processHttpEquiv): Modified to take a boolean argument whether the http-equiv
3019         meta tag is a descendent of <head> and to parse the value of a Content Security Policy http-equiv
3020         only if the http-equiv meta tag is a descendent of <head>.
3021         * dom/Document.h: Add parameter isInDocument to processHttpEquiv(). Remove javadoc-style parameters
3022         from processHttpEquiv() comment as we do not document parameters for non-API functions using such style.
3023         Also write the comment for processHttpEquiv() using C++ style comments instead of a C-style comment.
3024         * html/HTMLMetaElement.cpp:
3025         (WebCore::HTMLMetaElement::process): Pass whether this element is a descendent of <head>. Additionally
3026         update stale comment and move it closer to the code it refers to.
3027
3028 2016-04-07  Brent Fulgham  <bfulgham@apple.com>
3029
3030         [Win] Output WebCore.pdb to the same location as WebCore.lib
3031         https://bugs.webkit.org/show_bug.cgi?id=156256
3032         <rdar://problem/19416363>
3033
3034         Reviewed by Alex Christensen.
3035
3036         Add a rule to WebCore's CMake generator to tell Visual Studio to output
3037         the PDB file for the WebCore.lib in the same location as the resulting
3038         library, rather than in the build intermediary location).
3039         
3040         * CMakeLists.txt:
3041
3042 2016-04-06  Sam Weinig  <sam@webkit.org>
3043
3044         window.Crypto is missing
3045         <rdar://problem/25584034>
3046         https://bugs.webkit.org/show_bug.cgi?id=156307
3047
3048         Reviewed by Joseph Pecoraro.
3049
3050         Expose the Crypto constructor on the window object.
3051
3052         * page/Crypto.idl:
3053
3054 2016-04-07  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
3055
3056         [CMake][Win] WEBKIT_WRAP_SOURCELIST is not applied in WebCore project
3057         https://bugs.webkit.org/show_bug.cgi?id=156336
3058
3059         Reviewed by Csaba Osztrogon√°c.
3060
3061         * CMakeLists.txt: Do WEBKIT_WRAP_SOURCELIST for WebCore_SOURCES.
3062
3063 2016-04-07  Zalan Bujtas  <zalan@apple.com>
3064
3065         REGRESSION (197987): Ingredient lists on smittenkitchen.com are full justified instead of left justified.
3066         https://bugs.webkit.org/show_bug.cgi?id=156326
3067         <rdar://problem/25519393>
3068
3069         Reviewed by Antti Koivisto.
3070
3071         According to the spec (https://drafts.csswg.org/css-text-3/#text-align-property) 
3072         unless otherwise specified by text-align-last, the last line before
3073         a forced break or the end of the block is start-aligned.
3074
3075         In this patch we check if a forced break is present and we apply text alignment accordingly.
3076
3077         Test: fast/css3-text/css3-text-justify/text-justify-last-line-simple-line-layout.html
3078
3079         * rendering/SimpleLineLayout.cpp:
3080         (WebCore::SimpleLineLayout::LineState::lastFragment): Make it optional so that we don't just check against a default fragment.
3081         (WebCore::SimpleLineLayout::createLineRuns):
3082         (WebCore::SimpleLineLayout::justifyRuns): Do not compute first run index on the current line twice.
3083         (WebCore::SimpleLineLayout::textAlignForLine):
3084         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
3085
3086 2016-04-07  Antti Koivisto  <antti@apple.com>
3087
3088         FrameView::qualifiesAsVisuallyNonEmpty() returns false when loading a Google search results page before search results are loaded, even though the header is visible
3089         https://bugs.webkit.org/show_bug.cgi?id=156339
3090         <rdar://problem/24491381>
3091
3092         Reviewed by Andreas Kling.
3093
3094         Patch by Jeff Miller.
3095
3096         Jeff's testing indicates lowering the document height threshold improves things visually during page loading.
3097
3098         * page/FrameView.cpp:
3099         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
3100
3101             Lower document height threshold to from 200 to 48 pixels.
3102
3103 2016-04-07  Antti Koivisto  <antti@apple.com>
3104
3105         Shadow DOM: Implement display: contents for slots
3106         https://bugs.webkit.org/show_bug.cgi?id=149439
3107         <rdar://problem/22731922>
3108
3109         Reviewed by Ryosuke Niwa.
3110
3111         This patch adds support for value 'contents' of the 'display' property for <slot> elements only. The value is ignored
3112         for other elements for now. With this display value the element does not generate a box for itself but its descendants
3113         generate them normally.
3114
3115         Slots already have implicit "display: contents". With this patch the value comes from the user agent stylesheet and can
3116         be overriden by the author.
3117
3118         * css/CSSParser.cpp:
3119         (WebCore::isValidKeywordPropertyAndValue):
3120         * css/CSSPrimitiveValueMappings.h:
3121         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3122         * css/CSSValueKeywords.in:
3123
3124             Suport parsing display: contents.
3125
3126         * css/StyleResolver.cpp:
3127         (WebCore::equivalentBlockDisplay):
3128         (WebCore::StyleResolver::adjustRenderStyle):
3129
3130             Disallow for non-slots for now.
3131
3132         * css/html.css:
3133         (slot):
3134
3135             Add "slot { display: contents }" to the UA sheet.
3136
3137         * dom/Element.cpp:
3138         (WebCore::Element::resolveStyle):
3139         (WebCore::Element::hasDisplayContents):
3140         (WebCore::Element::setHasDisplayContents):
3141
3142             Add a rare data bit for elements with display:contents (as we don't save the RenderStyle for them).
3143
3144         (WebCore::Element::rendererIsNeeded):
3145
3146             Don't need renderer for display:contents.
3147
3148         (WebCore::Element::createElementRenderer):
3149         * dom/Element.h:
3150         (WebCore::Element::isVisibleInViewportChanged):
3151         * dom/ElementAndTextDescendantIterator.h:
3152         (WebCore::ElementAndTextDescendantIterator::operator!):
3153         (WebCore::ElementAndTextDescendantIterator::operator bool):
3154         (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
3155         (WebCore::ElementAndTextDescendantIterator::operator==):
3156         (WebCore::ElementAndTextDescendantIterator::operator!=):
3157
3158             Support initializing ElementAndTextDescendantIterator with root==current so that m_current is not nulled.
3159             This is needed for ComposedTreeIterator to be initialized correctly when root is a slot and the current node
3160             is a slotted node. The case happens in RenderTreePosition::previousSiblingRenderer when slot display is overriden
3161             to something else than 'contents'.
3162
3163         * dom/ElementRareData.h:
3164         (WebCore::ElementRareData::hasDisplayContents):
3165         (WebCore::ElementRareData::setHasDisplayContents):
3166         (WebCore::ElementRareData::ElementRareData):
3167         * rendering/RenderElement.cpp:
3168         (WebCore::RenderElement::createFor):
3169         * rendering/style/RenderStyleConstants.h:
3170         * style/RenderTreePosition.cpp:
3171         (WebCore::RenderTreePosition::nextSiblingRenderer):
3172
3173             Test for dynamic display:contents.
3174
3175         * style/RenderTreeUpdater.cpp:
3176         (WebCore::findRenderingRoot):
3177         (WebCore::RenderTreeUpdater::updateRenderTree):
3178         (WebCore::RenderTreeUpdater::updateElementRenderer):
3179
3180             Test for dynamic display:contents.
3181
3182         * style/StyleTreeResolver.cpp:
3183         (WebCore::Style::affectsRenderedSubtree):
3184
3185             No need for special case.
3186
3187         (WebCore::Style::TreeResolver::resolveComposedTree):
3188
3189             Test for dynamic display:contents.
3190
3191 2016-04-07  Sergio Villar Senin  <svillar@igalia.com>
3192
3193         [css-grid] Content box incorrectly used as non-auto min-height
3194         https://bugs.webkit.org/show_bug.cgi?id=155946
3195
3196         Reviewed by Antti Koivisto.
3197
3198         When computing the minimum height value of grid items with
3199         non-auto min-height we used to return the size of the content
3200         box meaning that borders and paddings were incorrectly
3201         ignored.
3202
3203         Note that we're also ignoring margins, but as that is a
3204         problem also for widths it'll be fixed in a follow up patch.
3205
3206         Test: fast/css-grid-layout/min-height-border-box.html
3207
3208         * rendering/RenderGrid.cpp:
3209         (WebCore::RenderGrid::minSizeForChild):
3210
3211 2016-04-07  Antti Koivisto  <antti@apple.com>
3212
3213         Reverting previous due to bad LayoutTest ChangeLog.
3214
3215 2016-04-06  Antti Koivisto  <antti@apple.com>
3216
3217         Shadow DOM: Implement display: contents for slots
3218         https://bugs.webkit.org/show_bug.cgi?id=149439
3219         <rdar://problem/22731922>
3220
3221         Reviewed by Ryosuke Niwa.
3222
3223         This patch adds support for value 'contents' of the 'display' property for <slot> elements only. The value is ignored
3224         for other elements for now. With this display value the element does not generate a box for itself but its descendants
3225         generate them normally.
3226
3227         Slots already have implicit "display: contents". With this patch the value comes from the user agent stylesheet and can
3228         be overriden by the author.
3229
3230         * css/CSSParser.cpp:
3231         (WebCore::isValidKeywordPropertyAndValue):
3232         * css/CSSPrimitiveValueMappings.h:
3233         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3234         * css/CSSValueKeywords.in:
3235
3236             Suport parsing display: contents.
3237
3238         * css/StyleResolver.cpp:
3239         (WebCore::equivalentBlockDisplay):
3240         (WebCore::StyleResolver::adjustRenderStyle):
3241
3242             Disallow for non-slots for now.
3243
3244         * css/html.css:
3245         (slot):
3246
3247             Add "slot { display: contents }" to the UA sheet.
3248
3249         * dom/Element.cpp:
3250         (WebCore::Element::resolveStyle):
3251         (WebCore::Element::hasDisplayContents):
3252         (WebCore::Element::setHasDisplayContents):
3253
3254             Add a rare data bit for elements with display:contents (as we don't save the RenderStyle for them).
3255
3256         (WebCore::Element::rendererIsNeeded):
3257
3258             Don't need renderer for display:contents.
3259
3260         (WebCore::Element::createElementRenderer):
3261         * dom/Element.h:
3262         (WebCore::Element::isVisibleInViewportChanged):
3263         * dom/ElementAndTextDescendantIterator.h:
3264         (WebCore::ElementAndTextDescendantIterator::operator!):
3265         (WebCore::ElementAndTextDescendantIterator::operator bool):
3266         (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
3267         (WebCore::ElementAndTextDescendantIterator::operator==):
3268         (WebCore::ElementAndTextDescendantIterator::operator!=):
3269
3270             Support initializing ElementAndTextDescendantIterator with root==current so that m_current is not nulled.
3271             This is needed for ComposedTreeIterator to be initialized correctly when root is a slot and the current node
3272             is a slotted node. The case happens in RenderTreePosition::previousSiblingRenderer when slot display is overriden
3273             to something else than 'contents'.
3274
3275         * dom/ElementRareData.h:
3276         (WebCore::ElementRareData::hasDisplayContents):
3277         (WebCore::ElementRareData::setHasDisplayContents):
3278         (WebCore::ElementRareData::ElementRareData):
3279         * rendering/RenderElement.cpp:
3280         (WebCore::RenderElement::createFor):
3281         * rendering/style/RenderStyleConstants.h:
3282         * style/RenderTreePosition.cpp:
3283         (WebCore::RenderTreePosition::nextSiblingRenderer):
3284
3285             Test for dynamic display:contents.
3286
3287         * style/RenderTreeUpdater.cpp:
3288         (WebCore::findRenderingRoot):
3289         (WebCore::RenderTreeUpdater::updateRenderTree):
3290         (WebCore::RenderTreeUpdater::updateElementRenderer):
3291
3292             Test for dynamic display:contents.
3293
3294         * style/StyleTreeResolver.cpp:
3295         (WebCore::Style::affectsRenderedSubtree):
3296
3297             No need for special case.
3298
3299         (WebCore::Style::TreeResolver::resolveComposedTree):
3300
3301             Test for dynamic display:contents.
3302
3303 2016-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
3304
3305         REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
3306         https://bugs.webkit.org/show_bug.cgi?id=156241
3307         <rdar://problem/25262213>
3308
3309         Reviewed by Simon Fraser.
3310
3311         When creating a CoreText font with a size of 0, the CoreText docs say that it will
3312         interpret this as a missing argument, and create a font of size 12 instead. However,
3313         this doesn't cause a problem (at least on this particular website) because we will
3314         use CGFontGetGlyphAdvancesForStyle(), which gets scaled by the supplied font 
3315         size (which is 0). However, if you turn on text-rendering: optimizeLegibility, we
3316         will use CTFontGetAdvancesForGlyphs() instead, which does not scale by the font size.
3317         The solution is to detect this case, and force the advance to 0.
3318
3319         Test: fast/text/zero-sized-fonts.html
3320
3321         * platform/graphics/cocoa/FontCocoa.mm:
3322         (WebCore::Font::platformWidthForGlyph):
3323
3324 2016-04-06  Myles C. Maxfield  <mmaxfield@apple.com>
3325
3326         Rename MidpointState to WhitespaceCollapsingState
3327         https://bugs.webkit.org/show_bug.cgi?id=156304
3328
3329         Reviewed by David Hyatt.
3330
3331         MidpointState has nothing to do with midpoints.
3332
3333         An individual midpoint is now known as a "whitespace collapsing transition."
3334
3335         No new tests because there is no behavior change.
3336
3337         * platform/text/BidiResolver.h:
3338         (WebCore::WhitespaceCollapsingState::reset): (See addMidpoint() below.)
3339         Previously, we were using operator= to destroy old Iterators when their
3340         storage inside the Vector was reused. Now that we are elliminating
3341         m_numMidpoints, we can push destruction earlier to this reset() function.
3342         Because the same amount of destruction happens in both cases, this doesn't
3343         add additional work. (Vector can destroy its contents without shrinking
3344         its storage overcommitment.)
3345         (WebCore::WhitespaceCollapsingState::startIgnoringSpaces):
3346         (WebCore::WhitespaceCollapsingState::stopIgnoringSpaces):
3347         (WebCore::WhitespaceCollapsingState::ensureLineBoxInsideIgnoredSpaces):
3348         (WebCore::WhitespaceCollapsingState::decrementTransitionAt):
3349         (WebCore::WhitespaceCollapsingState::thresholds): Make the return value
3350         const. The only clients of this function which needed mutation were
3351         migrated to using decrementTransitionAt().
3352         (WebCore::WhitespaceCollapsingState::numTransitions):
3353         (WebCore::WhitespaceCollapsingState::currentTransition):
3354         (WebCore::WhitespaceCollapsingState::setCurrentTransition):
3355         (WebCore::WhitespaceCollapsingState::incrementCurrentTransition):
3356         (WebCore::WhitespaceCollapsingState::decrementNumTransitions):
3357         (WebCore::WhitespaceCollapsingState::betweenTransitions):
3358         (WebCore::BidiResolverBase::whitespaceCollapsingState):
3359         (WebCore::Subclass>::setWhitespaceCollapsingTransitionForIsolatedRun):
3360         (WebCore::Subclass>::whitespaceCollapsingTransitionForIsolatedRun):
3361         (WebCore::MidpointState::MidpointState): Deleted.
3362         (WebCore::MidpointState::reset): Deleted.
3363         (WebCore::MidpointState::startIgnoringSpaces): Deleted.
3364         (WebCore::MidpointState::stopIgnoringSpaces): Deleted.
3365         (WebCore::MidpointState::ensureLineBoxInsideIgnoredSpaces): Deleted.
3366         (WebCore::MidpointState::midpoints): Deleted.
3367         (WebCore::MidpointState::numMidpoints): Deleted.
3368         (WebCore::MidpointState::currentMidpoint): Deleted.
3369         (WebCore::MidpointState::setCurrentMidpoint): Deleted.
3370         (WebCore::MidpointState::incrementCurrentMidpoint): Deleted.
3371         (WebCore::MidpointState::decrementNumMidpoints): Deleted.
3372         (WebCore::MidpointState::betweenMidpoints): Deleted.
3373         (WebCore::MidpointState::addMidpoint): Deleted. This code has been around for 13
3374         years (since r3672) where it was using QMemArray. That class doesn't have an
3375         append() class, so it was implemented inside this function. Luckily, Vector
3376         already overcommits its allocation, so we can elliminate m_numMidpoints entirely.
3377         (WebCore::BidiResolverBase::midpointState): Deleted.
3378         (WebCore::Subclass>::setMidpointForIsolatedRun): Deleted.
3379         (WebCore::Subclass>::midpointForIsolatedRun): Deleted.
3380         * rendering/InlineIterator.h:
3381         (WebCore::addPlaceholderRunForIsolatedInline):
3382         * rendering/RenderBlockLineLayout.cpp:
3383         (WebCore::RenderBlockFlow::appendRunsForObject):
3384         (WebCore::setUpResolverToResumeInIsolate):
3385         (WebCore::constructBidiRunsForSegment):
3386         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
3387         * rendering/line/BreakingContext.h:
3388         (WebCore::BreakingContext::BreakingContext):
3389         (WebCore::BreakingContext::handleBR):
3390         (WebCore::BreakingContext::handleOutOfFlowPositioned):
3391         (WebCore::shouldSkipWhitespaceAfterStartObject):
3392         (WebCore::BreakingContext::handleEmptyInline):
3393         (WebCore::BreakingContext::handleReplaced):
3394         (WebCore::ensureCharacterGetsLineBox):
3395         (WebCore::BreakingContext::handleText):
3396         (WebCore::checkWhitespaceCollapsingTransitions):
3397         (WebCore::BreakingContext::handleEndOfLine):
3398         (WebCore::checkMidpoints): Deleted.
3399         * rendering/line/TrailingObjects.cpp:
3400         (WebCore::TrailingObjects::updateWhitespaceCollapsingTransitionsForTrailingBoxes):
3401         (WebCore::TrailingObjects::updateMidpointsForTrailingBoxes): Deleted.
3402         * rendering/line/TrailingObjects.h:
3403         (WebCore::TrailingObjects::appendBoxIfNeeded):
3404
3405 2016-04-06  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3406
3407         Remove duplicated parsePortFromStringPosition()
3408         https://bugs.webkit.org/show_bug.cgi?id=156289
3409
3410         Reviewed by Simon Fraser.
3411
3412         Same parsePortFromStringPosition() functions have been defined in both URLUtils.h and HTMLAnchorElement.cpp.
3413      &