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