639ff6ab7cfcee75399727e633000cd61d4ed5a7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-04  Anders Carlsson  <andersca@apple.com>
2
3         Add an override point for drawing named images in ThemeCocoa
4         https://bugs.webkit.org/show_bug.cgi?id=157357
5         rdar://problem/25878445
6
7         Reviewed by Dean Jackson.
8
9         Rename ThemeCocoa.cpp to ThemeCocoa.mm and rearrange the code that draws the wireless-playback image
10         so we can import ThemeCocoaDrawNamedImage.mm below.
11
12         * WebCore.xcodeproj/project.pbxproj:
13         * platform/cocoa/ThemeCocoa.cpp:
14         (WebCore::fitContextToBox): Deleted.
15         (WebCore::ThemeCocoa::drawNamedImage): Deleted.
16         * platform/cocoa/ThemeCocoa.mm: Renamed from Source/WebCore/platform/cocoa/ThemeCocoa.cpp.
17         (WebCore::fitContextToBox):
18         (WebCore::ThemeCocoa::drawNamedImage):
19
20 2016-05-04  Jeremy Jones  <jeremyj@apple.com>
21
22         Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it.
23         https://bugs.webkit.org/show_bug.cgi?id=157337
24
25         Reviewed by Jer Noble.
26
27         WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode.
28         Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it
29         from its delegate, especially since we have no way to reconnect it.
30
31         The side effect of leaving it connected is that it can continue to make callbacks during cleanup.
32         Of importance is that it sets the audio and legible media selctions to nil. We don't want to change 
33         the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement
34         and causes an assert. This transition to nil selection is now ignored.
35
36         * platform/ios/WebAVPlayerController.mm:
37         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
38         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
39         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
40         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
41
42 2016-05-04  Chris Dumez  <cdumez@apple.com>
43
44         Media elements should not be paused right away when removed from the document
45         https://bugs.webkit.org/show_bug.cgi?id=157347
46         <rdar://problem/25888758>
47
48         Reviewed by Alex Christensen.
49
50         Media elements should not be paused right away when removed from the document.
51         Instead we should allow the task that removed the media element from the
52         document to finish because considering pausing.
53
54         This avoid inadvertently pausing media elements when the JS merely moves them
55         on the page (e.g. using Node.replaceChild()).
56
57         Text from the HTML specification:
58         """
59         When a media element is removed from a Document, the user agent must run the
60         following steps:
61         1.  Await a stable state, allowing the task that removed the media element
62             from the Document to continue. The synchronous section consists of all the
63             remaining steps of this algorithm. (Steps in the synchronous section are
64             marked with ⌛.)
65         2. ⌛ If the media element is in a Document, abort these steps.
66         3. ⌛ Run the internal pause steps for the media element.
67         """
68
69         c.f. https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
70
71         Test: media/replaceChild-should-not-pause-video.html
72
73         * dom/GenericEventQueue.cpp:
74         (WebCore::GenericEventQueue::sharedTimerFired):
75         Copy the queue of events before processing it so that we don't fire events that
76         get scheduled by the event handlers as a result of us firing the pending events.
77         Otherwise, we end up firing events synchronously right after they've been queued,
78         which is wrong. This was causing several W3C tests to fail.
79
80         * html/HTMLMediaElement.cpp:
81         (WebCore::HTMLMediaElement::HTMLMediaElement):
82         (WebCore::HTMLMediaElement::pauseAfterDetachedTimerFired):
83         (WebCore::HTMLMediaElement::removedFrom):
84         * html/HTMLMediaElement.h:
85         After the media element gets removed from the document, schedule a 0 timer before
86         pausing the media element, to give the task that removed us a chance to finish.
87         When the timer fires, we check if we were added back into an active document and
88         avoid pausing in such case.
89
90 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
91
92         Speed up JSGlobalObject initialization by making some properties lazy
93         https://bugs.webkit.org/show_bug.cgi?id=157045
94
95         Reviewed by Keith Miller.
96
97         No new tests because no change in behavior.
98         
99         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
100         that this was using a curious choice of global object, which may not be right. I decided
101         to do a very literal refactoring that exactly preserves what this code got before, but I
102         added a FIXME to reconsider this later.
103
104         * bindings/js/JSHTMLElementCustom.cpp:
105         (WebCore::JSHTMLElement::pushEventHandlerScope):
106
107 2016-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
108
109         [css-grid] Refactor information stored related to column positions
110         https://bugs.webkit.org/show_bug.cgi?id=157342
111
112         Reviewed by Darin Adler.
113
114         In m_columnPositions we were storing position of each column
115         including the alignment offset, always from the logical left,
116         and the border and padding, depending on the direction.
117
118         This was really confusing as in the case of RTL direction
119         we were adding the offset from the left and
120         the right border and padding.
121
122         This patches changes it to store always the info from the left,
123         so even in RTL direction we use the left border and padding.
124
125         This allows us to simplify translateRTLCoordinate() as
126         it doesn't need to care about border and padding anymore.
127         And also to refactor offsetAndBreadthForPositionedChild()
128         which became really complex after adding RTL support.
129
130         No new tests, no change of behavior.
131
132         * rendering/RenderGrid.cpp:
133         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
134         (WebCore::RenderGrid::populateGridPositions):
135         (WebCore::RenderGrid::translateRTLCoordinate):
136
137 2016-05-04  Mark Lam  <mark.lam@apple.com>
138
139         ES6 Function.name inferred from property names of literal objects can break some websites.
140         https://bugs.webkit.org/show_bug.cgi?id=157246
141
142         Reviewed by Geoffrey Garen.
143
144         Test: js/dom/regress-157246.html
145
146         * bindings/js/JSDOMWindowBase.cpp:
147         (WebCore::JSDOMWindowBase::finishCreation):
148         - Set the needsSiteSpecificQuirks flag in the JSGlobalObject if needed.
149
150 2016-05-04  Konstantin Tokarev  <annulen@yandex.ru>
151
152         Deduplicated initializer lists of BitmapImage constructors.
153         https://bugs.webkit.org/show_bug.cgi?id=157249
154
155         Reviewed by Darin Adler.
156
157         No new tests needed.
158
159         * platform/graphics/BitmapImage.cpp:
160         (WebCore::BitmapImage::BitmapImage): Added new private constructor of
161         BitmapImage for delegation purpose only.
162         * platform/graphics/BitmapImage.h: Use inline initialization for some
163         BitmapImage fields.
164         * platform/graphics/cairo/BitmapImageCairo.cpp:
165         (WebCore::BitmapImage::BitmapImage): Delegate field initialization to
166         new private constructor.
167         * platform/graphics/cg/BitmapImageCG.cpp:
168         (WebCore::BitmapImage::BitmapImage): Ditto.
169
170 2016-05-04  Chris Dumez  <cdumez@apple.com>
171
172         Unreviewed, rolling out r200383 and r200406.
173
174         Seems to have caused crashes on iOS / ARMv7s
175
176         Reverted changesets:
177
178         "Speed up JSGlobalObject initialization by making some
179         properties lazy"
180         https://bugs.webkit.org/show_bug.cgi?id=157045
181         http://trac.webkit.org/changeset/200383
182
183         "REGRESSION(r200383): Setting lazily initialized properties
184         across frame boundaries crashes"
185         https://bugs.webkit.org/show_bug.cgi?id=157333
186         http://trac.webkit.org/changeset/200406
187
188 2016-05-04  Joanmarie Diggs  <jdiggs@igalia.com>
189
190         AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark only if named
191         https://bugs.webkit.org/show_bug.cgi?id=157331
192
193         Reviewed by Chris Fleizach.
194
195         The 'region' role is now mapped as a landmark: The WebCore DocumentRegionRole
196         AccessibilityRole has been renamed to LandmarkRegionRole. The AXDocumentRegion
197         subrole has been renamed to AXLandmarkRegion. A 'section' element is mapped to
198         the LandmarkRegionRole if it has an author-provided accessible name via either
199         the aria-label or aria-labelledby attribute. Otherwise, it is mapped as GroupRole
200         with no subrole.
201
202         Our existing test coverage for exposure of the 'region' role and the 'section'
203         element is sufficient. These tests were updated to reflect the new behavior.
204         Several new test cases were added to cover both sections with accessible names
205         and those without.
206
207         * accessibility/AccessibilityObject.cpp:
208         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
209         (WebCore::AccessibilityObject::isLandmark):
210         (WebCore::initializeRoleMap):
211         * accessibility/AccessibilityObject.h:
212         * accessibility/AccessibilityRenderObject.cpp:
213         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
214         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
215         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
216         (atkRole):
217         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
218         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
219         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
220         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
221         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
222         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
223         (createAccessibilityRoleMap):
224         (-[WebAccessibilityObjectWrapper subrole]):
225         * platform/LocalizedStrings.cpp:
226         (WebCore::AXARIAContentGroupText):
227
228 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
229
230         Clicks inside button elements are sometimes discarded when the mouse moves
231         https://bugs.webkit.org/show_bug.cgi?id=39620
232
233         Reviewed by Darin Adler.
234
235         Test: fast/events/click-over-descendant-elements.html
236
237         * dom/Node.cpp:
238         (WebCore::ancestor):
239         (WebCore::commonAncestor): Method inspired from
240         http://src.chromium.org/viewvc/blink?view=revision&revision=162081.
241         (WebCore::commonAncestorCrossingShadowBoundary): Helper routine
242         that handles the case of nodes into a shadow node.
243         * dom/Node.h:
244         * page/EventHandler.cpp:
245         (WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event
246         target node according commonAncestorOverShadowBoundary method.
247         (WebCore::EventHandler::targetNodeForClickEvent): Deleted.
248
249 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
250
251         Unreviewed, fixing crashing GTK+ tests after r200407.
252
253         * platform/graphics/texmap/TextureMapperGL.cpp:
254         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
255         Don't use RELEASE_ASSERT. Also fix the actual assertion,
256         checking that any of the values in the map matches the object
257         that's being destroyed, instead of checking the keys.
258
259 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
260
261         Add WKPreference for SelectionPaintingWithoutSelectionGaps
262         https://bugs.webkit.org/show_bug.cgi?id=156900
263
264         Reviewed by Michael Catanzaro.
265
266         Unlike other browsers WebKit has been drawing selection gaps
267         between render blocks during the text selection. This often
268         cause text selection screen looks messy.
269
270         This patch adds a setting method to disable the functionality,
271         and EFL port disables it by default.
272
273         * page/Settings.in:
274         * rendering/RenderBlock.cpp:
275         (WebCore::RenderBlock::shouldPaintSelectionGaps):
276
277 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
278
279         Rename JSKeyValueIterator as JSDOMIterator
280         https://bugs.webkit.org/show_bug.cgi?id=157308
281
282         Reviewed by Darin Adler.
283
284         No change of behavior.
285
286         * bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h.
287         (WebCore::JSDOMIteratorPrototype::create):
288         (WebCore::JSDOMIteratorPrototype::createStructure):
289         (WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype):
290         (WebCore::createKeyValueIterator):
291         (WebCore::keyValueIteratorForEach):
292         (WebCore::JSDOMIterator<JSWrapper>::destroy):
293         (WebCore::JSDOMIterator<JSWrapper>::next):
294         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
295         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation):
296         * bindings/js/JSFontFaceSetCustom.cpp:
297         * bindings/scripts/CodeGeneratorJS.pm:
298         (GenerateImplementationIterableFunctions):
299         * bindings/scripts/test/JS/JSTestObj.cpp:
300
301 2016-05-04  Jiewen Tan  <jiewen_tan@apple.com>
302
303         CrashTracer: [USER] com.apple.WebKit.WebContent at …ple.WebCore: WebCore::EditCommandComposition::unapply + 105
304         https://bugs.webkit.org/show_bug.cgi?id=157282
305         <rdar://problem/25391441>
306
307         Reviewed by Darin Adler.
308
309         A frame could be destroyed in the middle of executing undo/redo command.
310         Therefore, add an early return.
311
312         * editing/CompositeEditCommand.cpp:
313         (WebCore::EditCommandComposition::unapply):
314         (WebCore::EditCommandComposition::reapply):
315
316 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
317
318         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
319         https://bugs.webkit.org/show_bug.cgi?id=157305
320
321         Reviewed by Carlos Garcia Campos.
322
323         Split out handling of the root compositing and the view overlay layers
324         into two separate methods. Both do nothing if the passed-in layer is
325         the same as the current one. Otherwise, the current one is removed
326         from the tree and the new one added to it.
327
328         No change in behavior is expected.
329
330         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
331         (WebCore::CompositingCoordinator::setRootCompositingLayer):
332         (WebCore::CompositingCoordinator::setViewOverlayRootLayer):
333         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
334
335 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
336
337         [TexMap] Clean up TextureMapperGLData, TextureMapperGLData::SharedGLData
338         https://bugs.webkit.org/show_bug.cgi?id=157303
339
340         Reviewed by Carlos Garcia Campos.
341
342         Torch the TextureMapperGLData and TextureMapperGLData::SharedGLData
343         classes into a better form.
344
345         SharedGLData is now private to the TextureMapperGLData class, but
346         lists that class as a friend. This enables moving the getShaderProgram()
347         method to TextureMapperGLData and removes the need to expose the
348         SharedGLData publicly. SharedGLData also doesn't have to keep a
349         reference to the GraphicsContext3D object.
350
351         TextureMapperGLData now default-initializes the publicly accessible
352         member variables while making some other members private, not exposing
353         anything that isn't necessary.
354
355         Usual whitespace cleanup included. More elegant HashMap::ensure()
356         insertions are used where they don't obfuscate object creation.
357
358         No new tests -- no change in behavior.
359
360         * platform/graphics/texmap/TextureMapperGL.cpp:
361         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
362         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
363         (WebCore::TextureMapperGLData::SharedGLData::contextDataMap):
364         (WebCore::TextureMapperGLData::SharedGLData::SharedGLData):
365         (WebCore::TextureMapperGLData::TextureMapperGLData):
366         (WebCore::TextureMapperGLData::~TextureMapperGLData):
367         (WebCore::TextureMapperGLData::initializeStencil):
368         (WebCore::TextureMapperGLData::getStaticVBO):
369         (WebCore::TextureMapperGLData::getShaderProgram):
370         (WebCore::TextureMapperGL::TextureMapperGL):
371         (WebCore::TextureMapperGL::drawBorder):
372         (WebCore::TextureMapperGL::drawTexture):
373         (WebCore::TextureMapperGL::drawSolidColor):
374         (WebCore::TextureMapperGL::drawFiltered):
375         (WebCore::TextureMapperGL::beginClip):
376         (WebCore::TextureMapperGLData::SharedGLData::glContextDataMap): Deleted.
377         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram): Deleted.
378         (WebCore::TextureMapperGLData::sharedGLData): Deleted.
379         * platform/graphics/texmap/TextureMapperGL.h:
380
381 2016-05-03  Chris Dumez  <cdumez@apple.com>
382
383         Optimize [StrictTypeChecking] on IDL attributes
384         https://bugs.webkit.org/show_bug.cgi?id=157321
385
386         Reviewed by Geoffrey Garen.
387
388         Optimize [StrictTypeChecking] on IDL attributes:
389         - Only generate extra code for nullable attributes because for non-nullable
390           attributes, JSXXX::toWrapped() will return null in case of a bad input
391           type. We will then throw a TypeError when null-checking it already.
392         - After the JSValue::isNullOrUndefined() check, avoid calling
393           JSXXX::toWrapped() and set nativeValue to nullptr directly.
394         - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
395           check on the value returned by JSXXX::toWrapped(). toWrapped() already
396           does a JSValue::inherits(JSXXX::info() check. Since we only call
397           toWrapped() if the JSValue is not null/undefined, a null return value
398           always indicates a bad input type.
399
400         * bindings/scripts/CodeGeneratorJS.pm:
401         (GenerateImplementation):
402         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
403         (webkit_dom_test_obj_set_strict_type_checking_attribute):
404         * bindings/scripts/test/JS/JSTestObj.cpp:
405         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
406         * bindings/scripts/test/ObjC/DOMTestObj.mm:
407         (-[DOMTestObj setStrictTypeCheckingAttribute:]):
408         * bindings/scripts/test/TestObj.idl:
409
410 2016-05-03  Chris Dumez  <cdumez@apple.com>
411
412         Unreviewed, rolling out r199259 and r200161.
413
414         Seems to have caused a ~1.2% PLT regression on iOS
415
416         Reverted changesets:
417
418         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
419         determine tiling area"
420         https://bugs.webkit.org/show_bug.cgi?id=156429
421         http://trac.webkit.org/changeset/199259
422
423         "[iOS WK2] When determining tile size, check whether ancestor
424         UIScrollViews are actually scrollable"
425         https://bugs.webkit.org/show_bug.cgi?id=157107
426         http://trac.webkit.org/changeset/200161
427
428 2016-05-03  Filip Pizlo  <fpizlo@apple.com>
429
430         Speed up JSGlobalObject initialization by making some properties lazy
431         https://bugs.webkit.org/show_bug.cgi?id=157045
432
433         Reviewed by Keith Miller.
434
435         No new tests because no change in behavior.
436         
437         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
438         that this was using a curious choice of global object, which may not be right. I decided
439         to do a very literal refactoring that exactly preserves what this code got before, but I
440         added a FIXME to reconsider this later.
441
442         * bindings/js/JSHTMLElementCustom.cpp:
443         (WebCore::JSHTMLElement::pushEventHandlerScope):
444
445 2016-05-03  Per Arne Vollan  <peavo@outlook.com>
446
447         [Win] Remove Windows XP Compatibility Requirements
448         https://bugs.webkit.org/show_bug.cgi?id=152899
449
450         Reviewed by Brent Fulgham.
451
452         Windows XP is not supported anymore, we can remove compatibility workarounds.
453
454         * platform/text/win/LocaleWin.cpp:
455         (WebCore::extractLanguageCode):
456         (WebCore::LCIDFromLocaleInternal):
457         (WebCore::LCIDFromLocale):
458         (WebCore::removeLastComponent): Deleted.
459         (WebCore::ensureNameToLCIDMap): Deleted.
460         (WebCore::convertLocaleNameToLCID): Deleted.
461
462 2016-05-02  Antti Koivisto  <antti@apple.com>
463
464         REGRESSION (r198943): Transitions don't work if they animate display property
465         https://bugs.webkit.org/show_bug.cgi?id=157244
466         <rdar://problem/26042189>
467
468         Reviewed by Simon Fraser.
469
470         Test: transitions/transition-display-property.html
471
472         * style/RenderTreeUpdater.cpp:
473         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
474
475             Call the common function for ::before/::after updates.
476
477         * style/StyleTreeResolver.cpp:
478         (WebCore::Style::TreeResolver::resolveElement):
479         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
480
481             If animation forces render tree reconstruction use the original rather than animated style for update.
482             Because animations are tied to renderers we start them during renderer construction in this case.
483
484             Factor to a function.
485
486         (WebCore::Style::elementImplicitVisibility):
487         * style/StyleTreeResolver.h:
488
489 2016-05-03  Pranjal Jumde  <pjumde@apple.com>
490
491         WorkerGlobalScope's self, location and navigator attributes should not be replaceable
492         https://bugs.webkit.org/show_bug.cgi?id=157296
493         <rdar://problem/25962738>
494
495         Reviewed by Chris Dumez.
496
497         Tests: http/tests/workers/location-readonly.html
498                http/tests/workers/navigator-readonly.html
499                http/tests/workers/self-readonly.html
500
501         * workers/WorkerGlobalScope.idl:
502         The 'self', 'location', and 'navigator' properties of the WorkerGlobalScope must be immutable.
503         See: https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
504
505 2016-05-03  Chris Dumez  <cdumez@apple.com>
506
507         Drop some unnecessary exception checking in the generated bindings
508         https://bugs.webkit.org/show_bug.cgi?id=157299
509
510         Reviewed by Darin Adler.
511
512         Drop some unnecessary exception checking in the generated bindings.
513         Only do a check for state->hadException() after converting a JSValue
514         to a native value when necessary. Update JSValueToNative() to
515         indicate the caller if converting to the native value may throw an
516         exception.
517
518         This gets rid of a lot of unnecessary branching in the bindings.
519
520         No new tests, no intended web-exposed behavior change.
521
522         * bindings/scripts/CodeGeneratorJS.pm:
523         (GenerateImplementation):
524         (GenerateParametersCheck):
525         (JSValueToNative):
526         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
527         * bindings/scripts/test/JS/JSTestInterface.cpp:
528         * bindings/scripts/test/JS/JSTestObj.cpp:
529         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
530
531 2016-05-03  Brady Eidson  <beidson@apple.com>
532
533         Add/refactor isolatedCopy methods for 3 IDB classes.
534         https://bugs.webkit.org/show_bug.cgi?id=157289
535
536         Reviewed by Alex Christensen.
537
538         No new tests (Refactor, no behavior change).
539
540         In an upcoming, much larger patch, I'll need the ability to directly construct these three objects
541         as isolated copies.
542         
543         This is a nice standalone refactor that enables that ability.
544
545         * Modules/indexeddb/IDBGetResult.cpp:
546         (WebCore::IDBGetResult::IDBGetResult):
547         (WebCore::IDBGetResult::isolatedCopy):
548         * Modules/indexeddb/IDBGetResult.h:
549         
550         * Modules/indexeddb/IDBKeyData.cpp:
551         (WebCore::IDBKeyData::IDBKeyData):
552         (WebCore::IDBKeyData::isolatedCopy):
553         * Modules/indexeddb/IDBKeyData.h:
554
555         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
556         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
557         (WebCore::IDBTransactionInfo::isolatedCopy):
558         * Modules/indexeddb/shared/IDBTransactionInfo.h:
559
560 2016-05-03  Joanmarie Diggs  <jdiggs@igalia.com>
561
562         [ATK] accessibility/content-editable-as-textarea.html fails
563         https://bugs.webkit.org/show_bug.cgi?id=155353
564
565         Reviewed by Darin Adler.
566
567         The test was timing out because it expected an AXValueChanged notification.
568         In ATK, AXValueChanged notifications are made for widgets which implement
569         the AtkValue interface (sliders, progress bars, etc.). We should be listening
570         for AXTextChanged instead.
571
572         In addition, for contenteditable elements, we should emit the notification on
573         the element itself. Because we were handling the notification in the same way
574         as native text controls (where the notification we receive from WebCore is for
575         StaticTextRole children), we were attempting to emit the notification from
576         the parent of the contenteditable.
577
578         Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
579         methods that are being used as part of the previously-failing test. Those
580         methods are now implemented so that the ATK results are much more similar
581         to those on the Mac.
582
583         No new tests needed. The previously-failing test now passes.
584
585         * accessibility/AccessibilityNodeObject.cpp:
586         (WebCore::AccessibilityNodeObject::childrenChanged):
587         * accessibility/AccessibilityObject.cpp:
588         (WebCore::AccessibilityObject::isNonNativeTextControl):
589         * accessibility/AccessibilityObject.h:
590         * accessibility/AccessibilityRenderObject.cpp:
591         (WebCore::AccessibilityRenderObject::textChanged):
592         * accessibility/atk/AXObjectCacheAtk.cpp:
593         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
594
595 2016-05-02  Sergio Villar Senin  <svillar@igalia.com>
596
597         [css-grid] Add support for position resolution with auto-repeat tracks
598         https://bugs.webkit.org/show_bug.cgi?id=157260
599
600         Reviewed by Darin Adler.
601
602         This is a generalization of our position resolution code so it now supports every possible
603         type of resolution (definite position, position spans, automatic resolution, named lines
604         resolution, grid areas...) under the presence of auto-repeat tracks, i.e., tracks that are
605         dynamically created by the LayoutGrid depending on the available space and that cannot be
606         directly inferred from the CSS declarations.
607
608         This means that we need two extra things to resolve positions:
609         - the LayoutGrid needs to provide the number of auto-repeat tracks per axis
610         - a wrapper is needed to hide the eventual presence of auto-repeat tracks (with their line
611         names) from the rest of the resolution code which should remain mostly unchanged.
612
613         The former is trivial (requires passing a new argument to some functions at the most) but
614         the latter requires a new class called NamedLineCollection. This class allow us to locate
615         and resolve named lines without having to insert the auto-repeat named lines in the already
616         existing data structures. It does it in a very compact representation as it does not
617         duplicate the names for every single repetition.
618
619         No new tests required as there is no change in behavior because the auto-repeat tracks
620         computation is not implemented yet. Current tests already test this code extensively, and
621         the auto-repeat code paths will be tested later once
622         RenderGrid::computeAutoRepeatTracksCount() is implemented.
623
624         * rendering/RenderGrid.cpp:
625         (WebCore::RenderGrid::computeAutoRepeatTracksCount): New method with empty implementation.
626         (WebCore::RenderGrid::placeItemsOnGrid): Initialize the auto repeat tracks count.
627         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
628         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
629         * rendering/RenderGrid.h:
630         * rendering/style/GridPositionsResolver.cpp:
631         (WebCore::directionFromSide):
632         (WebCore::NamedLineCollection::NamedLineCollection): New class which is able to resolve the
633         positions of a given named line in the presence of auto-repeat and "normal" tracks.
634         (WebCore::NamedLineCollection::isValidNamedLineOrArea): Checks whether the given named line
635         is a valid line name or area.
636         (WebCore::NamedLineCollection::hasNamedLines): Checks whether the named line exists in the
637         given axis (either specified by auto-repeat or "normal" tracks).
638         (WebCore::NamedLineCollection::find): Looks for a line number whithin the line numbers where
639         the given named line was found.
640         (WebCore::NamedLineCollection::contains):
641         (WebCore::NamedLineCollection::firstPosition): Returns the first line where the given named
642         line is located.
643         (WebCore::adjustGridPositionsFromStyle): Use NamedLineCollection.
644         (WebCore::GridPositionsResolver::explicitGridColumnCount): Include auto repeat tracks.
645         (WebCore::GridPositionsResolver::explicitGridRowCount): Ditto.
646         (WebCore::explicitGridSizeForSide): Ditto.
647         (WebCore::lookAheadForNamedGridLine): Use NamedLineCollection.
648         (WebCore::lookBackForNamedGridLine): Ditto.
649         (WebCore::resolveNamedGridLinePositionFromStyle):
650         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
651         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
652         (WebCore::resolveGridPositionAgainstOppositePosition):
653         (WebCore::resolveGridPositionFromStyle):
654         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
655         (WebCore::gridLinesForSide): Deleted.
656         (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea): Deleted.
657         * rendering/style/GridPositionsResolver.h:
658
659 2016-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
660
661         Unreviewed. Fix GObject DOM bindings API break after r200316.
662
663         webkit_dom_tree_walker_set_current_node no longer raises exceptions after r200316, so mark it accordingly.
664
665         * bindings/scripts/CodeGeneratorGObject.pm:
666         (FunctionUsedToRaiseException):
667
668 2016-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
669
670         [OpenType] OpenTypeVerticalData object should not be created if the font is not OpenType
671         https://bugs.webkit.org/show_bug.cgi?id=157172
672
673         Reviewed by Michael Catanzaro.
674
675         It's a bit weird that the object is always created and has an isOpenType() method to check whether it's an
676         OpenType or not. The caller is always deleting the object when it's not an OpenType, so it would be better if
677         the create method returned nullptr instead of creating the object when the font is not OpenType.
678
679         * platform/graphics/FontCache.cpp:
680         (WebCore::FontCache::verticalData): Do not use isOpenType(), we can now simply use the return value of OpenTypeVerticalData::create().
681         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
682         (WebCore::loadHmtxTable): Moved to a helper funtion that returns false if the font is not OpenType.
683         (WebCore::OpenTypeVerticalData::create): Try to load the Hmtx table, and create the object if succeeded or
684         return nullptr otherwise.
685         (WebCore::OpenTypeVerticalData::OpenTypeVerticalData): Receive the advanceWidths as constructor parameter.
686         (WebCore::OpenTypeVerticalData::loadMetrics): Load all other tables.
687         * platform/graphics/opentype/OpenTypeVerticalData.h:
688         (WebCore::OpenTypeVerticalData::isOpenType): Deleted.
689
690 2016-05-02  Darin Adler  <darin@apple.com>
691
692         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
693         https://bugs.webkit.org/show_bug.cgi?id=157257
694
695         Reviewed by Chris Dumez.
696
697         Chris and Alex requested this alternate style, where the enum class for each enumeration
698         goes inside the class for the interface the enumeration is used in. Also made a rule that
699         keeps the names short and not redundant with the class name they are nested in.
700
701         * Modules/fetch/FetchOptions.h: Moved all the enum class types into the struct.
702
703         * Modules/fetch/FetchRequest.cpp:
704         (WebCore::setReferrerPolicy): Updated.
705         (WebCore::setMode): Ditto.
706         (WebCore::setCredentials): Ditto.
707         (WebCore::setCache): Ditto.
708         (WebCore::setRedirect): Ditto.
709         (WebCore::buildOptions): Ditto.
710         (WebCore::buildHeaders): Ditto.
711         (WebCore::FetchRequest::create): Ditto.
712         * Modules/fetch/FetchRequest.h: Used "using" to repeat the types from FetchOptions
713         here in FetchRequest. That way the generated bindings can find the types, and we don't
714         need to do any trick like [ImplementedAs] in thd IDL to make it work.
715
716         * Modules/fetch/FetchResponse.cpp:
717         (WebCore::FetchResponse::error): Updated.
718         (WebCore::FetchResponse::redirect): Ditto.
719         (WebCore::FetchResponse::FetchResponse): Ditto.
720         (WebCore::FetchResponse::startFetching): Ditto.
721         * Modules/fetch/FetchResponse.h: Moved enum class into the class.
722
723         * Modules/mediacontrols/MediaControlsHost.cpp:
724         (WebCore::MediaControlsHost::externalDeviceType): Updated.
725         * Modules/mediacontrols/MediaControlsHost.h: Moved enum classs into the class.
726
727         * Modules/mediasession/MediaSession.cpp:
728         (WebCore::MediaSession::MediaSession): Updated.
729         * Modules/mediasession/MediaSession.h: Moved enum classs into the class.
730
731         * Modules/mediasource/MediaSource.cpp:
732         (WebCore::MediaSource::addSourceBuffer): Updated.
733         (WebCore::MediaSource::removeSourceBuffer): Ditto.
734
735         * Modules/mediasource/MediaSource.h: Moved enum class into the class.
736
737         * Modules/mediasource/SourceBuffer.cpp:
738         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Updated.
739         (WebCore::SourceBuffer::appendError): Ditto.
740         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
741         (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
742
743         * Modules/mediasource/SourceBuffer.h: Removed incorrect forward declaration
744         of EndOfStreamError that also now seems to be unneeded. Moved enum class into
745         the class.
746
747         * Modules/mediastream/MediaDeviceInfo.cpp:
748         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Updated.
749         (WebCore::MediaDeviceInfo::create): Ditto.
750         * Modules/mediastream/MediaDeviceInfo.h: Moved enum class into the class.
751
752         * Modules/mediastream/MediaDevicesRequest.cpp:
753         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Updated.
754         * Modules/mediastream/MediaStreamTrack.cpp:
755         (WebCore::MediaStreamTrack::readyState): Updated.
756
757         * Modules/mediastream/MediaStreamTrack.h: Moved enum class into the class.
758
759         * Modules/mediastream/RTCConfiguration.h: Moved enum classes into the class.
760
761         * Modules/webaudio/AudioContext.h: Moved enum class into the class.
762
763         * Modules/webaudio/WaveShaperNode.cpp:
764         (WebCore::processorType): Updated.
765         (WebCore::WaveShaperNode::oversample): Ditto.
766         * Modules/webaudio/WaveShaperNode.h: Moved enum class into the class.
767
768         * bindings/js/JSXMLHttpRequestCustom.cpp:
769         (WebCore::JSXMLHttpRequest::response): Updated.
770
771         * bindings/scripts/CodeGeneratorJS.pm:
772         (GenerateGetOwnPropertySlotBody): Removed unneeded $interfaceName argument.
773         (GetAttributeGetterName): Ditto.
774         (GetAttributeSetterName): Ditto.
775         (GetFunctionName): Tweaked style.
776         (AttributeShouldBeOnInstanceForCompatibility): Deleted. Was a function that
777         always returned 0.
778         (AttributeShouldBeOnInstance): Removed the call to the function above.
779         (IsClassNameWordBoundary): Added. Helper for function below.
780         (IsPrefixRemovable): Ditto.
781         (GetEnumerationClassName): Added an $interface argument and changed this
782         so it creates a nested name inside the class rather than a top level name
783         for use at the WebCore namespace level.
784         (GetEnumerationClassIdentifier): Added. Calls GetEnumerationClassName and
785         makes a flattened name without "::" that can be used in an identifier.
786         (GenerateEnumerationImplementationContent): Renamed from GetXXX. Added an
787         $interface argument, so it can pass that along to the functions above.
788         (GenerateHeader): Updated to not pass $interfaceName.
789         (GeneratePropertiesHashTable): Ditto.
790         (GenerateOverloadedFunction): Removed unneeded $interfaceName argument.
791         (GenerateImplementation): Updated for changes above. Tweaked formatting.
792         (GenerateFunctionCastedThis): Removed unneeded $interfaceName argument.
793         (GenerateParametersCheck): Ditto. Also streamlined implementation a bit
794         and made the IsEnumType section call the new functions.
795         (GenerateCallbackImplementation): Ditto.
796         (JSValueToNative): Added an $interface argument and pass it along when
797         dealing with enumerations.
798         (GeneratePrototypeDeclaration): Removed unneeded $interfaceName argument.
799         (GenerateConstructorDeclaration): Ditto.
800         (GenerateConstructorDefinitions): Ditto.
801         (GenerateConstructorDefinition): Ditto.
802         (GenerateConstructorHelperMethods): Ditto.
803
804         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
805
806         * bindings/scripts/test/TestObj.idl: Added some new enums that test some
807         of the logic above.
808
809         * crypto/CryptoKey.cpp:
810         (WebCore::CryptoKey::CryptoKey): Updated.
811         (WebCore::CryptoKey::usages): Ditto.
812         * crypto/CryptoKey.h: Moved enum class types inside the CryptoKey class.
813         Added comments about the two similar but distinct types named
814         CryptoKeyUsage and CryptoKey::Usage.
815
816         * css/FontFace.cpp:
817         (WebCore::FontFace::status): Updated.
818         * css/FontFace.h: Moved enum class into the class.
819
820         * css/FontFaceSet.cpp:
821         (WebCore::FontFaceSet::status): Updated.
822         * css/FontFaceSet.h: Moved enum class into the class.
823
824         * dom/Document.cpp:
825         (WebCore::Document::Document): Updated for the name change back from
826         ReferrerHeaderPolicy to ReferrerPolicy.
827         (WebCore::Document::processReferrerPolicy): Ditto.
828         (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
829         * dom/Document.h: More of the same.
830
831         * html/HTMLMediaElement.cpp:
832         (WebCore::HTMLMediaElement::loadInternal): Updated.
833         (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
834         (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
835         (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
836         (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
837         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
838         (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
839         (WebCore::HTMLMediaElement::setSelectedTextTrack): Ditto.
840         (WebCore::HTMLMediaElement::configureTextTracks): Ditto.
841         (WebCore::HTMLMediaElement::hasClosedCaptions): Ditto.
842         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
843         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
844         (WebCore::toPlatform): Ditto.
845         (WebCore::HTMLMediaElement::outOfBandTrackSources): Ditto.
846         * html/HTMLTrackElement.cpp:
847         (WebCore::HTMLTrackElement::scheduleLoad): Ditto.
848
849         * html/HTMLVideoElement.h: Moved enum class into class.
850
851         * html/HTMLVideoElement.idl: Added the missing conditional on
852         VideoPresentationMode, and also moved it to the bottom of the file
853         to work around what is apparently a bug in the IDL parser.
854
855         * html/canvas/CanvasRenderingContext2D.cpp:
856         (WebCore::toWindRule): Updated.
857         (WebCore::CanvasRenderingContext2D::fill): Ditto.
858         (WebCore::CanvasRenderingContext2D::clip): Ditto.
859         (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
860         (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
861         (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
862         (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
863         (WebCore::smoothingToInterpolationQuality): Ditto.
864
865         * html/canvas/CanvasRenderingContext2D.h: Moved enum class types into the class.
866
867         * html/shadow/MediaControlElements.cpp:
868         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Updated.
869         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
870
871         * html/track/InbandTextTrack.cpp:
872         (WebCore::InbandTextTrack::setMode): Updated.
873         (WebCore::toPrivate): Ditto.
874         (WebCore::InbandTextTrack::setModeInternal): Ditto.
875         (WebCore::InbandTextTrack::updateKindFromPrivate): Ditto.
876         * html/track/InbandTextTrack.h: Ditto.
877         * html/track/TextTrack.cpp:
878         (WebCore::TextTrack::TextTrack): Ditto.
879         (WebCore::TextTrack::enabled): Ditto.
880         (WebCore::TextTrack::kindKeyword): Ditto.
881         (WebCore::TextTrack::setKind): Ditto.
882         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase): Ditto.
883         (WebCore::TextTrack::setMode): Ditto.
884         (WebCore::TextTrack::cues): Ditto.
885         (WebCore::TextTrack::activeCues): Ditto.
886         (WebCore::TextTrack::addCue): Ditto.
887         (WebCore::TextTrack::regions): Ditto.
888         (WebCore::TextTrack::isRendered): Ditto.
889         (WebCore::TextTrack::isMainProgramContent): Ditto.
890         (WebCore::TextTrack::containsOnlyForcedSubtitles): Ditto.
891
892         * html/track/TextTrack.h: Moved enum class types into the class.
893
894         * html/track/TextTrackCue.cpp:
895         (WebCore::TextTrackCue::dispatchEvent): Updated.
896         (WebCore::TextTrackCue::isActive): Ditto.
897         * loader/FrameNetworkingContext.h: Ditto.
898         * page/CaptionUserPreferences.cpp:
899         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto.
900         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Ditto.
901         * page/CaptionUserPreferencesMediaAF.cpp:
902         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Ditto.
903         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto.
904
905         * page/SecurityPolicy.cpp:
906         (WebCore::SecurityPolicy::generateReferrerHeader): Updated since we
907         changed ReferrerHeaderPolicy back to ReferrerPolicy.
908         * page/SecurityPolicy.h: Ditto.
909
910         * platform/ReferrerPolicy.h: Changed ReferrerHeaderPolicy name back
911         to ReferrerPolicy now that nesting inside a class eliminated the conflict;
912         still should merge them and that FIXME remains.
913
914         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
915         (WebPlaybackSessionModelMediaElement::updateForEventName): Updated.
916         (WebPlaybackSessionModelMediaElement::updateLegibleOptions): Ditto.
917
918         * testing/Internals.cpp:
919         (WebCore::toResourceRequestCachePolicy): Updated.
920         (WebCore::Internals::setOverrideCachePolicy): Ditto.
921         (WebCore::toResourceLoadPriority): Ditto.
922         (WebCore::Internals::setOverrideResourceLoadPriority): Ditto.
923         (WebCore::toAutoFillButtonType): Ditto.
924         (WebCore::Internals::setShowAutoFillButton): Ditto.
925
926         * testing/Internals.h: Moved enum class types into class.
927
928         * testing/Internals.idl: Removed the "Internals" prefixes we added
929         to resolve ambiguity before. Nesting these in the class now takes care
930         of the ambiguity instead.
931
932         * xml/XMLHttpRequest.cpp:
933         (WebCore::XMLHttpRequest::responseText): Updated.
934         (WebCore::XMLHttpRequest::didCacheResponseJSON): Ditto.
935         (WebCore::XMLHttpRequest::responseXML): Ditto.
936         (WebCore::XMLHttpRequest::responseBlob): Ditto.
937         (WebCore::XMLHttpRequest::responseArrayBuffer): Ditto.
938         (WebCore::XMLHttpRequest::setResponseType): Ditto.
939         (WebCore::XMLHttpRequest::open): Ditto.
940         (WebCore::shouldDecodeResponse): Ditto.
941
942         * xml/XMLHttpRequest.h: Moved the enum class into the class.
943
944 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
945
946         Don't run transitions to/from 'auto' values
947         https://bugs.webkit.org/show_bug.cgi?id=38243
948         rdar://problem/20904225
949
950         Reviewed by Dean Jackson.
951         
952         The specified behavior of transitions and animations is to not animate when either endpoint is 'auto'.
953         Previously, we were treating 'auto' as zero and interpolating, which caused unwanted animations
954         on fandango.com, airbnb.com and others.
955         
956         Fix by having blend() return the from value if progress is 0, otherwise the to value. The
957         isZero() check can be removed, since this was effectively picking up auto value for one endpoint.
958
959         Tests: transitions/lengthsize-transition-to-from-auto.html
960                transitions/transition-to-from-auto.html
961
962         * platform/Length.cpp:
963         (WebCore::blend):
964
965 2016-05-02  Chris Dumez  <cdumez@apple.com>
966
967         Indexing CSSStyleDeclaration object with out-of-range index should return undefined
968         https://bugs.webkit.org/show_bug.cgi?id=157283
969
970         Reviewed by Darin Adler.
971
972         Indexing CSSStyleDeclaration object with out-of-range index should return undefined,
973         as per:
974         - http://heycam.github.io/webidl/#idl-indexed-properties
975         - http://heycam.github.io/webidl/#getownproperty-guts
976
977         WebKit was incorrectly returning the empty string in this case. We however, still
978         return the empty string if calling the indexed property getter via item(), as is
979         expected.
980
981         The new behavior matches Firefox and the Web IDL specification. Chrome returns the
982         empty string in this case though.
983
984         Test: fast/dom/indexed-getters-returning-string.html
985
986         * css/CSSComputedStyleDeclaration.cpp:
987         (WebCore::CSSComputedStyleDeclaration::item):
988         * css/PropertySetCSSStyleDeclaration.cpp:
989         (WebCore::PropertySetCSSStyleDeclaration::item):
990
991 2016-05-02  Antoine Quint  <graouts@apple.com>
992
993         Specifying a longhand property should not serialize to a shorthand property
994         https://bugs.webkit.org/show_bug.cgi?id=157180
995
996         Reviewed by Dean Jackson.
997
998         Ensure that we don't serialize to a shorthand property when the required longhand components
999         are not specified, per http://www.w3.org/TR/cssom-1/#serialize-a-css-declaration-block.
1000
1001         Test: fast/css/no-shorthand-with-incomplete-longhands.html
1002
1003         * css/StyleProperties.cpp:
1004         (WebCore::StyleProperties::getLayeredShorthandValue):
1005         Returning an empty string here means that calling getPropertyValue() with
1006         the shorthand property matching the currently processed longhand property
1007         in asText() will return an empty string as well and the shorthand property
1008         will be disregarded.
1009
1010 2016-05-02  Dean Jackson  <dino@apple.com>
1011
1012         REGRESSION: Page layout of Manga/Picture books and all Fixed Layout ePubs corrupted
1013         https://bugs.webkit.org/show_bug.cgi?id=157292
1014         <rdar://problem/25750144>
1015
1016         Reviewed by Tim Horton.
1017
1018         The scroll state restoration fixes caused a regression in UIWebViews.
1019         Code in UIKit checks for a non-zero page scale in a history item, and
1020         r199233 changed the initialization from 0 to 1.
1021
1022         * history/HistoryItem.h: Use 0 instead of 1 as the initial m_scale.
1023
1024 2016-05-02  Eric Carlson  <eric.carlson@apple.com>
1025
1026         [Mac] AirPlay fails if target is set before AVPlayer has been created
1027         https://bugs.webkit.org/show_bug.cgi?id=157147
1028         <rdar://problem/24197592>
1029
1030         Reviewed by Dean Jackson.
1031
1032         No new tests, it won't be possible to test this until 
1033         https://bugs.webkit.org/show_bug.cgi?id=157290 has been fixed.
1034
1035         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1036         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1037
1038 2016-05-02  Brady Eidson  <beidson@apple.com>
1039
1040         Const-ify some IDB code.
1041         https://bugs.webkit.org/show_bug.cgi?id=157287
1042
1043         Reviewed by Alex Christensen.
1044
1045         No new tests (Refactor only).
1046
1047         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1048         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1049         (WebCore::InProcessIDBServer::deleteDatabase):
1050         (WebCore::InProcessIDBServer::openDatabase):
1051         (WebCore::InProcessIDBServer::abortTransaction):
1052         (WebCore::InProcessIDBServer::commitTransaction):
1053         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
1054         * Modules/indexeddb/shared/InProcessIDBServer.h:
1055
1056 2016-05-02  Antti Koivisto  <antti@apple.com>
1057
1058         REGRESSION(r199964): Animation on pseudo elements doesn't trigger if first frame matches the current style
1059         https://bugs.webkit.org/show_bug.cgi?id=157284
1060
1061         Reviewed by Simon Fraser.
1062
1063         r199964 accidentally changed the logic for computing style change for animations.
1064
1065         Test: fast/css/animation-pseudo-style-change.html
1066
1067         * style/RenderTreeUpdater.cpp:
1068         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
1069
1070             If there is an animated style determine the style change using it rather than the originally resolved style.
1071
1072         * style/StyleTreeResolver.cpp:
1073         (WebCore::Style::TreeResolver::resolveElement):
1074
1075             Here too.
1076
1077 2016-05-02  Brady Eidson  <beidson@apple.com>
1078
1079         Add the ability to accumulate logs for specific logging channels to help diagnose test timeouts.
1080         https://bugs.webkit.org/show_bug.cgi?id=157274
1081
1082         Reviewed by Alex Christensen.
1083
1084         * platform/Logging.cpp:
1085         (WebCore::setLogChannelToAccumulate): Set the given log channel to accumulate logging,
1086           and dirty the initializeLoggingChannelsIfNecessary flag.
1087         (WebCore::initializeLoggingChannelsIfNecessary): Change from being a one-time-only call to a 
1088           one-time-for-each-time-somebody-calls-setLogChannelToAccumulate call.
1089         * platform/Logging.h:
1090
1091         * testing/js/WebCoreTestSupport.cpp:
1092         (WebCoreTestSupport::setLogChannelToAccumulate):
1093         (WebCoreTestSupport::initializeLoggingChannelsIfNecessary):
1094         * testing/js/WebCoreTestSupport.h:
1095
1096 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
1097
1098         Sort the project file.
1099
1100         * WebCore.xcodeproj/project.pbxproj:
1101
1102 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
1103
1104         Make Length, LengthSize and LengthPoint blending not use member functions
1105         https://bugs.webkit.org/show_bug.cgi?id=157281
1106
1107         Reviewed by Zalan Bujtas.
1108
1109         Having blend() be a member function is ambiguous because it's hard to tell which are
1110         the 'from' and 'to' values. Fix Length, LengthSize and LengthPoint accordingly.
1111
1112         No behavior change.
1113
1114         * page/animation/CSSPropertyAnimation.cpp:
1115         (WebCore::blendFunc):
1116         * platform/Length.cpp:
1117         (WebCore::blendMixedTypes):
1118         (WebCore::blend):
1119         (WebCore::Length::blendMixedTypes): Deleted.
1120         * platform/Length.h:
1121         (WebCore::Length::blend): Deleted.
1122         * platform/LengthPoint.h:
1123         (WebCore::blend):
1124         (WebCore::LengthPoint::blend): Deleted.
1125         * platform/LengthSize.h:
1126         (WebCore::blend):
1127         (WebCore::LengthSize::blend): Deleted.
1128         * platform/graphics/filters/FilterOperation.cpp:
1129         (WebCore::BlurFilterOperation::blend):
1130         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1131         (WebCore::TranslateTransformOperation::blend):
1132         * rendering/style/BasicShapes.cpp:
1133         (WebCore::BasicShapePolygon::blend):
1134         (WebCore::BasicShapeInset::blend):
1135         * rendering/style/BasicShapes.h:
1136         (WebCore::BasicShapeCenterCoordinate::blend):
1137         (WebCore::BasicShapeRadius::blend):
1138
1139 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
1140
1141         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
1142         https://bugs.webkit.org/show_bug.cgi?id=157277
1143
1144         Reviewed by Dean Jackson, Tim Horton.
1145
1146         shouldUpdateScrollLayerPositionSynchronously() gave an answer for the main frame even if
1147         called for a subframe. This could have caused scroll snapping, and isRubberBandInProgress()
1148         to give wrong answers sometimes. Fix by passing in the FrameView.
1149
1150         I was unable to easily come up with a testcase to detect the incorrect behavior.
1151
1152         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
1153
1154         * page/FrameView.cpp:
1155         (WebCore::FrameView::isScrollSnapInProgress):
1156         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
1157         (WebCore::FrameView::isRubberBandInProgress):
1158         (WebCore::FrameView::updatesScrollLayerPositionOnMainThread): Deleted.
1159         * page/FrameView.h:
1160         * page/scrolling/ScrollingCoordinator.cpp:
1161         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
1162         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
1163         * page/scrolling/ScrollingCoordinator.h:
1164         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1165         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
1166         * platform/ScrollableArea.h:
1167         * platform/win/PopupMenuWin.h:
1168         * rendering/RenderLayer.cpp:
1169         (WebCore::RenderLayer::setupFontSubpixelQuantization):
1170         * rendering/RenderLayer.h:
1171         * rendering/RenderListBox.h:
1172
1173 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
1174
1175         Add to the Animations log channel output about which properties are being blended
1176         https://bugs.webkit.org/show_bug.cgi?id=157271
1177
1178         Reviewed by Dean Jackson.
1179
1180         Make the Animations log channel dump information as CSS properties are being blended.
1181         Sample output:
1182
1183           blending left from 0px to 400px at 0.57 -> 227.76px
1184           blending transform from translate(0px, 0px, 0px) to translate(400px, 0px, 0px) at 0.74 -> translate(294.97px, 0px, 0px)
1185
1186         This makes it easier to see, for example, transitions to or from "auto" values.
1187
1188         * CMakeLists.txt:
1189         * WebCore.xcodeproj/project.pbxproj:
1190         * page/animation/CSSPropertyAnimation.cpp:
1191         (WebCore::PropertyWrapperGetter::value):
1192         (WebCore::PropertyWrapperMaybeInvalidColor::value):
1193         (WebCore::CSSPropertyAnimationWrapperMap::wrapperForProperty):
1194         (WebCore::CSSPropertyAnimation::blendProperties):
1195         * platform/Length.cpp:
1196         (WebCore::operator<<):
1197         * platform/LengthBox.h:
1198         * platform/graphics/transforms/IdentityTransformOperation.h:
1199         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1200         (WebCore::Matrix3DTransformOperation::dump):
1201         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1202         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1203         (WebCore::MatrixTransformOperation::dump):
1204         * platform/graphics/transforms/MatrixTransformOperation.h:
1205         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1206         (WebCore::PerspectiveTransformOperation::dump):
1207         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1208         * platform/graphics/transforms/RotateTransformOperation.cpp:
1209         (WebCore::RotateTransformOperation::dump):
1210         * platform/graphics/transforms/RotateTransformOperation.h:
1211         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1212         (WebCore::ScaleTransformOperation::dump):
1213         * platform/graphics/transforms/ScaleTransformOperation.h:
1214         * platform/graphics/transforms/SkewTransformOperation.cpp:
1215         (WebCore::SkewTransformOperation::dump):
1216         * platform/graphics/transforms/SkewTransformOperation.h:
1217         * platform/graphics/transforms/TransformOperation.h:
1218         * platform/graphics/transforms/TransformOperations.cpp:
1219         (WebCore::operator<<):
1220         * platform/graphics/transforms/TransformOperations.h:
1221         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1222         (WebCore::TranslateTransformOperation::dump):
1223         * platform/graphics/transforms/TranslateTransformOperation.h:
1224         * rendering/style/NinePieceImage.cpp:
1225         (WebCore::operator<<):
1226         * rendering/style/NinePieceImage.h:
1227         * svg/SVGLength.cpp:
1228         (WebCore::operator<<):
1229         * svg/SVGLength.h:
1230
1231 2016-05-02  Chris Dumez  <cdumez@apple.com>
1232
1233         Modernize HTMLConstructionSite
1234         https://bugs.webkit.org/show_bug.cgi?id=157279
1235
1236         Reviewed by Alex Christensen.
1237
1238         Modernize HTMLConstructionSite: Use less raw pointers, more auto, more
1239         range loops and more nullptr.
1240
1241         * dom/ScriptElement.h:
1242         * html/parser/HTMLConstructionSite.cpp:
1243         (WebCore::setAttributes):
1244         (WebCore::shouldUseLengthLimit):
1245         (WebCore::executeReparentTask):
1246         (WebCore::HTMLConstructionSite::attachLater):
1247         (WebCore::HTMLConstructionSite::executeQueuedTasks):
1248         (WebCore::HTMLConstructionSite::HTMLConstructionSite):
1249         (WebCore::HTMLConstructionSite::takeForm):
1250         (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
1251         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
1252         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
1253         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
1254         (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
1255         (WebCore::HTMLConstructionSite::setDefaultCompatibilityMode):
1256         (WebCore::HTMLConstructionSite::setCompatibilityMode):
1257         (WebCore::HTMLConstructionSite::finishedParsing):
1258         (WebCore::HTMLConstructionSite::insertDoctype):
1259         (WebCore::HTMLConstructionSite::insertComment):
1260         (WebCore::HTMLConstructionSite::insertCommentOnDocument):
1261         (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
1262         (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
1263         (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
1264         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
1265         (WebCore::HTMLConstructionSite::insertHTMLElement):
1266         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
1267         (WebCore::HTMLConstructionSite::insertCustomElement):
1268         (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
1269         (WebCore::HTMLConstructionSite::insertFormattingElement):
1270         (WebCore::HTMLConstructionSite::insertScriptElement):
1271         (WebCore::HTMLConstructionSite::insertForeignElement):
1272         (WebCore::HTMLConstructionSite::insertTextNode):
1273         (WebCore::HTMLConstructionSite::reparent):
1274         (WebCore::HTMLConstructionSite::insertAlreadyParsedChild):
1275         (WebCore::HTMLConstructionSite::takeAllChildren):
1276         (WebCore::HTMLConstructionSite::createElement):
1277         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1278         (WebCore::HTMLConstructionSite::createHTMLElement):
1279         (WebCore::HTMLConstructionSite::createElementFromSavedToken):
1280         (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
1281         (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
1282         (WebCore::HTMLConstructionSite::findFosterSite):
1283         (WebCore::HTMLConstructionSite::shouldFosterParent):
1284         (WebCore::HTMLConstructionSite::fosterParent):
1285         (WebCore::HTMLConstructionSite::~HTMLConstructionSite): Deleted.
1286         (WebCore::HTMLConstructionSite::setForm): Deleted.
1287         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): Deleted.
1288         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode): Deleted.
1289         (WebCore::HTMLConstructionSite::generateImpliedEndTagsWithExclusion): Deleted.
1290         * html/parser/HTMLConstructionSite.h:
1291         (WebCore::HTMLConstructionSite::inQuirksMode):
1292         (WebCore::HTMLConstructionSite::isTelephoneNumberParsingEnabled):
1293         (WebCore::HTMLConstructionSite::RedirectToFosterParentGuard::RedirectToFosterParentGuard):
1294         * html/parser/HTMLElementStack.cpp:
1295         (WebCore::HTMLNames::isRootNode):
1296         (WebCore::HTMLElementStack::ElementRecord::ElementRecord):
1297         (WebCore::HTMLElementStack::ElementRecord::replaceElement):
1298         (WebCore::HTMLElementStack::ElementRecord::isAbove):
1299         (WebCore::HTMLElementStack::popAll):
1300         (WebCore::HTMLElementStack::popUntil):
1301         (WebCore::HTMLElementStack::popUntilPopped):
1302         (WebCore::HTMLElementStack::pushRootNode):
1303         (WebCore::HTMLElementStack::pushHTMLHtmlElement):
1304         (WebCore::HTMLElementStack::pushRootNodeCommon):
1305         (WebCore::HTMLElementStack::pushHTMLHeadElement):
1306         (WebCore::HTMLElementStack::pushHTMLBodyElement):
1307         (WebCore::HTMLElementStack::push):
1308         (WebCore::HTMLElementStack::insertAbove):
1309         (WebCore::HTMLElementStack::removeHTMLHeadElement):
1310         (WebCore::HTMLElementStack::remove):
1311         (WebCore::HTMLElementStack::contains):
1312         (WebCore::inScopeCommon):
1313         (WebCore::HTMLElementStack::hasNumberedHeaderElementInScope):
1314         (WebCore::HTMLElementStack::inScope):
1315         (WebCore::HTMLElementStack::pushCommon):
1316         (WebCore::HTMLElementStack::popCommon):
1317         (WebCore::HTMLElementStack::removeNonTopCommon):
1318         (WebCore::HTMLElementStack::show):
1319         (WebCore::HTMLElementStack::hasOnlyOneElement): Deleted.
1320         (WebCore::HTMLElementStack::secondElementIsHTMLBodyElement): Deleted.
1321         (WebCore::HTMLElementStack::pop): Deleted.
1322         (WebCore::HTMLElementStack::popUntilTableScopeMarker): Deleted.
1323         (WebCore::HTMLElementStack::oneBelowTop): Deleted.
1324         * html/parser/HTMLElementStack.h:
1325         (WebCore::HTMLElementStack::ElementRecord::stackItem):
1326         (WebCore::HTMLElementStack::ElementRecord::setNext): Deleted.
1327         (WebCore::HTMLElementStack::popUntilPopped): Deleted.
1328         * html/parser/HTMLFormattingElementList.cpp:
1329         (WebCore::HTMLFormattingElementList::contains):
1330         (WebCore::HTMLFormattingElementList::swapTo):
1331         (WebCore::HTMLFormattingElementList::append):
1332         (WebCore::HTMLFormattingElementList::remove):
1333         (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
1334         (WebCore::HTMLFormattingElementList::ensureNoahsArkCondition):
1335         * html/parser/HTMLFormattingElementList.h:
1336         (WebCore::HTMLFormattingElementList::Entry::Entry):
1337         (WebCore::HTMLFormattingElementList::Entry::replaceElement):
1338         (WebCore::HTMLFormattingElementList::Bookmark::Bookmark):
1339         (WebCore::HTMLFormattingElementList::Bookmark::moveToAfter):
1340         (WebCore::HTMLFormattingElementList::Bookmark::mark):
1341         (WebCore::HTMLFormattingElementList::first):
1342         (WebCore::HTMLFormattingElementList::Entry::isMarker): Deleted.
1343         (WebCore::HTMLFormattingElementList::Entry::stackItem): Deleted.
1344         (WebCore::HTMLFormattingElementList::Entry::operator!=): Deleted.
1345         * html/parser/HTMLTreeBuilder.cpp:
1346         (WebCore::HTMLTreeBuilder::processDoctypeToken):
1347         (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
1348         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1349         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
1350         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
1351         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
1352         (WebCore::HTMLTreeBuilder::processStartTag):
1353         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
1354         (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
1355         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
1356         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
1357         (WebCore::HTMLTreeBuilder::processComment):
1358         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
1359         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
1360         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
1361         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
1362         (WebCore::HTMLTreeBuilder::processScriptStartTag):
1363         (WebCore::HTMLTreeBuilder::processTokenInForeignContent):
1364
1365 2016-05-02  Per Arne Vollan  <peavo@outlook.com>
1366
1367         Remove unneeded casts once we upgrade to a version of Visual Studio that is not broken
1368         https://bugs.webkit.org/show_bug.cgi?id=121235
1369
1370         Reviewed by Darin Adler.
1371
1372         * css/MediaQueryEvaluator.cpp:
1373         (WebCore::createFunctionMap):
1374         * dom/make_names.pl:
1375         (printWrapperFactoryCppFile):
1376         * loader/archive/ArchiveFactory.cpp:
1377         (WebCore::archiveMIMETypes):
1378         * rendering/svg/SVGPathData.cpp:
1379         (WebCore::updatePathFromGraphicsElement):
1380
1381 2016-05-02  Anders Carlsson  <andersca@apple.com>
1382
1383         Fix build.
1384
1385         * platform/mac/WebPlaybackControlsManager.h:
1386
1387 2016-05-02  Sam Weinig  <sam@webkit.org>
1388
1389         DataDetector underline color should be based on the text color
1390         https://bugs.webkit.org/show_bug.cgi?id=157272
1391
1392         Fixes:
1393             <rdar://problem/25663930> DataDetectors links should use the default text color for their parent nodes
1394             <rdar://problem/25663983> DataDetectors links underline color update
1395
1396         Reviewed by Tim Horton.
1397
1398         * editing/cocoa/DataDetection.mm:
1399         (WebCore::DataDetection::detectContentInRange):
1400         When using light links, use the color of the parent element as the text color, and that same color with
1401         20% alpha as the underline color.
1402
1403 2016-05-01  Ryosuke Niwa  <rniwa@webkit.org>
1404
1405         document.currentScript must be null when we're executing a script inside a shadow tree
1406         https://bugs.webkit.org/show_bug.cgi?id=157245
1407
1408         Reviewed by Darin Adler.
1409
1410         Fix the bug by not setting currentScript as spec'ed in HTML5 specification:
1411         https://html.spec.whatwg.org/multipage/dom.html#dom-document-currentscript
1412         https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
1413         as of 3dc763829ca1598427b588cf08830c1e2af5a05c
1414
1415         New behavior matches that of Google Chrome Canary.
1416
1417         Test: fast/shadow-dom/Document-prototype-currentScript.html
1418
1419         * dom/CurrentScriptIncrementer.h:
1420         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
1421         (WebCore::CurrentScriptIncrementer::~CurrentScriptIncrementer):
1422         * dom/ScriptElement.cpp:
1423         (WebCore::ScriptElement::executeScript):
1424
1425 2016-04-29  Alex Christensen  <achristensen@webkit.org>
1426
1427         Do not reuse cache entries with conditional headers
1428         https://bugs.webkit.org/show_bug.cgi?id=157205
1429         rdar://problem/25856933
1430
1431         Reviewed by Chris Dumez.
1432
1433         Test: http/tests/xmlhttprequest/if-modified-since-0.html
1434
1435         * loader/cache/CachedRawResource.cpp:
1436         (WebCore::CachedRawResource::canReuse):
1437         CachedResourceLoader::determineRevalidationPolicy asserts that the request is not conditional,
1438         which means that it does not have any headers like If-Modified-Since.  They are usually different,
1439         because we put the timestamp in the If-Modified-Since header, so it fails the canReuse test because
1440         time has passed since the last If-Modified-Since header was sent.  When a user sets the If-Modified-Since
1441         manually to something that is constant, we reuse cache entries when we should not.
1442         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1443         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1444         Set the source so we can use it in Internals.
1445
1446 2016-05-02  Yoav Weiss  <yoav@yoav.ws>
1447
1448         Speculatively fix the cmake build
1449         https://bugs.webkit.org/show_bug.cgi?id=157262
1450
1451         Reviewed by Darin Adler.
1452
1453         This patch adds WEB_TIMING build flag guards around calls to DOMWindow()->performance(),
1454         in order to make sure builds that have WEB_TIMING disabled (e.g. cmake on Mac) continue
1455         to build.
1456
1457         No new tests as there's no functional change.
1458
1459         * loader/cache/CachedResourceLoader.cpp:
1460         (WebCore::CachedResourceLoader::loadDone):
1461
1462 2016-05-02  Daniel Bates  <dabates@apple.com>
1463
1464         CSP: Add workaround for XtraMath
1465         https://bugs.webkit.org/show_bug.cgi?id=157252
1466
1467         Reviewed by Andy Estes.
1468
1469         * platform/RuntimeApplicationChecks.h:
1470         * platform/RuntimeApplicationChecks.mm:
1471         (WebCore::IOSApplication::isXtraMath): Added.
1472
1473 2016-05-02  Daniel Bates  <dabates@apple.com>
1474
1475         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
1476         https://bugs.webkit.org/show_bug.cgi?id=147672
1477         <rdar://problem/22357464>
1478
1479         Reviewed by Brady Eidson.
1480
1481         Schedule a DatabaseCloseTask when Database::close() is called from a thread other than the
1482         database thread as the database thread is responsible for interacting with the database.
1483
1484         Currently -[WebDatabaseManager startBackgroundTask] and WebProcess::processWillSuspendImminently()
1485         call DatabaseTracker::closeAllDatabases() indirectly and directly, respectively, from a
1486         thread other than the database thread. In a debug build, this causes an assertion failure
1487         in Database::close(). In a release/production build, this starts a race between the calling
1488         thread and the database thread that can lead to a crash. It is the responsibility of the
1489         database thread to manage the database. We should ensure that calling Database::close()
1490         delegates the responsibility of actually closing the database to the database thread to
1491         avoid interfering with the database thread or the need to synchronize access to data
1492         structures used by the database thread.
1493
1494         * Modules/webdatabase/Database.cpp:
1495         (WebCore::Database::interrupt): Added. Turns around and calls SQLiteDatabase::interrupt().
1496         (WebCore::Database::close): Added. Schedules a DatabaseCloseTask to close the database and
1497         wait for it to complete if we have not already scheduled closing the database.
1498         (WebCore::Database::performClose): Renamed; formerly named close.
1499         (WebCore::Database::markAsDeletedAndClose): Extracted logic to schedule a DatabaseCloseTask
1500         from here to Database::close() and modified this function to call Database::close().
1501         * Modules/webdatabase/Database.h:
1502         * Modules/webdatabase/DatabaseTask.cpp:
1503         (WebCore::DatabaseCloseTask::doPerformTask): Call Database::performClose() instead of Database::close()
1504         as the latter has been repurposed to schedule closing the database.
1505         * Modules/webdatabase/DatabaseThread.cpp:
1506         (WebCore::DatabaseThread::databaseThread): Ditto.
1507         * Modules/webdatabase/DatabaseTracker.cpp:
1508         (WebCore::DatabaseTracker::closeAllDatabases): Added argument currentQueryBehavior (defaults
1509         to CurrentQueryBehavior::RunToCompletion - close every database after completion of the
1510         current database query, if any).
1511         * Modules/webdatabase/DatabaseTracker.h:
1512         * platform/sql/SQLiteDatabase.cpp:
1513         (WebCore::SQLiteDatabase::interrupt): Added. This is safe to call regardless of the state
1514         of the database and thread safe by <https://www.sqlite.org/c3ref/interrupt.html>.
1515         * platform/sql/SQLiteDatabase.h:
1516
1517 2016-05-02  Yoav Weiss  <yoav@yoav.ws>
1518
1519         Move ResourceTiming behind a runtime flag
1520         https://bugs.webkit.org/show_bug.cgi?id=157133
1521
1522         Reviewed by Alex Christensen.
1523
1524         Move the ResourceTiming API from being behind a build time flag to be behind an
1525         off-by-default runtime flag, that can be turned on using internals.
1526
1527         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
1528                http/tests/performance/performance-resource-timing-entries.html
1529
1530         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
1531         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
1532         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
1533         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
1534         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
1535         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
1536         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
1537         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming, and replaced PERFORMANCE_TIMELINE for WEB_TIMING.
1538         Added build flag around UserTiming related h files.
1539         (WebCore::toJS): Deleted.
1540         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
1541         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
1542         (WebCore::DocumentThreadableLoader::loadRequest):
1543         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
1544         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
1545         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
1546         (WebCore::CachedResourceLoader::revalidateResource):
1547         (WebCore::CachedResourceLoader::loadResource):
1548         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
1549         (WebCore::CachedResourceLoader::loadDone):
1550         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
1551         * page/Performance.cpp: Remove #if for ResourceTiming.
1552         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
1553         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
1554         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
1555         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
1556         * page/Performance.h: Remove #if for ResourceTiming.
1557         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
1558         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
1559         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
1560         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
1561         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
1562         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
1563         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
1564         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
1565         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
1566         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
1567         * testing/Internals.cpp: Add a method that enables ResourceTiming.
1568         (WebCore::Internals::setResourceTimingSupport):
1569         * testing/Internals.h: Add a method that enables ResourceTiming.
1570         * testing/Internals.idl: Add a method that enables ResourceTiming.
1571
1572 2016-05-01  Nan Wang  <n_wang@apple.com>
1573
1574         AX: Crash at  WebCore::AccessibilityObject::getAttribute const + 9
1575         https://bugs.webkit.org/show_bug.cgi?id=157256
1576
1577         Reviewed by Chris Fleizach.
1578
1579         When the <label> for the input element has no renderer, it will cause
1580         crash when we ask for the title element text. Fixed it by getting the 
1581         aria-label attribute directly from the <label> element instead of its 
1582         accessibility object. 
1583
1584         Test case covered in accessibility/mac/aria-label-on-label-element.html.
1585
1586         * accessibility/AccessibilityNodeObject.cpp:
1587         (WebCore::AccessibilityNodeObject::titleElementText):
1588
1589 2016-05-01  Darin Adler  <darin@apple.com>
1590
1591         Stop using string-based enumerations in TextTrack, and eliminate support for string-based enumerations
1592         https://bugs.webkit.org/show_bug.cgi?id=157253
1593
1594         Reviewed by Chris Dumez.
1595
1596         This was the most difficult case to convert from the old style of enumeration to enum class.
1597         Afterward there is a bit of messy duplication, but it still seems like an improvement overall.
1598
1599         After this patch, I plan to change the rule for the name of the enumeration; instead of
1600         living at the top level of the WebCore namespace, we will look for them inside the class for the
1601         first interface defined in the same file along with the enumeration, and remove the name prefix,
1602         if the interfaces's name is a prefix of the enumerations's name.
1603
1604         Once that's done, next step is to do something in the bindings for dictionaries. And adopt both the
1605         enumeration and dictionary mechanisms more widely, and remove the old use of "dictionary" as a type name.
1606
1607         * Modules/mediasource/MediaSource.cpp:
1608         (WebCore::MediaSource::removeSourceBuffer): Use enum values instead of keywords.
1609         * Modules/mediasource/SourceBuffer.cpp:
1610         (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
1611
1612         * bindings/js/JSTextTrackCustom.cpp:
1613         (WebCore::JSTextTrack::setKind): Deleted.
1614
1615         * bindings/scripts/CodeGenerator.pm:
1616         (IsStringBasedEnumType): Deleted.
1617
1618         * bindings/scripts/CodeGeneratorJS.pm:
1619         (GetEnumerationImplementationContent): Removed IsStringBasedEnumType check.
1620         (GenerateParametersCheck): Ditto.
1621         (GenerateImplementation): Ditto.
1622         (GetNativeType): Ditto.
1623         (JSValueToNative): Ditto.
1624
1625         * html/HTMLMediaElement.cpp:
1626         (WebCore::HTMLMediaElement::loadInternal): Use enum values instead of keywords.
1627         (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
1628         (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
1629         (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
1630         (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
1631         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
1632         (WebCore::HTMLMediaElement::configureTextTrackGroup): Ditto.
1633         (WebCore::HTMLMediaElement::setSelectedTextTrack): Ditto.
1634         (WebCore::HTMLMediaElement::configureTextTracks): Ditto.
1635         (WebCore::HTMLMediaElement::hasClosedCaptions): Ditto.
1636         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
1637         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Ditto.
1638         (WebCore::toPlatform): Added helpers for the outOfBandTrackSources function.
1639         (WebCore::HTMLMediaElement::outOfBandTrackSources): Removed unneeded fastHasAttribute
1640         check since getNonEmptyURLAttribute already returns an empty URL when the attribute is
1641         not present. Changed to use enum values instead of keywords.
1642
1643         * html/HTMLTrackElement.cpp:
1644         (WebCore::HTMLTrackElement::parseAttribute): Use new setKindKeywordIgnoringASCIICase
1645         function rather than calling setKind and convertToASCIILowercase. Also use ensureTrack
1646         instead of track since the latter is a cover that calls it and dumbs down the return type.
1647         (WebCore::HTMLTrackElement::kind): Changed return type to const AtomicString& since
1648         that's what we will have for kind keywords and because it matches what we normally have
1649         for attribute getting fuctions. Also use ensureTrack.
1650         (WebCore::HTMLTrackElement::setKind): Changed argument to AtomicString so we don't waste
1651         time making a string and then destroying it before turning it into an AtomicString so it
1652         can be an attribute value.
1653         (WebCore::HTMLTrackElement::srclang): Changed return type to const AtomicString& as is
1654         customary and efficient for attribute value convenience functions. Also use fastGetAttribute.
1655         (WebCore::HTMLTrackElement::setSrclang): Deleted.
1656         (WebCore::HTMLTrackElement::label): Ditto.
1657         (WebCore::HTMLTrackElement::setLabel): Deleted.
1658         (WebCore::HTMLTrackElement::setIsDefault): Deleted.
1659         (WebCore::HTMLTrackElement::scheduleLoad): Use enum values instead of keywords.
1660
1661         * html/HTMLTrackElement.h: Use pragma once. Update for changes mentioned above.
1662         Also mark things final instead of override as per our recent style discussion.
1663
1664         * html/HTMLTrackElement.idl: Use [Reflect] for srclang and label.
1665
1666         * html/shadow/MediaControlElements.cpp:
1667         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Use enum value
1668         instead of keyword.
1669         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Ditto.
1670
1671         * html/track/AudioTrack.cpp:
1672         (WebCore::AudioTrack::AudioTrack): Use new base class MediaTrackBase.
1673
1674         * html/track/AudioTrack.h: Use pragma once. Make base class be MediaTrackBase instead
1675         of TrackBase.
1676
1677         * html/track/InbandTextTrack.cpp:
1678         (WebCore::InbandTextTrack::setMode): Change argument type to enum instead of string.
1679         (WebCore::toPrivate): Added. Helper for setModeInternal.
1680         (WebCore::InbandTextTrack::setModeInternal): Change argument type to enum instead of string.
1681         (WebCore::InbandTextTrack::updateKindFromPrivate): Use enum instead of string to call setKind.
1682
1683         * html/track/InbandTextTrack.h: Use pragma once. Use TextTrackMode for argument types.
1684
1685         * html/track/TextTrack.cpp:
1686         (WebCore::captionsKeyword): Converted this to a non-member function since it is now
1687         private to this file.
1688         (WebCore::descriptionsKeyword): Ditto.
1689         (WebCore::chaptersKeyword): Ditto.
1690         (WebCore::metadataKeyword): Ditto.
1691         (WebCore::forcedKeyword): Ditto.
1692         (WebCore::TextTrack::disabledKeyword): Deleted.
1693         (WebCore::TextTrack::hiddenKeyword): Deleted.
1694         (WebCore::TextTrack::showingKeyword): Deleted.
1695         (WebCore::TextTrack::TextTrack): Moved some initialization to be done in the header where
1696         the data members are defined. Put the code that is the equivalent to setKindInternal here,
1697         because it turns out it's not needed anywhere else. Over time we might change the types
1698         involved and there's no need to have that be across multiple functions.
1699         (WebCore::TextTrack::~TextTrack): Removed unneeded call to clearClient, right when the
1700         object is about to be destroyed. Perhaps there was an illusion that the old call might
1701         be a virtual function call that invokes the clearClient from a derived class, but that
1702         doesn't work in a destructor, so this code was only clearing out the data member and
1703         that does not need to be done.
1704         (WebCore::TextTrack::isValidKind): Deleted.
1705         (WebCore::TextTrack::enabled): Use enum value instead of keyword.
1706         (WebCore::TextTrack::kindKeyword): Added. Function for callers who need a string, not the
1707         enum value.
1708         (WebCore::TextTrack::setKind): Take enum value instead of keyword. Also changed since
1709         we store the kind in a data member in this class, not inherited.
1710         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase): Added. For HTMLTrackElement to use
1711         when setting the kind attribute.
1712         (WebCore::TextTrack::setMode): Take enum value instread of keyword. Also removed assertion
1713         since the enum already makes it intrinsically clear what values are valid, unlike a string.
1714         (WebCore::TextTrack::cues): Use enum value instead of keyword.
1715         (WebCore::TextTrack::activeCues): Ditto.
1716         (WebCore::TextTrack::addCue): Ditto.
1717         (WebCore::TextTrack::ensureVTTRegionList): Changed return type to reference.
1718         (WebCore::TextTrack::regions): Use enum value instead of keyword.
1719         (WebCore::TextTrack::addRegion): Use reference.
1720         (WebCore::TextTrack::cueDidChange): Ditto.
1721         (WebCore::TextTrack::isRendered): Use enum values instead of keywords. Also write to be
1722         a boolean expression instead of a couple different if statements.
1723         (WebCore::TextTrack::ensureTextTrackCueList): Changed return type to reference.
1724         (WebCore::TextTrack::isMainProgramContent): Use enum value instead of keyword.
1725         (WebCore::TextTrack::containsOnlyForcedSubtitles): Ditto.
1726
1727         * html/track/TextTrack.h: Use pragma once. Removed unneeded include. Added enums for
1728         TextTrackKind and TextTrackMode. Updated for changes to functions listed above.
1729         Added m_mode and m_kind and initialized those data members and some others.
1730
1731         * html/track/TextTrack.idl: Tweaked formatting. Used ImplementedAs for the kind
1732         attribute rather than using a CustomSetter. This preserves the strange behavior
1733         where setting kind does nothing when !ENABLE(MEDIA_SOURCE). If we discover we don't
1734         need that, then we won't need ImplementedAs any more either.
1735
1736         * html/track/TextTrackCue.cpp:
1737         (WebCore::TextTrackCue::dispatchEvent): Use enum instad of keyword.
1738         (WebCore::TextTrackCue::isActive): Ditto.
1739
1740         * html/track/TrackBase.cpp:
1741         (WebCore::TrackBase::TrackBase): Removed unneeded initialization that is handled in
1742         the data member definition in the header now.
1743         (WebCore::MediaTrackBase::MediaTrackBase): Added. Calls through to TrackBase.
1744         (WebCore::MediaTrackBase::setKind): Moved to MediaTrackBase from TrackBase, because
1745         this isn't needed for text tracks.
1746         (WebCore::MediaTrackBase::setKindInternal): Ditto.
1747
1748         * html/track/TrackBase.h: Use pragma once. Move kind, setKind, isValidKind, defaultKindKeyword,
1749         setKindInternal, and m_kind all to a derived class, MediaTrackBase, since TextTrack doesn't need
1750         any of those any more. Later we might adopt enumerations more and it's possible the need for
1751         MediaTrackBase will go away.
1752
1753         * html/track/VideoTrack.cpp:
1754         (WebCore::VideoTrack::VideoTrack): Updated to use MediaTrackBase.
1755         (WebCore::VideoTrack::setLanguage): Ditto.
1756
1757         * html/track/VideoTrack.h: Use pragma once. Removed unneeded header include.
1758         Derive from MediaTrackBase instead of TrackBase.
1759
1760         * page/CaptionUserPreferences.cpp:
1761         (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Use enum values instead
1762         of keywords.
1763         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Ditto.
1764         * page/CaptionUserPreferencesMediaAF.cpp:
1765         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Ditto.
1766         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Ditto. Also used
1767         kindKeyword since we want a string for logging.
1768         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1769         (WebPlaybackSessionModelMediaElement::updateLegibleOptions): Ditto.
1770
1771 2016-05-01  Chris Dumez  <cdumez@apple.com>
1772
1773         Pass reference instead of pointer to IDL attribute setters if not nullable
1774         https://bugs.webkit.org/show_bug.cgi?id=157250
1775
1776         Reviewed by Darin Adler.
1777
1778         Update the bindings generator so that we pass wrapper types by reference
1779         to attribute setters instead of by raw pointer when the attribute is not
1780         marked as nullable in the IDL.
1781
1782         There is no intended Web-exposed behavior change.
1783
1784         * Modules/speech/SpeechSynthesisUtterance.idl:
1785         * Modules/webaudio/ConvolverNode.idl:
1786         * bindings/js/JSDataCueCustom.cpp:
1787         (WebCore::constructJSDataCue):
1788         * bindings/scripts/CodeGeneratorJS.pm:
1789         (GenerateImplementation):
1790         * bindings/scripts/CodeGeneratorObjC.pm:
1791         (GenerateImplementation):
1792
1793         * bindings/scripts/test/JS/JSTestInterface.cpp:
1794         * bindings/scripts/test/JS/JSTestObj.cpp:
1795         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
1796         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1797         Rebaseline bindings tests.
1798
1799         * dom/Document.cpp:
1800         (WebCore::Document::moveNodeIteratorsToNewDocument):
1801         * dom/NodeIterator.cpp:
1802         (WebCore::NodeIterator::NodePointer::NodePointer):
1803         (WebCore::NodeIterator::NodePointer::moveToNext):
1804         (WebCore::NodeIterator::NodePointer::moveToPrevious):
1805         (WebCore::NodeIterator::NodeIterator):
1806         (WebCore::NodeIterator::~NodeIterator):
1807         (WebCore::NodeIterator::updateForNodeRemoval):
1808         (WebCore::NodeIterator::NodePointer::clear): Deleted.
1809         (WebCore::NodeIterator::nextNode): Deleted.
1810         * dom/NodeIterator.h:
1811         * dom/Traversal.cpp:
1812         (WebCore::NodeIteratorBase::NodeIteratorBase):
1813         * dom/Traversal.h:
1814         (WebCore::NodeIteratorBase::root):
1815         * dom/TreeWalker.cpp:
1816         (WebCore::TreeWalker::setCurrentNode):
1817         (WebCore::TreeWalker::setCurrent):
1818         (WebCore::TreeWalker::parentNode):
1819         (WebCore::TreeWalker::firstChild):
1820         (WebCore::TreeWalker::lastChild):
1821         (WebCore::TreeWalker::traverseSiblings):
1822         (WebCore::TreeWalker::previousNode):
1823         (WebCore::TreeWalker::nextNode):
1824         * dom/TreeWalker.h:
1825         (WebCore::TreeWalker::currentNode):
1826         * dom/TreeWalker.idl:
1827         * html/HTMLAttachmentElement.idl:
1828         * html/HTMLInputElement.idl:
1829         * html/HTMLTableElement.idl:
1830         * html/track/DataCue.cpp:
1831         (WebCore::DataCue::DataCue):
1832         (WebCore::DataCue::setData):
1833         (WebCore::toDataCue): Deleted.
1834         * html/track/DataCue.h:
1835         * html/track/DataCue.idl:
1836
1837 2016-05-01  Commit Queue  <commit-queue@webkit.org>
1838
1839         Unreviewed, rolling out r200264 and r200266.
1840         https://bugs.webkit.org/show_bug.cgi?id=157251
1841
1842         This change caused existing LayoutTest media/media-source
1843         /media-source-stalled-holds-sleep-assertion.html to time out
1844         on Mac on every run. (Requested by ryanhaddad on #webkit).
1845
1846         Reverted changesets:
1847
1848         "[Mac] AirPlay fails if target is set before AVPlayer has been
1849         created"
1850         https://bugs.webkit.org/show_bug.cgi?id=157147
1851         http://trac.webkit.org/changeset/200264
1852
1853         "[Mac] AirPlay fails if target is set before AVPlayer has been
1854         created"
1855         https://bugs.webkit.org/show_bug.cgi?id=157147
1856         http://trac.webkit.org/changeset/200266
1857
1858 2016-05-01  Chris Dumez  <cdumez@apple.com>
1859
1860         Drop CanUseWTFOptionalForParameter() from bindings generator
1861         https://bugs.webkit.org/show_bug.cgi?id=157247
1862
1863         Reviewed by Darin Adler.
1864
1865         * bindings/scripts/CodeGeneratorJS.pm:
1866         (GenerateParametersCheck):
1867         (CanUseWTFOptionalForParameter): Deleted.
1868
1869 2016-05-01  Darin Adler  <darin@apple.com>
1870
1871         Update Fetch to use enum class instead of string for enumerations
1872         https://bugs.webkit.org/show_bug.cgi?id=157241
1873
1874         Reviewed by Chris Dumez.
1875
1876         * Modules/fetch/FetchOptions.h: Changed this class into a struct,
1877         getting rid of all the getter and setter functions. Moved all the
1878         enumeration types out of this class to the WebCore namespace level
1879         and gave them all the names and values that match the ones from the
1880         IDL file.
1881
1882         * Modules/fetch/FetchRequest.cpp:
1883         (WebCore::setReferrerPolicy): Updated for the changes to FetchOptions.
1884         The string matching here will likely go away when we change dictionary
1885         so it sets up a structure, which will parse the enumeration values, but
1886         that won't be for a while, so this stays for now.
1887         (WebCore::setMode): Ditto.
1888         (WebCore::setCredentials): Ditto.
1889         (WebCore::setCache): Ditto.
1890         (WebCore::setRedirect): Ditto.
1891         (WebCore::buildOptions): Updated for changes to FetchOptions.
1892         (WebCore::buildHeaders): Ditto.
1893         (WebCore::FetchRequest::create): Ditto.
1894         (WebCore::FetchRequest::type): Moved this to the header and changed its
1895         return type to the enum; it's not just a single return statement.
1896         (WebCore::FetchRequest::destination): Ditto.
1897         (WebCore::FetchRequest::referrerPolicy): Ditto.
1898         (WebCore::FetchRequest::mode): Ditto.
1899         (WebCore::FetchRequest::credentials): Ditto.
1900         (WebCore::FetchRequest::cache): Ditto.
1901         (WebCore::FetchRequest::redirect): Ditto.
1902
1903         * Modules/fetch/FetchRequest.h: Changed all the getters that return
1904         enumerations to return the enum class values instead of strings.
1905         Put all the inline versions here in the header.
1906
1907         * bindings/scripts/CodeGenerator.pm: Removed the seven enum types that
1908         are in FetchRequest.idl from the list of "string-based" enums.
1909
1910         * dom/Document.cpp:
1911         (WebCore::Document::Document): Updated for the change where I
1912         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
1913         (WebCore::Document::processReferrerPolicy): Ditto.
1914         (WebCore::Document::applyContentDispositionAttachmentSandbox): Ditto.
1915         * dom/Document.h: Ditto.
1916         * loader/FrameNetworkingContext.h: Ditto.
1917         * page/SecurityPolicy.cpp:
1918         (WebCore::SecurityPolicy::generateReferrerHeader): Ditto.
1919         * page/SecurityPolicy.h: Ditto.
1920
1921         * platform/ReferrerPolicy.h: Renamed this enum from ReferrerPolicy to
1922         ReferrerHeaderPolicy, since the one specified in the Fetch API has the
1923         name ReferrerPolicy. I think the best way to resolve this longer term is
1924         to merge them since they really do represent the same concept, although
1925         the one from the Fetch API has a few more features.
1926
1927 2016-05-01  Chris Dumez  <cdumez@apple.com>
1928
1929         Unreviewed attempt to fix Windows build after r200288.
1930
1931         * bindings/scripts/CodeGeneratorJS.pm:
1932         (GenerateParametersCheck):
1933
1934 2016-05-01  Chris Dumez  <cdumez@apple.com>
1935
1936         Unreviewed attempt to fix Windows build after r200288.
1937
1938         * bindings/scripts/CodeGeneratorJS.pm:
1939         (GetEnumerationImplementationContent):
1940
1941 2016-05-01  Chris Dumez  <cdumez@apple.com>
1942
1943         Unreviewed, rebaseline bindings tests after r200300.
1944
1945         * bindings/scripts/test/JS/JSTestObj.cpp:
1946         (WebCore::jsStringWithCache):
1947
1948 2016-05-01  Darin Adler  <darin@apple.com>
1949
1950         Use enum class instead of string-based enums in RTC code
1951         https://bugs.webkit.org/show_bug.cgi?id=157242
1952
1953         Reviewed by Alex Christensen.
1954
1955         * Modules/mediastream/RTCConfiguration.cpp:
1956         (WebCore::RTCConfiguration::RTCConfiguration): Don't initialize members here,
1957         do it in the header instead.
1958         (WebCore::RTCConfiguration::initialize): Initialize data members to enum values,
1959         not strings.
1960
1961         * Modules/mediastream/RTCConfiguration.h: Tried to keep this class compiling.
1962         Added the new enum class, and changed to use that instead of strings. But note,
1963         this should not even be a class. Needs to become a dictionary.
1964
1965         * Modules/mediastream/RTCConfiguration.idl: Updated the names and values of the
1966         enums to match the current RTC specification. Again, as I said, this should be
1967         a dictionary, not an interface.
1968
1969         * bindings/scripts/CodeGenerator.pm: Removed the RTC enumerations from the list
1970         of string-based enums.
1971
1972 2016-04-30  Antti Koivisto  <antti@apple.com>
1973
1974         REGRESSION (r199640): position:absolute generated content inherits text-decoration from its element
1975         https://bugs.webkit.org/show_bug.cgi?id=157199
1976         <rdar://problem/26013111>
1977
1978         Reviewed by Zalan Bujtas.
1979
1980         Test: fast/css/text-decoration-inheritance-pseudo.html
1981
1982         * css/StyleResolver.cpp:
1983         (WebCore::doesNotInheritTextDecoration):
1984         (WebCore::StyleResolver::adjustRenderStyle):
1985
1986             There was an accidental logic change here. Even if element is null other conditions may make this test true.
1987
1988 2016-04-30  Zalan Bujtas  <zalan@apple.com>
1989
1990         Some content causes deep recursion.
1991         https://bugs.webkit.org/show_bug.cgi?id=157230
1992         <rdar://problem/7694756>
1993
1994         Reviewed by Antti Koivisto.
1995
1996         This patch sets a limit(512) on content nesting for the render tree. Elements injected over the limit
1997         are still accessible through DOM APIs but
1998         1. we stop generating renderers for them -they behave like display: none. 
1999         2. their layout related computed style values are set to default (e.g. window.computedStyle(document.elementById("over512").width -> auto) 
2000
2001         Test: fast/block/nested-renderers.html
2002
2003         * page/Settings.h:
2004         * style/StyleTreeResolver.cpp: Skip renderer constructing and continue with the sibling node. 
2005         (WebCore::Style::TreeResolver::resolveComposedTree):
2006
2007 2016-04-30  Darin Adler  <darin@apple.com>
2008
2009         Update XMLHttpRequest to use enum class instead of string for enumeration
2010         https://bugs.webkit.org/show_bug.cgi?id=157238
2011
2012         Reviewed by Chris Dumez.
2013
2014         * bindings/js/JSXMLHttpRequestCustom.cpp:
2015         (WebCore::JSXMLHttpRequest::response): Rewrite to use responseType function
2016         instead of responseTypeCode function.
2017
2018         * bindings/scripts/CodeGenerator.pm: Removed XMLHttpRequestResponseType
2019         from the list of enumerations that use a string-based implementation.
2020
2021         * bindings/scripts/CodeGeneratorJS.pm:
2022         (GetEnumerationImplementationContent): Use emptyString instead of ASCIILiteral
2023         when the string constant is empty, to avoid the assertion.
2024
2025         * xml/XMLHttpRequest.cpp:
2026         (WebCore::XMLHttpRequest::XMLHttpRequest): Move simple scalar data member
2027         initialization to where the data members are defined in the header.
2028         (WebCore::XMLHttpRequest::responseText): Use m_responseType instead of
2029         m_responseTypeCode.
2030         (WebCore::XMLHttpRequest::didCacheResponseJSON): Ditto.
2031         (WebCore::XMLHttpRequest::responseXML): Ditto.
2032         (WebCore::XMLHttpRequest::responseBlob): Ditto.
2033         (WebCore::XMLHttpRequest::responseArrayBuffer): Ditto.
2034         (WebCore::XMLHttpRequest::setResponseType): Ditto.
2035         (WebCore::XMLHttpRequest::responseType): Moved to header now that it's a
2036         trivial function that should be inlined.
2037         (WebCore::XMLHttpRequest::open): Use m_responseType instead of
2038         m_responseTypeCode.
2039         (WebCore::XMLHttpRequest::responseMIMEType): Removed one redundant check.
2040         (WebCore::XMLHttpRequest::status): Ditto.
2041         (WebCore::XMLHttpRequest::statusText): Ditto.
2042         (WebCore::shouldDecodeResponse): Moved here from the header. This is now
2043         a non-member function that gets passed a response type. It uses a switch
2044         now instead of ordering the types so that the binary ones are all at the
2045         end of the list.
2046         (WebCore::XMLHttpRequest::didReceiveData): Use the new shouldDecodeResponse.
2047         Also removed an unnecessary check that non-decoded responses are of type
2048         "arraybuffer" or "blob"; that's the same check that shouldDecodeResponse does.
2049
2050         * xml/XMLHttpRequest.h: Removed some unneeded includes and forward declarations.
2051         Removed a comment about the State values needing to be stable numbers; for one
2052         thing the bindings already check that these values have no changed. It's not a
2053         valuable comment. Removed ResponseTypeCode, responseTypeCode, and
2054         m_responseTypeCode. Changed the type of the result of responseType and the
2055         argument to setResponseType from a string to XMLHttpRequestResponseType.
2056         Removed shouldDecodeResponse. Added the initial values for lots of data members
2057         that are simple scalars, matching what was set in the constructor before.
2058
2059 2016-04-30  Darin Adler  <darin@apple.com>
2060
2061         Streamline and remove unused bindings generation code
2062         https://bugs.webkit.org/show_bug.cgi?id=157237
2063
2064         Reviewed by Chris Dumez.
2065
2066         * Modules/notifications/NotificationCenter.idl: Replace non-standard "int"
2067         with standard "long", which means the same thing.
2068
2069         * bindings/scripts/CodeGenerator.pm:
2070         (UpdateFile): Use a better perl idiom for open.
2071         (IsTypedArrayType): Use a hash instead of a list of checks in the code.
2072         (IsRefPtrType): Use GetArrayOrSequenceType. Add handling for "any", which
2073         is not a "RefPtr" type.
2074         (IsWrapperType): Build on top of IsRefPtr type so we don't have to repeat
2075         the list.
2076         (getInterfaceExtendedAttributesFromName): Added a FIXME about why this is no good.
2077         (ComputeIsCallbackInterface): Renamed.
2078         (IsCallbackInterface): Added a cache so we don't keep reading the same file
2079         over and over again. Added a FIXME about why this is no good.
2080         (ComputeIsFunctionOnlyCallbackInterface): Ditto.
2081         (IsFunctionOnlyCallbackInterface): Ditto.
2082
2083         * bindings/scripts/CodeGeneratorJS.pm:
2084         (AddIncludesForType): Use GetArrayOrSequenceType.
2085         (IsScriptProfileType): Deleted.
2086         (AddTypedefForScriptProfileType): Deleted.
2087         (AddClassForwardIfNeeded): Streamlined the code and made the ScriptProfileNode
2088         special case easier to read.
2089         (GenerateParametersCheckExpression): Use GetArrayOrSequenceType.
2090         (GetFunctionLength): Tweaked formatting and argument names.
2091         (GenerateImplementation): Merged a couple checks into a single if statement.
2092         (WillConvertUndefinedToDefaultParameterValue): Streamlined the function by
2093         using a hash instead of a sequence of if statements for most cases.
2094         (GetNativeType): Use GetArrayOrSequenceType.
2095         (JSValueToNative): Do the integer conversion based on a hash rather than
2096         with lots of separate lines of code. Moved more of the simple names down to
2097         the bottom of the function and streamlined the logic. Removed unnecessary
2098         includes of the DOM headers directly, since our header file includes those.
2099         (NativeToJSValue): Factored out the global object handling so it works across
2100         more cases. Simplified the logic for dates. Use IsNumericType instead of
2101         IsPrimitiveType to guard code that is right only for the numeric types.
2102         Removed code to handle "Symbol" since we don't ever use that.
2103
2104         * bindings/scripts/test/JS/JSTestCallback.cpp:
2105         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
2106         * bindings/scripts/test/JS/JSTestInterface.cpp:
2107         * bindings/scripts/test/JS/JSTestObj.cpp:
2108         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2109         Regenerated.
2110
2111         * bindings/scripts/test/TestObj.idl: Removed test coverage for Symbol, which
2112         we never use anywhere.
2113
2114         * html/canvas/EXTBlendMinMax.idl: Replace non-standard "int" with standard
2115         "long", which means the same thing.
2116         * html/canvas/EXTTextureFilterAnisotropic.idl: Ditto.
2117         * html/canvas/EXTsRGB.idl: Ditto.
2118         * html/canvas/OESStandardDerivatives.idl: Ditto.
2119         * html/canvas/OESVertexArrayObject.idl: Ditto.
2120         * html/canvas/WebGLCompressedTextureATC.idl: Ditto.
2121         * html/canvas/WebGLCompressedTexturePVRTC.idl: Ditto.
2122         * html/canvas/WebGLCompressedTextureS3TC.idl: Ditto.
2123         * html/canvas/WebGLDebugRendererInfo.idl: Ditto.
2124         * html/canvas/WebGLDepthTexture.idl: Ditto.
2125
2126 2016-04-30  Chris Dumez  <cdumez@apple.com>
2127
2128         [Web IDL] Pass even more types by reference
2129         https://bugs.webkit.org/show_bug.cgi?id=157231
2130
2131         Reviewed by Darin Adler.
2132
2133         Pass even more types by reference when the parameters are not marked as
2134         nullable in the IDL.
2135
2136         * Modules/encryptedmedia/MediaKeySession.cpp:
2137         (WebCore::MediaKeySession::generateKeyRequest):
2138         (WebCore::MediaKeySession::keyRequestTimerFired):
2139         (WebCore::MediaKeySession::update):
2140         (WebCore::MediaKeySession::addKeyTimerFired):
2141         * Modules/encryptedmedia/MediaKeySession.h:
2142         * Modules/encryptedmedia/MediaKeys.cpp:
2143         (WebCore::MediaKeys::createSession):
2144         * Modules/encryptedmedia/MediaKeys.h:
2145         * Modules/encryptedmedia/MediaKeys.idl:
2146         * Modules/mediasource/SourceBuffer.cpp:
2147         (WebCore::SourceBuffer::appendBuffer):
2148         (WebCore::SourceBuffer::resetParserState): Deleted.
2149         * Modules/mediasource/SourceBuffer.h:
2150         * Modules/mediastream/RTCDataChannel.cpp:
2151         (WebCore::RTCDataChannel::send):
2152         * Modules/mediastream/RTCDataChannel.h:
2153         * Modules/webaudio/AnalyserNode.h:
2154         (WebCore::AnalyserNode::getFloatFrequencyData):
2155         (WebCore::AnalyserNode::getByteFrequencyData):
2156         (WebCore::AnalyserNode::getByteTimeDomainData):
2157         * Modules/webaudio/AnalyserNode.idl:
2158         * Modules/webaudio/AudioContext.cpp:
2159         (WebCore::AudioContext::createPeriodicWave):
2160         * Modules/webaudio/AudioContext.h:
2161         * Modules/webaudio/AudioParam.h:
2162         (WebCore::AudioParam::setValueCurveAtTime):
2163         * Modules/webaudio/AudioParam.idl:
2164         * Modules/webaudio/BiquadFilterNode.cpp:
2165         (WebCore::BiquadFilterNode::getFrequencyResponse):
2166         * Modules/webaudio/BiquadFilterNode.h:
2167         * Modules/webaudio/BiquadFilterNode.idl:
2168         * Modules/webaudio/PeriodicWave.cpp:
2169         (WebCore::PeriodicWave::create):
2170         (WebCore::PeriodicWave::createSine): Deleted.
2171         * Modules/webaudio/PeriodicWave.h:
2172         * Modules/websockets/WebSocket.cpp:
2173         (WebCore::WebSocket::send):
2174         * Modules/websockets/WebSocket.h:
2175         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
2176         (WebCore::dataFunctionf):
2177         (WebCore::dataFunctioni):
2178         (WebCore::dataFunctionMatrix):
2179         * bindings/scripts/CodeGeneratorJS.pm:
2180         (GenerateParametersCheck):
2181         (ShouldPassWrapperByReference):
2182         * bindings/scripts/test/JS/JSTestObj.cpp:
2183         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
2184         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2185         (WebCore::constructJSTestOverloadedConstructors2):
2186         * html/HTMLMediaElement.cpp:
2187         (WebCore::HTMLMediaElement::webkitAddKey):
2188         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
2189         * html/HTMLMediaElement.h:
2190         * html/HTMLMediaElement.idl:
2191         * html/ImageData.cpp:
2192         (WebCore::ImageData::create):
2193         (WebCore::ImageData::ImageData):
2194         * html/ImageData.h:
2195         * html/canvas/CanvasRenderingContext2D.cpp:
2196         (WebCore::CanvasRenderingContext2D::getImageData):
2197         * html/canvas/WebGL2RenderingContext.cpp:
2198         (WebCore::WebGL2RenderingContext::texImage3D):
2199         (WebCore::WebGL2RenderingContext::texSubImage3D):
2200         (WebCore::WebGL2RenderingContext::compressedTexImage3D):
2201         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
2202         (WebCore::WebGL2RenderingContext::uniform1uiv):
2203         (WebCore::WebGL2RenderingContext::uniform2uiv):
2204         (WebCore::WebGL2RenderingContext::uniform3uiv):
2205         (WebCore::WebGL2RenderingContext::uniform4uiv):
2206         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
2207         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
2208         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
2209         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
2210         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
2211         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
2212         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
2213         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
2214         (WebCore::WebGL2RenderingContext::clearBufferiv):
2215         (WebCore::WebGL2RenderingContext::clearBufferuiv):
2216         (WebCore::WebGL2RenderingContext::clearBufferfv):
2217         (WebCore::WebGL2RenderingContext::getActiveUniforms):
2218         (WebCore::WebGL2RenderingContext::texSubImage2D):
2219         * html/canvas/WebGL2RenderingContext.h:
2220         * html/canvas/WebGL2RenderingContext.idl:
2221         * html/canvas/WebGLRenderingContext.cpp:
2222         (WebCore::WebGLRenderingContext::texSubImage2D):
2223         * html/canvas/WebGLRenderingContext.h:
2224         * html/canvas/WebGLRenderingContextBase.cpp:
2225         (WebCore::WebGLRenderingContextBase::bufferData):
2226         (WebCore::WebGLRenderingContextBase::bufferSubData):
2227         (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
2228         (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
2229         (WebCore::WebGLRenderingContextBase::readPixels):
2230         (WebCore::WebGLRenderingContextBase::texImage2D):
2231         (WebCore::WebGLRenderingContextBase::uniform1fv):
2232         (WebCore::WebGLRenderingContextBase::uniform1iv):
2233         (WebCore::WebGLRenderingContextBase::uniform2fv):
2234         (WebCore::WebGLRenderingContextBase::uniform2iv):
2235         (WebCore::WebGLRenderingContextBase::uniform3fv):
2236         (WebCore::WebGLRenderingContextBase::uniform3iv):
2237         (WebCore::WebGLRenderingContextBase::uniform4fv):
2238         (WebCore::WebGLRenderingContextBase::uniform4iv):
2239         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
2240         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
2241         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
2242         (WebCore::WebGLRenderingContextBase::vertexAttrib1fv):
2243         (WebCore::WebGLRenderingContextBase::vertexAttrib2fv):
2244         (WebCore::WebGLRenderingContextBase::vertexAttrib3fv):
2245         (WebCore::WebGLRenderingContextBase::vertexAttrib4fv):
2246         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
2247         (WebCore::WebGLRenderingContextBase::validateUniformParameters):
2248         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
2249         (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl):
2250         (WebCore::WebGLRenderingContextBase::validateSettableTexFormat): Deleted.
2251         (WebCore::WebGLRenderingContextBase::uniform1i): Deleted.
2252         (WebCore::WebGLRenderingContextBase::uniform2i): Deleted.
2253         (WebCore::WebGLRenderingContextBase::uniform3f): Deleted.
2254         (WebCore::WebGLRenderingContextBase::uniform3i): Deleted.
2255         (WebCore::WebGLRenderingContextBase::uniform4f): Deleted.
2256         (WebCore::WebGLRenderingContextBase::uniform4i): Deleted.
2257         (WebCore::WebGLRenderingContextBase::useProgram): Deleted.
2258         (WebCore::WebGLRenderingContextBase::vertexAttribPointer): Deleted.
2259         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions): Deleted.
2260         (WebCore::WebGLRenderingContextBase::validateBufferDataParameters): Deleted.
2261         * html/canvas/WebGLRenderingContextBase.h:
2262         * html/canvas/WebGLRenderingContextBase.idl:
2263         * testing/Internals.cpp:
2264         (WebCore::Internals::createTimeRanges):
2265         * testing/Internals.h:
2266
2267 2016-04-30  Ryosuke Niwa  <rniwa@webkit.org>
2268
2269         Node.prototype.rootNode is not Web compatible
2270         https://bugs.webkit.org/show_bug.cgi?id=157233
2271
2272         Reviewed by Chris Dumez.
2273
2274         Turns out that the name rootNode is not Web compatible. Remove the method for now
2275         until we can come up with a better name in https://github.com/whatwg/dom/issues/241.
2276
2277         No new tests since we're just removing a method.
2278
2279         * dom/Node.idl:
2280
2281 2016-04-30  Darin Adler  <darin@apple.com>
2282
2283         Try to fix GTK build.
2284
2285         * testing/Internals.h: Added conditional around include of
2286         MediaSessionInterruptionProvider.h.
2287
2288 2016-04-30  Darin Adler  <darin@apple.com>
2289
2290         Stop using old-style string-based enums in Internals.idl
2291         https://bugs.webkit.org/show_bug.cgi?id=157235
2292
2293         Reviewed by Chris Dumez.
2294
2295         * bindings/scripts/CodeGenerator.pm: Removed the six enumeration names
2296         that are used in Internals.idl.
2297         (GenerateCompileTimeCheckForEnumsIfNeeded): Unrelated cleanup. Tighten
2298         code and use static_assert instead of COMPILE_ASSERT.
2299         (IsStringType): Marked this function as deprecated. Calling a function
2300         just to check if something is specifically "DOMString" isn't a good pattern.
2301         Lots of call sites were checking "DOMString" directly and there is no
2302         reason to mix the two different idioms.
2303
2304         * bindings/scripts/CodeGeneratorJS.pm:
2305         (GetEnumerationImplementationContent): Use GenerateConditionalString.
2306         (GenerateImplementation): Use static_assert instead of COMPILE_ASSERT.
2307         (GenerateCallbackHeader): Tighten code. Remove peculiar code that was
2308         trying to emit COMPILE_ASSERT(false); not an important case to detect, and
2309         if we did want to detect it, then having the code generator report an error
2310         is better than COMPILE_ASSERT when compiling the output.
2311         (NativeToJSValue): Stop using IsStringType.
2312
2313         * bindings/scripts/CodeGeneratorObjC.pm:
2314         (GetClassName): Stop using IsStringType.
2315         (GetPropertyAttributes): Ditto.
2316         (ConversionNeeded): Ditto.
2317         (GetObjCTypeGetter): Ditto.
2318         (AddIncludesForType): Ditto.
2319         (GenerateImplementation): Removed unused @needsAssert. It was a write-only
2320         variable.
2321
2322         * bindings/scripts/IDLParser.pm:
2323         (parseEnum): Put the extended attributes into the enumeration object.
2324
2325         * bindings/scripts/test/TestObj.idl: Added test cases for the Conditional
2326         extended attribute, used with enumerations.
2327
2328         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2329         * bindings/scripts/test/JS/JSTestCallback.cpp:
2330         * bindings/scripts/test/JS/JSTestCallback.h:
2331         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2332         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2333         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2334         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2335         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2336         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2337         * bindings/scripts/test/JS/JSTestException.cpp:
2338         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2339         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2340         * bindings/scripts/test/JS/JSTestInterface.cpp:
2341         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2342         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2343         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2344         * bindings/scripts/test/JS/JSTestObj.cpp:
2345         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2346         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2347         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2348         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2349         * bindings/scripts/test/JS/JSattribute.cpp:
2350         * bindings/scripts/test/JS/JSreadonly.cpp:
2351         Regenerated.
2352
2353         * testing/Internals.cpp:
2354         (WebCore::toResourceRequestCachePolicy): Take enum instead of string.
2355         (WebCore::Internals::setOverrideCachePolicy): Ditto.
2356         (WebCore::toResourceLoadPriority): Ditto.
2357         (WebCore::Internals::setOverrideResourceLoadPriority): Ditto.
2358         (WebCore::toAutoFillButtonType): Ditto.
2359         (WebCore::Internals::setShowAutoFillButton): Ditto.
2360         (WebCore::interruptingCategoryFromString): Deleted.
2361         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Ditto.
2362         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
2363         (WebCore::Internals::sendMediaControlEvent): Ditto.
2364         (WebCore::Internals::installMockPageOverlay): Ditto.
2365
2366         * testing/Internals.h: Added enum class and use those instead of strings for
2367         enumerations defined in the IDL.
2368
2369         * testing/Internals.idl: Renamed enumerations that conflict with ones that already
2370         exist in WebCore; added Internals prefix. Made MediaSessionInterruptingCategory and
2371         MediaControlEvent conditional to match the functions they are used on. Added some
2372         FIXMEs about peculiarities of some of the enumerations.
2373
2374 2016-04-30  Darin Adler  <darin@apple.com>
2375
2376         Fixed expected results from bindings tests.
2377
2378         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
2379
2380 2016-04-30  Darin Adler  <darin@apple.com>
2381
2382         Next batch of conversions to use C++ enum class instead of strings for enumerations
2383         https://bugs.webkit.org/show_bug.cgi?id=157232
2384
2385         Reviewed by Chris Dumez.
2386
2387         * Modules/fetch/FetchResponse.cpp:
2388         (WebCore::FetchResponse::error): Use ResponseType.
2389         (WebCore::FetchResponse::redirect): Ditto.
2390         (WebCore::FetchResponse::FetchResponse): Ditto.
2391         (WebCore::FetchResponse::clone): Ditto.
2392         (WebCore::FetchResponse::type): Return ResponseType.
2393         (WebCore::FetchResponse::startFetching): Use auto.
2394         * Modules/fetch/FetchResponse.h: Added ResponseType and used it for the return value
2395         of the type function, and also to replace FetchResponse::Type.
2396
2397         * Modules/mediacontrols/MediaControlsHost.cpp:
2398         (WebCore::MediaControlsHost::externalDeviceType): Return DeviceType.
2399         * Modules/mediacontrols/MediaControlsHost.h: Added DeviceType and use it for the
2400         return value for the externalDeviceType function.
2401
2402         * Modules/mediasession/MediaSession.cpp:
2403         (WebCore::MediaSession::parseKind): Deleted.
2404         (WebCore::MediaSession::MediaSession): Use MediaSessionKind.
2405         (WebCore::MediaSession::kind): Deleted.
2406         * Modules/mediasession/MediaSession.h: Added MediaSessionKind and use it as the
2407         argument to MediaSession::create and the return type for the kind function.
2408         Probably didn't get this 100% right because this code does not seem to be compiled.
2409         * Modules/mediasession/MediaSession.idl: Added default value for kind, as specified
2410         in the current version of the specification for this class.
2411         * Modules/mediasession/MediaSessionManager.cpp:
2412         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification):
2413         Tried to update for changes above.
2414         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
2415
2416         * Modules/mediasource/MediaSource.cpp:
2417         (WebCore::MediaSource::endOfStream): Changed to take Optional<EndOfStreamError>
2418         instead of overloading and taking const AtomicString&.
2419         (WebCore::MediaSource::streamEndedWithError): Ditto. Also removed exception code.
2420         (WebCore::MediaSource::addSourceBuffer): Updated to use EndOfStreamError. Also
2421         used an if statement.
2422         (WebCore::MediaSource::sourceBufferDidChangeActiveState): Updated to take a reference
2423         instead of a pointer.
2424         * Modules/mediasource/MediaSource.h: Added EndOfStreamError and changed as above.
2425
2426         * Modules/mediasource/SourceBuffer.cpp:
2427         (WebCore::SourceBuffer::segmentsKeyword): Deleted.
2428         (WebCore::SourceBuffer::sequenceKeyword): Deleted.
2429         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Initialize booleans where they are
2430         defined rather than in this constructor.
2431         (WebCore::SourceBuffer::create): Use Ref instead of RefPtr.
2432         (WebCore::SourceBuffer::SourceBuffer): Initialize many data members where they are
2433         defined rather than in this constructor.
2434         (WebCore::SourceBuffer::setTimestampOffset): Use AppendMode.
2435         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
2436         (WebCore::SourceBuffer::decodeError): Deleted.
2437         (WebCore::SourceBuffer::networkError): Deleted.
2438         (WebCore::SourceBuffer::setActive): Pass reference instead of pointer.
2439         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Deleted. No callers.
2440         (WebCore::SourceBuffer::appendError): Use AppendMode.
2441         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
2442         (WebCore::SourceBuffer::setMode): Take AppendMode.
2443         * Modules/mediasource/SourceBuffer.h: Added AppendMode, removed various string
2444         constant functions, initialize more data emebers in this header. Removed unused
2445         sourceBufferPrivateDidEndStream function.
2446
2447         * Modules/mediastream/MediaDeviceInfo.cpp:
2448         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Take MediaDeviceKind instead of string.
2449         (WebCore::MediaDeviceInfo::create): Ditto.
2450         (WebCore::MediaDeviceInfo::audioInputType): Deleted.
2451         (WebCore::MediaDeviceInfo::audioOutputType): Deleted.
2452         (WebCore::MediaDeviceInfo::videoInputType): Deleted.
2453         * Modules/mediastream/MediaDeviceInfo.h: Aedded MediaDeviceKind and used it.
2454         * Modules/mediastream/MediaDeviceInfo.idl: Changed type of the kind attribute
2455         to be MediaDeviceKind as in the specification.
2456
2457         * Modules/mediastream/MediaDevicesRequest.cpp:
2458         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Fix loop to not
2459         churn the reference countds. Also updated to use String instead of AtomicString for
2460         label, and MediaDeviceKind instead of string for kind.
2461
2462         * Modules/mediastream/MediaStreamTrack.cpp:
2463         (WebCore::MediaStreamTrack::readyState): Return MediaStreamTrackState.
2464         * Modules/mediastream/MediaStreamTrack.h: Added MediaStreamTrackState and used it
2465         for the return value from the readyState function.
2466
2467         * Modules/webaudio/AudioContext.cpp:
2468         (WebCore::AudioContext::state): Return AudioContextState.
2469         * Modules/webaudio/AudioContext.h: Added AudioContextState and used it.
2470
2471         * Modules/webaudio/WaveShaperNode.cpp:
2472         (WebCore::processorType): Added.
2473         (WebCore::WaveShaperNode::setOversample): Take OverSampletype instead of a string.
2474         (WebCore::WaveShaperNode::oversample): Return OverSampleType.
2475         * Modules/webaudio/WaveShaperNode.h: Added OverSampleType and used it.
2476         * Modules/webaudio/WaveShaperNode.idl: Removed unneeded [SetterRaisesException].
2477
2478         * bindings/scripts/CodeGenerator.pm: Removed special cases for 18 enumerations that
2479         either don't exist or were converted to no longer pass strings in to the C++ DOM.
2480
2481         * bindings/scripts/CodeGeneratorJS.pm:
2482         (GenerateHeaderContentHeader): Use #pragma once instead of header guards.
2483         (GetEnumerationValueName): Added logic to handle names with "-" and starting with
2484         a numeric digit.
2485         (GetEnumerationImplementationContent): Changed functions so they do more of the
2486         binding work. Added JSValueTraits specialization so we can generate bindings for
2487         a vector of any enumeration. Added special cases for null string. Removed special
2488         case to keep the style checker happy.
2489         (GenerateHeader): Removed the #endif that matched the header guards in
2490         GenerateHeaderContentHeader.
2491         (GenerateImplementation): Use the $type local variable rather than writing out
2492         $attribute->signature->type or $attributeType. Fixed code path that checks for
2493         valid enumeration values to work for non-string-based enumerations.
2494         (CanUseWTFOptionalForParameter): Turn this function off for the new enumerations.
2495         For now, leave it on for the old string-based enumerations.
2496         (GenerateParametersCheck): Added appropriate parameter checking for the new
2497         enumerations.
2498         (GenerateCallbackHeader): Removed the #endif that matched the header guards in
2499         GenerateHeaderContentHeader.
2500         (GetNativeType): Use "auto" instead of the enumeration name in generated code.
2501         (JSValueToNative): Updated since the name of enumerationValueMyEnum was changed
2502         to parseMyEnum.
2503         (NativeToJSValue): Took out call to stringValue, since we now overload the
2504         jsStringWithCache function instead.
2505
2506         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2507         * bindings/scripts/test/JS/JSTestCallback.h:
2508         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
2509         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
2510         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2511         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2512         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2513         * bindings/scripts/test/JS/JSTestEventTarget.h:
2514         * bindings/scripts/test/JS/JSTestException.h:
2515         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2516         * bindings/scripts/test/JS/JSTestGlobalObject.h:
2517         * bindings/scripts/test/JS/JSTestInterface.h:
2518         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2519         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2520         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2521         * bindings/scripts/test/JS/JSTestNode.h:
2522         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2523         * bindings/scripts/test/JS/JSTestObj.cpp:
2524         * bindings/scripts/test/JS/JSTestObj.h:
2525         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2526         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2527         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2528         * bindings/scripts/test/JS/JSTestTypedefs.h:
2529         * bindings/scripts/test/JS/JSattribute.h:
2530         * bindings/scripts/test/JS/JSreadonly.h:
2531         Regenerated.
2532
2533         * crypto/CryptoKey.cpp:
2534         (WebCore::CryptoKey::type): Use CryptoKeyType.
2535         (WebCore::CryptoKey::usages): Use KeyUsage.
2536         * crypto/CryptoKey.h: Added KeyUsage and use CryptoKeyType.
2537
2538         * css/FontFaceSet.cpp:
2539         (WebCore::FontFaceSet::status): Use FontFaceSetLoadStatus.
2540         * css/FontFaceSet.h: Added FontFaceSetLoadStatus and used it.
2541
2542         * html/HTMLMediaElement.cpp:
2543         (WebCore::HTMLMediaElement::playInternal): Use kind instead of kindEnum.
2544
2545         * html/HTMLVideoElement.cpp:
2546         (WebCore::presentationModeFullscreen): Deleted.
2547         (WebCore::presentationModePictureInPicture): Deleted.
2548         (WebCore::presentationModeInline): Deleted.
2549         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use VideoPresentationMode.
2550         (WebCore::toFullscreenMode): Ditto.
2551         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
2552         (WebCore::toPresentationMode): Ditto.
2553         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
2554         * html/HTMLVideoElement.h: Added VideoPresentationMode and used it.
2555
2556         * html/canvas/CanvasRenderingContext2D.cpp: Tweaked formatting. Changed
2557         DefaultSmoothingQuality macro to a constant.
2558         (WebCore::toWindRule): Replaces parseWinding.
2559         (WebCore::CanvasRenderingContext2D::fill): Use CanvasWindingRule instead of string.
2560         (WebCore::CanvasRenderingContext2D::clip): Ditto.
2561         (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
2562         (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
2563         (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
2564         (WebCore::CanvasRenderingContext2D::isPointInStroke): Ditto.
2565         (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
2566         (WebCore::smoothingToInterpolationQuality): Ditto.
2567         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality): Ditto.
2568         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality): Ditto.
2569         * html/canvas/CanvasRenderingContext2D.h: Added CanvasWindingRule and
2570         ImageSmoothingQuality, and use them throughout the class.
2571
2572         * platform/graphics/SourceBufferPrivateClient.h: Removed unused
2573         sourceBufferPrivateDidEndStream function.
2574
2575 2016-04-30  Nan Wang  <n_wang@apple.com>
2576
2577         AX: @aria-label attribute should work on <label> element
2578         https://bugs.webkit.org/show_bug.cgi?id=157219
2579
2580         Reviewed by Chris Fleizach.
2581
2582         When there's aria-label on a <label> element, we shouldn't expose it
2583         as the titleUIElement. Instead, we return its aria-label as a title.
2584
2585         Test: accessibility/mac/aria-label-on-label-element.html
2586
2587         * accessibility/AccessibilityNodeObject.cpp:
2588         (WebCore::AccessibilityNodeObject::titleElementText):
2589         * accessibility/AccessibilityRenderObject.cpp:
2590         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
2591
2592         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2593         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
2594         Use DeviceType instead of String for externalDeviceType.
2595
2596 2016-04-29  Chris Dumez  <cdumez@apple.com>
2597
2598         [Web IDL] Specify default parameter values for callback parameters
2599         https://bugs.webkit.org/show_bug.cgi?id=157188
2600
2601         Reviewed by Darin Adler.
2602
2603         Specify default parameter values for callback parameters.
2604
2605         * Modules/geolocation/Geolocation.idl:
2606         * Modules/notifications/Notification.cpp:
2607         (WebCore::Notification::requestPermission):
2608         * Modules/notifications/Notification.h:
2609         * Modules/notifications/Notification.idl:
2610         * Modules/notifications/NotificationCenter.idl:
2611         * Modules/quota/StorageInfo.cpp:
2612         (WebCore::StorageInfo::queryUsageAndQuota):
2613         (WebCore::StorageInfo::requestQuota):
2614         * Modules/quota/StorageInfo.h:
2615         * Modules/quota/StorageInfo.idl:
2616         * Modules/quota/StorageQuota.h:
2617         * Modules/quota/StorageQuota.idl:
2618         * Modules/webaudio/AudioContext.idl:
2619         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2620         (WebCore::DOMWindowWebDatabase::openDatabase):
2621         * Modules/webdatabase/DOMWindowWebDatabase.h:
2622         (WebCore::DOMWindowWebDatabase::DOMWindowWebDatabase):
2623         (WebCore::DOMWindowWebDatabase::~DOMWindowWebDatabase):
2624         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2625         * Modules/webdatabase/Database.cpp:
2626         (WebCore::Database::runTransaction):
2627         (WebCore::Database::changeVersion):
2628         (WebCore::Database::transaction):
2629         (WebCore::Database::readTransaction):
2630         * Modules/webdatabase/Database.h:
2631         * Modules/webdatabase/Database.idl:
2632         * Modules/webdatabase/SQLTransaction.idl:
2633         * bindings/scripts/CodeGeneratorJS.pm:
2634         (GenerateParametersCheck):
2635         (CanUseWTFOptionalForParameter): Deleted.
2636         * bindings/scripts/test/TestObj.idl:
2637         * dom/DataTransferItem.h:
2638         * dom/DataTransferItem.idl:
2639
2640 2016-04-28  Darin Adler  <darin@apple.com>
2641
2642         First step in using "enum class" instead of "String" for enumerations in DOM
2643         https://bugs.webkit.org/show_bug.cgi?id=157163
2644
2645         Reviewed by Chris Dumez.
2646
2647         This patch adds the basic support for using "enum class" to implement enumerations
2648         in the C++ DOM. This is enough so we can use it for one case, but not enough for
2649         others. For example, it correctly generates code to get an attribute, but likely
2650         does not correctly generate code to set an attribute or call a function with an
2651         argument type that is the new style of enum.
2652
2653         * bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes
2654         at the start of this file. Added a new one named stringBasedEnumerationHash
2655         and a comment explaining that we need to eventually make it empty.
2656         (ProcessDocument): Pass the enumerations into the GenerateInterface function.
2657         (IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
2658         as opposed to enumerations we use "enum class" for.
2659
2660         * bindings/scripts/CodeGeneratorJS.pm:
2661         (GenerateInterface): Take the enumerations argument and pass it along to the
2662         functions that generate headers and implementation files.
2663         (EnumerationClassName): Added. Maps from an enumeration type name as seen
2664         in the IDL file to the enumeration class name used in the C++ DOM implementation.
2665         (EnumerationValueName): Added. Maps from an anumeration string value as seen
2666         in the IDL file to an enumeration value name used in the C++ DOM implementatino.
2667         (EnumerationImplementationContent): Added. Generates a string with all the content
2668         needed in the implementation file to define the helper functions for enumerations.
2669         (GenerateHeader): Tweak.
2670         (GenerateImplementation): Added call to EnumerationImplementationContent.
2671         (GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
2672         longer way of writing out the same thing.
2673         (GenerateCallbackHeader): Tweak.
2674         (GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
2675         (GetNativeType): Continue to return String for string-based enum types, but for
2676         other enum types, return the result of EnumerationClassName instead.
2677         (JSValueToNative): Use toWTFString instead of toString/value (see above), convert
2678         to a string only for string-based enum types, and add a preliminary, probably not
2679         yet working, version of the code for non-string-based enum types. Will finish this
2680         in the next patch when we are trying to use one of the new enumerations for a setter
2681         or a function argument.
2682         (NativeToJSValue): Call the stringValue function to convert an enumeration value
2683         into a string when it's not a string-based enumeration.
2684
2685         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2686         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2687         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2688         * bindings/scripts/test/JS/JSTestInterface.cpp:
2689         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2690         * bindings/scripts/test/JS/JSTestNode.cpp:
2691         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2692         * bindings/scripts/test/JS/JSTestObj.cpp:
2693         * bindings/scripts/test/JS/JSTestObj.h:
2694         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2695         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2696         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2697         Regenerated.
2698
2699         * css/FontFace.cpp:
2700         (WebCore::FontFace::status): Updated to return enum values rather than strings.
2701
2702         * css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.
2703         Added enum class for FontFaceLoadStatus, with names that match the names from the
2704         enumeration in the IDL, but with our standard enum capitalization style. Changed
2705         the return value of the status function to FontFaceLoadStatus.
2706
2707 2016-04-29  Chris Dumez  <cdumez@apple.com>
2708
2709         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
2710         https://bugs.webkit.org/show_bug.cgi?id=157224
2711
2712         Reviewed by Ryosuke Niwa.
2713
2714         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
2715         since all the call sites already do a null check. Also update the function
2716         to take the implementation object by reference instead of pointer. Finally,
2717         use is<>() / downcast<>() more at the call sites.
2718
2719         * Modules/indexeddb/IDBCursor.cpp:
2720         (WebCore::IDBCursor::update):
2721         (WebCore::IDBCursor::deleteFunction):
2722         (WebCore::IDBCursor::setGetResult):
2723         * Modules/indexeddb/IDBCursor.h:
2724         (WebCore::IDBCursor::isKeyCursorWithValue):
2725         (WebCore::IDBCursor::isKeyCursor): Deleted.
2726         * Modules/indexeddb/IDBCursorWithValue.h:
2727         (isType):
2728         * bindings/js/JSBlobCustom.cpp:
2729         (WebCore::toJS):
2730         * bindings/js/JSCanvasRenderingContextCustom.cpp:
2731         (WebCore::toJS):
2732         * bindings/js/JSDOMBinding.h:
2733         (WebCore::wrap):
2734         * bindings/js/JSIDBCursorCustom.cpp:
2735         (WebCore::toJS):
2736         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
2737         (WebCore::toJS):
2738         * bindings/js/JSPerformanceEntryCustom.cpp:
2739         (WebCore::toJS):
2740         * html/canvas/WebGL2RenderingContext.h:
2741         * html/canvas/WebGLRenderingContext.h:
2742         * page/PerformanceMark.h:
2743         (isType):
2744         (WebCore::PerformanceMark::isMark): Deleted.
2745         * page/PerformanceMeasure.h:
2746         (isType):
2747         (WebCore::PerformanceMeasure::isMeasure): Deleted.
2748         * page/PerformanceResourceTiming.h:
2749         (isType):
2750         (WebCore::PerformanceResourceTiming::isResource): Deleted.
2751
2752 2016-04-29  Chris Dumez  <cdumez@apple.com>
2753
2754         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings
2755         https://bugs.webkit.org/show_bug.cgi?id=157210
2756
2757         Reviewed by Darin Adler.
2758
2759         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings.
2760         We already make use of them in the JS bindings but they are some cases
2761         where we don't and they may be useful.
2762
2763         * bindings/scripts/CodeGeneratorJS.pm:
2764         (GenerateOverloadedFunction):
2765         (GenerateImplementation):
2766         (GenerateParametersCheck):
2767         (GenerateImplementationFunctionCall):
2768         (GenerateOverloadedConstructorDefinition):
2769         (GenerateConstructorDefinition):
2770         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2771         (WebCore::jsTestActiveDOMObjectConstructor):
2772         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
2773         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2774         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
2775         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2776         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2777         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2778         (WebCore::jsTestCustomNamedGetterConstructor):
2779         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2780         (WebCore::jsTestEventConstructorConstructor):
2781         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2782         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
2783         (WebCore::jsTestEventTargetConstructor):
2784         * bindings/scripts/test/JS/JSTestException.cpp:
2785         (WebCore::jsTestExceptionConstructor):
2786         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2787         (WebCore::jsTestGenerateIsReachableConstructor):
2788         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2789         (WebCore::jsTestGlobalObjectConstructor):
2790         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
2791         * bindings/scripts/test/JS/JSTestInterface.cpp:
2792         (WebCore::JSTestInterfaceConstructor::construct):
2793         (WebCore::jsTestInterfaceConstructor):
2794         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
2795         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2796         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2797         (WebCore::jsTestJSBuiltinConstructorConstructor):
2798         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2799         (WebCore::jsTestMediaQueryListListenerConstructor):
2800         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
2801         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2802         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
2803         (WebCore::jsTestNamedConstructorConstructor):
2804         * bindings/scripts/test/JS/JSTestNode.cpp:
2805         (WebCore::jsTestNodeConstructor):
2806         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2807         (WebCore::jsTestNondeterministicConstructor):
2808         * bindings/scripts/test/JS/JSTestObj.cpp:
2809         (WebCore::JSTestObjConstructor::construct):
2810         (WebCore::JSTestObj::getOwnPropertySlotByIndex):
2811         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
2812         (WebCore::jsTestObjConstructor):
2813         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
2814         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
2815         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
2816         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
2817         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
2818         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
2819         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
2820         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
2821         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
2822         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
2823         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
2824         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
2825         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
2826         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
2827         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
2828         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
2829         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
2830         (WebCore::jsTestObjPrototypeFunctionConvert1):
2831         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
2832         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
2833         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
2834         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
2835         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
2836         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
2837         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
2838         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2839         (WebCore::constructJSTestOverloadedConstructors1):
2840         (WebCore::constructJSTestOverloadedConstructors3):
2841         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
2842         (WebCore::jsTestOverloadedConstructorsConstructor):
2843         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2844         (WebCore::jsTestOverrideBuiltinsConstructor):
2845         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2846         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
2847         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2848         (WebCore::JSTestTypedefsConstructor::construct):
2849         (WebCore::jsTestTypedefsConstructor):
2850         * bindings/scripts/test/JS/JSattribute.cpp:
2851         (WebCore::jsattributeConstructor):
2852         * bindings/scripts/test/JS/JSreadonly.cpp:
2853         (WebCore::jsreadonlyConstructor):
2854
2855 2016-04-29  Ryosuke Niwa  <rniwa@webkit.org>
2856
2857         Rename getAssignedNodes to assignedNodes and support flattened option
2858         https://bugs.webkit.org/show_bug.cgi?id=157225
2859
2860         Reviewed by Antti Koivisto.
2861
2862         Renamed getAssignedNodes and added the the support for {flattened: true/false} as spec'ed at
2863         http://w3c.github.io/webcomponents/spec/shadow/#widl-HTMLSlotElement-assignedNodes-sequence-Node--AssignedNodesOptions-options
2864
2865         Test: fast/shadow-dom/HTMLSlotElement-interface.html
2866
2867         * html/HTMLSlotElement.cpp:
2868         (WebCore::flattenAssignedNodes): Added.
2869         (WebCore::HTMLSlotElement::assignedNodesForBindings): Added.
2870         * html/HTMLSlotElement.h:
2871         * html/HTMLSlotElement.idl:
2872
2873 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
2874
2875         Make clipToRect() and restoreClip() have similar signatures
2876         https://bugs.webkit.org/show_bug.cgi?id=157229
2877
2878         Reviewed by Zalan Bujtas.
2879
2880         clipToRect() and restoreClip() are always called in pairs, but had different
2881         parameter order, and parameter types. So make them more similar.
2882         
2883         In future we could use them in a stack-based class.
2884
2885         No behavior change.
2886
2887         * rendering/RenderLayer.cpp:
2888         (WebCore::RenderLayer::clipToRect):
2889         (WebCore::RenderLayer::restoreClip):
2890         (WebCore::RenderLayer::paintLayer):
2891         (WebCore::RenderLayer::applyFilters):
2892         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
2893         (WebCore::RenderLayer::paintBackgroundForFragments):
2894         (WebCore::RenderLayer::paintForegroundForFragments):
2895         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2896         (WebCore::RenderLayer::paintOutlineForFragments):
2897         (WebCore::RenderLayer::paintMaskForFragments):
2898         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
2899         (WebCore::RenderLayer::paintOverflowControlsForFragments):
2900         (WebCore::RenderLayer::calculateClipRects):
2901         * rendering/RenderLayer.h:
2902
2903 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
2904
2905         Blur filter escapes an enclosing overflow:hidden
2906         https://bugs.webkit.org/show_bug.cgi?id=155029
2907
2908         Reviewed by Zalan Bujtas.
2909
2910         The clipping that was applied when drawing the results of filters was wrong for two reasons.
2911
2912         First, it used localPaintingInfo which has already been contaminated when setting up the filters.
2913         When painting the result, we need to use the original paintingInfo, to get the right paintDirtyRect.
2914
2915         Secondly, when setting up the clip to paint the filter result, it was relying on layerFragments[0].backgroundRect.
2916         However, that was also contaminated by filter setup, since calculateRects() intersects with paintDirtyRect to
2917         compute that backgroundRect, and that paintDirtyRect came from filterPainter->repaintRect().
2918         
2919         Fix this second issue by re-running collectFragments(), which computes a fragment backgroundRect using
2920         the original paintDirtyRect.
2921
2922         Tests: css3/filters/blur-clipped-by-ancestor.html
2923                css3/filters/blur-clipped-with-overflow.html
2924                css3/filters/drop-shadow-with-overflow-hidden.html
2925                css3/filters/drop-shadow.html
2926
2927         * platform/graphics/filters/FilterEffect.cpp:
2928         (WebCore::FilterEffect::clearResult): Unconditionally null these out.
2929         * rendering/FilterEffectRenderer.cpp:
2930         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Typo fix.
2931         * rendering/FilterEffectRenderer.h:
2932         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): C++11 initialization.
2933         * rendering/RenderLayer.cpp:
2934         (WebCore::RenderLayer::applyFilters):
2935         (WebCore::RenderLayer::paintLayerContents):
2936         * rendering/RenderLayer.h: const
2937
2938 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2939
2940         REGRESSION(194502): overflow: scroll; direction: rtl; divs jump horizontally when scrolled vertically
2941         https://bugs.webkit.org/show_bug.cgi?id=157201
2942
2943         Reviewed by Simon Fraser.
2944
2945         ScrollableArea::scrollToOffsetWithoutAnimation() was mistakenly conflating scroll offsets with
2946         scroll positions.
2947
2948         Test: fast/scrolling/rtl-drag-vertical-scroller.html
2949
2950         * platform/ScrollableArea.cpp:
2951         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
2952
2953 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
2954
2955         Clean up GraphicsContext use in RenderLayer::paintLayerContents()
2956         https://bugs.webkit.org/show_bug.cgi?id=157193
2957
2958         Reviewed by Zalan Bujtas.
2959
2960         Make the lifetime of the temporary GraphicsContext used to paint filters more explicit
2961         by putting it in an inner scope.
2962         
2963         Make currentContext a reference.
2964         
2965         transparencyLayerContext was a confusing name (it doens't mean we've started a
2966         transparency layer), so just use "context" to refer to the original context. When
2967         passed to other functions, this is called "contextForTransparencyLayer".
2968         
2969         No longer leaves "context" as a null pointer if filterPainter->filterContext() returns
2970         a null pointer. It's unclear if this ever happened.
2971
2972         * rendering/FilterEffectRenderer.cpp:
2973         (WebCore::FilterEffectRendererHelper::filterContext):
2974         * rendering/RenderLayer.cpp:
2975         (WebCore::RenderLayer::beginTransparencyLayers):
2976         (WebCore::RenderLayer::applyFilters):
2977         (WebCore::RenderLayer::paintLayerContents):
2978         (WebCore::RenderLayer::paintBackgroundForFragments):
2979         (WebCore::RenderLayer::paintForegroundForFragments):
2980         * rendering/RenderLayer.h:
2981
2982 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2983
2984         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
2985         https://bugs.webkit.org/show_bug.cgi?id=157198
2986         <rdar://problem/26011049>
2987
2988         Reviewed by Timothy Hatcher.
2989
2990         No new tests. This only affects inspecting an inspector.
2991
2992         * inspector/InspectorController.h:
2993         * inspector/InspectorFrontendClient.h:
2994         (WebCore::InspectorFrontendClient::pagePaused):
2995         (WebCore::InspectorFrontendClient::pageUnpaused):
2996         * inspector/PageScriptDebugServer.cpp:
2997         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
2998         Inform a frontend client if the frontend page itself pauses/unpauses.
2999
3000 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
3001
3002         [iOS] do not exit AirPlay when the screen locks
3003         https://bugs.webkit.org/show_bug.cgi?id=156502
3004         <rdar://problem/24616592>
3005
3006         Reviewed by Dean Jackson
3007
3008         * html/HTMLMediaElement.cpp:
3009         (WebCore::HTMLMediaElement::pendingActionTimerFired): Use m_isPlayingToWirelessTarget.
3010         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless): Ditto.
3011         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): Set m_isPlayingToWirelessTarget.
3012         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Use
3013           m_isPlayingToWirelessTarget.
3014         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): Ditto.
3015         (WebCore::HTMLMediaElement::configureMediaControls): Ditto.
3016         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
3017         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge 
3018           data if it is playing to a wireless target because that will drop the connection.
3019         * html/HTMLMediaElement.h:
3020
3021         * html/MediaElementSession.cpp:
3022         (WebCore::MediaElementSession::playbackPermitted): Add logging.
3023         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't 
3024           have an explicit playbackTarget, don't test for it.
3025         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
3026
3027 2016-04-29  Chris Dumez  <cdumez@apple.com>
3028
3029         Node.nodeName should not be nullable
3030         https://bugs.webkit.org/show_bug.cgi?id=157211
3031
3032         Reviewed by Ryosuke Niwa.
3033
3034         Node.nodeName should not be nullable as per the specification:
3035         https://dom.spec.whatwg.org/#interface-node
3036
3037         Our implementation never returns null anyway. However, having
3038         it as nullable in the IDL means we use jsStringOrNull() instead
3039         of jsStringWithCache(), thus doing an unnecessary null check.
3040
3041         This should not be observable by JS.
3042
3043         * dom/Node.idl:
3044
3045 2016-04-29  Commit Queue  <commit-queue@webkit.org>
3046
3047         Unreviewed, rolling out r200150 and r200256.
3048         https://bugs.webkit.org/show_bug.cgi?id=157216
3049
3050         This change introduced flakiness in existing CJK LayoutTests.
3051         Also reverting the change that marked the tests as flaky.
3052         (Requested by ryanhaddad on #webkit).
3053
3054         Reverted changesets:
3055
3056         "Clean up Font::removeFromSystemFallbackCache()"
3057         https://bugs.webkit.org/show_bug.cgi?id=157093
3058         http://trac.webkit.org/changeset/200150
3059
3060         "Marking fast/ruby/ruby-expansion-cjk.html and fast/ruby/ruby-
3061         expansion-cjk-4.html as flaky on Mac"
3062         https://bugs.webkit.org/show_bug.cgi?id=157197
3063         http://trac.webkit.org/changeset/200256
3064
3065 2016-04-29  Antonio Gomes  <tonikitoo@webkit.org>
3066
3067         <select multiple> padding should react when scrolling
3068
3069         https://bugs.webkit.org/show_bug.cgi?id=156590
3070         https://bugs.webkit.org/show_bug.cgi?id=156591
3071
3072         Reviewed by Reviewed by Darin Adler.
3073
3074         Tests: fast/forms/listbox-respects-padding-bottom.html
3075                fast/forms/listbox-top-padding-do-not-clip-items.html
3076
3077         Non-dropdown listboxes have support to padding-{top,bottom} implemented similarly
3078         to the border model: the padding area does not move when the listbox' content gets scrolled,
3079         but instead it clips out its content.
3080         This is not consistent with other browsers and is not consistent with the CSS box model.
3081
3082         This in practice, if a <select> has padding-top set, the padding-top area will clip out listbox'
3083         content as one scrolls upwards.
3084         It also means that if padding-bottom is set, when one scrolls all the way to the bottom
3085         of the listbox content, padding-bottom is not respected.
3086
3087         In order to fix these two problems, and make WebKit match Blink with respect to the the way
3088         padding-{top,bottom} are handled, patch adds two class member variables that control the number
3089         of list items (i.e. <option>s) that can be painted over the current listbox' padding area.
3090
3091         In short, depending on the scroll position and the amount of space available in the padding top/bottom
3092         areas, items are painted or not on top of it, mimic'ing the CSS box model behavior of other browsers.
3093
3094         Note that this is specific solution is worth it to pursue on the short/mid term, but a long-term solution
3095         to this problem and many other listbox discrepancies on WebKit's implementation, would be to reimplement
3096         RenderListBox class in terms of RenderLayer. This will be a follow up work.
3097
3098         * rendering/RenderListBox.cpp:
3099         (WebCore::RenderListBox::updateFromElement):
3100         (WebCore::RenderListBox::numVisibleItems):
3101         (WebCore::RenderListBox::paintObject):
3102         (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
3103         (WebCore::RenderListBox::listIndexIsVisible):
3104         (WebCore::RenderListBox::maximumNumberOfItemsThatFitInPaddingBottomArea):
3105         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingTop):
3106         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingBottom):
3107         (WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
3108         (WebCore::RenderListBox::scrollTo):
3109         * rendering/RenderListBox.h:
3110
3111 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
3112
3113         [Mac] AirPlay fails if target is set before AVPlayer has been created
3114         https://bugs.webkit.org/show_bug.cgi?id=157147
3115         <rdar://problem/24197592>
3116
3117         Reviewed by Jer Noble.
3118
3119         Test: media/media-source/media-source-airplay.html
3120
3121         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3122         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Clear flag before calling
3123           setShouldPlayToPlaybackTarget so it does the necessary setup.
3124
3125         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3126         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Return false if the mock
3127           MSE source has been registered.
3128         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Return 'not supported' if
3129           isAvailable is false.
3130         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Fail if isAvailable is false.
3131         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless): Cleanup.
3132
3133         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3134         (WebCore::registered): Global accessor.
3135         (WebCore::MockMediaPlayerMediaSource::isRegistered): 
3136         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine): Set registered to true.
3137         (WebCore::MockMediaPlayerMediaSource::setWirelessPlaybackTarget): New, remember the target.
3138         (WebCore::MockMediaPlayerMediaSource::setShouldPlayToPlaybackTarget): New, remember the setting.
3139         (WebCore::MockMediaPlayerMediaSource::isCurrentPlaybackTargetWireless):
3140         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
3141
3142         * testing/Internals.cpp:
3143         (WebCore::Internals::initializeMockMediaSource): Don't disable AVFoundation.
3144
3145 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
3146
3147         [RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
3148         https://bugs.webkit.org/show_bug.cgi?id=157164
3149         <rdar://problem/25993610>
3150
3151         Reviewed by Darin Adler.
3152
3153         There was some code left over from the old implementation of RTL_SCROLLBARS
3154         which had some faulty assumptions about the interaction between direction
3155         and scrollbar placement. In particular, once we began obeying the "dir"
3156         attribute in r200116, these assumptions were no longer valid.
3157
3158         Test: fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html
3159               scrollbars/rtl/div-absolute.html
3160               scrollbars/rtl/div-horizontal.html
3161
3162         * rendering/InlineFlowBox.h:
3163         (WebCore::InlineFlowBox::layoutOverflowRect):
3164         * rendering/RenderBlock.cpp:
3165         (WebCore::RenderBlock::computeOverflow): Deleted.
3166         * rendering/RenderBox.cpp:
3167         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3168         * rendering/RenderLayer.cpp:
3169         (WebCore::RenderLayer::computeScrollDimensions):
3170
3171 2016-04-29  Nan Wang  <n_wang@apple.com>
3172
3173         AX: CharacterOffset not working correctly with composed characters and collapsed white spaces
3174         https://bugs.webkit.org/show_bug.cgi?id=157190
3175
3176         Reviewed by Chris Fleizach.
3177
3178         When navigating emoji, next/previous text marker call is only moving by one character. Fixed it by
3179         using the helper function in Position to get the real character count for the composed character sequence.
3180         Also there's another issue with collapsed white spaces, TextIterator emits only one space. So we have to 
3181         use the actual space length to create the CharacterOffset in order to generate valid Range object from it.
3182
3183         New test cases in accessibility/text-marker/text-marker-previous-next.html.
3184
3185         * accessibility/AXObjectCache.cpp:
3186         (WebCore::AXObjectCache::traverseToOffsetInRange):
3187         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
3188         (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
3189         (WebCore::AXObjectCache::nextNode):
3190         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
3191         (WebCore::AXObjectCache::nextCharacterOffset):
3192         (WebCore::AXObjectCache::previousCharacterOffset):
3193         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
3194
3195 2016-04-28  Jer Noble  <jer.noble@apple.com>
3196
3197         WebPlaybackControlsManager should not be owned by the WebPlaybackSessionInterfaceMac.
3198         https://bugs.webkit.org/show_bug.cgi?id=157155
3199         <rdar://problem/25991724>
3200
3201         Reviewed by Beth Dakin.
3202
3203         Move the WebPlaybackControlsManager class into its own header and implementation files.
3204
3205         * WebCore.xcodeproj/project.pbxproj:
3206         * platform/mac/WebPlaybackControlsManager.h: Added.
3207         * platform/mac/WebPlaybackControlsManager.mm: Added.
3208         (-[WebPlaybackControlsManager timing]): Moved from WebPlaybackSessionInterfaceMac.
3209         (-[WebPlaybackControlsManager setTiming:]): Ditto.
3210         (-[WebPlaybackControlsManager seekableTimeRanges]): Ditto.
3211         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Ditto.
3212         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Ditto.
3213         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Ditto.
3214         * platform/mac/WebPlaybackSessionInterfaceMac.h:
3215         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
3216         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
3217         (-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]): Deleted.
3218         (-[WebPlaybackControlsManager timing]): Deleted.
3219         (-[WebPlaybackControlsManager setTiming:]): Deleted.
3220         (-[WebPlaybackControlsManager seekableTimeRanges]): Deleted.
3221         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Deleted.
3222         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Deleted.
3223         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Deleted.
3224         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager): Deleted.
3225
3226 2016-04-29  Commit Queue  <commit-queue@webkit.org>
3227
3228         Unreviewed, rolling out r200232.
3229         https://bugs.webkit.org/show_bug.cgi?id=157189
3230
3231         This change broke the Mac CMake build and its LayoutTest is
3232         failing and/or flaky on all platforms (Requested by ryanhaddad
3233         on #webkit).
3234
3235         Reverted changeset:
3236
3237         "Move ResourceTiming behind a runtime flag"
3238         https://bugs.webkit.org/show_bug.cgi?id=157133
3239         http://trac.webkit.org/changeset/200232
3240
3241 2016-04-29  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
3242
3243         [GTK] Fix build failure introduced by r199738
3244         https://bugs.webkit.org/show_bug.cgi?id=157182
3245
3246         Reviewed by Alex Christensen.
3247
3248         * CMakeLists.txt:
3249
3250 2016-04-29  Brady Eidson  <beidson@apple.com>
3251
3252         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
3253         https://bugs.webkit.org/show_bug.cgi?id=157185
3254
3255         Reviewed by Anders Carlsson.
3256
3257         No new tests (Code cleanup, no change in behavior).
3258
3259         * platform/CrossThreadCopier.cpp:
3260         (WebCore::IndexedDB::TransactionMode>::copy): Deleted.
3261         (WebCore::IndexedDB::CursorDirection>::copy): Deleted.
3262         (WebCore::IndexedDB::CursorType>::copy): Deleted.
3263         (WebCore::IDBGetResult>::copy): Deleted.
3264         (WebCore::IDBKeyData>::copy): Deleted.
3265         (WebCore::IDBKeyRangeData>::copy): Deleted.
3266         (WebCore::IDBDatabaseInfo>::copy): Deleted.
3267         (WebCore::IDBDatabaseIdentifier>::copy): Deleted.
3268         (WebCore::IDBTransactionInfo>::copy): Deleted.
3269         (WebCore::IDBResourceIdentifier>::copy): Deleted.
3270         (WebCore::IDBError>::copy): Deleted.
3271         (WebCore::IDBObjectStoreInfo>::copy): Deleted.
3272         (WebCore::IDBIndexInfo>::copy): Deleted.
3273         (WebCore::IDBCursorInfo>::copy): Deleted.
3274         (WebCore::IDBValue>::copy): Deleted.
3275
3276         * platform/CrossThreadCopier.h:
3277         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): Deleted dead code.
3278         (WebCore::AllowCrossThreadAccessWrapper::value): Deleted dead code.
3279         (WebCore::AllowCrossThreadAccess): Deleted dead code.
3280         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper): Deleted dead code.
3281         (WebCore::AllowAccessLaterWrapper::value): Deleted dead code.
3282         (WebCore::AllowAccessLater): Deleted dead code.
3283
3284 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
3285
3286         Wheel Event Not Fired For `body,html { height:100% }`
3287         https://bugs.webkit.org/show_bug.cgi?id=148450
3288
3289         Reviewed by Brent Fulgham.
3290         
3291         EventHandler::handleWheelEvent() didn't pass the Active flag in the HitTestRequest,
3292         which causes code in RenderLayer::hitTest() to fail to fall back to returning the
3293         root layer if no other element is hit. "Active" is in the default flags,
3294         so just create the HitTestRequest with the default flags.
3295
3296         Test: fast/events/wheel-event-outside-body.html
3297
3298         * page/EventHandler.cpp:
3299         (WebCore::EventHandler::handleWheelEvent):
3300
3301 2016-04-29  Chris Dumez  <cdumez@apple.com>
3302
3303         [Web IDL] Specify default values for optional parameters of wrapper types
3304         https://bugs.webkit.org/show_bug.cgi?id=157161
3305
3306         Reviewed by Darin Adler.
3307
3308         Specify default values for optional parameters of wrapper types.
3309
3310         * Modules/indexeddb/IDBIndex.cpp:
3311         (WebCore::IDBIndex::count): Deleted.
3312         * Modules/indexeddb/IDBIndex.h:
3313         * Modules/indexeddb/IDBIndex.idl:
3314         * Modules/indexeddb/IDBObjectStore.cpp:
3315         (WebCore::IDBObjectStore::count): Deleted.
3316         * Modules/indexeddb/IDBObjectStore.h:
3317         * Modules/indexeddb/IDBObjectStore.idl:
3318         * Modules/mediastream/RTCPeerConnection.cpp:
3319         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
3320         * Modules/mediastream/RTCPeerConnection.h:
3321         * Modules/mediastream/RTCPeerConnection.idl:
3322
3323         * bindings/scripts/CodeGeneratorJS.pm:
3324         (WillConvertUndefinedToDefaultParameterValue):
3325         Optimization to avoid generating a ternary if the default
3326         value of a wrapper type parameter is null, since undefined
3327         will already convert to null for those.
3328
3329         (GenerateParametersCheck):
3330         Use null as implicit default value for nullable parameters, given that Web IDL
3331         converts undefined to null for such parameters:
3332         http://heycam.github.io/webidl/#es-nullable-type
3333
3334         (CanUseWTFOptionalForParameter):
3335         Drop the check for wrapper types.
3336
3337         * bindings/scripts/test/*:
3338         Improve bindings tests coverage / rebaseline.
3339
3340         * css/MediaQueryList.idl:
3341         * css/MediaQueryListListener.idl:
3342         * dom/Document.idl:
3343
3344         * html/canvas/DOMPath.idl:
3345         The previous syntax was working because the bindings was generating an early
3346         return if addPath() was called with only one parameter, calling the
3347         implementation method with only 1 parameter. However, since we no longer
3348         generate early returns for optional parameters, we now have to use a slightly
3349         different syntax to maintain the previous behavior. This is only temporary,
3350         I just did not want to deal with SVG tear off types in this patch since they
3351         are very special in the bindings generator.
3352
3353         * page/DOMSelection.idl:
3354         The node parameter to extend() was confusingly marked as optional. However,
3355         when omitted, it would get translated into null, which would throw an
3356         exception since the type is not nullable. Since the specification says 'node'
3357         should not be optional, and since there is no behavior change, I dropped
3358         the 'optional'. The only web-exposed difference is the message provided with
3359         the TypeError that is thrown when called without enough parameters. The new
3360         message is more accurate (see rebaselined layout test).
3361
3362         * svg/SVGMarkerElement.idl:
3363         The parameter for setOrientToAngle() was confusingly marked as optional and
3364         having a default value of null. However, the bindings would throw a TypeError
3365         if called with no parameters or when calling it with null. This is because
3366         this is an SVG Tear off type and the bindings always throw when passing null
3367         for an SVG Tear off type. I therefore updated the IDL to reflect the actual
3368         behavior (no actual behavior change). The new IDL also now matches the spec:
3369         http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
3370
3371         * svg/SVGSVGElement.idl:
3372         Same comments as for SVGMarkerElement. The new IDL matches the actual
3373         behavior and is closer to the specification. I added FIXME comments for when
3374         it does not match the specification:
3375         http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
3376         I did not change web-exposed behavior in this patch.
3377
3378         * svg/SVGTextContentElement.idl:
3379         Same as above. No actual behavior change.
3380
3381         * testing/Internals.cpp:
3382         * testing/Internals.h:
3383         * testing/Internals.idl:
3384         * xml/XPathEvaluator.idl:
3385
3386 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
3387
3388         [ATK] Expose the value of aria-roledescription via an AtkObject attribute
3389         https://bugs.webkit.org/show_bug.cgi?id=146719
3390
3391         Reviewed by Chris Fleizach.
3392
3393         The author-provided value is now exposed via an AtkObject attribute.
3394
3395         Implementation is already covered by aria-roledescription.html. The ATK
3396         expectations are slightly different than those for AX API because falling
3397         back on the default role description is done by assistive technologies.
3398         That this fall back is needed is identified by the lack of an author-
3399         provided value. Thus we do not wish to expose the default role description
3400         in our implementation.
3401
3402         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3403         (webkitAccessibleGetAttributes):
3404
3405 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
3406
3407         [ATK] accessibility/aria-current-global-attribute.html has been failed since r198303
3408         https://bugs.webkit.org/show_bug.cgi?id=155935
3409
3410         Reviewed by Chris Fleizach.
3411
3412         In ATK, the text of span elements is typically exposed through the parent
3413         element, unless the span has some attribute requiring inclusion in the
3414         accessibility tree. We were not checking for the presence of global ARIA
3415         attributes (including aria-current), other than describedby and role.
3416         The fix is to also check AccessibilityObject::supportsARIAAttributes().
3417
3418         No new tests. This issue was caught as a result of a failing test.
3419
3420         * accessibility/atk/AccessibilityObjectAtk.cpp:
3421         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
3422
3423 2016-04-29  Chris Dumez  <cdumez@apple.com>
3424
3425         [Web IDL] Drop 'any' type handling from CanUseWTFOptionalForParameter()
3426         https://bugs.webkit.org/show_bug.cgi?id=157152
3427
3428         Reviewed by Darin Adler.
3429
3430         Drop 'any' type handling from CanUseWTFOptionalForParameter(). Always
3431         use undefined as default value for parameters of type 'any' unless
3432         specified otherwise.
3433
3434         * Modules/indexeddb/IDBCursor.cpp:
3435         (WebCore::IDBCursor::continueFunction): Deleted.
3436         * Modules/indexeddb/IDBCursor.h:
3437         * Modules/indexeddb/IDBObjectStore.cpp:
3438         (WebCore::IDBObjectStore::add): Deleted.
3439         (WebCore::IDBObjectStore::putOrAdd): Deleted.
3440         * Modules/indexeddb/IDBObjectStore.h:
3441         * bindings/scripts/CodeGeneratorJS.pm:
3442
3443         (WillConvertUndefinedToDefaultParameterValue):
3444         Fix optimization for optional DOMString attributes whose default value
3445         is the string "undefined". I also added bindings test coverage for it.
3446
3447         (GenerateParametersCheck):
3448         (CanUseWTFOptionalForParameter): Deleted.
3449         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3450         (webkit_dom_test_obj_method_with_optional_string_is_undefined):
3451         (webkit_dom_test_obj_method_with_optional_any):
3452         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3453         * bindings/scripts/test/JS/JSTestObj.cpp:
3454         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
3455         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
3456         * bindings/scripts/test/ObjC/DOMTestObj.h:
3457         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3458         (-[DOMTestObj methodWithOptionalStringIsUndefined:]):
3459         (-[DOMTestObj methodWithOptionalAny:]):
3460         * bindings/scripts/test/TestObj.idl:
3461         * testing/Internals.h:
3462
3463 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
3464
3465         AX: [ATK] Expose elements with ARIA's "text" role
3466         https://bugs.webkit.org/show_bug.cgi?id=157160
3467
3468         Reviewed by Chris Fleizach.
3469
3470         WebCore Accessibility's StaticTextRole is used for exposed RenderText
3471         objects and for the ARIA "text" role. The former should be folded into
3472         the parent element; the latter should not be, but was. Now we check to
3473         see which type we have when building the accessibility tree. Also map
3474         the "text" role to ATK_ROLE_STATIC.
3475
3476         We already have sufficient test coverage. Three previously-failing tests
3477         are now passing.
3478
3479         * accessibility/atk/AccessibilityObjectAtk.cpp:
3480         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
3481         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3482         (atkRole):
3483
3484 2016-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3485
3486         [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()
3487         https://bugs.webkit.org/show_bug.cgi?id=157132
3488
3489         Reviewed by Darin Adler.
3490
3491         I've noticed that some tests fail randomly in the GTK+ debug bot due to an assertion in HashMap when getting
3492         vertical data from the FontCache. I don't know exactly what's wrong, but looks like a problem with the
3493         FontVerticalDataCache hash traits implementation. Looking at the code, I've realized that we could simplify
3494         everything by reusing the FontDataCache hash and traits, since we are actually using the
3495         FontPlatformData::hash() in the end in both cases. Also, I don't see why we need to get the vertical data from
3496         the FontPlatformData while it's actually cached by the font cache. We could just use the FontCache directly
3497         passing only the FontPlatformData. These changes seem to fix the crashes and make the code a lot simpler.
3498
3499         * platform/graphics/Font.cpp:
3500         (WebCore::Font::Font): Use FontCache::verticalData().
3501         * platform/graphics/FontCache.cpp:
3502         (WebCore::fontVerticalDataCache):
3503         (WebCore::FontCache::verticalData):
3504         (WebCore::FontCache::purgeInactiveFontData): Also remove the cached vertical data when removing a font.
3505         (WebCore::FontCache::invalidate): Clear also the vertical data.
3506         * platform/graphics/FontCache.h:
3507         * platform/graphics/FontPlatformData.h:
3508         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3509         (WebCore::FontPlatformData::openTypeTable): Deleted.
3510         * platform/graphics/opentype/OpenTypeVerticalData.h: Remove the m_inFontCache member that is now unused.
3511
3512 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3513
3514         Remove UsePointersEvenForNonNullableObjectArguments keyword
3515         https://bugs.webkit.org/show_bug.cgi?id=156844
3516
3517         Reviewed by Darin Adler.
3518
3519         No change of behavior.
3520
3521         * bindings/scripts/CodeGenerator.pm:
3522         (ShouldPassWrapperByReference): Removed UsePointersEvenForNonNullableObjectArguments support.
3523         * bindings/scripts/IDLAttributes.txt: Removed UsePointersEvenForNonNullableObjectArguments.
3524
3525 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3526
3527         FetchResponse should return a ReadableStream even if disturbed
3528         https://bugs.webkit.org/show_bug.cgi?id=156911
3529
3530         Reviewed by Darin Adler.
3531
3532         Covered by rebased test.
3533
3534         * Modules/fetch/FetchResponse.cpp:
3535         (WebCore::FetchResponse::createReadableStreamSource): Asserting in case response is disturbed.
3536         * bindings/js/JSFetchResponseCustom.cpp:
3537         (WebCore::JSFetchResponse::body): Creating a locked empty readable stream if response is disturbed.
3538         * bindings/js/ReadableStreamController.cpp:
3539         (WebCore::createReadableStream): Constructing a readable stream even if source is null.
3540         (WebCore::getReadableStreamReader): Retrieving the reader from a readable stream. Stream must not be locked.
3541         * bindings/js/ReadableStreamController.h:
3542
3543 2016-04-29  Yoav Weiss  <yoav@yoav.ws>
3544
3545         Move ResourceTiming behind a runtime flag
3546         https://bugs.webkit.org/show_bug.cgi?id=157133
3547
3548         Reviewed by Alex Christensen.
3549
3550         Move the ResourceTiming API from being behind a build time flag to be behind an
3551         off-by-default runtime flag, that can be turned on using internals.
3552
3553         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
3554                http/tests/performance/performance-resource-timing-entries.html
3555
3556         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
3557         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
3558         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
3559         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
3560         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
3561         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
3562         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
3563         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming. Added build flag around UserTiming related h files.
3564         (WebCore::toJS): Deleted.
3565         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
3566         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
3567         (WebCore::DocumentThreadableLoader::loadRequest):
3568         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
3569         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
3570         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
3571         (WebCore::CachedResourceLoader::revalidateResource):
3572         (WebCore::CachedResourceLoader::loadResource):
3573         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
3574         (WebCore::CachedResourceLoader::loadDone):
3575         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
3576         * page/Performance.cpp: Remove #if for ResourceTiming.
3577         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
3578         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
3579         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
3580         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
3581         * page/Performance.h: Remove #if for ResourceTiming.
3582         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
3583         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
3584         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
3585         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
3586         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
3587         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
3588         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
3589         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
3590         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
3591         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
3592         * testing/Internals.cpp: Add a method that enables ResourceTiming.
3593         (WebCore::Internals::setResourceTimingSupport):
3594         * testing/Internals.h: Add a method that enables ResourceTiming.
3595         * testing/Internals.idl: Add a method that enables ResourceTiming.
3596
3597 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3598
3599         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaStream interfaces
3600         https://bugs.webkit.org/show_bug.cgi?id=156905
3601
3602         Reviewed by Darin Adler.
3603
3604         Removing UsePointersEvenForNonNullableObjectArguments from MediaStream, RTCPeerConnection and RTCRtpSender.
3605         Updating methods to take references and making some related refactoring.
3606
3607         Test: fast/mediastream/MediaStream-add-remove-null-undefined-tracks.html
3608         Changes also covered by updated tests.
3609
3610         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3611         (WebCore::MediaEndpointPeerConnection::createOfferTask):
3612         * Modules/mediastream/MediaStream.cpp:
3613         (WebCore::MediaStream::create):
3614         (WebCore::MediaStream::addTrack):
3615         (WebCore::MediaStream::removeTrack):
3616         (WebCore::MediaStream::didAddTrack):
3617         (WebCore::MediaStream::didRemoveTrack):
3618         (WebCore::MediaStream::internalAddTrack):
3619         (WebCore::MediaStream::internalRemoveTrack):
3620         * Modules/mediastream/MediaStream.h:
3621         * Modules/mediastream/MediaStream.idl:
3622         * Modules/mediastream/RTCDataChannel.cpp:
3623         (WebCore::RTCDataChannel::send):
3624         * Modules/mediastream/RTCDataChannel.h:
3625         * Modules/mediastream/RTCDataChannel.idl:
3626         * Modules/mediastream/RTCPeerConnection.cpp:
3627         (WebCore::RTCPeerConnection::addTrack):
3628         (WebCore::RTCPeerConnection::removeTrack):
3629         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
3630         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
3631         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
3632         (WebCore::RTCPeerConnection::privateGetStats):
3633         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
3634         (WebCore::RTCPeerConnection::localDescription): Deleted.
3635         (WebCore::RTCPeerConnection::currentLocalDescription): Deleted.
3636         (WebCore::RTCPeerConnection::remoteDescription): Deleted.
3637         (WebCore::RTCPeerConnection::currentRemoteDescription): Deleted.
3638         (WebCore::RTCPeerConnection::signalingState): Deleted.
3639         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
3640         (WebCore::RTCPeerConnection::close): Deleted.
3641         * Modules/mediastream/RTCPeerConnection.h:
3642         * Modules/mediastream/RTCPeerConnection.idl:
3643         * Modules/mediastream/RTCRtpReceiver.cpp:
3644         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
3645         * Modules/mediastream/RTCRtpReceiver.h:
3646         (WebCore::RTCRtpReceiver::create):
3647         * Modules/mediastream/RTCRtpSender.cpp:
3648         (WebCore::RTCRtpSender::RTCRtpSender):
3649         (WebCore::RTCRtpSender::replaceTrack):
3650         * Modules/mediastream/RTCRtpSender.h:
3651         (WebCore::RTCRtpSender::create):
3652         * Modules/mediastream/RTCRtpSender.idl:
3653         * Modules/mediastream/RTCRtpSenderReceiverBase.h:
3654         (WebCore::RTCRtpSenderReceiverBase::track):
3655         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
3656
3657 2016-04-28  Daniel Bates  <dabates@apple.com>
3658
3659         Remove extraneous space characters from parameter list for RenderListBox::paintItem()
3660         that were added in r200190 (https://bugs.webkit.org/show_bug.cgi?id=157117).
3661
3662         * rendering/RenderListBox.h:
3663
3664 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
3665
3666         AX: [ATK] Expose subscript and superscript format style groups using ATK_ROLE_SUBSCRIPT and ATK_ROLE_SUPERSCRIPT
3667         https://bugs.webkit.org/show_bug.cgi?id=157158
3668
3669         Reviewed by Chris Fleizach.
3670
3671         r200214 caused the sup and sub elements to be exposed as ATK_ROLE_STATIC.
3672         While this exposure is much better than folding the text into the parent
3673         element, ATK has roles for subscript and superscript, so use them instead.
3674
3675         The roles-exposed.html and roles-computedRoleString.html tests were updated
3676         to reflect the new behavior.
3677
3678         * accessibility/AccessibilityObject.cpp:
3679         (WebCore::AccessibilityObject::isSubscriptStyleGroup):
3680         (WebCore::AccessibilityObject::isSuperscriptStyleGroup):
3681         * accessibility/AccessibilityObject.h:
3682         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3683         (atkRole):
3684
3685 2016-04-28  Zalan Bujtas  <zalan@apple.com>
3686
3687         Content disappears on mouse over.
3688         https://bugs.webkit.org/show_bug.cgi?id=157073
3689         <rdar://problem/24389168>
3690
3691         Reviewed by Simon Fraser.
3692
3693         When a redundant inlinebox is found after constructing the line, we remove it from the tree.
3694         The remove operation marks the ancestor tree dirty (and this newly constructed line is supposed to be clean).
3695         This patch resets this dirty flag on the boxes all the way up to the rootlinebox.
3696         Previously we only cleared the rootinlinebox and we ended up with dirty inlineflowboxes.
3697
3698         Test: fast/text/text-node-remains-dirty-after-calling-surroundContents.html
3699
3700         * rendering/BidiRun.h:
3701         (WebCore::BidiRun::setBox):
3702         * rendering/RenderBlockFlow.h:
3703         * rendering/RenderBlockLineLayout.cpp:
3704         (WebCore::RenderBlockFlow::constructLine):
3705         (WebCore::RenderBlockFlow::removeLineBoxIfNeeded):
3706         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
3707         * rendering/RenderBox.cpp:
3708         (WebCore::RenderBox::positionLineBox): Deleted.
3709         * rendering/RenderText.cpp:
3710         (WebCore::RenderText::setText):
3711         (WebCore::RenderText::positionLineBox): Deleted.
3712
3713 2016-04-28  John Wilander  <wilander@apple.com>
3714
3715         Allow non-standard HTTP headers in WebSocket handshake
3716         https://bugs.webkit.org/show_bug.cgi?id=157157
3717
3718         Reviewed by Brent Fulgham.
3719
3720         No new tests since https://bugs.webkit.org/show_bug.cgi?id=157095
3721         tests that non-standard headers are allowed.
3722
3723         * Modules/websockets/WebSocketHandshake.cpp:
3724         (WebCore::WebSocketHandshake::readHTTPHeaders):
3725             Changed from fail to allow for unrecognized headers.
3726             This was the behavior before https://bugs.webkit.org/show_bug.cgi?id=155602.
3727         * platform/network/HTTPHeaderNames.in:
3728             Removed whitelisted legacy headers since we now allow all non-standard headers.
3729
3730 2016-04-27  Brent Fulgham  <bfulgham@apple.com>
3731
3732         Make sure we don't mishandle HTMLFrameOwnerElement lifecycle
3733         https://bugs.webkit.org/show_bug.cgi?id=157040
3734
3735         Reviewed by Chris Dumez.
3736
3737         Protect a couple of sites where event handling could result in the owning frame
3738         being destroyed during execution.
3739
3740         Tested by fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash.html.
3741
3742         * inspector/InspectorDOMAgent.cpp:
3743         (WebCore::InspectorDOMAgent::didCommitLoad):
3744         * rendering/RenderLayer.cpp:
3745         (WebCore::RenderLayer::scrollRectToVisible):
3746
3747 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
3748
3749         [css-grid] Add CSS Grid Layout runtime flag
3750         https://bugs.webkit.org/show_bug.cgi?id=157134
3751
3752         Reviewed by Simon Fraser.
3753
3754         Add CSS Grid Layout runtime flag enabled by default.
3755         Disable parsing of CSS Grid Layout properties
3756         if the runtime flag is not enabled.
3757         Expose runtime flag through internals to verify that
3758         it's working as expected.
3759
3760         Test: fast/css-grid-layout/grid-disable.html
3761
3762         * bindings/generic/RuntimeEnabledFeatures.cpp:
3763         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
3764         * bindings/generic/RuntimeEnabledFeatures.h:
3765         (WebCore::RuntimeEnabledFeatures::setCSSGridLayoutEnabled):
3766         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
3767         * css/CSSParser.cpp:
3768         (WebCore::CSSParserContext::CSSParserContext):
3769         (WebCore::operator==):
3770         (WebCore::isValidKeywordPropertyAndValue):
3771         (WebCore::CSSParser::parseValue):
3772         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
3773         (WebCore::CSSParser::parseGridPosition):
3774         (WebCore::CSSParser::parseGridItemPositionShorthand):
3775         (WebCore::CSSParser::parseGridGapShorthand):
3776         (WebCore::CSSParser::parseGridTemplateColumns):
3777         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
3778         (WebCore::CSSParser::parseGridTemplateShorthand):
3779         (WebCore::CSSParser::parseGridShorthand):
3780         (WebCore::CSSParser::parseGridAreaShorthand):
3781         (WebCore::CSSParser::parseSingleGridAreaLonghand):
3782         (WebCore::CSSParser::parseGridLineNames):
3783         (WebCore::CSSParser::parseGridTrackList):
3784         (WebCore::CSSParser::parseGridTrackRepeatFunction):
3785         (WebCore::CSSParser::parseGridTrackSize):
3786         (WebCore::CSSParser::parseGridBreadth):
3787         (WebCore::CSSParser::parseGridAutoFlow):
3788         (WebCore::CSSParser::parseGridTemplateAreasRow):
3789         (WebCore::CSSParser::parseGridTemplateAreas):
3790         (WebCore::CSSParser::iscSSGridLayoutEnabled):
3791         * css/CSSParser.h:
3792         * css/CSSParserMode.h:
3793         * dom/Document.cpp:
3794         (WebCore::Document::isCSSGridLayoutEnabled):
3795         * dom/Document.h:
3796         * testing/Internals.cpp:
3797         (WebCore::Internals::setCSSGridLayoutEnabled):
3798         * testing/Internals.h:
3799         * testing/Internals.idl:
3800
3801 2016-04-28  Chris Fleizach  <cfleizach@apple.com>
3802
3803         AX: superscript content exposed as plain text; VoiceOver does not speak or pause to make this understandable
3804         https://bugs.webkit.org/show_bug.cgi?id=157122
3805         <rdar://problem/21231487>
3806
3807         Reviewed by Daniel Bates.
3808
3809         Expose role types for subscript and superscript.
3810
3811         Modified: accessibility/mac/subroles-for-formatted-groups.html
3812
3813         * accessibility/AccessibilityObject.cpp:
3814         (WebCore::AccessibilityObject::isStyleFormatGroup):
3815         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3816         (-[WebAccessibilityObjectWrapper subrole]):
3817
3818 2016-04-28  Brady Eidson  <beidson@apple.com>
3819
3820         inspector/indexeddb/requestDatabaseNames.html is flaky on Mac.
3821         https://bugs.webkit.org/show_bug.cgi?id=157141
3822
3823         Reviewed by Alex Christensen.
3824
3825         Test: inspector/indexeddb/deleteDatabaseNamesWithSpace.html
3826
3827         * platform/FileSystem.cpp:
3828         (WebCore::decodeFromFilename): Advance iterator after decoding.
3829
3830 2016-04-28  Dan Bernstein  <mitz@apple.com>
3831
3832         <rdar://problem/25986324> WebKit build broken with error: undeclared selector 'childViewControllerForWhitePointAdaptivityStyle'
3833
3834         Fixed the build by removing use of API that no longer does anything.
3835
3836         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3837         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Revert to using a plain UIViewController.
3838         (createFullScreenVideoRootViewControllerClass): Deleted.
3839         (allocWebFullScreenVideoRootViewControllerInstance): Deleted.
3840
3841 2016-04-28  Brady Eidson  <beidson@apple.com>
3842
3843         Modern IDB: Reimplement Web Inspector code that was tied to Legacy IDB.
3844         https://bugs.webkit.org/show_bug.cgi?id=154686
3845
3846         Reviewed by Alex Christensen.
3847
3848         No new tests (Inspector folks will have to write them if they're possible).
3849
3850         * inspector/InspectorIndexedDBAgent.cpp: Reimplement missing functionality mostly with code that was 
3851           removed in http://trac.webkit.org/changeset/197131/trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
3852
3853 2016-04-28  Daniel Bates  <dabates@apple.com>
3854
3855         Fix the Apple Internal OS X build
3856
3857         * platform/graphics/mac/PDFDocumentImageMac.mm:
3858         (WebCore::PDFDocumentImage::drawPDFPage): Ignore deprecation warning for -[PDFPage drawWithBox:].
3859
3860 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3861
3862         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
3863         https://bugs.webkit.org/show_bug.cgi?id=156904
3864
3865         Reviewed by Darin Adler.
3866
3867         MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
3868         MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
3869         SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.
3870
3871         Did some refactoring to use more references.
3872
3873         Covered by updated test.
3874
3875         * Modules/mediasource/MediaSource.cpp:
3876         (WebCore::MediaSource::endOfStream):
3877         (WebCore::MediaSource::addSourceBuffer):
3878         (WebCore::MediaSource::removeSourceBuffer):
3879         * Modules/mediasource/MediaSource.h:
3880         * Modules/mediasource/MediaSource.idl:
3881         * Modules/mediasource/SourceBuffer.cpp:
3882         (WebCore::SourceBuffer::appendBuffer):
3883         * Modules/mediasource/SourceBuffer.h:
3884         * Modules/mediasource/SourceBuffer.idl:
3885         * Modules/mediasource/SourceBufferList.cpp:
3886         (WebCore::SourceBufferList::add):
3887         (WebCore::SourceBufferList::remove):
3888         * Modules/mediasource/SourceBufferList.h:
3889
3890 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3891
3892         Drop [UsePointersEvenForNonNullableObjectArguments] from Node
3893         https://bugs.webkit.org/show_bug.cgi?id=156978
3894
3895         Reviewed by Chris Dumez.
3896
3897         No change of behavior.
3898
3899         * dom/Node.idl: Marking some parameters nullable.
3900
3901 2016-04-27  Ada Chan  <adachan@apple.com>
3902
3903         Set overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
3904         https://bugs.webkit.org/show_bug.cgi?id=157110
3905
3906         Reviewed by Eric Carlson.
3907
3908         Test: fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html
3909
3910         This matches what we do in mediaControlsiOS.css.
3911
3912         * Modules/mediacontrols/mediaControlsApple.css:
3913         (::-webkit-media-controls):
3914
3915 2016-04-28  Chris Dumez  <cdumez@apple.com>
3916
3917         [Web IDL] Specify default values for optional parameters of type 'DOMString'
3918         https://bugs.webkit.org/show_bug.cgi?id=157116
3919
3920         Reviewed by Darin Adler.
3921
3922         Specify default values for optional parameters of type 'DOMString' so
3923         that this default value is used if the parameter is either omitted or
3924         undefined. For parameters of type DOMString and that are not nullable,
3925         the bindings generator now uses the null string as implicit default
3926         value (unless explicitely specified otherwise in the IDL). This
3927     &n