Node.prototype.rootNode is not Web compatible
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-04-30  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Node.prototype.rootNode is not Web compatible
4         https://bugs.webkit.org/show_bug.cgi?id=157233
5
6         Reviewed by Chris Dumez.
7
8         Turns out that the name rootNode is not Web compatible. Remove the method for now
9         until we can come up with a better name in https://github.com/whatwg/dom/issues/241.
10
11         No new tests since we're just removing a method.
12
13         * dom/Node.idl:
14
15 2016-04-30  Darin Adler  <darin@apple.com>
16
17         Try to fix GTK build.
18
19         * testing/Internals.h: Added conditional around include of
20         MediaSessionInterruptionProvider.h.
21
22 2016-04-30  Darin Adler  <darin@apple.com>
23
24         Stop using old-style string-based enums in Internals.idl
25         https://bugs.webkit.org/show_bug.cgi?id=157235
26
27         Reviewed by Chris Dumez.
28
29         * bindings/scripts/CodeGenerator.pm: Removed the six enumeration names
30         that are used in Internals.idl.
31         (GenerateCompileTimeCheckForEnumsIfNeeded): Unrelated cleanup. Tighten
32         code and use static_assert instead of COMPILE_ASSERT.
33         (IsStringType): Marked this function as deprecated. Calling a function
34         just to check if something is specifically "DOMString" isn't a good pattern.
35         Lots of call sites were checking "DOMString" directly and there is no
36         reason to mix the two different idioms.
37
38         * bindings/scripts/CodeGeneratorJS.pm:
39         (GetEnumerationImplementationContent): Use GenerateConditionalString.
40         (GenerateImplementation): Use static_assert instead of COMPILE_ASSERT.
41         (GenerateCallbackHeader): Tighten code. Remove peculiar code that was
42         trying to emit COMPILE_ASSERT(false); not an important case to detect, and
43         if we did want to detect it, then having the code generator report an error
44         is better than COMPILE_ASSERT when compiling the output.
45         (NativeToJSValue): Stop using IsStringType.
46
47         * bindings/scripts/CodeGeneratorObjC.pm:
48         (GetClassName): Stop using IsStringType.
49         (GetPropertyAttributes): Ditto.
50         (ConversionNeeded): Ditto.
51         (GetObjCTypeGetter): Ditto.
52         (AddIncludesForType): Ditto.
53         (GenerateImplementation): Removed unused @needsAssert. It was a write-only
54         variable.
55
56         * bindings/scripts/IDLParser.pm:
57         (parseEnum): Put the extended attributes into the enumeration object.
58
59         * bindings/scripts/test/TestObj.idl: Added test cases for the Conditional
60         extended attribute, used with enumerations.
61
62         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
63         * bindings/scripts/test/JS/JSTestCallback.cpp:
64         * bindings/scripts/test/JS/JSTestCallback.h:
65         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
66         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
67         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
68         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
69         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
70         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
71         * bindings/scripts/test/JS/JSTestException.cpp:
72         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
73         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
74         * bindings/scripts/test/JS/JSTestInterface.cpp:
75         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
76         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
77         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
78         * bindings/scripts/test/JS/JSTestObj.cpp:
79         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
80         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
81         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
82         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
83         * bindings/scripts/test/JS/JSattribute.cpp:
84         * bindings/scripts/test/JS/JSreadonly.cpp:
85         Regenerated.
86
87         * testing/Internals.cpp:
88         (WebCore::toResourceRequestCachePolicy): Take enum instead of string.
89         (WebCore::Internals::setOverrideCachePolicy): Ditto.
90         (WebCore::toResourceLoadPriority): Ditto.
91         (WebCore::Internals::setOverrideResourceLoadPriority): Ditto.
92         (WebCore::toAutoFillButtonType): Ditto.
93         (WebCore::Internals::setShowAutoFillButton): Ditto.
94         (WebCore::interruptingCategoryFromString): Deleted.
95         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Ditto.
96         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
97         (WebCore::Internals::sendMediaControlEvent): Ditto.
98         (WebCore::Internals::installMockPageOverlay): Ditto.
99
100         * testing/Internals.h: Added enum class and use those instead of strings for
101         enumerations defined in the IDL.
102
103         * testing/Internals.idl: Renamed enumerations that conflict with ones that already
104         exist in WebCore; added Internals prefix. Made MediaSessionInterruptingCategory and
105         MediaControlEvent conditional to match the functions they are used on. Added some
106         FIXMEs about peculiarities of some of the enumerations.
107
108 2016-04-30  Darin Adler  <darin@apple.com>
109
110         Fixed expected results from bindings tests.
111
112         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
113
114 2016-04-30  Darin Adler  <darin@apple.com>
115
116         Next batch of conversions to use C++ enum class instead of strings for enumerations
117         https://bugs.webkit.org/show_bug.cgi?id=157232
118
119         Reviewed by Chris Dumez.
120
121         * Modules/fetch/FetchResponse.cpp:
122         (WebCore::FetchResponse::error): Use ResponseType.
123         (WebCore::FetchResponse::redirect): Ditto.
124         (WebCore::FetchResponse::FetchResponse): Ditto.
125         (WebCore::FetchResponse::clone): Ditto.
126         (WebCore::FetchResponse::type): Return ResponseType.
127         (WebCore::FetchResponse::startFetching): Use auto.
128         * Modules/fetch/FetchResponse.h: Added ResponseType and used it for the return value
129         of the type function, and also to replace FetchResponse::Type.
130
131         * Modules/mediacontrols/MediaControlsHost.cpp:
132         (WebCore::MediaControlsHost::externalDeviceType): Return DeviceType.
133         * Modules/mediacontrols/MediaControlsHost.h: Added DeviceType and use it for the
134         return value for the externalDeviceType function.
135
136         * Modules/mediasession/MediaSession.cpp:
137         (WebCore::MediaSession::parseKind): Deleted.
138         (WebCore::MediaSession::MediaSession): Use MediaSessionKind.
139         (WebCore::MediaSession::kind): Deleted.
140         * Modules/mediasession/MediaSession.h: Added MediaSessionKind and use it as the
141         argument to MediaSession::create and the return type for the kind function.
142         Probably didn't get this 100% right because this code does not seem to be compiled.
143         * Modules/mediasession/MediaSession.idl: Added default value for kind, as specified
144         in the current version of the specification for this class.
145         * Modules/mediasession/MediaSessionManager.cpp:
146         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification):
147         Tried to update for changes above.
148         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
149
150         * Modules/mediasource/MediaSource.cpp:
151         (WebCore::MediaSource::endOfStream): Changed to take Optional<EndOfStreamError>
152         instead of overloading and taking const AtomicString&.
153         (WebCore::MediaSource::streamEndedWithError): Ditto. Also removed exception code.
154         (WebCore::MediaSource::addSourceBuffer): Updated to use EndOfStreamError. Also
155         used an if statement.
156         (WebCore::MediaSource::sourceBufferDidChangeActiveState): Updated to take a reference
157         instead of a pointer.
158         * Modules/mediasource/MediaSource.h: Added EndOfStreamError and changed as above.
159
160         * Modules/mediasource/SourceBuffer.cpp:
161         (WebCore::SourceBuffer::segmentsKeyword): Deleted.
162         (WebCore::SourceBuffer::sequenceKeyword): Deleted.
163         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Initialize booleans where they are
164         defined rather than in this constructor.
165         (WebCore::SourceBuffer::create): Use Ref instead of RefPtr.
166         (WebCore::SourceBuffer::SourceBuffer): Initialize many data members where they are
167         defined rather than in this constructor.
168         (WebCore::SourceBuffer::setTimestampOffset): Use AppendMode.
169         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
170         (WebCore::SourceBuffer::decodeError): Deleted.
171         (WebCore::SourceBuffer::networkError): Deleted.
172         (WebCore::SourceBuffer::setActive): Pass reference instead of pointer.
173         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Deleted. No callers.
174         (WebCore::SourceBuffer::appendError): Use AppendMode.
175         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
176         (WebCore::SourceBuffer::setMode): Take AppendMode.
177         * Modules/mediasource/SourceBuffer.h: Added AppendMode, removed various string
178         constant functions, initialize more data emebers in this header. Removed unused
179         sourceBufferPrivateDidEndStream function.
180
181         * Modules/mediastream/MediaDeviceInfo.cpp:
182         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Take MediaDeviceKind instead of string.
183         (WebCore::MediaDeviceInfo::create): Ditto.
184         (WebCore::MediaDeviceInfo::audioInputType): Deleted.
185         (WebCore::MediaDeviceInfo::audioOutputType): Deleted.
186         (WebCore::MediaDeviceInfo::videoInputType): Deleted.
187         * Modules/mediastream/MediaDeviceInfo.h: Aedded MediaDeviceKind and used it.
188         * Modules/mediastream/MediaDeviceInfo.idl: Changed type of the kind attribute
189         to be MediaDeviceKind as in the specification.
190
191         * Modules/mediastream/MediaDevicesRequest.cpp:
192         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Fix loop to not
193         churn the reference countds. Also updated to use String instead of AtomicString for
194         label, and MediaDeviceKind instead of string for kind.
195
196         * Modules/mediastream/MediaStreamTrack.cpp:
197         (WebCore::MediaStreamTrack::readyState): Return MediaStreamTrackState.
198         * Modules/mediastream/MediaStreamTrack.h: Added MediaStreamTrackState and used it
199         for the return value from the readyState function.
200
201         * Modules/webaudio/AudioContext.cpp:
202         (WebCore::AudioContext::state): Return AudioContextState.
203         * Modules/webaudio/AudioContext.h: Added AudioContextState and used it.
204
205         * Modules/webaudio/WaveShaperNode.cpp:
206         (WebCore::processorType): Added.
207         (WebCore::WaveShaperNode::setOversample): Take OverSampletype instead of a string.
208         (WebCore::WaveShaperNode::oversample): Return OverSampleType.
209         * Modules/webaudio/WaveShaperNode.h: Added OverSampleType and used it.
210         * Modules/webaudio/WaveShaperNode.idl: Removed unneeded [SetterRaisesException].
211
212         * bindings/scripts/CodeGenerator.pm: Removed special cases for 18 enumerations that
213         either don't exist or were converted to no longer pass strings in to the C++ DOM.
214
215         * bindings/scripts/CodeGeneratorJS.pm:
216         (GenerateHeaderContentHeader): Use #pragma once instead of header guards.
217         (GetEnumerationValueName): Added logic to handle names with "-" and starting with
218         a numeric digit.
219         (GetEnumerationImplementationContent): Changed functions so they do more of the
220         binding work. Added JSValueTraits specialization so we can generate bindings for
221         a vector of any enumeration. Added special cases for null string. Removed special
222         case to keep the style checker happy.
223         (GenerateHeader): Removed the #endif that matched the header guards in
224         GenerateHeaderContentHeader.
225         (GenerateImplementation): Use the $type local variable rather than writing out
226         $attribute->signature->type or $attributeType. Fixed code path that checks for
227         valid enumeration values to work for non-string-based enumerations.
228         (CanUseWTFOptionalForParameter): Turn this function off for the new enumerations.
229         For now, leave it on for the old string-based enumerations.
230         (GenerateParametersCheck): Added appropriate parameter checking for the new
231         enumerations.
232         (GenerateCallbackHeader): Removed the #endif that matched the header guards in
233         GenerateHeaderContentHeader.
234         (GetNativeType): Use "auto" instead of the enumeration name in generated code.
235         (JSValueToNative): Updated since the name of enumerationValueMyEnum was changed
236         to parseMyEnum.
237         (NativeToJSValue): Took out call to stringValue, since we now overload the
238         jsStringWithCache function instead.
239
240         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
241         * bindings/scripts/test/JS/JSTestCallback.h:
242         * bindings/scripts/test/JS/JSTestCallbackFunction.h:
243         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
244         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
245         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
246         * bindings/scripts/test/JS/JSTestEventConstructor.h:
247         * bindings/scripts/test/JS/JSTestEventTarget.h:
248         * bindings/scripts/test/JS/JSTestException.h:
249         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
250         * bindings/scripts/test/JS/JSTestGlobalObject.h:
251         * bindings/scripts/test/JS/JSTestInterface.h:
252         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
253         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
254         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
255         * bindings/scripts/test/JS/JSTestNode.h:
256         * bindings/scripts/test/JS/JSTestNondeterministic.h:
257         * bindings/scripts/test/JS/JSTestObj.cpp:
258         * bindings/scripts/test/JS/JSTestObj.h:
259         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
260         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
261         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
262         * bindings/scripts/test/JS/JSTestTypedefs.h:
263         * bindings/scripts/test/JS/JSattribute.h:
264         * bindings/scripts/test/JS/JSreadonly.h:
265         Regenerated.
266
267         * crypto/CryptoKey.cpp:
268         (WebCore::CryptoKey::type): Use CryptoKeyType.
269         (WebCore::CryptoKey::usages): Use KeyUsage.
270         * crypto/CryptoKey.h: Added KeyUsage and use CryptoKeyType.
271
272         * css/FontFaceSet.cpp:
273         (WebCore::FontFaceSet::status): Use FontFaceSetLoadStatus.
274         * css/FontFaceSet.h: Added FontFaceSetLoadStatus and used it.
275
276         * html/HTMLMediaElement.cpp:
277         (WebCore::HTMLMediaElement::playInternal): Use kind instead of kindEnum.
278
279         * html/HTMLVideoElement.cpp:
280         (WebCore::presentationModeFullscreen): Deleted.
281         (WebCore::presentationModePictureInPicture): Deleted.
282         (WebCore::presentationModeInline): Deleted.
283         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use VideoPresentationMode.
284         (WebCore::toFullscreenMode): Ditto.
285         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
286         (WebCore::toPresentationMode): Ditto.
287         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
288         * html/HTMLVideoElement.h: Added VideoPresentationMode and used it.
289
290         * html/canvas/CanvasRenderingContext2D.cpp: Tweaked formatting. Changed
291         DefaultSmoothingQuality macro to a constant.
292         (WebCore::toWindRule): Replaces parseWinding.
293         (WebCore::CanvasRenderingContext2D::fill): Use CanvasWindingRule instead of string.
294         (WebCore::CanvasRenderingContext2D::clip): Ditto.
295         (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
296         (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
297         (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
298         (WebCore::CanvasRenderingContext2D::isPointInStroke): Ditto.
299         (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
300         (WebCore::smoothingToInterpolationQuality): Ditto.
301         (WebCore::CanvasRenderingContext2D::imageSmoothingQuality): Ditto.
302         (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality): Ditto.
303         * html/canvas/CanvasRenderingContext2D.h: Added CanvasWindingRule and
304         ImageSmoothingQuality, and use them throughout the class.
305
306         * platform/graphics/SourceBufferPrivateClient.h: Removed unused
307         sourceBufferPrivateDidEndStream function.
308
309 2016-04-30  Nan Wang  <n_wang@apple.com>
310
311         AX: @aria-label attribute should work on <label> element
312         https://bugs.webkit.org/show_bug.cgi?id=157219
313
314         Reviewed by Chris Fleizach.
315
316         When there's aria-label on a <label> element, we shouldn't expose it
317         as the titleUIElement. Instead, we return its aria-label as a title.
318
319         Test: accessibility/mac/aria-label-on-label-element.html
320
321         * accessibility/AccessibilityNodeObject.cpp:
322         (WebCore::AccessibilityNodeObject::titleElementText):
323         * accessibility/AccessibilityRenderObject.cpp:
324         (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
325
326         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
327         (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
328         Use DeviceType instead of String for externalDeviceType.
329
330 2016-04-29  Chris Dumez  <cdumez@apple.com>
331
332         [Web IDL] Specify default parameter values for callback parameters
333         https://bugs.webkit.org/show_bug.cgi?id=157188
334
335         Reviewed by Darin Adler.
336
337         Specify default parameter values for callback parameters.
338
339         * Modules/geolocation/Geolocation.idl:
340         * Modules/notifications/Notification.cpp:
341         (WebCore::Notification::requestPermission):
342         * Modules/notifications/Notification.h:
343         * Modules/notifications/Notification.idl:
344         * Modules/notifications/NotificationCenter.idl:
345         * Modules/quota/StorageInfo.cpp:
346         (WebCore::StorageInfo::queryUsageAndQuota):
347         (WebCore::StorageInfo::requestQuota):
348         * Modules/quota/StorageInfo.h:
349         * Modules/quota/StorageInfo.idl:
350         * Modules/quota/StorageQuota.h:
351         * Modules/quota/StorageQuota.idl:
352         * Modules/webaudio/AudioContext.idl:
353         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
354         (WebCore::DOMWindowWebDatabase::openDatabase):
355         * Modules/webdatabase/DOMWindowWebDatabase.h:
356         (WebCore::DOMWindowWebDatabase::DOMWindowWebDatabase):
357         (WebCore::DOMWindowWebDatabase::~DOMWindowWebDatabase):
358         * Modules/webdatabase/DOMWindowWebDatabase.idl:
359         * Modules/webdatabase/Database.cpp:
360         (WebCore::Database::runTransaction):
361         (WebCore::Database::changeVersion):
362         (WebCore::Database::transaction):
363         (WebCore::Database::readTransaction):
364         * Modules/webdatabase/Database.h:
365         * Modules/webdatabase/Database.idl:
366         * Modules/webdatabase/SQLTransaction.idl:
367         * bindings/scripts/CodeGeneratorJS.pm:
368         (GenerateParametersCheck):
369         (CanUseWTFOptionalForParameter): Deleted.
370         * bindings/scripts/test/TestObj.idl:
371         * dom/DataTransferItem.h:
372         * dom/DataTransferItem.idl:
373
374 2016-04-28  Darin Adler  <darin@apple.com>
375
376         First step in using "enum class" instead of "String" for enumerations in DOM
377         https://bugs.webkit.org/show_bug.cgi?id=157163
378
379         Reviewed by Chris Dumez.
380
381         This patch adds the basic support for using "enum class" to implement enumerations
382         in the C++ DOM. This is enough so we can use it for one case, but not enough for
383         others. For example, it correctly generates code to get an attribute, but likely
384         does not correctly generate code to set an attribute or call a function with an
385         argument type that is the new style of enum.
386
387         * bindings/scripts/CodeGenerator.pm: Cleaned up the formatting of the hashes
388         at the start of this file. Added a new one named stringBasedEnumerationHash
389         and a comment explaining that we need to eventually make it empty.
390         (ProcessDocument): Pass the enumerations into the GenerateInterface function.
391         (IsStringBasedEnumType): Added. Returns 1 for the old-style string-based enumerations,
392         as opposed to enumerations we use "enum class" for.
393
394         * bindings/scripts/CodeGeneratorJS.pm:
395         (GenerateInterface): Take the enumerations argument and pass it along to the
396         functions that generate headers and implementation files.
397         (EnumerationClassName): Added. Maps from an enumeration type name as seen
398         in the IDL file to the enumeration class name used in the C++ DOM implementation.
399         (EnumerationValueName): Added. Maps from an anumeration string value as seen
400         in the IDL file to an enumeration value name used in the C++ DOM implementatino.
401         (EnumerationImplementationContent): Added. Generates a string with all the content
402         needed in the implementation file to define the helper functions for enumerations.
403         (GenerateHeader): Tweak.
404         (GenerateImplementation): Added call to EnumerationImplementationContent.
405         (GenerateParametersCheck): Use toWTFString instead of toString/value, which is a
406         longer way of writing out the same thing.
407         (GenerateCallbackHeader): Tweak.
408         (GenerateCallbackImplementation): Added call to EnumerationImplementationContent.
409         (GetNativeType): Continue to return String for string-based enum types, but for
410         other enum types, return the result of EnumerationClassName instead.
411         (JSValueToNative): Use toWTFString instead of toString/value (see above), convert
412         to a string only for string-based enum types, and add a preliminary, probably not
413         yet working, version of the code for non-string-based enum types. Will finish this
414         in the next patch when we are trying to use one of the new enumerations for a setter
415         or a function argument.
416         (NativeToJSValue): Call the stringValue function to convert an enumeration value
417         into a string when it's not a string-based enumeration.
418
419         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
420         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
421         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
422         * bindings/scripts/test/JS/JSTestInterface.cpp:
423         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
424         * bindings/scripts/test/JS/JSTestNode.cpp:
425         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
426         * bindings/scripts/test/JS/JSTestObj.cpp:
427         * bindings/scripts/test/JS/JSTestObj.h:
428         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
429         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
430         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
431         Regenerated.
432
433         * css/FontFace.cpp:
434         (WebCore::FontFace::status): Updated to return enum values rather than strings.
435
436         * css/FontFace.h: Removed unneeded forward declaration of Deprecated::ScriptValue.
437         Added enum class for FontFaceLoadStatus, with names that match the names from the
438         enumeration in the IDL, but with our standard enum capitalization style. Changed
439         the return value of the status function to FontFaceLoadStatus.
440
441 2016-04-29  Chris Dumez  <cdumez@apple.com>
442
443         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
444         https://bugs.webkit.org/show_bug.cgi?id=157224
445
446         Reviewed by Ryosuke Niwa.
447
448         Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
449         since all the call sites already do a null check. Also update the function
450         to take the implementation object by reference instead of pointer. Finally,
451         use is<>() / downcast<>() more at the call sites.
452
453         * Modules/indexeddb/IDBCursor.cpp:
454         (WebCore::IDBCursor::update):
455         (WebCore::IDBCursor::deleteFunction):
456         (WebCore::IDBCursor::setGetResult):
457         * Modules/indexeddb/IDBCursor.h:
458         (WebCore::IDBCursor::isKeyCursorWithValue):
459         (WebCore::IDBCursor::isKeyCursor): Deleted.
460         * Modules/indexeddb/IDBCursorWithValue.h:
461         (isType):
462         * bindings/js/JSBlobCustom.cpp:
463         (WebCore::toJS):
464         * bindings/js/JSCanvasRenderingContextCustom.cpp:
465         (WebCore::toJS):
466         * bindings/js/JSDOMBinding.h:
467         (WebCore::wrap):
468         * bindings/js/JSIDBCursorCustom.cpp:
469         (WebCore::toJS):
470         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
471         (WebCore::toJS):
472         * bindings/js/JSPerformanceEntryCustom.cpp:
473         (WebCore::toJS):
474         * html/canvas/WebGL2RenderingContext.h:
475         * html/canvas/WebGLRenderingContext.h:
476         * page/PerformanceMark.h:
477         (isType):
478         (WebCore::PerformanceMark::isMark): Deleted.
479         * page/PerformanceMeasure.h:
480         (isType):
481         (WebCore::PerformanceMeasure::isMeasure): Deleted.
482         * page/PerformanceResourceTiming.h:
483         (isType):
484         (WebCore::PerformanceResourceTiming::isResource): Deleted.
485
486 2016-04-29  Chris Dumez  <cdumez@apple.com>
487
488         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings
489         https://bugs.webkit.org/show_bug.cgi?id=157210
490
491         Reviewed by Darin Adler.
492
493         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings.
494         We already make use of them in the JS bindings but they are some cases
495         where we don't and they may be useful.
496
497         * bindings/scripts/CodeGeneratorJS.pm:
498         (GenerateOverloadedFunction):
499         (GenerateImplementation):
500         (GenerateParametersCheck):
501         (GenerateImplementationFunctionCall):
502         (GenerateOverloadedConstructorDefinition):
503         (GenerateConstructorDefinition):
504         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
505         (WebCore::jsTestActiveDOMObjectConstructor):
506         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
507         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
508         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
509         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
510         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
511         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
512         (WebCore::jsTestCustomNamedGetterConstructor):
513         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
514         (WebCore::jsTestEventConstructorConstructor):
515         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
516         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
517         (WebCore::jsTestEventTargetConstructor):
518         * bindings/scripts/test/JS/JSTestException.cpp:
519         (WebCore::jsTestExceptionConstructor):
520         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
521         (WebCore::jsTestGenerateIsReachableConstructor):
522         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
523         (WebCore::jsTestGlobalObjectConstructor):
524         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
525         * bindings/scripts/test/JS/JSTestInterface.cpp:
526         (WebCore::JSTestInterfaceConstructor::construct):
527         (WebCore::jsTestInterfaceConstructor):
528         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
529         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
530         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
531         (WebCore::jsTestJSBuiltinConstructorConstructor):
532         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
533         (WebCore::jsTestMediaQueryListListenerConstructor):
534         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
535         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
536         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
537         (WebCore::jsTestNamedConstructorConstructor):
538         * bindings/scripts/test/JS/JSTestNode.cpp:
539         (WebCore::jsTestNodeConstructor):
540         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
541         (WebCore::jsTestNondeterministicConstructor):
542         * bindings/scripts/test/JS/JSTestObj.cpp:
543         (WebCore::JSTestObjConstructor::construct):
544         (WebCore::JSTestObj::getOwnPropertySlotByIndex):
545         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
546         (WebCore::jsTestObjConstructor):
547         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
548         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
549         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
550         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
551         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
552         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
553         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
554         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
555         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
556         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
557         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
558         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
559         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
560         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
561         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
562         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
563         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
564         (WebCore::jsTestObjPrototypeFunctionConvert1):
565         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
566         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
567         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
568         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
569         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
570         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
571         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
572         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
573         (WebCore::constructJSTestOverloadedConstructors1):
574         (WebCore::constructJSTestOverloadedConstructors3):
575         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
576         (WebCore::jsTestOverloadedConstructorsConstructor):
577         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
578         (WebCore::jsTestOverrideBuiltinsConstructor):
579         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
580         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
581         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
582         (WebCore::JSTestTypedefsConstructor::construct):
583         (WebCore::jsTestTypedefsConstructor):
584         * bindings/scripts/test/JS/JSattribute.cpp:
585         (WebCore::jsattributeConstructor):
586         * bindings/scripts/test/JS/JSreadonly.cpp:
587         (WebCore::jsreadonlyConstructor):
588
589 2016-04-29  Ryosuke Niwa  <rniwa@webkit.org>
590
591         Rename getAssignedNodes to assignedNodes and support flattened option
592         https://bugs.webkit.org/show_bug.cgi?id=157225
593
594         Reviewed by Antti Koivisto.
595
596         Renamed getAssignedNodes and added the the support for {flattened: true/false} as spec'ed at
597         http://w3c.github.io/webcomponents/spec/shadow/#widl-HTMLSlotElement-assignedNodes-sequence-Node--AssignedNodesOptions-options
598
599         Test: fast/shadow-dom/HTMLSlotElement-interface.html
600
601         * html/HTMLSlotElement.cpp:
602         (WebCore::flattenAssignedNodes): Added.
603         (WebCore::HTMLSlotElement::assignedNodesForBindings): Added.
604         * html/HTMLSlotElement.h:
605         * html/HTMLSlotElement.idl:
606
607 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
608
609         Make clipToRect() and restoreClip() have similar signatures
610         https://bugs.webkit.org/show_bug.cgi?id=157229
611
612         Reviewed by Zalan Bujtas.
613
614         clipToRect() and restoreClip() are always called in pairs, but had different
615         parameter order, and parameter types. So make them more similar.
616         
617         In future we could use them in a stack-based class.
618
619         No behavior change.
620
621         * rendering/RenderLayer.cpp:
622         (WebCore::RenderLayer::clipToRect):
623         (WebCore::RenderLayer::restoreClip):
624         (WebCore::RenderLayer::paintLayer):
625         (WebCore::RenderLayer::applyFilters):
626         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
627         (WebCore::RenderLayer::paintBackgroundForFragments):
628         (WebCore::RenderLayer::paintForegroundForFragments):
629         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
630         (WebCore::RenderLayer::paintOutlineForFragments):
631         (WebCore::RenderLayer::paintMaskForFragments):
632         (WebCore::RenderLayer::paintChildClippingMaskForFragments):
633         (WebCore::RenderLayer::paintOverflowControlsForFragments):
634         (WebCore::RenderLayer::calculateClipRects):
635         * rendering/RenderLayer.h:
636
637 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
638
639         Blur filter escapes an enclosing overflow:hidden
640         https://bugs.webkit.org/show_bug.cgi?id=155029
641
642         Reviewed by Zalan Bujtas.
643
644         The clipping that was applied when drawing the results of filters was wrong for two reasons.
645
646         First, it used localPaintingInfo which has already been contaminated when setting up the filters.
647         When painting the result, we need to use the original paintingInfo, to get the right paintDirtyRect.
648
649         Secondly, when setting up the clip to paint the filter result, it was relying on layerFragments[0].backgroundRect.
650         However, that was also contaminated by filter setup, since calculateRects() intersects with paintDirtyRect to
651         compute that backgroundRect, and that paintDirtyRect came from filterPainter->repaintRect().
652         
653         Fix this second issue by re-running collectFragments(), which computes a fragment backgroundRect using
654         the original paintDirtyRect.
655
656         Tests: css3/filters/blur-clipped-by-ancestor.html
657                css3/filters/blur-clipped-with-overflow.html
658                css3/filters/drop-shadow-with-overflow-hidden.html
659                css3/filters/drop-shadow.html
660
661         * platform/graphics/filters/FilterEffect.cpp:
662         (WebCore::FilterEffect::clearResult): Unconditionally null these out.
663         * rendering/FilterEffectRenderer.cpp:
664         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Typo fix.
665         * rendering/FilterEffectRenderer.h:
666         (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper): C++11 initialization.
667         * rendering/RenderLayer.cpp:
668         (WebCore::RenderLayer::applyFilters):
669         (WebCore::RenderLayer::paintLayerContents):
670         * rendering/RenderLayer.h: const
671
672 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
673
674         REGRESSION(194502): overflow: scroll; direction: rtl; divs jump horizontally when scrolled vertically
675         https://bugs.webkit.org/show_bug.cgi?id=157201
676
677         Reviewed by Simon Fraser.
678
679         ScrollableArea::scrollToOffsetWithoutAnimation() was mistakenly conflating scroll offsets with
680         scroll positions.
681
682         Test: fast/scrolling/rtl-drag-vertical-scroller.html
683
684         * platform/ScrollableArea.cpp:
685         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
686
687 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
688
689         Clean up GraphicsContext use in RenderLayer::paintLayerContents()
690         https://bugs.webkit.org/show_bug.cgi?id=157193
691
692         Reviewed by Zalan Bujtas.
693
694         Make the lifetime of the temporary GraphicsContext used to paint filters more explicit
695         by putting it in an inner scope.
696         
697         Make currentContext a reference.
698         
699         transparencyLayerContext was a confusing name (it doens't mean we've started a
700         transparency layer), so just use "context" to refer to the original context. When
701         passed to other functions, this is called "contextForTransparencyLayer".
702         
703         No longer leaves "context" as a null pointer if filterPainter->filterContext() returns
704         a null pointer. It's unclear if this ever happened.
705
706         * rendering/FilterEffectRenderer.cpp:
707         (WebCore::FilterEffectRendererHelper::filterContext):
708         * rendering/RenderLayer.cpp:
709         (WebCore::RenderLayer::beginTransparencyLayers):
710         (WebCore::RenderLayer::applyFilters):
711         (WebCore::RenderLayer::paintLayerContents):
712         (WebCore::RenderLayer::paintBackgroundForFragments):
713         (WebCore::RenderLayer::paintForegroundForFragments):
714         * rendering/RenderLayer.h:
715
716 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
717
718         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
719         https://bugs.webkit.org/show_bug.cgi?id=157198
720         <rdar://problem/26011049>
721
722         Reviewed by Timothy Hatcher.
723
724         No new tests. This only affects inspecting an inspector.
725
726         * inspector/InspectorController.h:
727         * inspector/InspectorFrontendClient.h:
728         (WebCore::InspectorFrontendClient::pagePaused):
729         (WebCore::InspectorFrontendClient::pageUnpaused):
730         * inspector/PageScriptDebugServer.cpp:
731         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
732         Inform a frontend client if the frontend page itself pauses/unpauses.
733
734 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
735
736         [iOS] do not exit AirPlay when the screen locks
737         https://bugs.webkit.org/show_bug.cgi?id=156502
738         <rdar://problem/24616592>
739
740         Reviewed by Dean Jackson
741
742         * html/HTMLMediaElement.cpp:
743         (WebCore::HTMLMediaElement::pendingActionTimerFired): Use m_isPlayingToWirelessTarget.
744         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless): Ditto.
745         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): Set m_isPlayingToWirelessTarget.
746         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Use
747           m_isPlayingToWirelessTarget.
748         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): Ditto.
749         (WebCore::HTMLMediaElement::configureMediaControls): Ditto.
750         (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
751         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge 
752           data if it is playing to a wireless target because that will drop the connection.
753         * html/HTMLMediaElement.h:
754
755         * html/MediaElementSession.cpp:
756         (WebCore::MediaElementSession::playbackPermitted): Add logging.
757         (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't 
758           have an explicit playbackTarget, don't test for it.
759         (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
760
761 2016-04-29  Chris Dumez  <cdumez@apple.com>
762
763         Node.nodeName should not be nullable
764         https://bugs.webkit.org/show_bug.cgi?id=157211
765
766         Reviewed by Ryosuke Niwa.
767
768         Node.nodeName should not be nullable as per the specification:
769         https://dom.spec.whatwg.org/#interface-node
770
771         Our implementation never returns null anyway. However, having
772         it as nullable in the IDL means we use jsStringOrNull() instead
773         of jsStringWithCache(), thus doing an unnecessary null check.
774
775         This should not be observable by JS.
776
777         * dom/Node.idl:
778
779 2016-04-29  Commit Queue  <commit-queue@webkit.org>
780
781         Unreviewed, rolling out r200150 and r200256.
782         https://bugs.webkit.org/show_bug.cgi?id=157216
783
784         This change introduced flakiness in existing CJK LayoutTests.
785         Also reverting the change that marked the tests as flaky.
786         (Requested by ryanhaddad on #webkit).
787
788         Reverted changesets:
789
790         "Clean up Font::removeFromSystemFallbackCache()"
791         https://bugs.webkit.org/show_bug.cgi?id=157093
792         http://trac.webkit.org/changeset/200150
793
794         "Marking fast/ruby/ruby-expansion-cjk.html and fast/ruby/ruby-
795         expansion-cjk-4.html as flaky on Mac"
796         https://bugs.webkit.org/show_bug.cgi?id=157197
797         http://trac.webkit.org/changeset/200256
798
799 2016-04-29  Antonio Gomes  <tonikitoo@webkit.org>
800
801         <select multiple> padding should react when scrolling
802
803         https://bugs.webkit.org/show_bug.cgi?id=156590
804         https://bugs.webkit.org/show_bug.cgi?id=156591
805
806         Reviewed by Reviewed by Darin Adler.
807
808         Tests: fast/forms/listbox-respects-padding-bottom.html
809                fast/forms/listbox-top-padding-do-not-clip-items.html
810
811         Non-dropdown listboxes have support to padding-{top,bottom} implemented similarly
812         to the border model: the padding area does not move when the listbox' content gets scrolled,
813         but instead it clips out its content.
814         This is not consistent with other browsers and is not consistent with the CSS box model.
815
816         This in practice, if a <select> has padding-top set, the padding-top area will clip out listbox'
817         content as one scrolls upwards.
818         It also means that if padding-bottom is set, when one scrolls all the way to the bottom
819         of the listbox content, padding-bottom is not respected.
820
821         In order to fix these two problems, and make WebKit match Blink with respect to the the way
822         padding-{top,bottom} are handled, patch adds two class member variables that control the number
823         of list items (i.e. <option>s) that can be painted over the current listbox' padding area.
824
825         In short, depending on the scroll position and the amount of space available in the padding top/bottom
826         areas, items are painted or not on top of it, mimic'ing the CSS box model behavior of other browsers.
827
828         Note that this is specific solution is worth it to pursue on the short/mid term, but a long-term solution
829         to this problem and many other listbox discrepancies on WebKit's implementation, would be to reimplement
830         RenderListBox class in terms of RenderLayer. This will be a follow up work.
831
832         * rendering/RenderListBox.cpp:
833         (WebCore::RenderListBox::updateFromElement):
834         (WebCore::RenderListBox::numVisibleItems):
835         (WebCore::RenderListBox::paintObject):
836         (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
837         (WebCore::RenderListBox::listIndexIsVisible):
838         (WebCore::RenderListBox::maximumNumberOfItemsThatFitInPaddingBottomArea):
839         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingTop):
840         (WebCore::RenderListBox::numberOfVisibleItemsInPaddingBottom):
841         (WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
842         (WebCore::RenderListBox::scrollTo):
843         * rendering/RenderListBox.h:
844
845 2016-04-29  Eric Carlson  <eric.carlson@apple.com>
846
847         [Mac] AirPlay fails if target is set before AVPlayer has been created
848         https://bugs.webkit.org/show_bug.cgi?id=157147
849         <rdar://problem/24197592>
850
851         Reviewed by Jer Noble.
852
853         Test: media/media-source/media-source-airplay.html
854
855         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
856         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Clear flag before calling
857           setShouldPlayToPlaybackTarget so it does the necessary setup.
858
859         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
860         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Return false if the mock
861           MSE source has been registered.
862         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Return 'not supported' if
863           isAvailable is false.
864         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Fail if isAvailable is false.
865         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless): Cleanup.
866
867         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
868         (WebCore::registered): Global accessor.
869         (WebCore::MockMediaPlayerMediaSource::isRegistered): 
870         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine): Set registered to true.
871         (WebCore::MockMediaPlayerMediaSource::setWirelessPlaybackTarget): New, remember the target.
872         (WebCore::MockMediaPlayerMediaSource::setShouldPlayToPlaybackTarget): New, remember the setting.
873         (WebCore::MockMediaPlayerMediaSource::isCurrentPlaybackTargetWireless):
874         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
875
876         * testing/Internals.cpp:
877         (WebCore::Internals::initializeMockMediaSource): Don't disable AVFoundation.
878
879 2016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
880
881         [RTL Scrollbars] REGRESSION(r200116): Positioned contents can overlap RTL scrollbars
882         https://bugs.webkit.org/show_bug.cgi?id=157164
883         <rdar://problem/25993610>
884
885         Reviewed by Darin Adler.
886
887         There was some code left over from the old implementation of RTL_SCROLLBARS
888         which had some faulty assumptions about the interaction between direction
889         and scrollbar placement. In particular, once we began obeying the "dir"
890         attribute in r200116, these assumptions were no longer valid.
891
892         Test: fast/scrolling/rtl-scrollbars-positioned-intersect-scrollbars.html
893               scrollbars/rtl/div-absolute.html
894               scrollbars/rtl/div-horizontal.html
895
896         * rendering/InlineFlowBox.h:
897         (WebCore::InlineFlowBox::layoutOverflowRect):
898         * rendering/RenderBlock.cpp:
899         (WebCore::RenderBlock::computeOverflow): Deleted.
900         * rendering/RenderBox.cpp:
901         (WebCore::RenderBox::layoutOverflowRectForPropagation):
902         * rendering/RenderLayer.cpp:
903         (WebCore::RenderLayer::computeScrollDimensions):
904
905 2016-04-29  Nan Wang  <n_wang@apple.com>
906
907         AX: CharacterOffset not working correctly with composed characters and collapsed white spaces
908         https://bugs.webkit.org/show_bug.cgi?id=157190
909
910         Reviewed by Chris Fleizach.
911
912         When navigating emoji, next/previous text marker call is only moving by one character. Fixed it by
913         using the helper function in Position to get the real character count for the composed character sequence.
914         Also there's another issue with collapsed white spaces, TextIterator emits only one space. So we have to 
915         use the actual space length to create the CharacterOffset in order to generate valid Range object from it.
916
917         New test cases in accessibility/text-marker/text-marker-previous-next.html.
918
919         * accessibility/AXObjectCache.cpp:
920         (WebCore::AXObjectCache::traverseToOffsetInRange):
921         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
922         (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
923         (WebCore::AXObjectCache::nextNode):
924         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
925         (WebCore::AXObjectCache::nextCharacterOffset):
926         (WebCore::AXObjectCache::previousCharacterOffset):
927         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
928
929 2016-04-28  Jer Noble  <jer.noble@apple.com>
930
931         WebPlaybackControlsManager should not be owned by the WebPlaybackSessionInterfaceMac.
932         https://bugs.webkit.org/show_bug.cgi?id=157155
933         <rdar://problem/25991724>
934
935         Reviewed by Beth Dakin.
936
937         Move the WebPlaybackControlsManager class into its own header and implementation files.
938
939         * WebCore.xcodeproj/project.pbxproj:
940         * platform/mac/WebPlaybackControlsManager.h: Added.
941         * platform/mac/WebPlaybackControlsManager.mm: Added.
942         (-[WebPlaybackControlsManager timing]): Moved from WebPlaybackSessionInterfaceMac.
943         (-[WebPlaybackControlsManager setTiming:]): Ditto.
944         (-[WebPlaybackControlsManager seekableTimeRanges]): Ditto.
945         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Ditto.
946         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Ditto.
947         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Ditto.
948         * platform/mac/WebPlaybackSessionInterfaceMac.h:
949         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
950         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
951         (-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]): Deleted.
952         (-[WebPlaybackControlsManager timing]): Deleted.
953         (-[WebPlaybackControlsManager setTiming:]): Deleted.
954         (-[WebPlaybackControlsManager seekableTimeRanges]): Deleted.
955         (-[WebPlaybackControlsManager setSeekableTimeRanges:]): Deleted.
956         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]): Deleted.
957         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]): Deleted.
958         (WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager): Deleted.
959
960 2016-04-29  Commit Queue  <commit-queue@webkit.org>
961
962         Unreviewed, rolling out r200232.
963         https://bugs.webkit.org/show_bug.cgi?id=157189
964
965         This change broke the Mac CMake build and its LayoutTest is
966         failing and/or flaky on all platforms (Requested by ryanhaddad
967         on #webkit).
968
969         Reverted changeset:
970
971         "Move ResourceTiming behind a runtime flag"
972         https://bugs.webkit.org/show_bug.cgi?id=157133
973         http://trac.webkit.org/changeset/200232
974
975 2016-04-29  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
976
977         [GTK] Fix build failure introduced by r199738
978         https://bugs.webkit.org/show_bug.cgi?id=157182
979
980         Reviewed by Alex Christensen.
981
982         * CMakeLists.txt:
983
984 2016-04-29  Brady Eidson  <beidson@apple.com>
985
986         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
987         https://bugs.webkit.org/show_bug.cgi?id=157185
988
989         Reviewed by Anders Carlsson.
990
991         No new tests (Code cleanup, no change in behavior).
992
993         * platform/CrossThreadCopier.cpp:
994         (WebCore::IndexedDB::TransactionMode>::copy): Deleted.
995         (WebCore::IndexedDB::CursorDirection>::copy): Deleted.
996         (WebCore::IndexedDB::CursorType>::copy): Deleted.
997         (WebCore::IDBGetResult>::copy): Deleted.
998         (WebCore::IDBKeyData>::copy): Deleted.
999         (WebCore::IDBKeyRangeData>::copy): Deleted.
1000         (WebCore::IDBDatabaseInfo>::copy): Deleted.
1001         (WebCore::IDBDatabaseIdentifier>::copy): Deleted.
1002         (WebCore::IDBTransactionInfo>::copy): Deleted.
1003         (WebCore::IDBResourceIdentifier>::copy): Deleted.
1004         (WebCore::IDBError>::copy): Deleted.
1005         (WebCore::IDBObjectStoreInfo>::copy): Deleted.
1006         (WebCore::IDBIndexInfo>::copy): Deleted.
1007         (WebCore::IDBCursorInfo>::copy): Deleted.
1008         (WebCore::IDBValue>::copy): Deleted.
1009
1010         * platform/CrossThreadCopier.h:
1011         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): Deleted dead code.
1012         (WebCore::AllowCrossThreadAccessWrapper::value): Deleted dead code.
1013         (WebCore::AllowCrossThreadAccess): Deleted dead code.
1014         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper): Deleted dead code.
1015         (WebCore::AllowAccessLaterWrapper::value): Deleted dead code.
1016         (WebCore::AllowAccessLater): Deleted dead code.
1017
1018 2016-04-29  Simon Fraser  <simon.fraser@apple.com>
1019
1020         Wheel Event Not Fired For `body,html { height:100% }`
1021         https://bugs.webkit.org/show_bug.cgi?id=148450
1022
1023         Reviewed by Brent Fulgham.
1024         
1025         EventHandler::handleWheelEvent() didn't pass the Active flag in the HitTestRequest,
1026         which causes code in RenderLayer::hitTest() to fail to fall back to returning the
1027         root layer if no other element is hit. "Active" is in the default flags,
1028         so just create the HitTestRequest with the default flags.
1029
1030         Test: fast/events/wheel-event-outside-body.html
1031
1032         * page/EventHandler.cpp:
1033         (WebCore::EventHandler::handleWheelEvent):
1034
1035 2016-04-29  Chris Dumez  <cdumez@apple.com>
1036
1037         [Web IDL] Specify default values for optional parameters of wrapper types
1038         https://bugs.webkit.org/show_bug.cgi?id=157161
1039
1040         Reviewed by Darin Adler.
1041
1042         Specify default values for optional parameters of wrapper types.
1043
1044         * Modules/indexeddb/IDBIndex.cpp:
1045         (WebCore::IDBIndex::count): Deleted.
1046         * Modules/indexeddb/IDBIndex.h:
1047         * Modules/indexeddb/IDBIndex.idl:
1048         * Modules/indexeddb/IDBObjectStore.cpp:
1049         (WebCore::IDBObjectStore::count): Deleted.
1050         * Modules/indexeddb/IDBObjectStore.h:
1051         * Modules/indexeddb/IDBObjectStore.idl:
1052         * Modules/mediastream/RTCPeerConnection.cpp:
1053         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
1054         * Modules/mediastream/RTCPeerConnection.h:
1055         * Modules/mediastream/RTCPeerConnection.idl:
1056
1057         * bindings/scripts/CodeGeneratorJS.pm:
1058         (WillConvertUndefinedToDefaultParameterValue):
1059         Optimization to avoid generating a ternary if the default
1060         value of a wrapper type parameter is null, since undefined
1061         will already convert to null for those.
1062
1063         (GenerateParametersCheck):
1064         Use null as implicit default value for nullable parameters, given that Web IDL
1065         converts undefined to null for such parameters:
1066         http://heycam.github.io/webidl/#es-nullable-type
1067
1068         (CanUseWTFOptionalForParameter):
1069         Drop the check for wrapper types.
1070
1071         * bindings/scripts/test/*:
1072         Improve bindings tests coverage / rebaseline.
1073
1074         * css/MediaQueryList.idl:
1075         * css/MediaQueryListListener.idl:
1076         * dom/Document.idl:
1077
1078         * html/canvas/DOMPath.idl:
1079         The previous syntax was working because the bindings was generating an early
1080         return if addPath() was called with only one parameter, calling the
1081         implementation method with only 1 parameter. However, since we no longer
1082         generate early returns for optional parameters, we now have to use a slightly
1083         different syntax to maintain the previous behavior. This is only temporary,
1084         I just did not want to deal with SVG tear off types in this patch since they
1085         are very special in the bindings generator.
1086
1087         * page/DOMSelection.idl:
1088         The node parameter to extend() was confusingly marked as optional. However,
1089         when omitted, it would get translated into null, which would throw an
1090         exception since the type is not nullable. Since the specification says 'node'
1091         should not be optional, and since there is no behavior change, I dropped
1092         the 'optional'. The only web-exposed difference is the message provided with
1093         the TypeError that is thrown when called without enough parameters. The new
1094         message is more accurate (see rebaselined layout test).
1095
1096         * svg/SVGMarkerElement.idl:
1097         The parameter for setOrientToAngle() was confusingly marked as optional and
1098         having a default value of null. However, the bindings would throw a TypeError
1099         if called with no parameters or when calling it with null. This is because
1100         this is an SVG Tear off type and the bindings always throw when passing null
1101         for an SVG Tear off type. I therefore updated the IDL to reflect the actual
1102         behavior (no actual behavior change). The new IDL also now matches the spec:
1103         http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
1104
1105         * svg/SVGSVGElement.idl:
1106         Same comments as for SVGMarkerElement. The new IDL matches the actual
1107         behavior and is closer to the specification. I added FIXME comments for when
1108         it does not match the specification:
1109         http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement
1110         I did not change web-exposed behavior in this patch.
1111
1112         * svg/SVGTextContentElement.idl:
1113         Same as above. No actual behavior change.
1114
1115         * testing/Internals.cpp:
1116         * testing/Internals.h:
1117         * testing/Internals.idl:
1118         * xml/XPathEvaluator.idl:
1119
1120 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
1121
1122         [ATK] Expose the value of aria-roledescription via an AtkObject attribute
1123         https://bugs.webkit.org/show_bug.cgi?id=146719
1124
1125         Reviewed by Chris Fleizach.
1126
1127         The author-provided value is now exposed via an AtkObject attribute.
1128
1129         Implementation is already covered by aria-roledescription.html. The ATK
1130         expectations are slightly different than those for AX API because falling
1131         back on the default role description is done by assistive technologies.
1132         That this fall back is needed is identified by the lack of an author-
1133         provided value. Thus we do not wish to expose the default role description
1134         in our implementation.
1135
1136         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1137         (webkitAccessibleGetAttributes):
1138
1139 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
1140
1141         [ATK] accessibility/aria-current-global-attribute.html has been failed since r198303
1142         https://bugs.webkit.org/show_bug.cgi?id=155935
1143
1144         Reviewed by Chris Fleizach.
1145
1146         In ATK, the text of span elements is typically exposed through the parent
1147         element, unless the span has some attribute requiring inclusion in the
1148         accessibility tree. We were not checking for the presence of global ARIA
1149         attributes (including aria-current), other than describedby and role.
1150         The fix is to also check AccessibilityObject::supportsARIAAttributes().
1151
1152         No new tests. This issue was caught as a result of a failing test.
1153
1154         * accessibility/atk/AccessibilityObjectAtk.cpp:
1155         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1156
1157 2016-04-29  Chris Dumez  <cdumez@apple.com>
1158
1159         [Web IDL] Drop 'any' type handling from CanUseWTFOptionalForParameter()
1160         https://bugs.webkit.org/show_bug.cgi?id=157152
1161
1162         Reviewed by Darin Adler.
1163
1164         Drop 'any' type handling from CanUseWTFOptionalForParameter(). Always
1165         use undefined as default value for parameters of type 'any' unless
1166         specified otherwise.
1167
1168         * Modules/indexeddb/IDBCursor.cpp:
1169         (WebCore::IDBCursor::continueFunction): Deleted.
1170         * Modules/indexeddb/IDBCursor.h:
1171         * Modules/indexeddb/IDBObjectStore.cpp:
1172         (WebCore::IDBObjectStore::add): Deleted.
1173         (WebCore::IDBObjectStore::putOrAdd): Deleted.
1174         * Modules/indexeddb/IDBObjectStore.h:
1175         * bindings/scripts/CodeGeneratorJS.pm:
1176
1177         (WillConvertUndefinedToDefaultParameterValue):
1178         Fix optimization for optional DOMString attributes whose default value
1179         is the string "undefined". I also added bindings test coverage for it.
1180
1181         (GenerateParametersCheck):
1182         (CanUseWTFOptionalForParameter): Deleted.
1183         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1184         (webkit_dom_test_obj_method_with_optional_string_is_undefined):
1185         (webkit_dom_test_obj_method_with_optional_any):
1186         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1187         * bindings/scripts/test/JS/JSTestObj.cpp:
1188         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
1189         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
1190         * bindings/scripts/test/ObjC/DOMTestObj.h:
1191         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1192         (-[DOMTestObj methodWithOptionalStringIsUndefined:]):
1193         (-[DOMTestObj methodWithOptionalAny:]):
1194         * bindings/scripts/test/TestObj.idl:
1195         * testing/Internals.h:
1196
1197 2016-04-29  Joanmarie Diggs  <jdiggs@igalia.com>
1198
1199         AX: [ATK] Expose elements with ARIA's "text" role
1200         https://bugs.webkit.org/show_bug.cgi?id=157160
1201
1202         Reviewed by Chris Fleizach.
1203
1204         WebCore Accessibility's StaticTextRole is used for exposed RenderText
1205         objects and for the ARIA "text" role. The former should be folded into
1206         the parent element; the latter should not be, but was. Now we check to
1207         see which type we have when building the accessibility tree. Also map
1208         the "text" role to ATK_ROLE_STATIC.
1209
1210         We already have sufficient test coverage. Three previously-failing tests
1211         are now passing.
1212
1213         * accessibility/atk/AccessibilityObjectAtk.cpp:
1214         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1215         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1216         (atkRole):
1217
1218 2016-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1219
1220         [FreeType] ASSERTION FAILED: !lookupForWriting(Extractor::extract(entry)).second in FontCache::getVerticalData()
1221         https://bugs.webkit.org/show_bug.cgi?id=157132
1222
1223         Reviewed by Darin Adler.
1224
1225         I've noticed that some tests fail randomly in the GTK+ debug bot due to an assertion in HashMap when getting
1226         vertical data from the FontCache. I don't know exactly what's wrong, but looks like a problem with the
1227         FontVerticalDataCache hash traits implementation. Looking at the code, I've realized that we could simplify
1228         everything by reusing the FontDataCache hash and traits, since we are actually using the
1229         FontPlatformData::hash() in the end in both cases. Also, I don't see why we need to get the vertical data from
1230         the FontPlatformData while it's actually cached by the font cache. We could just use the FontCache directly
1231         passing only the FontPlatformData. These changes seem to fix the crashes and make the code a lot simpler.
1232
1233         * platform/graphics/Font.cpp:
1234         (WebCore::Font::Font): Use FontCache::verticalData().
1235         * platform/graphics/FontCache.cpp:
1236         (WebCore::fontVerticalDataCache):
1237         (WebCore::FontCache::verticalData):
1238         (WebCore::FontCache::purgeInactiveFontData): Also remove the cached vertical data when removing a font.
1239         (WebCore::FontCache::invalidate): Clear also the vertical data.
1240         * platform/graphics/FontCache.h:
1241         * platform/graphics/FontPlatformData.h:
1242         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1243         (WebCore::FontPlatformData::openTypeTable): Deleted.
1244         * platform/graphics/opentype/OpenTypeVerticalData.h: Remove the m_inFontCache member that is now unused.
1245
1246 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1247
1248         Remove UsePointersEvenForNonNullableObjectArguments keyword
1249         https://bugs.webkit.org/show_bug.cgi?id=156844
1250
1251         Reviewed by Darin Adler.
1252
1253         No change of behavior.
1254
1255         * bindings/scripts/CodeGenerator.pm:
1256         (ShouldPassWrapperByReference): Removed UsePointersEvenForNonNullableObjectArguments support.
1257         * bindings/scripts/IDLAttributes.txt: Removed UsePointersEvenForNonNullableObjectArguments.
1258
1259 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1260
1261         FetchResponse should return a ReadableStream even if disturbed
1262         https://bugs.webkit.org/show_bug.cgi?id=156911
1263
1264         Reviewed by Darin Adler.
1265
1266         Covered by rebased test.
1267
1268         * Modules/fetch/FetchResponse.cpp:
1269         (WebCore::FetchResponse::createReadableStreamSource): Asserting in case response is disturbed.
1270         * bindings/js/JSFetchResponseCustom.cpp:
1271         (WebCore::JSFetchResponse::body): Creating a locked empty readable stream if response is disturbed.
1272         * bindings/js/ReadableStreamController.cpp:
1273         (WebCore::createReadableStream): Constructing a readable stream even if source is null.
1274         (WebCore::getReadableStreamReader): Retrieving the reader from a readable stream. Stream must not be locked.
1275         * bindings/js/ReadableStreamController.h:
1276
1277 2016-04-29  Yoav Weiss  <yoav@yoav.ws>
1278
1279         Move ResourceTiming behind a runtime flag
1280         https://bugs.webkit.org/show_bug.cgi?id=157133
1281
1282         Reviewed by Alex Christensen.
1283
1284         Move the ResourceTiming API from being behind a build time flag to be behind an
1285         off-by-default runtime flag, that can be turned on using internals.
1286
1287         Tests: fast/dom/Window/window-properties-performance-resource-timing.html
1288                http/tests/performance/performance-resource-timing-entries.html
1289
1290         * DerivedSources.make: Added idl files for PerformanceEntry, PerformanceEntryList and PerformanceResourceTiming.
1291         * WebCore.xcodeproj/project.pbxproj: Added the various Performance* files to the project.
1292         * bindings/generic/RuntimeEnabledFeatures.cpp: Added ResourceTiming as a runtime flag.
1293         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
1294         * bindings/generic/RuntimeEnabledFeatures.h: Added ResourceTiming as a runtime flag.
1295         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
1296         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
1297         * bindings/js/JSPerformanceEntryCustom.cpp: Removed #if for ResourceTiming. Added build flag around UserTiming related h files.
1298         (WebCore::toJS): Deleted.
1299         * dom/EventNames.h: Renamed webkitresourcetimingbufferfull to resourcetimingbufferfull.
1300         * loader/DocumentThreadableLoader.cpp: Replace #if for ResourceTiming with runtime flag.
1301         (WebCore::DocumentThreadableLoader::loadRequest):
1302         * loader/ResourceLoadNotifier.cpp: Replace #if for ResourceTiming with runtime flag.
1303         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
1304         * loader/cache/CachedResourceLoader.cpp: Replace #if for ResourceTiming with runtime flag.
1305         (WebCore::CachedResourceLoader::revalidateResource):
1306         (WebCore::CachedResourceLoader::loadResource):
1307         (WebCore::CachedResourceLoader::storeResourceTimingInitiatorInformation):
1308         (WebCore::CachedResourceLoader::loadDone):
1309         * loader/cache/CachedResourceLoader.h: Remove #if for ResourceTiming.
1310         * page/Performance.cpp: Remove #if for ResourceTiming.
1311         (WebCore::Performance::Performance): Removed #if for ResourceTiming related initialization.
1312         (WebCore::Performance::webkitGetEntries): Renamed to getEntries.
1313         (WebCore::Performance::webkitGetEntriesByType): Renamed to getEntriesByType.
1314         (WebCore::Performance::webkitGetEntriesByName): Renamed to getEntriesByName.
1315         * page/Performance.h: Remove #if for ResourceTiming.
1316         * page/Performance.idl: Replace #if for ResourceTiming with runtime flag.
1317         * page/PerformanceEntry.cpp: Remove the PERFORMANCE_TIMELINE build flag.
1318         * page/PerformanceEntry.h: Remove the PERFORMANCE_TIMELINE build flag.
1319         * page/PerformanceEntry.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
1320         * page/PerformanceEntryList.cpp: Remove the PERFORMANCE_TIMELINE build flag.
1321         * page/PerformanceEntryList.h: Remove the PERFORMANCE_TIMELINE build flag.
1322         * page/PerformanceEntryList.idl: Replace the PERFORMANCE_TIMELINE build flag with runtime flag.
1323         * page/PerformanceResourceTiming.cpp: Remove the RESOURCE_TIMING build flag.
1324         * page/PerformanceResourceTiming.h: Remove the RESOURCE_TIMING build flag.
1325         * page/PerformanceResourceTiming.idl: Replace the RESOURCE_TIMING build flag with runtime flag.
1326         * testing/Internals.cpp: Add a method that enables ResourceTiming.
1327         (WebCore::Internals::setResourceTimingSupport):
1328         * testing/Internals.h: Add a method that enables ResourceTiming.
1329         * testing/Internals.idl: Add a method that enables ResourceTiming.
1330
1331 2016-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1332
1333         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaStream interfaces
1334         https://bugs.webkit.org/show_bug.cgi?id=156905
1335
1336         Reviewed by Darin Adler.
1337
1338         Removing UsePointersEvenForNonNullableObjectArguments from MediaStream, RTCPeerConnection and RTCRtpSender.
1339         Updating methods to take references and making some related refactoring.
1340
1341         Test: fast/mediastream/MediaStream-add-remove-null-undefined-tracks.html
1342         Changes also covered by updated tests.
1343
1344         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1345         (WebCore::MediaEndpointPeerConnection::createOfferTask):
1346         * Modules/mediastream/MediaStream.cpp:
1347         (WebCore::MediaStream::create):
1348         (WebCore::MediaStream::addTrack):
1349         (WebCore::MediaStream::removeTrack):
1350         (WebCore::MediaStream::didAddTrack):
1351         (WebCore::MediaStream::didRemoveTrack):
1352         (WebCore::MediaStream::internalAddTrack):
1353         (WebCore::MediaStream::internalRemoveTrack):
1354         * Modules/mediastream/MediaStream.h:
1355         * Modules/mediastream/MediaStream.idl:
1356         * Modules/mediastream/RTCDataChannel.cpp:
1357         (WebCore::RTCDataChannel::send):
1358         * Modules/mediastream/RTCDataChannel.h:
1359         * Modules/mediastream/RTCDataChannel.idl:
1360         * Modules/mediastream/RTCPeerConnection.cpp:
1361         (WebCore::RTCPeerConnection::addTrack):
1362         (WebCore::RTCPeerConnection::removeTrack):
1363         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
1364         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
1365         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
1366         (WebCore::RTCPeerConnection::privateGetStats):
1367         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
1368         (WebCore::RTCPeerConnection::localDescription): Deleted.
1369         (WebCore::RTCPeerConnection::currentLocalDescription): Deleted.
1370         (WebCore::RTCPeerConnection::remoteDescription): Deleted.
1371         (WebCore::RTCPeerConnection::currentRemoteDescription): Deleted.
1372         (WebCore::RTCPeerConnection::signalingState): Deleted.
1373         (WebCore::RTCPeerConnection::createDataChannel): Deleted.
1374         (WebCore::RTCPeerConnection::close): Deleted.
1375         * Modules/mediastream/RTCPeerConnection.h:
1376         * Modules/mediastream/RTCPeerConnection.idl:
1377         * Modules/mediastream/RTCRtpReceiver.cpp:
1378         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
1379         * Modules/mediastream/RTCRtpReceiver.h:
1380         (WebCore::RTCRtpReceiver::create):
1381         * Modules/mediastream/RTCRtpSender.cpp:
1382         (WebCore::RTCRtpSender::RTCRtpSender):
1383         (WebCore::RTCRtpSender::replaceTrack):
1384         * Modules/mediastream/RTCRtpSender.h:
1385         (WebCore::RTCRtpSender::create):
1386         * Modules/mediastream/RTCRtpSender.idl:
1387         * Modules/mediastream/RTCRtpSenderReceiverBase.h:
1388         (WebCore::RTCRtpSenderReceiverBase::track):
1389         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
1390
1391 2016-04-28  Daniel Bates  <dabates@apple.com>
1392
1393         Remove extraneous space characters from parameter list for RenderListBox::paintItem()
1394         that were added in r200190 (https://bugs.webkit.org/show_bug.cgi?id=157117).
1395
1396         * rendering/RenderListBox.h:
1397
1398 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
1399
1400         AX: [ATK] Expose subscript and superscript format style groups using ATK_ROLE_SUBSCRIPT and ATK_ROLE_SUPERSCRIPT
1401         https://bugs.webkit.org/show_bug.cgi?id=157158
1402
1403         Reviewed by Chris Fleizach.
1404
1405         r200214 caused the sup and sub elements to be exposed as ATK_ROLE_STATIC.
1406         While this exposure is much better than folding the text into the parent
1407         element, ATK has roles for subscript and superscript, so use them instead.
1408
1409         The roles-exposed.html and roles-computedRoleString.html tests were updated
1410         to reflect the new behavior.
1411
1412         * accessibility/AccessibilityObject.cpp:
1413         (WebCore::AccessibilityObject::isSubscriptStyleGroup):
1414         (WebCore::AccessibilityObject::isSuperscriptStyleGroup):
1415         * accessibility/AccessibilityObject.h:
1416         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1417         (atkRole):
1418
1419 2016-04-28  Zalan Bujtas  <zalan@apple.com>
1420
1421         Content disappears on mouse over.
1422         https://bugs.webkit.org/show_bug.cgi?id=157073
1423         <rdar://problem/24389168>
1424
1425         Reviewed by Simon Fraser.
1426
1427         When a redundant inlinebox is found after constructing the line, we remove it from the tree.
1428         The remove operation marks the ancestor tree dirty (and this newly constructed line is supposed to be clean).
1429         This patch resets this dirty flag on the boxes all the way up to the rootlinebox.
1430         Previously we only cleared the rootinlinebox and we ended up with dirty inlineflowboxes.
1431
1432         Test: fast/text/text-node-remains-dirty-after-calling-surroundContents.html
1433
1434         * rendering/BidiRun.h:
1435         (WebCore::BidiRun::setBox):
1436         * rendering/RenderBlockFlow.h:
1437         * rendering/RenderBlockLineLayout.cpp:
1438         (WebCore::RenderBlockFlow::constructLine):
1439         (WebCore::RenderBlockFlow::removeLineBoxIfNeeded):
1440         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
1441         * rendering/RenderBox.cpp:
1442         (WebCore::RenderBox::positionLineBox): Deleted.
1443         * rendering/RenderText.cpp:
1444         (WebCore::RenderText::setText):
1445         (WebCore::RenderText::positionLineBox): Deleted.
1446
1447 2016-04-28  John Wilander  <wilander@apple.com>
1448
1449         Allow non-standard HTTP headers in WebSocket handshake
1450         https://bugs.webkit.org/show_bug.cgi?id=157157
1451
1452         Reviewed by Brent Fulgham.
1453
1454         No new tests since https://bugs.webkit.org/show_bug.cgi?id=157095
1455         tests that non-standard headers are allowed.
1456
1457         * Modules/websockets/WebSocketHandshake.cpp:
1458         (WebCore::WebSocketHandshake::readHTTPHeaders):
1459             Changed from fail to allow for unrecognized headers.
1460             This was the behavior before https://bugs.webkit.org/show_bug.cgi?id=155602.
1461         * platform/network/HTTPHeaderNames.in:
1462             Removed whitelisted legacy headers since we now allow all non-standard headers.
1463
1464 2016-04-27  Brent Fulgham  <bfulgham@apple.com>
1465
1466         Make sure we don't mishandle HTMLFrameOwnerElement lifecycle
1467         https://bugs.webkit.org/show_bug.cgi?id=157040
1468
1469         Reviewed by Chris Dumez.
1470
1471         Protect a couple of sites where event handling could result in the owning frame
1472         being destroyed during execution.
1473
1474         Tested by fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash.html.
1475
1476         * inspector/InspectorDOMAgent.cpp:
1477         (WebCore::InspectorDOMAgent::didCommitLoad):
1478         * rendering/RenderLayer.cpp:
1479         (WebCore::RenderLayer::scrollRectToVisible):
1480
1481 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
1482
1483         [css-grid] Add CSS Grid Layout runtime flag
1484         https://bugs.webkit.org/show_bug.cgi?id=157134
1485
1486         Reviewed by Simon Fraser.
1487
1488         Add CSS Grid Layout runtime flag enabled by default.
1489         Disable parsing of CSS Grid Layout properties
1490         if the runtime flag is not enabled.
1491         Expose runtime flag through internals to verify that
1492         it's working as expected.
1493
1494         Test: fast/css-grid-layout/grid-disable.html
1495
1496         * bindings/generic/RuntimeEnabledFeatures.cpp:
1497         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
1498         * bindings/generic/RuntimeEnabledFeatures.h:
1499         (WebCore::RuntimeEnabledFeatures::setCSSGridLayoutEnabled):
1500         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
1501         * css/CSSParser.cpp:
1502         (WebCore::CSSParserContext::CSSParserContext):
1503         (WebCore::operator==):
1504         (WebCore::isValidKeywordPropertyAndValue):
1505         (WebCore::CSSParser::parseValue):
1506         (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
1507         (WebCore::CSSParser::parseGridPosition):
1508         (WebCore::CSSParser::parseGridItemPositionShorthand):
1509         (WebCore::CSSParser::parseGridGapShorthand):
1510         (WebCore::CSSParser::parseGridTemplateColumns):
1511         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
1512         (WebCore::CSSParser::parseGridTemplateShorthand):
1513         (WebCore::CSSParser::parseGridShorthand):
1514         (WebCore::CSSParser::parseGridAreaShorthand):
1515         (WebCore::CSSParser::parseSingleGridAreaLonghand):
1516         (WebCore::CSSParser::parseGridLineNames):
1517         (WebCore::CSSParser::parseGridTrackList):
1518         (WebCore::CSSParser::parseGridTrackRepeatFunction):
1519         (WebCore::CSSParser::parseGridTrackSize):
1520         (WebCore::CSSParser::parseGridBreadth):
1521         (WebCore::CSSParser::parseGridAutoFlow):
1522         (WebCore::CSSParser::parseGridTemplateAreasRow):
1523         (WebCore::CSSParser::parseGridTemplateAreas):
1524         (WebCore::CSSParser::iscSSGridLayoutEnabled):
1525         * css/CSSParser.h:
1526         * css/CSSParserMode.h:
1527         * dom/Document.cpp:
1528         (WebCore::Document::isCSSGridLayoutEnabled):
1529         * dom/Document.h:
1530         * testing/Internals.cpp:
1531         (WebCore::Internals::setCSSGridLayoutEnabled):
1532         * testing/Internals.h:
1533         * testing/Internals.idl:
1534
1535 2016-04-28  Chris Fleizach  <cfleizach@apple.com>
1536
1537         AX: superscript content exposed as plain text; VoiceOver does not speak or pause to make this understandable
1538         https://bugs.webkit.org/show_bug.cgi?id=157122
1539         <rdar://problem/21231487>
1540
1541         Reviewed by Daniel Bates.
1542
1543         Expose role types for subscript and superscript.
1544
1545         Modified: accessibility/mac/subroles-for-formatted-groups.html
1546
1547         * accessibility/AccessibilityObject.cpp:
1548         (WebCore::AccessibilityObject::isStyleFormatGroup):
1549         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1550         (-[WebAccessibilityObjectWrapper subrole]):
1551
1552 2016-04-28  Brady Eidson  <beidson@apple.com>
1553
1554         inspector/indexeddb/requestDatabaseNames.html is flaky on Mac.
1555         https://bugs.webkit.org/show_bug.cgi?id=157141
1556
1557         Reviewed by Alex Christensen.
1558
1559         Test: inspector/indexeddb/deleteDatabaseNamesWithSpace.html
1560
1561         * platform/FileSystem.cpp:
1562         (WebCore::decodeFromFilename): Advance iterator after decoding.
1563
1564 2016-04-28  Dan Bernstein  <mitz@apple.com>
1565
1566         <rdar://problem/25986324> WebKit build broken with error: undeclared selector 'childViewControllerForWhitePointAdaptivityStyle'
1567
1568         Fixed the build by removing use of API that no longer does anything.
1569
1570         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1571         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Revert to using a plain UIViewController.
1572         (createFullScreenVideoRootViewControllerClass): Deleted.
1573         (allocWebFullScreenVideoRootViewControllerInstance): Deleted.
1574
1575 2016-04-28  Brady Eidson  <beidson@apple.com>
1576
1577         Modern IDB: Reimplement Web Inspector code that was tied to Legacy IDB.
1578         https://bugs.webkit.org/show_bug.cgi?id=154686
1579
1580         Reviewed by Alex Christensen.
1581
1582         No new tests (Inspector folks will have to write them if they're possible).
1583
1584         * inspector/InspectorIndexedDBAgent.cpp: Reimplement missing functionality mostly with code that was 
1585           removed in http://trac.webkit.org/changeset/197131/trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
1586
1587 2016-04-28  Daniel Bates  <dabates@apple.com>
1588
1589         Fix the Apple Internal OS X build
1590
1591         * platform/graphics/mac/PDFDocumentImageMac.mm:
1592         (WebCore::PDFDocumentImage::drawPDFPage): Ignore deprecation warning for -[PDFPage drawWithBox:].
1593
1594 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1595
1596         Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
1597         https://bugs.webkit.org/show_bug.cgi?id=156904
1598
1599         Reviewed by Darin Adler.
1600
1601         MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
1602         MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
1603         SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.
1604
1605         Did some refactoring to use more references.
1606
1607         Covered by updated test.
1608
1609         * Modules/mediasource/MediaSource.cpp:
1610         (WebCore::MediaSource::endOfStream):
1611         (WebCore::MediaSource::addSourceBuffer):
1612         (WebCore::MediaSource::removeSourceBuffer):
1613         * Modules/mediasource/MediaSource.h:
1614         * Modules/mediasource/MediaSource.idl:
1615         * Modules/mediasource/SourceBuffer.cpp:
1616         (WebCore::SourceBuffer::appendBuffer):
1617         * Modules/mediasource/SourceBuffer.h:
1618         * Modules/mediasource/SourceBuffer.idl:
1619         * Modules/mediasource/SourceBufferList.cpp:
1620         (WebCore::SourceBufferList::add):
1621         (WebCore::SourceBufferList::remove):
1622         * Modules/mediasource/SourceBufferList.h:
1623
1624 2016-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1625
1626         Drop [UsePointersEvenForNonNullableObjectArguments] from Node
1627         https://bugs.webkit.org/show_bug.cgi?id=156978
1628
1629         Reviewed by Chris Dumez.
1630
1631         No change of behavior.
1632
1633         * dom/Node.idl: Marking some parameters nullable.
1634
1635 2016-04-27  Ada Chan  <adachan@apple.com>
1636
1637         Set overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
1638         https://bugs.webkit.org/show_bug.cgi?id=157110
1639
1640         Reviewed by Eric Carlson.
1641
1642         Test: fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html
1643
1644         This matches what we do in mediaControlsiOS.css.
1645
1646         * Modules/mediacontrols/mediaControlsApple.css:
1647         (::-webkit-media-controls):
1648
1649 2016-04-28  Chris Dumez  <cdumez@apple.com>
1650
1651         [Web IDL] Specify default values for optional parameters of type 'DOMString'
1652         https://bugs.webkit.org/show_bug.cgi?id=157116
1653
1654         Reviewed by Darin Adler.
1655
1656         Specify default values for optional parameters of type 'DOMString' so
1657         that this default value is used if the parameter is either omitted or
1658         undefined. For parameters of type DOMString and that are not nullable,
1659         the bindings generator now uses the null string as implicit default
1660         value (unless explicitely specified otherwise in the IDL). This
1661         simplifies the IDL a little and makes it a bit less confusing (it is
1662         a bit weird to see something like "optional DOMString param = null",
1663         considering the parameter is not nullable). I also think it makes
1664         more sense to use the null String() rather than Optional<String> in
1665         this case.
1666
1667         No new tests, existing tests were rebaselined.
1668
1669         * Modules/encryptedmedia/MediaKeys.idl:
1670         * Modules/indexeddb/IDBDatabase.idl:
1671         * Modules/indexeddb/IDBIndex.h:
1672         * Modules/indexeddb/IDBIndex.idl:
1673         * Modules/indexeddb/IDBObjectStore.cpp:
1674         (WebCore::IDBObjectStore::openCursor): Deleted.
1675         * Modules/indexeddb/IDBObjectStore.h:
1676         * Modules/indexeddb/IDBObjectStore.idl:
1677         * Modules/speech/SpeechSynthesisUtterance.idl:
1678         * Modules/websockets/WebSocket.idl:
1679         * bindings/scripts/CodeGeneratorJS.pm:
1680         (GenerateParametersCheck):
1681         (CanUseWTFOptionalForParameter): Deleted.
1682         * bindings/scripts/test/JS/JSTestObj.cpp:
1683         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
1684         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
1685         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue): Deleted.
1686         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1687         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1688         * bindings/scripts/test/TestNamedConstructor.idl:
1689         * css/FontFaceSet.cpp:
1690         * css/FontFaceSet.h:
1691         * css/FontFaceSet.idl:
1692         * css/WebKitCSSMatrix.idl:
1693         * dom/Comment.idl:
1694         * dom/DOMImplementation.idl:
1695         * dom/DataTransfer.cpp:
1696         (WebCore::DataTransfer::clearData):
1697         (WebCore::DataTransfer::getData): Deleted.
1698         * dom/DataTransfer.h:
1699         * dom/Document.idl:
1700         * dom/Text.idl:
1701         * fileapi/FileReader.cpp:
1702         (WebCore::FileReader::readAsDataURL): Deleted.
1703         * fileapi/FileReader.h:
1704         * fileapi/FileReaderSync.h:
1705         * fileapi/FileReaderSync.idl:
1706         * html/HTMLAudioElement.idl:
1707         * html/HTMLInputElement.idl:
1708
1709         * html/HTMLMediaElement.cpp:
1710         (WebCore::HTMLMediaElement::addTextTrack):
1711         Throw a TypeError if the 'kind' parameter is not a valid string in the
1712         TextTrackKind enum:
1713         https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
1714
1715         We previously threw a SYNTAX_ERR instead of a TypeError in such case,
1716         which was not correct as per Web IDL specification.
1717
1718         * html/HTMLMediaElement.h:
1719         * html/HTMLMediaElement.idl:
1720         * html/HTMLOptionElement.idl:
1721         * html/HTMLTextAreaElement.idl:
1722         * html/canvas/CanvasRenderingContext2D.cpp:
1723         (WebCore::CanvasRenderingContext2D::setShadow):
1724         * html/canvas/CanvasRenderingContext2D.h:
1725         * page/Performance.idl:
1726
1727 2016-04-28  Antonio Gomes  <tonikitoo@webkit.org>
1728
1729         Factor out the "paint item" logic in RenderListBox into a helper
1730         https://bugs.webkit.org/show_bug.cgi?id=157117
1731
1732         Reviewed by Daniel Bates.
1733
1734         Patch factors out the duplicated painting logic in RenderListBox::paintObject()
1735         into a member function named paintItem.
1736
1737         This is in preparation for bug 156590.
1738         No new tests, since there is no behavior change.
1739
1740         * rendering/RenderListBox.cpp:
1741         (WebCore::RenderListBox::paintItem):
1742         (WebCore::RenderListBox::paintObject):
1743         * rendering/RenderListBox.h:
1744
1745 2016-04-28  Joanmarie Diggs  <jdiggs@igalia.com>
1746
1747         AX: [ATK] We need to be smarter about flattening and the accessible text implementation
1748         https://bugs.webkit.org/show_bug.cgi?id=144639
1749
1750         Reviewed by Chris Fleizach.
1751
1752         Defer to WebCore Accessibility more regarding when to include anonymous blocks in the
1753         accessibility tree. Explicitly flatten menu items, headings, list items, and paragraphs
1754         in order to preserve the expected platform behavior for backwards compatibility. Also
1755         map anonymous table parts to DivRole rather than GroupRole for GTK and EFL because ATK
1756         has separate roles for generic text block elements and other generic containers.
1757
1758         Tests: accessibility/gtk/nested-block-element-children.html
1759                accessibility/gtk/spans-paragraphs-and-divs-tree.html
1760
1761         * accessibility/AccessibilityRenderObject.cpp:
1762         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1763         * accessibility/atk/AccessibilityObjectAtk.cpp:
1764         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1765
1766 2016-04-28  Frederic Wang  <fred.wang@free.fr>
1767
1768         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
1769         https://bugs.webkit.org/show_bug.cgi?id=156910
1770
1771         Reviewed by Alejandro G. Castro.
1772
1773         No new tests, the behavior is not changed.
1774
1775         * rendering/mathml/RenderMathMLOperator.cpp:
1776         (WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent to
1777         getDisplayStyleLargeOperator.
1778         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
1779         not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
1780         (WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
1781         base glyph and do some validity checks.
1782         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
1783         parameter as it is always m_textContent.
1784         We use getBaseGlyph and replace primaryFont with baseGlyph.font.
1785         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
1786         (WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
1787         getDisplayStyleLargeOperator or findStretchyData.
1788         * rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
1789         from getDisplayStyleLargeOperator and findStretchyData.
1790
1791 2016-04-28  Commit Queue  <commit-queue@webkit.org>
1792
1793         Unreviewed, rolling out r200185.
1794         https://bugs.webkit.org/show_bug.cgi?id=157131
1795
1796         Bad temporary file added unintentionally (Requested by fredw
1797         on #webkit).
1798
1799         Reverted changeset:
1800
1801         "RenderMathMLOperator refactoring: introduce getBaseGlyph and
1802         remove parameter from getDisplayStyleLargeOperator"
1803         https://bugs.webkit.org/show_bug.cgi?id=156910
1804         http://trac.webkit.org/changeset/200185
1805
1806 2016-04-28  Frederic Wang  <fred.wang@free.fr>
1807
1808         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
1809         https://bugs.webkit.org/show_bug.cgi?id=156910
1810
1811         Reviewed by Alejandro G. Castro.
1812
1813         No new tests, the behavior is not changed.
1814
1815         * rendering/mathml/RenderMathMLOperator.cpp:
1816         (WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent
1817         to getDisplayStyleLargeOperator.
1818         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
1819         not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
1820         (WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
1821         base glyph and do some validity checks.
1822         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
1823         parameter as it is always m_textContent.
1824         We use getBaseGlyph and replace primaryFont with baseGlyph.font.
1825         (WebCore::RenderMathMLOperator::findStretchyData): Ditto.
1826         (WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
1827         getDisplayStyleLargeOperator or findStretchyData.
1828         * rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
1829         from getDisplayStyleLargeOperator and findStretchyData.
1830
1831 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1832
1833         REGRESSION(r199659): Web Process crash when RenderTheme::adjustMenuListStyle is called with a null element
1834         https://bugs.webkit.org/show_bug.cgi?id=157127
1835
1836         Reviewed by Sergio Villar Senin.
1837
1838         This happens for example with tests fast/css/appearance-with-pseudo-elements-in-quirks-mode.html and
1839         fast/css/appearance-with-pseudo-elements.html.
1840
1841         * rendering/RenderThemeGtk.cpp:
1842         (WebCore::RenderThemeGtk::adjustMenuListStyle): Do not change the style color if the given element is nullptr.
1843
1844 2016-04-28  Sergio Villar Senin  <svillar@igalia.com>
1845
1846         [css-grid] Store auto-repeat information in style
1847         https://bugs.webkit.org/show_bug.cgi?id=157097
1848
1849         Reviewed by Darin Adler.
1850
1851         This is the second step to implement auto-repeat. This patch provides the necessary
1852         machinery to store the auto-repeat data extracted by the parser in the RenderStyle class. We
1853         are not doing anything with that information yet, it will be used later to compute the
1854         number of auto-repeat tracks in a follow up patch.
1855
1856         No new tests required as there is no change in behavior yet (we're just storing the info we
1857         already get from the parser).
1858
1859         * css/CSSComputedStyleDeclaration.cpp:
1860         (WebCore::valueForGridTrackList): Check also that the auto-repeat list of tracks is empty.
1861         * css/StyleBuilderConverter.h:
1862         (WebCore::createGridLineNamesList): Refactored from createGridTrackList.
1863         (WebCore::StyleBuilderConverter::createGridTrackList): Extract auto-repeat data from the
1864         parser. Also gathered all the out arguments in a single new struct called TracksData.
1865         * css/StyleBuilderCustom.h: Added new macro SET_TRACKS_DATA which properly sets the info
1866         from TracksData struct into style.
1867         (WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateColumns): Store auto-repeat data
1868         in RenderStyle.
1869         (WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateRows): Ditto.
1870         * rendering/style/RenderStyle.h: Add methods and attributes for auto-repeat data.
1871         * rendering/style/RenderStyleConstants.h: New AutoRepeatType enumerated type.
1872         * rendering/style/StyleGridData.cpp:
1873         (WebCore::StyleGridData::StyleGridData): Add auto-repeat data.
1874         * rendering/style/StyleGridData.h:
1875         (WebCore::StyleGridData::operator==): Check also auto-repeat data.
1876
1877 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
1878
1879         [css-grid] Fix alignment with content distribution
1880         https://bugs.webkit.org/show_bug.cgi?id=156623
1881
1882         Reviewed by Sergio Villar Senin.
1883
1884         We were only subtracting the distribution offset for items spanning
1885         several tracks, but not for items in a single cell.
1886         We should actually subtract the offset in that situation too,
1887         the same that we do for the grid gaps.
1888
1889         Test: fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html
1890
1891         * rendering/RenderGrid.cpp:
1892         (WebCore::RenderGrid::columnAxisOffsetForChild): Subtract distribution
1893         offset like we do for gaps.
1894         (WebCore::RenderGrid::rowAxisOffsetForChild): Ditto.
1895
1896 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1897
1898         [GTK] Overlay scrollbars with steppers enabled render incorrectly
1899         https://bugs.webkit.org/show_bug.cgi?id=156988
1900
1901         Reviewed by Michael Catanzaro.
1902
1903         Fix rendering of scrollbars when using GTK+ themes having stepper buttons.
1904
1905         * platform/gtk/RenderThemeGadget.cpp:
1906         (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): Receive the box orientation as constructor parameter.
1907         (WebCore::RenderThemeBoxGadget::preferredSize): Fix the preferred size calculation taking into account the box orientation.
1908         (WebCore::RenderThemeScrollbarGadget::renderStepper): New method to render scrollbar steppers.
1909         * platform/gtk/RenderThemeGadget.h:
1910         (WebCore::RenderThemeGadget::context): Make this public instead of protected.
1911         * platform/gtk/ScrollAnimatorGtk.cpp:
1912         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Invalidate the whole scrollbars instead of just
1913         the thumb when opacity changes, because themes can actually render the trough or even stepper buttons when in
1914         indicator mode too.
1915         * platform/gtk/ScrollbarThemeGtk.cpp:
1916         (WebCore::ScrollbarThemeGtk::hasButtons): Properly implement this method instead of returning true unconditionally.
1917         (WebCore::contentsGadgetForLayout): Pass orientation to RenderThemeBoxGadget constructor.
1918         (WebCore::ScrollbarThemeGtk::trackRect): Fix the calculation of the track rect taking stepper buttons into account.
1919         (WebCore::ScrollbarThemeGtk::backButtonRect): Fix the calculation of the stepper button rectangle.
1920         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
1921         (WebCore::ScrollbarThemeGtk::paint): Use RenderThemeScrollbarGadget::renderStepper() to render the stepper
1922         buttons, and fix the calculation of the steppers button rectangle.
1923         (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Handle clicks on stepper buttons.
1924         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Fix the calculation of the scrollbar thickness.
1925         (WebCore::ScrollbarThemeGtk::minimumThumbLength): Pass orientation to RenderThemeBoxGadget constructor.
1926         * platform/gtk/ScrollbarThemeGtk.h:
1927         * rendering/RenderThemeGtk.cpp:
1928         (WebCore::menuListColor): Ditto.
1929         (WebCore::RenderThemeGtk::popupInternalPaddingBox): Ditto.
1930         (WebCore::RenderThemeGtk::paintMenuList): Ditto.
1931
1932 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
1933
1934         SVG SMIL animations run at less than 60fps
1935         https://bugs.webkit.org/show_bug.cgi?id=157119
1936         rdar://problem/25971304
1937
1938         Reviewed by Tim Horton.
1939         
1940         If you re-fetch current time while doing animation computations you're gonna have
1941         a bad time.
1942         
1943         More specifically, SMILTimeContainer::startTimer() re-fetched elapsedTime() when
1944         computing the delay for the next timer fire, then clamped to 16.667ms, so the timer
1945         would actually be scheduled at intervals greater than desired, causing a ~54fps framerate.
1946         
1947         Fix by using the elapsedTime fetched at the start of animation processing.
1948
1949         Tested by iOS content-animation performance tests.
1950
1951         * svg/SVGSVGElement.cpp:
1952         (WebCore::SVGSVGElement::SVGSVGElement): Just cleanup.
1953         * svg/animation/SMILTimeContainer.cpp:
1954         (WebCore::SMILTimeContainer::notifyIntervalsChanged):
1955         (WebCore::SMILTimeContainer::resume):
1956         (WebCore::SMILTimeContainer::startTimer):
1957         (WebCore::SMILTimeContainer::updateAnimations):
1958         * svg/animation/SMILTimeContainer.h:
1959
1960 2016-04-27  Brady Eidson  <beidson@apple.com>
1961
1962         Build fix followup to r200163
1963         
1964         Unreviewed.
1965
1966         * platform/efl/FileSystemEfl.cpp:
1967         (WebCore::stringFromFileSystemRepresentation): At least stub this out for now until EFL folks can do better.
1968
1969 2016-04-27  Saam barati  <sbarati@apple.com>
1970
1971         Move the implementation of Settings::globalConstRedeclarationShouldThrow into the cpp file
1972         https://bugs.webkit.org/show_bug.cgi?id=157109
1973
1974         Rubber-stamped by Geoffrey Garen.
1975
1976         * page/Settings.cpp:
1977         (WebCore::Settings::networkInterfaceName):
1978         (WebCore::Settings::globalConstRedeclarationShouldThrow):
1979         * page/Settings.h:
1980         (WebCore::Settings::shouldUseHighResolutionTimers):
1981         (WebCore::Settings::backgroundShouldExtendBeyondPage):
1982         (WebCore::Settings::globalConstRedeclarationShouldThrow): Deleted.
1983
1984 2016-04-27  Dean Jackson  <dino@apple.com>
1985
1986         RTL non-native <select> buttons should have arrows on the left
1987         https://bugs.webkit.org/show_bug.cgi?id=157112
1988         <rdar://problem/25894441>
1989
1990         Reviewed by Simon Fraser.
1991
1992         The <select> elements that are completely rendered by WebCore
1993         (i.e. not the native controls) always assumed that they
1994         were left-to-right.
1995
1996         This change allows the button to handle both directions,
1997         swapping the side the little arrows are rendered on, as
1998         well as the padding of the text label.
1999
2000         Test: fast/forms/select-non-native-rendering-direction.html
2001
2002         * rendering/RenderMenuList.cpp:
2003         (RenderMenuList::clientPaddingLeft): This must take into account
2004         the direction of the element.
2005         (RenderMenuList::clientPaddingRight): Ditto.
2006         * rendering/RenderThemeMac.mm: Change the left and right constants
2007         to use the terms before and after.
2008         (WebCore::RenderThemeMac::paintMenuListButtonDecorations): The left
2009         and right positions must take the direction into account, which
2010         means different calculations.
2011         (WebCore::RenderThemeMac::popupInternalPaddingBox): Similarly for
2012         the padding that is used to position the text label.
2013
2014 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
2015
2016         CSS and SVG animations should run at 60fps
2017         https://bugs.webkit.org/show_bug.cgi?id=157113
2018         rdar://problem/24337280
2019         rdar://problem/24337328
2020
2021         Reviewed by Dean Jackson.
2022
2023         For both CSS and SVG animations we used a 0.025s frame interval, which translates to
2024         40fps. That caused these animations to look extra janky compared with accelerated
2025         animations.
2026
2027         So use a 16.667ms frame interval for both.
2028
2029         Tested by content-animation benchmark tests.
2030
2031         * page/animation/AnimationController.cpp:
2032         * svg/animation/SMILTime.h:
2033         * svg/animation/SMILTimeContainer.cpp:
2034         (WebCore::SMILTimeContainer::updateAnimations):
2035         * svg/animation/SVGSMILElement.cpp:
2036         (WebCore::SVGSMILElement::calculateNextProgressTime):
2037
2038 2016-04-27  Brady Eidson  <beidson@apple.com>
2039
2040         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
2041         https://bugs.webkit.org/show_bug.cgi?id=157072
2042
2043         Reviewed by Alex Christensen.
2044
2045         No new tests (Covered by changes to existing test).
2046
2047         Implement a new "getAllDatabaseNames" call on IDBFactory.
2048         
2049         It is not exposed to the DOM, and is meant solely for internal WebInspector use.
2050
2051         * Modules/indexeddb/DOMWindowIndexedDatabase.h: Export some stuff to WebCoreTestSupport
2052
2053         * Modules/indexeddb/IDBDatabase.cpp:
2054         (WebCore::IDBDatabase::createObjectStore):
2055
2056         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2057         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
2058         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2059
2060         * Modules/indexeddb/IDBFactory.cpp:
2061         (WebCore::IDBFactory::getAllDatabaseNames):
2062         * Modules/indexeddb/IDBFactory.h:
2063
2064         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
2065         (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames):
2066         * Modules/indexeddb/client/IDBConnectionProxy.h:
2067
2068         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2069         (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
2070         (WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames):
2071         * Modules/indexeddb/client/IDBConnectionToServer.h:
2072         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2073
2074         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2075         (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
2076         * Modules/indexeddb/server/IDBConnectionToClient.h:
2077         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2078
2079         * Modules/indexeddb/server/IDBServer.cpp:
2080         (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
2081         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames): Do the actual work of getting 
2082           the appropriate directory listing and converting the paths to database names.
2083         (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
2084         * Modules/indexeddb/server/IDBServer.h:
2085
2086         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2087         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename): Helper for IDBServer.
2088         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2089
2090         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2091         (WebCore::InProcessIDBServer::getAllDatabaseNames):
2092         (WebCore::InProcessIDBServer::didGetAllDatabaseNames):
2093         * Modules/indexeddb/shared/InProcessIDBServer.h:
2094
2095         * inspector/InspectorIndexedDBAgent.cpp:
2096         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Use the new IDBFactory API to
2097           asynchronously get the list of database names.
2098
2099         * platform/CrossThreadCopier.cpp:
2100         (WebCore::SecurityOriginData>::copy):
2101         (WebCore::Vector<String>>::copy):
2102         * platform/CrossThreadCopier.h:
2103
2104         * platform/FileSystem.cpp:
2105         (WebCore::decodeFromFilename): Perform the reverse of encodeForFilename.
2106         * platform/FileSystem.h:
2107
2108         * platform/cf/FileSystemCF.cpp:
2109         (WebCore::stringFromFileSystemRepresentation):
2110
2111         * platform/glib/FileSystemGlib.cpp:
2112         (WebCore::stringFromFileSystemRepresentation):
2113         
2114         * platform/posix/FileSystemPOSIX.cpp:
2115         (WebCore::lastComponentOfPathIgnoringTrailingSlash): Utility for peeling off the last component
2116           of a multi-component path.
2117         (WebCore::listDirectory): This was broken when returning filenames with UTF in them. Fix it.
2118         
2119         * platform/mac/WebCoreNSURLExtras.mm: Move the static hex digit utility functions to WTF.
2120         (WebCore::userVisibleString):
2121         (WebCore::isUserVisibleURL):
2122         (WebCore::isHexDigit): Deleted.
2123         (WebCore::hexDigit): Deleted.
2124         (WebCore::hexDigitValue): Deleted.
2125     
2126
2127 2016-04-27  Enrica Casucci  <enrica@apple.com>
2128
2129         Refactor findExplodedTextNodeAtPoint to move core functionality in RenderBlockFlow.
2130         https://bugs.webkit.org/show_bug.cgi?id=157076
2131
2132         Reviewed by Simon Fraser.
2133
2134         * bindings/objc/DOMUIKitExtensions.mm:
2135         (-[DOMNode findExplodedTextNodeAtPoint:]):
2136         * rendering/RenderBlockFlow.cpp:
2137         (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
2138         * rendering/RenderBlockFlow.h:
2139         * rendering/RenderText.h:
2140
2141 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
2142
2143         [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
2144         https://bugs.webkit.org/show_bug.cgi?id=157107
2145         rdar://problem/25943577
2146
2147         Reviewed by Tim Horton.
2148
2149         Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
2150
2151         * page/FrameView.cpp:
2152         (WebCore::FrameView::adjustTiledBackingScrollability):
2153         * page/Page.h:
2154         (WebCore::Page::enclosedInScrollableAncestorView):
2155         (WebCore::Page::setEnclosedInScrollableAncestorView):
2156         (WebCore::Page::enclosedInScrollView): Deleted.
2157         (WebCore::Page::setEnclosedInScrollView): Deleted.
2158
2159 2016-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2160
2161         [SOUP] Implement PlatformCookieJar::addCookie
2162         https://bugs.webkit.org/show_bug.cgi?id=156295
2163
2164         Reviewed by Carlos Garcia Campos.
2165
2166         * platform/network/soup/CookieJarSoup.cpp:
2167         (WebCore::msToSoupDate):
2168         (WebCore::toSoupCookie):
2169         (WebCore::addCookie):
2170
2171 2016-04-27  Chris Dumez  <cdumez@apple.com>
2172
2173         Let the bindings generator use WTF::Optional for optional parameters using [Clamp]
2174         https://bugs.webkit.org/show_bug.cgi?id=157077
2175
2176         Reviewed by Darin Adler.
2177
2178         Let the bindings generator use WTF::Optional for optional parameters using [Clamp],
2179         if they do not have a default value.
2180
2181         * Modules/websockets/WebSocket.cpp:
2182         (WebCore::WebSocket::close):
2183         * Modules/websockets/WebSocket.h:
2184         * Modules/websockets/WebSocket.idl:
2185         * bindings/scripts/CodeGeneratorJS.pm:
2186         (CanUseWTFOptionalForParameter): Deleted.
2187
2188 2016-04-26  Ada Chan  <adachan@apple.com>
2189
2190         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
2191         https://bugs.webkit.org/show_bug.cgi?id=157008
2192
2193         Reviewed by Jer Noble.
2194
2195         For WebVideoFullscreenInterfaceMac to be notified when the playback rate changes in
2196         WebPlaybackSessionInterfaceMac, add a new WebPlaybackSessionInterfaceMacClient base
2197         class that WebVideoFullscreenInterfaceMac implements, similar to the WebPlaybackSessionInterfaceAVKitClient
2198         on iOS. WebVideoFullscreenInterfaceMac sets itself as a client of WebPlaybackSessionInterfaceMac
2199         so WebPlaybackSessionInterfaceMac can notify WebVideoFullscreenInterfaceMac whenever the
2200         playback rate changes.
2201
2202         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2203         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
2204         We should not change the WebPlaybackSessionModelMediaElement's interface here since WebPlaybackSessionManager
2205         has already set that up when creating the context for this media element.
2206         (WebVideoFullscreenModelVideoElement::setVideoElement):
2207         We should not change the WebPlaybackSessionModelMediaElement's media element here because
2208         this will be called with NULL when the fullscreen context is cleaned up, but the
2209         WebPlaybackSessionModelMediaElement might still need to stay around. We'll make sure the
2210         WebPlaybackSessionModelMediaElement's media element is set when setting up the fullscreen
2211         context in WebVideoFullscreenManager::enterVideoFullscreenForVideoElement().
2212
2213         * platform/mac/WebPlaybackSessionInterfaceMac.h:
2214         (WebCore::WebPlaybackSessionInterfaceMacClient::~WebPlaybackSessionInterfaceMacClient):
2215
2216         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2217         (WebCore::WebPlaybackSessionInterfaceMac::setClient):
2218         Set the client. Notify the client about the current playback state.
2219         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
2220         If a client is set, let that client know about the change in playback rate.
2221
2222         * platform/mac/WebVideoFullscreenInterfaceMac.h:
2223         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2224         (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
2225         Set itself as a client of WebPlaybackSessionInterfaceMac.
2226         (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
2227         Make sure WebPlaybackSessionInterfaceMac won't hold onto a stale pointer to itself.
2228         (WebCore::WebVideoFullscreenInterfaceMac::setRate):
2229         We don't have to update the WebVideoFullscreenInterfaceMac's rate here anymore. The change
2230         in playback rate in WebPlaybackSessionInterfaceMac should trigger
2231         WebVideoFullscreenInterfaceMac::rateChanged() to be called.
2232         (WebCore::WebVideoFullscreenInterfaceMac::rateChanged):
2233         Pass in both the isPlaying state and the playback rate to WebVideoFullscreenInterfaceMacObjC.
2234
2235 2016-04-27  Brady Eidson  <beidson@apple.com>
2236
2237         Modernize platform/CrossThreadCopier.h style.
2238         https://bugs.webkit.org/show_bug.cgi?id=157106
2239
2240         Reviewed by Alex Christensen.
2241
2242         No new tests (No change in behavior).
2243
2244         * platform/CrossThreadCopier.h:
2245         (WebCore::CrossThreadCopierPassThrough::copy):
2246         (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper):
2247         (WebCore::AllowCrossThreadAccessWrapper::value):
2248         (WebCore::AllowCrossThreadAccess):
2249         (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper):
2250         (WebCore::AllowAccessLaterWrapper::value):
2251         (WebCore::AllowAccessLater):
2252
2253 2016-04-27  Filip Pizlo  <fpizlo@apple.com>
2254
2255         Speculative fix for null pointer dereference.
2256         rdar://problem/25964854
2257
2258         Reviewed by Michael Saboff.
2259
2260         * platform/mac/Language.mm:
2261         (WebCore::isValidICUCountryCode):
2262
2263 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
2264
2265         Clean up Font::removeFromSystemFallbackCache()
2266         https://bugs.webkit.org/show_bug.cgi?id=157093
2267
2268         Reviewed by Darin Adler.
2269
2270         Fonts have a bit which represents whether or not the system fallback cache references them.
2271         This bit gets set to 1 when they are inserted into the system fallback cache, but was not
2272         being reset back to 0 when it was removed.
2273
2274         This is benign, since the old codepath has no effect. However, we can speed up the function
2275         by properly updating this bit.
2276
2277         No new tests because there is no behavior change.
2278
2279         * platform/graphics/Font.cpp:
2280         (WebCore::Font::removeFromSystemFallbackCache):
2281
2282 2016-04-27  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2283
2284         WebRTC: RTCIceCandidate don't need a custom bindings
2285         https://bugs.webkit.org/show_bug.cgi?id=157074
2286
2287         Reviewed by Eric Carlson.
2288
2289         Removed custom constructor and replaced custom attribute getters with
2290         nullable types. Removed custom binding from builds.
2291
2292         Testing: Updated existing test.
2293
2294         * CMakeLists.txt:
2295         * Modules/mediastream/RTCIceCandidate.idl:
2296         * WebCore.xcodeproj/project.pbxproj:
2297         * bindings/js/JSRTCIceCandidateCustom.cpp: Removed.
2298         (WebCore::constructJSRTCIceCandidate): Deleted.
2299         (WebCore::JSRTCIceCandidate::sdpMid): Deleted.
2300         (WebCore::JSRTCIceCandidate::sdpMLineIndex): Deleted.
2301
2302 2016-04-27  Chris Dumez  <cdumez@apple.com>
2303
2304         Unreviewed, rolling out r199383.
2305
2306         Seems to have caused a 0.5% PLT regression on iOS
2307
2308         Reverted changeset:
2309
2310         "[iOS] do not exit AirPlay when the screen locks"
2311         https://bugs.webkit.org/show_bug.cgi?id=156502
2312         http://trac.webkit.org/changeset/199383
2313
2314 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
2315
2316         Remove unnecessary HashMap from Font
2317         https://bugs.webkit.org/show_bug.cgi?id=157090
2318
2319         Reviewed by Darin Adler.
2320
2321         There were only ever a maximum of 2 keys in the hashmap.
2322
2323         No new tests because there is no behavior change.
2324
2325         * platform/graphics/Font.h:
2326         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2327         (WebCore::Font::getCFStringAttributes):
2328
2329 2016-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
2330
2331         Rename DerivedFontData to DerivedFonts
2332         https://bugs.webkit.org/show_bug.cgi?id=157092
2333
2334         Reviewed by Darin Adler.
2335
2336         This is a follow-up to r178510 where we named SimpleFontData to Font.
2337         This patch didn't include renaming DerivedFontData to DerivedFonts.
2338
2339         No new tests because there is no behavior change.
2340
2341         * platform/graphics/Font.cpp:
2342         (WebCore::Font::verticalRightOrientationFont):
2343         (WebCore::Font::uprightOrientationFont):
2344         (WebCore::Font::smallCapsFont):
2345         (WebCore::Font::noSynthesizableFeaturesFont):
2346         (WebCore::Font::emphasisMarkFont):
2347         (WebCore::Font::brokenIdeographFont):
2348         (WebCore::Font::nonSyntheticItalicFont):
2349         (WebCore::Font::DerivedFonts::~DerivedFonts):
2350         (WebCore::Font::DerivedFontData::~DerivedFontData): Deleted.
2351         * platform/graphics/Font.h:
2352         (WebCore::Font::DerivedFonts::DerivedFonts):
2353         (WebCore::Font::DerivedFontData::DerivedFontData): Deleted.
2354
2355 2016-04-27  Chris Dumez  <cdumez@apple.com>
2356
2357         [Web IDL] Clean up support for [Clamp] IDL extended attribute
2358         https://bugs.webkit.org/show_bug.cgi?id=157060
2359
2360         Reviewed by Darin Adler.
2361
2362         Clean up support for [Clamp] IDL extended attribute:
2363         1.  Move [Clamp] handling in the bindings generator from the parameter
2364             conversion to JSValueToNative(). This has the benefit of
2365             simplifying the parameter conversion code, adding support for [Clamp]
2366             on non-readonly attributes, and improving consistency by handling
2367             this in the same place as [EnforceRange].
2368         2.  Add 'Clamp' to the IntegerConversionConfiguration enumeration in
2369             JSDOMbindings.h and add support for it to the various toInt*() /
2370             toUInt*() functions, similary to [EnforceRange]. Call these from
2371             the generated bindings.
2372
2373         * bindings/js/JSDOMBinding.cpp:
2374         (WebCore::toSmallerInt):
2375         (WebCore::toSmallerUInt):
2376         (WebCore::toInt32EnforceRange):
2377         (WebCore::toInt32Clamp):
2378         (WebCore::toUInt32Clamp):
2379         (WebCore::toUInt32EnforceRange):
2380         (WebCore::toInt64):
2381         (WebCore::toUInt64):
2382         (WebCore::toUInt8): Deleted.
2383         (WebCore::toUInt16): Deleted.
2384         * bindings/js/JSDOMBinding.h:
2385         (WebCore::toInt32):
2386         (WebCore::toUInt32):
2387         * bindings/scripts/CodeGeneratorJS.pm:
2388         (JSValueToNative):
2389         (GenerateParametersCheck): Deleted.
2390         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2391         (webkit_dom_test_obj_set_property):
2392         (webkit_dom_test_obj_get_property):
2393         (webkit_dom_test_obj_class_init):
2394         (webkit_dom_test_obj_class_method_with_enforce_range):
2395         (webkit_dom_test_obj_get_clamped_short_attr):
2396         (webkit_dom_test_obj_set_clamped_short_attr):
2397         (webkit_dom_test_obj_get_enforce_range_short_attr):
2398         (webkit_dom_test_obj_set_enforce_range_short_attr):
2399         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2400         * bindings/scripts/test/JS/JSTestObj.cpp:
2401         (WebCore::jsTestObjClampedShortAttr):
2402         (WebCore::jsTestObjEnforceRangeShortAttr):
2403         (WebCore::setJSTestObjClampedShortAttr):
2404         (WebCore::setJSTestObjEnforceRangeShortAttr):
2405         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
2406         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
2407         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional): Deleted.
2408         (WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
2409         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2410         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
2411         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction): Deleted.
2412         * bindings/scripts/test/ObjC/DOMTestObj.h:
2413         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2414         (-[DOMTestObj clampedShortAttr]):
2415         (-[DOMTestObj setClampedShortAttr:]):
2416         (-[DOMTestObj enforceRangeShortAttr]):
2417         (-[DOMTestObj setEnforceRangeShortAttr:]):
2418         (-[DOMTestObj classMethodWithEnforceRange:objArgsLong:]):
2419         * bindings/scripts/test/TestObj.idl:
2420
2421 2016-04-27  Daniel Bates  <dabates@apple.com>
2422
2423         CSP: Add app-specific workaround for Ecobee and Quora
2424         https://bugs.webkit.org/show_bug.cgi?id=157005
2425         <rdar://problem/25560776>
2426
2427         Reviewed by Brent Fulgham.
2428
2429         * page/Settings.in: Add setting allowContentSecurityPolicySourceStarToMatchAnyProtocol (disabled by default).
2430         * page/csp/ContentSecurityPolicy.cpp:
2431         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
2432         * page/csp/ContentSecurityPolicy.h:
2433         * page/csp/ContentSecurityPolicySourceList.cpp:
2434         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Modified to return true
2435         if ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol() evaluates to true.
2436         * platform/RuntimeApplicationChecks.h:
2437         * platform/RuntimeApplicationChecks.mm:
2438         (WebCore::IOSApplication::isEcobee): Added.
2439         (WebCore::IOSApplication::isQuora): Added.
2440
2441 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2442
2443         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
2444         https://bugs.webkit.org/show_bug.cgi?id=157066
2445
2446         Reviewed by Martin Robinson.
2447
2448         The problem is that Freetype implementation needs to call buildScaledFont() when orientation, SyntheticOblique
2449         or size change, but the new static clone methods don't do that. I think it's the time to stop using our own
2450         header for FontPlatformData for the FreeType implementation to make cross-platform changes easier and prevent
2451         regressions like this in the future.
2452
2453         * CMakeLists.txt: Compile FontPlatformData.cpp for all ports.
2454         * PlatformMac.cmake: Remove FontPlatformData.cpp.
2455         * PlatformWin.cmake: Ditto.
2456         * platform/graphics/FontPlatformData.cpp: We need our own clone methods in the FreeType backend.
2457         * platform/graphics/FontPlatformData.h: Move FreeType specific methods and members from the old header file.
2458         * platform/graphics/cairo/CairoUtilities.cpp:
2459         (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Move CairoFtFaceLocker implementation here from
2460         HarfBuzzFaceCairo.cpp to make it available to other classes, and make it handle the case of
2461         cairo_ft_scaled_font_lock_face() returning nullptr.
2462         (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker):
2463         * platform/graphics/cairo/CairoUtilities.h:
2464         (WebCore::CairoFtFaceLocker::ftFace):
2465         * platform/graphics/freetype/FontCacheFreeType.cpp:
2466         (WebCore::findBestFontGivenFallbacks): Move the fallbacks implementation to FontPlatformData where it belongs
2467         and here simply use FontPlatformData::fallbacks().
2468         * platform/graphics/freetype/FontPlatformData.h: Removed.
2469         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2470         (WebCore::FontPlatformData::FontPlatformData): Remove members already initialized in the header.
2471         (WebCore::FontPlatformData::operator=): Add missing members to be copied.
2472         (WebCore::FontPlatformData::~FontPlatformData): Do not free m_scaledFont manually since we are now using a smart pointer.
2473         (WebCore::FontPlatformData::cloneWithOrientation): Call buildScaledFont() like setOrientation() did.
2474         (WebCore::FontPlatformData::cloneWithSyntheticOblique): Call buildScaledFont() like setSyntheticOblique() did.
2475         (WebCore::FontPlatformData::cloneWithSize): Call buildScaledFont().
2476         (WebCore::FontPlatformData::fallbacks): Lazily initialize fallbacks if needed and return it.
2477         (WebCore::FontPlatformData::platformIsEqual): Only compare FreeType specific members.
2478         (WebCore::FontPlatformData::buildScaledFont): Use RefPtr for m_scaledFont.
2479         (WebCore::FontPlatformData::hasCompatibleCharmap): Use CairoFtFaceLocker.
2480         (WebCore::FontPlatformData::openTypeTable): Update to return RefPtr instead of PassRefPtr and use CairoFtFaceLocker.
2481         (WebCore::FontPlatformData::operator==): Deleted.
2482         (WebCore::FontPlatformData::setOrientation): Deleted.
2483         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
2484         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2485         (WebCore::GlyphPage::fill): Use CairoFtFaceLocker.
2486         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2487         (WebCore::Font::platformInit): Ditto.
2488         (WebCore::Font::canRenderCombiningCharacterSequence): Ditto.
2489         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2490         (WebCore::harfBuzzCairoGetTable): Ditto.
2491         (WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Deleted.
2492         (WebCore::CairoFtFaceLocker::lock): Deleted.
2493         (WebCore::CairoFtFaceLocker::~CairoFtFaceLocker): Deleted.
2494
2495 2016-04-27  Hunseop Jeong  <hs85.jeong@samsung.com>
2496
2497         [EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
2498         https://bugs.webkit.org/show_bug.cgi?id=156970
2499
2500         Reviewed by Xabier Rodriguez-Calvar.
2501
2502         Volume slider have to change the volume while dragging the thumb. 
2503
2504         Test: media/video-volume-slider-drag.html 
2505
2506         * Modules/mediacontrols/mediaControlsBase.js:
2507         (Controller.prototype.createControls): Use the 'input' event instead of the 'change' to
2508         check the changed value correctly.
2509         (Controller.prototype.handleMaxButtonClicked):
2510         (Controller.prototype.handleVolumeSliderInput): Renamed from handleVolumeSliderChange.
2511         (Controller.prototype.handleVolumeSliderChange): Deleted. 
2512
2513 2016-04-27  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2514
2515         [Fetch API] Remove FetchResponse::redirect overload
2516         https://bugs.webkit.org/show_bug.cgi?id=157034
2517
2518         Reviewed by Darin Adler.
2519
2520         No change of behavior.
2521
2522         * Modules/fetch/FetchResponse.h:
2523
2524 2016-04-27  Csaba Osztrogon√°c  <ossy@webkit.org>
2525
2526         [Mac][cmake] Unreviewed speculative buildfix after r200116, just for fun.
2527
2528         * PlatformMac.cmake:
2529
2530 2016-04-27  Saam barati  <sbarati@apple.com>
2531
2532         JSC should have an option to allow global const redeclarations
2533         https://bugs.webkit.org/show_bug.cgi?id=157006
2534
2535         Reviewed by Geoffrey Garen.
2536
2537         This patch makes the JS VM not throw global const redeclaration
2538         errors when the application is iBooks.
2539
2540         * bindings/js/JSDOMWindowBase.cpp:
2541         (WebCore::JSDOMWindowBase::commonVM):
2542         * page/Settings.h:
2543         (WebCore::Settings::shouldUseHighResolutionTimers):
2544         (WebCore::Settings::globalConstRedeclarationShouldThrow):
2545         (WebCore::Settings::backgroundShouldExtendBeyondPage):
2546
2547 2016-04-26  John Wilander  <wilander@apple.com>
2548
2549         Support legacy HTTP headers in WebSockets
2550         https://bugs.webkit.org/show_bug.cgi?id=157057
2551
2552         Reviewed by Brent Fulgham.
2553
2554         No new tests since these headers are not officially supported and should not be used.
2555
2556         * platform/network/HTTPHeaderNames.in:
2557             Added four legacy headers needed to support older WebSockets servers.
2558             Two of them are in the draft from August 2010: https://whatwg.org/specs/web-socket-protocol/
2559
2560 2016-04-26  Dean Jackson  <dino@apple.com>
2561
2562         RTL native <select> buttons should have arrows on left
2563         https://bugs.webkit.org/show_bug.cgi?id=157055
2564         <rdar://problem/25894428>
2565
2566         Reviewed by Myles Maxfield.
2567
2568         If the text direction is right-to-left, the select popup
2569         buttons should have the arrows on the left side.
2570
2571         Test: fast/forms/select-writing-direction-natural.html
2572
2573         * rendering/RenderThemeMac.h:
2574         * rendering/RenderThemeMac.mm:
2575         (WebCore::RenderThemeMac::popupButtonPadding): Takes a direction parameter.
2576         (WebCore::RenderThemeMac::popupInternalPaddingBox): Checks the direction for the padding.
2577         (WebCore::RenderThemeMac::setPopupButtonCellState): Tell the button to put the
2578         arrows on the correct side.
2579         (WebCore::RenderThemeMac::popupButton): Deleted an unnecessary comment.
2580
2581 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
2582
2583         [WK2] [OS X] Create API for switching RTL scrollbar policy
2584         https://bugs.webkit.org/show_bug.cgi?id=156948
2585         <rdar://problem/25707757>
2586
2587         Reviewed by Darin Adler.
2588
2589         There are two schools of thought for where to put scrollbars in RTL environments.
2590         The first is that we should obey the content's "dir" attribute, specified on each
2591         element. The second is that we should be consistent with the platform (AppKit's)
2592         behavior.
2593
2594         There are some situations where the placement should be done according to the
2595         content. For example, this policy would be used in web browsers.
2596
2597         However, there are also places where web content is designed to fit seamlessly
2598         amongst native content. In this situation, the placement of the scrollbars should
2599         be done according to the view.
2600
2601         Because WebKit doesn't know which of these situations it is operating within, this
2602         patch adds a new API property, userInterfaceDirectionPolicy, to
2603         WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to
2604         abide by. It is plumbed to the web process inside the WebPreferencesStore and is
2605         ultimately held inside the Page's Settings object.
2606
2607         This Setting is consulted by RenderLayerModelObject, which serves as a good
2608         centralized place for this policy implementation. This is the class which decides
2609         if we should be consulting its RenderStyle or the platform itself when we decide
2610         where to put the scrollbars.
2611
2612         Putting this decision inside the renderer is important because ScrollableArea
2613         often needs to know if scrollbars should be put on the left, but ScrollableArea
2614         doesn't know anything about RenderStyles. Therefore, the renderer must be the
2615         intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also
2616         doesn't directly know anything about renderers either; however, each of the
2617         subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets
2618         a new virtual method which is implemented by the RenderLayerModelObject.
2619
2620         Tests: fast/scrolling/rtl-scrollbars*.html
2621
2622         * WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary.
2623         * page/FrameView.cpp:
2624         (WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden
2625         ScrollableArea function.
2626         * page/FrameView.h:
2627         * page/Settings.h:
2628         * page/Settings.in:
2629         * platform/ScrollView.cpp: Adding two new settings: One to know if we should
2630         consult with the RenderStyle or the platform, and the other is whether or not
2631         the platform considers itself to be RTL.
2632         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to
2633         use new mechanism.
2634         (WebCore::ScrollView::updateScrollbars): Ditto.
2635         (WebCore::ScrollView::scrollCornerRect): Ditto.
2636         (WebCore::ScrollView::locationOfContents): Ditto.
2637         * platform/ScrollableArea.cpp:
2638         (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old
2639         mechanism.
2640         (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto.
2641         * platform/ScrollableArea.h:
2642         * platform/mac/ScrollableAreaMac.mm: Removed.
2643         (WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted.
2644         (WebCore::ScrollableArea::systemLanguageIsRTL): Deleted.
2645         * platform/mac/ScrollbarThemeMac.mm:
2646         (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new
2647         mechanism.
2648         * platform/text/WritingMode.h: These enums should match what's in WebKit2.
2649         * rendering/RenderBlock.cpp:
2650         (WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism.
2651         (WebCore::RenderBlock::logicalRightOffsetForContent): Ditto.
2652         * rendering/RenderBlockFlow.cpp:
2653         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto.
2654         * rendering/RenderBox.cpp: Ditto.
2655         (WebCore::RenderBox::contentBoxRect):
2656         (WebCore::RenderBox::overflowClipRect):
2657         (WebCore::RenderBox::computePositionedLogicalWidth):
2658         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2659         * rendering/RenderBoxModelObject.cpp: Ditto.
2660         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
2661         * rendering/RenderLayer.cpp:
2662         (WebCore::RenderLayer::resize): Ditto.
2663         (WebCore::cornerStart): Migrate to use references.
2664         (WebCore::cornerRect): Ditto.
2665         (WebCore::RenderLayer::scrollCornerRect): Ditto.
2666         (WebCore::resizerCornerRect): Ditto.
2667         (WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto.
2668         (WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism.
2669         (WebCore::RenderLayer::horizontalScrollbarStart): Ditto.
2670         (WebCore::RenderLayer::offsetFromResizeCorner): Ditto.
2671         (WebCore::RenderLayer::positionOverflowControls): Migrate to use references.
2672         (WebCore::RenderLayer::computeScrollDimensions): Ditto.
2673         (WebCore::RenderLayer::overflowControlsIntersectRect): Ditto.
2674         (WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism.
2675         (WebCore::RenderLayer::paintResizer): Migrate to use references.
2676         (WebCore::RenderLayer::isPointInResizeControl): Ditto.
2677         (WebCore::RenderLayer::hitTestOverflowControls): Ditto.
2678         (WebCore::RenderLayer::hitTestResizerInFragments): Ditto.
2679         * rendering/RenderLayer.h: ScrollableArea override
2680         * rendering/RenderLayerCompositor.cpp:
2681         (WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new
2682         mechanism.
2683         * rendering/RenderLayerModelObject.cpp:
2684         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
2685         This is the meat of this patch. This is where we decide if we should be
2686         interrogating the RenderStyle or the underlying platform.
2687         * rendering/RenderLayerModelObject.h:
2688         * rendering/RenderListBox.cpp: Update to use new mechanism.
2689         (WebCore::RenderListBox::itemBoundingBoxRect):
2690         (WebCore::RenderListBox::paintScrollbar):
2691         (WebCore::RenderListBox::isPointInOverflowControl):
2692         (WebCore::RenderListBox::listIndexAtOffset):
2693         (WebCore::RenderListBox::controlClipRect):
2694         (WebCore::RenderListBox::invalidateScrollbarRect):
2695         (WebCore::RenderListBox::convertFromScrollbarToContainingView):
2696         (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
2697         * rendering/RenderListBox.h:
2698         * rendering/RenderView.cpp: Ditto.
2699         (WebCore::RenderView::repaintViewRectangle):
2700         * rendering/style/RenderStyle.cpp:
2701         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This
2702         function is now much dumber. It just inspects its own style.
2703         * testing/InternalSettings.cpp: Allow mocking.
2704         (WebCore::InternalSettings::Backup::Backup):
2705         (WebCore::InternalSettings::Backup::restoreTo):
2706         (WebCore::InternalSettings::verticalScrollbarLocationPolicy):
2707         (WebCore::InternalSettings::setVerticalScrollbarLocationPolicy):
2708         (WebCore::InternalSettings::systemLayoutDirection):
2709         (WebCore::InternalSettings::setSystemLayoutDirection):
2710         * testing/InternalSettings.h:
2711         * testing/InternalSettings.idl:
2712
2713 2016-04-26  Chris Dumez  <cdumez@apple.com>
2714
2715         [Web IDL] Specify default values for optional parameters of type 'unsigned long'
2716         https://bugs.webkit.org/show_bug.cgi?id=157043
2717
2718         Reviewed by Alex Christensen.
2719
2720         Specify default values for optional parameters of type 'unsigned long' and let
2721         the bindings generator use WTF::Optional<> for the parameters that do not have
2722         such default value.
2723
2724         * Modules/webaudio/AudioContext.cpp:
2725         (WebCore::AudioContext::createScriptProcessor): Deleted.
2726         (WebCore::AudioContext::createChannelSplitter): Deleted.
2727         (WebCore::AudioContext::createChannelMerger): Deleted.
2728         * Modules/webaudio/AudioContext.h:
2729         * Modules/webaudio/AudioContext.idl:
2730         * bindings/scripts/CodeGeneratorJS.pm:
2731         (CanUseWTFOptionalForParameter): Deleted.
2732         * css/CSSStyleSheet.cpp:
2733         (WebCore::CSSStyleSheet::addRule):
2734         * css/CSSStyleSheet.h:
2735         * inspector/InspectorStyleSheet.cpp:
2736         (WebCore::InspectorStyleSheet::addRule):
2737
2738 2016-04-26  Ryosuke Niwa  <rniwa@webkit.org>
2739
2740         ASSERTION FAILED: m_templateInsertionModes.isEmpty() in WebCore::HTMLTreeBuilder::finished
2741         https://bugs.webkit.org/show_bug.cgi?id=143519
2742
2743         Reviewed by Darin Adler.
2744
2745         The assertion failure was caused by our parser inconsistently following the spec. Fixed it by making our HTML parser
2746         match the latest HTML5 specification. See inline comments below.
2747
2748         Tests: fast/dom/HTMLTemplateElement/parsing-template-with-frameset.html
2749                html5lib/generated/run-template-data.html
2750                html5lib/generated/run-template-write.html
2751                imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html
2752                imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html
2753                imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html
2754
2755         * html/parser/HTMLTreeBuilder.cpp:
2756         (WebCore::HTMLTreeBuilder::processStartTagForInBody): When parsing a template element for 'in body' insertion mode,
2757         we process the token using the rules for 'in head' insertion mode, which sets the frameset-ok flag to "not ok".
2758         In addition, 'in template' insertion mode should not special case a start tag whose tag name is "frame". Instead,
2759         fallback to using 'in body' insertion mode.
2760         https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
2761         (WebCore::HTMLTreeBuilder::processStartTag): 'in frameset' insertion mode should not special case a start tag whose
2762         tag name is "template": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inframeset
2763         (WebCore::HTMLTreeBuilder::processEndTag): Ditto for an end tag whose name is "template".
2764         (WebCore::HTMLTreeBuilder::processStartTagForInHead): When parsing a template element in 'in head' inserting mode,
2765         we set the frameset-ok flag to "not ok": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
2766
2767 2016-04-26  Filip Pizlo  <fpizlo@apple.com>
2768
2769         WebCore on Mac ignores the user's preferred region (country) while getting the language
2770         https://bugs.webkit.org/show_bug.cgi?id=156993
2771
2772         Reviewed by Geoffrey Garen.
2773
2774         This is tested by the NavigatorLanguage API test.
2775         
2776         WebCore was previously getting the list of preferred languages, and for each one, deducing
2777         the default region. That's wrong, since for example it doesn't respect the user's choice (in
2778         System Preferences) to display dates/calenders/etc according to a different region (like how
2779         I have my machine set to en-pl right now).
2780         
2781         It might be possible for the country code we get via kCFLocaleCountryCode to be something
2782         that our ICU doesn't handle. To defend against this, we search for the resulting country
2783         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
2784         behavior.
2785
2786         * platform/mac/Language.mm:
2787         (WebCore::httpStyleLanguageCode):
2788         (WebCore::isValidICUCountryCode):
2789         (WebCore::platformUserPreferredLanguages):
2790
2791 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
2792
2793         Use auto-generated operators in FontPlatformData
2794         https://bugs.webkit.org/show_bug.cgi?id=157037
2795
2796         Reviewed by Geoffrey Garen.
2797
2798         The only reason why they weren't used before is because Cairo was
2799         using a raw pointer. However, RefPtr supports Cairo types, so this
2800         patch migrates that pointer to a RefPtr. Therefore, we can remove
2801         our custom operators (because they work the same way as auto-
2802         generated ones do).
2803
2804         No new tests because there is no behavior change.
2805
2806         * platform/graphics/FontPlatformData.cpp:
2807         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2808         (WebCore::FontPlatformData::operator=): Deleted.
2809         * platform/graphics/FontPlatformData.h:
2810         (WebCore::FontPlatformData::scaledFont):
2811         (WebCore::FontPlatformData::hash):
2812         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2813         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
2814         (WebCore::FontPlatformData::platformDataInit): Deleted.
2815         (WebCore::FontPlatformData::platformDataAssign): Deleted.
2816         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2817         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
2818         (WebCore::FontPlatformData::platformDataInit): Deleted.
2819         (WebCore::FontPlatformData::platformDataAssign): Deleted.
2820         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2821         (WebCore::FontPlatformData::platformDataInit):
2822         (WebCore::FontPlatformData::FontPlatformData):
2823         (WebCore::FontPlatformData::~FontPlatformData): Deleted.
2824         (WebCore::FontPlatformData::platformDataAssign): Deleted.
2825         * platform/graphics/win/FontPlatformDataWin.cpp:
2826         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2827
2828 2016-04-26  Zalan Bujtas  <zalan@apple.com>
2829
2830         Add renderer address and needslayout state to inlineboxtree dump.
2831         https://bugs.webkit.org/show_bug.cgi?id=157035
2832
2833         Reviewed by Simon Fraser.
2834
2835         * rendering/InlineBox.cpp:
2836         (WebCore::InlineBox::showLineBox):
2837         * rendering/InlineTextBox.cpp:
2838         (WebCore::InlineTextBox::showLineBox):
2839         * rendering/SimpleLineLayoutFunctions.cpp:
2840         (WebCore::SimpleLineLayout::printPrefix):
2841
2842 2016-04-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2843
2844         [curl] Requests interrupted when using https via proxy
2845         https://bugs.webkit.org/show_bug.cgi?id=157028
2846
2847         Reviewed by Alex Christensen.
2848
2849         A proxy responds "200 Connection Established" to a CONNECT
2850         method.  This response doesn't have Content-Type, then the
2851         request is canceled due to a unsupported MIME type. This is not
2852         a real response from the recipient server. It should not be
2853         processed normally. Just ignore the response.
2854
2855         * platform/network/curl/ResourceHandleManager.cpp:
2856         (WebCore::headerCallback):
2857         Do nothing if httpCode is 0. This is the case of "200 Connection Established".
2858
2859 2016-04-26  Chris Dumez  <cdumez@apple.com>
2860
2861         Drop Dictionary from CanUseWTFOptionalForParameter()
2862         https://bugs.webkit.org/show_bug.cgi?id=157023
2863
2864         Reviewed by Darin Adler.
2865
2866         As per Web IDL, optional dictionary parameters are always considered to have
2867         a default value of an empty dictionary, unless otherwise specified. There is
2868         therefore never any need to use Optional<> for it. Just implement this
2869         behavior in the bindings generator and drop blacklisting of Dictionary from
2870         CanUseWTFOptionalForParameter().
2871
2872         * bindings/scripts/CodeGeneratorJS.pm:
2873         (GenerateParametersCheck):
2874         (CanUseWTFOptionalForParameter): Deleted.
2875         * bindings/scripts/test/JS/JSTestObj.cpp:
2876         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
2877
2878 2016-04-26  Antti Koivisto  <antti@apple.com>
2879
2880         RenderElement::style() should return const RenderStyle
2881         https://bugs.webkit.org/show_bug.cgi?id=157016
2882
2883         Reviewed by Geoff Garen.
2884
2885         Style should be changed via setStyle, not by mutating it directly.
2886
2887         Pulling this string turns RenderStyle const in many places.
2888
2889         * accessibility/AccessibilityObject.cpp:
2890         (WebCore::startOfStyleRange):
2891         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2892         (getAttributeSetForAccessibilityObject):
2893         * bindings/objc/DOM.mm:
2894         (-[DOMNode innerFrameQuad]):
2895         (-[DOMNode computedFontSize]):
2896         * css/CSSComputedStyleDeclaration.cpp:
2897         (WebCore::createPositionListForLayer):
2898         (WebCore::positionOffsetValue):
2899         (WebCore::ComputedStyleExtractor::currentColorOrValidColor):
2900         (WebCore::getTransitionPropertyValue):
2901         (WebCore::scrollSnapDestination):
2902         (WebCore::scrollSnapPoints):
2903         (WebCore::scrollSnapCoordinates):
2904         (WebCore::logUnimplementedPropertyID):
2905         (WebCore::fontFamilyFromStyle):
2906         (WebCore::lineHeightFromStyle):
2907         (WebCore::fontSizeFromStyle):
2908         (WebCore::fontStyleFromStyle):
2909         (WebCore::fontVariantFromStyle):
2910         (WebCore::fontWeightFromStyle):
2911         (WebCore::fontSynthesisFromStyle):
2912         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
2913         (WebCore::paddingOrMarginIsRendererDependent):
2914         (WebCore::convertToRegionBreak):
2915         (WebCore::isLayoutDependent):
2916         (WebCore::updateStyleIfNeededForNode):
2917         (WebCore::computeRenderStyleForProperty):
2918         (WebCore::ComputedStyleExtractor::propertyValue):
2919         (WebCore::CSSComputedStyleDeclaration::length):
2920         (WebCore::CSSComputedStyleDeclaration::item):
2921         (WebCore::ComputedStyleExtractor::propertyMatches):
2922         * css/CSSComputedStyleDeclaration.h:
2923         * css/CSSToLengthConversionData.cpp:
2924         (WebCore::CSSToLengthConversionData::viewportWidthFactor):
2925         (WebCore::CSSToLengthConversionData::viewportHeightFactor):
2926         (WebCore::CSSToLengthConversionData::viewportMinFactor):
2927         (WebCore::CSSToLengthConversionData::viewportMaxFactor):
2928         * css/CSSToLengthConversionData.h:
2929         (WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
2930         (WebCore::CSSToLengthConversionData::style):
2931         (WebCore::CSSToLengthConversionData::rootStyle):
2932         (WebCore::CSSToLengthConversionData::computingFontSize):
2933         (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom):
2934         * css/CSSToStyleMap.cpp:
2935         (WebCore::CSSToStyleMap::style):
2936         (WebCore::CSSToStyleMap::rootElementStyle):
2937         * css/CSSToStyleMap.h:
2938         * css/MediaQueryEvaluator.cpp:
2939         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
2940         * css/MediaQueryEvaluator.h:
2941         * css/SVGCSSComputedStyleDeclaration.cpp:
2942         (WebCore::strokeDashArrayToCSSValueList):
2943         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
2944         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2945         * css/SourceSizeList.cpp:
2946         (WebCore::match):
2947         (WebCore::defaultLength):
2948         (WebCore::computeLength):
2949         (WebCore::parseSizesAttribute):
2950         * css/StyleBuilderCustom.h:
2951         (WebCore::ApplyPropertyBorderImageModifier::applyValue):
2952         (WebCore::ApplyPropertyBorderImageModifier::getValue):
2953         (WebCore::StyleBuilderCustom::applyInheritClip):
2954         (WebCore::StyleBuilderCustom::applyInheritCounter):
2955         (WebCore::StyleBuilderCustom::applyValueContent):
2956         (WebCore::StyleBuilderCustom::applyValueAlt):
2957         * css/StyleResolver.cpp:
2958         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
2959         (WebCore::StyleResolver::State::State):
2960         (WebCore::isAtShadowBoundary):
2961         (WebCore::StyleResolver::styleForElement):
2962         (WebCore::StyleResolver::keyframeStylesForAnimation):
2963         (WebCore::StyleResolver::pseudoStyleForElement):
2964         (WebCore::StyleResolver::applyProperty):
2965         (WebCore::StyleResolver::checkForTextSizeAdjust):
2966         (WebCore::StyleResolver::checkForZoomChange):
2967         (WebCore::StyleResolver::checkForGenericFamilyChange):
2968         * css/StyleResolver.h:
2969         (WebCore::StyleResolver::style):
2970         (WebCore::StyleResolver::parentStyle):
2971         (WebCore::StyleResolver::rootElementStyle):
2972         (WebCore::StyleResolver::element):
2973         (WebCore::StyleResolver::document):
2974         (WebCore::StyleResolver::documentSettings):
2975         (WebCore::StyleResolver::State::State):
2976         (WebCore::StyleResolver::State::takeStyle):
2977         (WebCore::StyleResolver::State::parentStyle):
2978         (WebCore::StyleResolver::State::rootElementStyle):
2979         (WebCore::StyleResolver::State::regionForStyling):
2980         (WebCore::StyleResolver::State::elementLinkState):
2981         * dom/Document.cpp:
2982         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2983         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
2984         (WebCore::Document::setVisuallyOrdered):
2985         (WebCore::Document::createParser):
2986         * dom/Document.h:
2987         * dom/Element.cpp:
2988         (WebCore::Element::styleResolver):
2989         (WebCore::Element::resolveStyle):
2990         (WebCore::checkForEmptyStyleChange):
2991         (WebCore::checkForSiblingStyleChanges):
2992         (WebCore::beforeOrAfterPseudoElement):
2993         (WebCore::Element::existingComputedStyle):
2994         (WebCore::Element::resolveComputedStyle):
2995         (WebCore::Element::computedStyle):
2996         (WebCore::Element::didDetachRenderers):
2997         (WebCore::Element::resolveCustomStyle):
2998         * dom/Element.h:
2999         * dom/Node.cpp:
3000         (WebCore::computeEditabilityFromComputedStyle):
3001         (WebCore::Node::pseudoAwareLastChild):
3002         (WebCore::Node::computedStyle):
3003         * dom/Node.h:
3004         * dom/NodeRenderStyle.h:
3005         (WebCore::Node::renderStyle):
3006         * dom/PseudoElement.cpp:
3007         (WebCore::PseudoElement::clearHostElement):
3008         (WebCore::PseudoElement::resolveCustomStyle):
3009         * dom/PseudoElement.h:
3010         * editing/ApplyBlockElementCommand.cpp:
3011         (WebCore::isNewLineAtPosition):
3012         (WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode):
3013         (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
3014         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
3015         * editing/ApplyBlockElementCommand.h:
3016         * editing/EditingStyle.cpp:
3017         (WebCore::EditingStyle::init):
3018         (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded):
3019         * editing/EditingStyle.h:
3020         * editing/Editor.h:
3021         * editing/SimplifyMarkupCommand.cpp:
3022         (WebCore::SimplifyMarkupCommand::doApply):
3023         * editing/cocoa/EditorCocoa.mm:
3024         (WebCore::Editor::styleForSelectionStart):
3025         (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle):
3026         * editing/ios/EditorIOS.mm:
3027         (WebCore::Editor::fontForSelection):
3028         (WebCore::Editor::fontAttributesForSelectionStart):
3029         * editing/mac/EditorMac.mm:
3030         (WebCore::Editor::fontForSelection):
3031         (WebCore::Editor::fontAttributesForSelectionStart):
3032         * html/HTMLTitleElement.cpp:
3033         (WebCore::HTMLTitleElement::computedTextWithDirection):
3034         * html/canvas/CanvasRenderingContext2D.cpp:
3035         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
3036         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
3037         (WebCore::CanvasRenderingContext2D::setFont):
3038         (WebCore::CanvasRenderingContext2D::setTextBaseline):
3039         (WebCore::CanvasRenderingContext2D::toTextDirection):
3040         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3041         * html/canvas/CanvasRenderingContext2D.h:
3042         * html/parser/HTMLResourcePreloader.cpp:
3043         (WebCore::HTMLResourcePreloader::preload):
3044         (WebCore::mediaAttributeMatches):
3045         * html/shadow/SliderThumbElement.cpp:
3046         (WebCore::RenderSliderThumb::RenderSliderThumb):
3047         (WebCore::RenderSliderThumb::updateAppearance):
3048         (WebCore::RenderSliderContainer::layout):
3049         (WebCore::SliderThumbElement::hostInput):
3050         (WebCore::SliderThumbElement::resolveCustomStyle):
3051         (WebCore::SliderContainerElement::createElementRenderer):
3052         (WebCore::SliderContainerElement::resolveCustomStyle):
3053         * html/shadow/SliderThumbElement.h:
3054         * html/shadow/TextControlInnerElements.cpp:
3055         (WebCore::TextControlInnerElement::create):
3056         (WebCore::TextControlInnerElement::resolveCustomStyle):
3057         (WebCore::TextControlInnerTextElement::renderer):
3058         (WebCore::TextControlInnerTextElement::resolveCustomStyle):
3059         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
3060         (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
3061         * html/shadow/TextControlInnerElements.h:
3062         * page/EventHandler.cpp:
3063         (WebCore::EventHandler::selectCursor):
3064         * page/animation/AnimationBase.cpp:
3065         (WebCore::solveStepsFunction):
3066         (WebCore::AnimationBase::AnimationBase):
3067         * page/animation/AnimationBase.h:
3068         (WebCore::AnimationBase::~AnimationBase):
3069         (WebCore::AnimationBase::renderer):
3070         (WebCore::AnimationBase::animation):
3071         (WebCore::AnimationBase::setAnimation):
3072         * page/animation/AnimationController.cpp:
3073         (WebCore::AnimationController::cancelAnimations):
3074         (WebCore::AnimationController::updateAnimations):
3075         * page/animation/AnimationController.h:
3076         * page/animation/CompositeAnimation.cpp:
3077         (WebCore::CompositeAnimation::clearRenderer):
3078         (WebCore::CompositeAnimation::updateTransitions):
3079         (WebCore::CompositeAnimation::updateKeyframeAnimations):
3080         (WebCore::CompositeAnimation::animate):
3081         * page/animation/CompositeAnimation.h:
3082         * page/animation/ImplicitAnimation.cpp:
3083         (WebCore::ImplicitAnimation::ImplicitAnimation):
3084         (WebCore::ImplicitAnimation::shouldSendEventForListener):
3085         (WebCore::ImplicitAnimation::animate):
3086         (WebCore::ImplicitAnimation::sendTransitionEvent):
3087         (WebCore::ImplicitAnimation::reset):
3088         * page/animation/ImplicitAnimation.h:
3089         (WebCore::ImplicitAnimation::create):
3090         * page/animation/KeyframeAnimation.cpp:
3091         (WebCore::KeyframeAnimation::KeyframeAnimation):
3092         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
3093         (WebCore::KeyframeAnimation::animate):
3094         * page/animation/KeyframeAnimation.h:
3095         * page/ios/FrameIOS.mm:
3096         (WebCore::ancestorRespondingToScrollWheelEvents):
3097         * rendering/FlowThreadController.cpp:
3098         (WebCore::FlowThreadController::styleDidChange):
3099         * rendering/InlineFlowBox.cpp:
3100         (WebCore::clipRectForNinePieceImageStrip):
3101         * rendering/RenderBlock.cpp:
3102         (WebCore::RenderBlock::styleDidChange):
3103         (WebCore::RenderBlock::lineHeight):
3104         (WebCore::RenderBlock::firstLineBlock):
3105         (WebCore::styleForFirstLetter):
3106         (WebCore::RenderBlock::updateFirstLetterStyle):
3107         (WebCore::RenderBlock::createFirstLetterRenderer):
3108         * rendering/RenderBlockFlow.cpp:
3109         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
3110         (WebCore::calculateMinimumPageHeight):
3111         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
3112         * rendering/RenderBox.cpp:
3113         (WebCore::RenderBox::styleDidChange):
3114         (WebCore::RenderBox::borderRadii):
3115         (WebCore::RenderBox::enclosingFloatPaintingLayer):
3116         (WebCore::RenderBox::logicalVisualOverflowRectForPropagation):
3117         (WebCore::RenderBox::visualOverflowRectForPropagation):
3118         (WebCore::RenderBox::logicalLayoutOverflowRectForPropagation):
3119         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3120         * rendering/RenderBox.h:
3121         (WebCore::RenderBox::applyTopLeftLocationOffset):
3122         (WebCore::RenderBox::hasRenderOverflow):
3123         (WebCore::RenderBox::hasVisualOverflow):
3124         * rendering/RenderBoxModelObject.cpp:
3125         (WebCore::RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance):
3126         (WebCore::applyBoxShadowForBackground):
3127         * rendering/RenderButton.cpp:
3128         (WebCore::RenderButton::addChild):
3129         (WebCore::RenderButton::styleWillChange):
3130         (WebCore::RenderButton::styleDidChange):
3131         (WebCore::RenderButton::setupInnerStyle):
3132         (WebCore::RenderButton::layout):
3133         * rendering/RenderDeprecatedFlexibleBox.cpp:
3134         (WebCore::RenderDeprecatedFlexibleBox::styleWillChange):
3135         * rendering/RenderElement.cpp:
3136         (WebCore::RenderElement::createFor):
3137         (WebCore::RenderElement::uncachedFirstLineStyle):
3138         (WebCore::RenderElement::cachedFirstLineStyle):
3139         (WebCore::RenderElement::firstLineStyle):
3140         (WebCore::RenderElement::styleWillChange):
3141         (WebCore::RenderElement::addControlStatesForRenderer):
3142         (WebCore::RenderElement::getCachedPseudoStyle):
3143         (WebCore::RenderElement::getMutableCachedPseudoStyle):
3144         (WebCore::RenderElement::getUncachedPseudoStyle):
3145         (WebCore::RenderElement::paintOutline):
3146         * rendering/RenderElement.h:
3147         (WebCore::RenderElement::hasInitializedStyle):
3148         (WebCore::RenderElement::style):
3149         (WebCore::RenderElement::mutableStyle):
3150         (WebCore::RenderElement::element):
3151         (WebCore::RenderObject::isRenderInline):
3152         (WebCore::RenderObject::style):
3153         (WebCore::RenderObject::firstLineStyle):
3154         * rendering/RenderEmbeddedObject.cpp:
3155         (WebCore::RenderEmbeddedObject::layout):
3156         * rendering/RenderFlowThread.cpp:
3157         (WebCore::RenderFlowThread::RenderFlowThread):
3158         (WebCore::RenderFlowThread::createFlowThreadStyle):
3159         * rendering/RenderFlowThread.h:
3160         * rendering/RenderImage.cpp:
3161         (WebCore::RenderImage::layoutShadowControls):
3162         * rendering/RenderInline.cpp:
3163         (WebCore::RenderInline::styleDidChange):
3164         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
3165         (WebCore::RenderInline::paintOutline):
3166         * rendering/RenderLayer.cpp:
3167         (WebCore::RenderLayer::setupClipPath):
3168         * rendering/RenderListBox.cpp:
3169         (WebCore::RenderListBox::paintScrollbar):
3170         (WebCore::itemOffsetForAlignment):
3171         (WebCore::RenderListBox::paintItemForeground):
3172         (WebCore::RenderListBox::paintItemBackground):
3173         * rendering/RenderListMarker.cpp:
3174         (WebCore::RenderListMarker::updateMargins):
3175         (WebCore::RenderListMarker::lineHeight):
3176         * rendering/RenderMarquee.cpp:
3177         (WebCore::RenderMarquee::computePosition):
3178         (WebCore::RenderMarquee::updateMarqueeStyle):
3179         * rendering/RenderMenuList.cpp:
3180         (WebCore::RenderMenuList::adjustInnerStyle):
3181         (RenderMenuList::updateOptionsWidth):
3182         (RenderMenuList::itemStyle):
3183         * rendering/RenderMultiColumnFlowThread.cpp:
3184         (WebCore::isValidColumnSpanner):
3185         * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
3186         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
3187         * rendering/RenderMultiColumnSpannerPlaceholder.h:
3188         * rendering/RenderNamedFlowFragment.cpp:
3189         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
3190         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
3191         * rendering/RenderNamedFlowFragment.h:
3192         * rendering/RenderObject.cpp:
3193         (WebCore::RenderObject::innerLineHeight):
3194         (WebCore::decorationColor):
3195         (WebCore::RenderObject::getTextDecorationColorsAndStyles):
3196         * rendering/RenderObject.h:
3197         (WebCore::RenderObject::minPreferredLogicalWidth):
3198         (WebCore::RenderObject::maxPreferredLogicalWidth):
3199         * rendering/RenderTable.cpp:
3200         (WebCore::RenderTable::computePreferredLogicalWidths):
3201         * rendering/RenderTableSection.cpp:
3202         (WebCore::RenderTableSection::paintRowGroupBorderIfRequired):
3203         (WebCore::physicalBorderForDirection):
3204         * rendering/RenderText.h:
3205         (WebCore::RenderText::characterAt):
3206         (WebCore::RenderText::style):
3207         (WebCore::RenderText::firstLineStyle):
3208         (WebCore::RenderText::getCachedPseudoStyle):
3209         * rendering/RenderTextControl.cpp:
3210         (WebCore::RenderTextControl::styleDidChange):
3211         * rendering/RenderTextControlMultiLine.cpp:
3212         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
3213         * rendering/RenderTextControlSingleLine.cpp:
3214         (WebCore::RenderTextControlSingleLine::layout):
3215         (WebCore::RenderTextControlSingleLine::styleDidChange):
3216         * rendering/RenderTextFragment.cpp:
3217         (WebCore::RenderTextFragment::styleDidChange):
3218         * rendering/RenderThemeGtk.cpp:
3219         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
3220         (WebCore::borderRadiiFromStyle):
3221         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
3222         (WebCore::RenderThemeGtk::paintMediaSliderThumb):
3223         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
3224         * rendering/SimpleLineLayoutFunctions.cpp:
3225         (WebCore::SimpleLineLayout::paintFlow):
3226         (WebCore::SimpleLineLayout::hitTestFlow):
3227         * rendering/TextAutoSizing.cpp:
3228         (WebCore::TextAutoSizingKey::TextAutoSizingKey):
3229         * rendering/TextAutoSizing.h:
3230         (WebCore::TextAutoSizingKey::style):
3231         (WebCore::TextAutoSizingKey::isDeleted):
3232         * rendering/TextPaintStyle.cpp:
3233         (WebCore::computeTextSelectionPaintStyle):
3234         * rendering/line/BreakingContext.h:
3235         * rendering/mathml/RenderMathMLRoot.cpp:
3236         (WebCore::RenderMathMLRoot::layout):
3237         * rendering/style/RenderStyle.h:
3238         (WebCore::RenderStyle::setColumnRuleWidth):
3239         (WebCore::RenderStyle::resetColumnRule):
3240         (WebCore::RenderStyle::setColumnSpan):
3241         (WebCore::RenderStyle::inheritColumnPropertiesFrom):
3242         (WebCore::RenderStyle::setTransform):
3243         (WebCore::RenderStyle::setTransformOriginX):
3244         (WebCore::RenderStyle::setTransformOriginY):
3245         * rendering/svg/SVGInlineTextBox.cpp:
3246         (WebCore::SVGInlineTextBox::positionForOffset):
3247         (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
3248         (WebCore::SVGInlineTextBox::localSelectionRect):
3249         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3250         (WebCore::SVGInlineTextBox::paint):
3251         (WebCore::SVGInlineTextBox::acquirePaintingResource):
3252         (WebCore::SVGInlineTextBox::releasePaintingResource):
3253         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
3254         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
3255         (WebCore::SVGInlineTextBox::constructTextRun):
3256         (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
3257         (WebCore::SVGInlineTextBox::paintTextWithShadows):
3258         (WebCore::SVGInlineTextBox::paintText):
3259         * rendering/svg/SVGInlineTextBox.h:
3260         * rendering/svg/SVGPathData.cpp:
3261         (WebCore::updatePathFromCircleElement):
3262         (WebCore::updatePathFromEllipseElement):
3263         (WebCore::updatePathFromRectElement):
3264         * rendering/svg/SVGRenderingContext.cpp:
3265         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3266         * style/StyleTreeResolver.cpp:
3267         (WebCore::Style::TreeResolver::Parent::Parent):
3268         (WebCore::Style::TreeResolver::popScope):
3269         (WebCore::Style::TreeResolver::styleForElement):
3270         (WebCore::Style::TreeResolver::pushParent):
3271         (WebCore::Style::TreeResolver::resolveComposedTree):
3272         * style/StyleTreeResolver.h:
3273         (WebCore::Style::TreeResolver::scope):
3274         * style/StyleUpdate.cpp:
3275         (WebCore::Style::Update::textUpdate):
3276         (WebCore::Style::Update::elementStyle):
3277         (WebCore::Style::Update::addElement):
3278         * style/StyleUpdate.h:
3279         (WebCore::Style::Update::document):
3280         * svg/SVGElement.cpp:
3281         (WebCore::SVGElement::synchronizeSystemLanguage):
3282         (WebCore::SVGElement::resolveCustomStyle):
3283         (WebCore::SVGElement::setUseOverrideComputedStyle):
3284         (WebCore::SVGElement::computedStyle):
3285         * svg/SVGElement.h:
3286         * svg/SVGElementRareData.h:
3287         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
3288         (WebCore::SVGElementRareData::overrideComputedStyle):
3289         * svg/SVGGraphicsElement.cpp:
3290         (WebCore::SVGGraphicsElement::animatedLocalTransform):
3291         * svg/SVGLengthContext.cpp:
3292         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits):
3293         (WebCore::renderStyleForLengthResolving):
3294         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
3295         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):
3296         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEXS):
3297         (WebCore::SVGLengthContext::convertValueFromEXSToUserUnits):
3298         * svg/SVGStopElement.cpp:
3299         (WebCore::SVGStopElement::stopColorIncludingOpacity):
3300         * svg/SVGTextElement.cpp:
3301         (WebCore::SVGTextElement::animatedLocalTransform):
3302
3303 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
3304
3305         Make FontPlatformData immutable
3306         https://bugs.webkit.org/show_bug.cgi?id=157024
3307
3308         Reviewed by Darin Adler.
3309
3310         This patch deletes all functions which modify a FontPlatformData once
3311         it has been created. This makes for a cleaner design.
3312
3313         No new tests because there is no behavior change.
3314
3315         * platform/graphics/Font.cpp:
3316         (WebCore::Font::verticalRightOrientationFont):
3317         (WebCore::Font::nonSyntheticItalicFont):
3318         * platform/graphics/FontPlatformData.cpp:
3319         (WebCore::FontPlatformData::FontPlatformData):
3320         (WebCore::FontPlatformData::cloneWithOrientation):
3321         (WebCore::FontPlatformData::cloneWithSyntheticOblique):
3322         * platform/graphics/FontPlatformData.h:
3323         (WebCore::FontPlatformData::setIsSystemFont): Deleted.
3324         (WebCore::FontPlatformData::setSize): Deleted.
3325         (WebCore::FontPlatformData::setOrientation): Deleted.
3326         (WebCore::FontPlatformData::setSyntheticOblique): Deleted.
3327         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3328         (WebCore::FontCache::systemFallbackForCharacters):
3329         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3330         (WebCore::FontCascade::drawGlyphs):
3331         * platform/graphics/cocoa/FontCocoa.mm:
3332         (WebCore::Font::platformInit):
3333         (WebCore::Font::platformCharWidthInit):
3334         (WebCore::createDerivativeFont):
3335         (WebCore::Font::createFontWithoutSynthesizableFeatures):
3336         (WebCore::Font::platformCreateScaledFont):
3337         (WebCore::Font::platformWidthForGlyph):
3338         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3339         (WebCore::FontPlatformData::openTypeTable):
3340         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
3341         (WebCore::FontPlatformData::platformDataInit):
3342
3343 2016-04-26  Ryan Haddad  <ryanhaddad@apple.com>
3344
3345         Unreviewed, rolling out r200089.
3346
3347         This change causes API test failures
3348
3349         Reverted changeset:
3350
3351         "WebCore on Mac ignores the user's preferred region (country)
3352         while getting the language"
3353         https://bugs.webkit.org/show_bug.cgi?id=156993
3354         http://trac.webkit.org/changeset/200089
3355
3356 2016-04-26  Brent Fulgham  <bfulgham@apple.com>
3357
3358         GuardMalloc crash in WebCore::HTMLFrameElementBase::marginHeight() 
3359         https://bugs.webkit.org/show_bug.cgi?id=157020
3360         <rdar://problem/25148315>
3361
3362         Reviewed by Darin Adler.
3363
3364         Calls to setIntegralAttribute triggers event handling code, which can cause
3365         the underlying m_frameOwnerElement member to be deleted. We could clone this
3366         object, but since we only want the width and height we should just read them
3367         while we know the object is in a good state, then execute the potentially
3368         mutating methods.
3369
3370         Tested by imported/blink/fast/dom/HTMLBodyElement/body-inserting-iframe-crash.html.
3371
3372         * html/HTMLBodyElement.cpp:
3373         (WebCore::HTMLBodyElement::insertedInto): Read margin width and height before
3374         calling setIntegralAttribute.
3375
3376 2016-04-25  Filip Pizlo  <fpizlo@apple.com>
3377
3378         WebCore on Mac ignores the user's preferred region (country) while getting the language
3379         https://bugs.webkit.org/show_bug.cgi?id=156993
3380
3381         Reviewed by Geoffrey Garen.
3382
3383         I don't know how to test this since this depends on user settings.
3384         
3385         WebCore was previously getting the list of preferred languages, and for each one, deducing
3386         the default region. That's wrong, since for example it doesn't respect the user's choice (in
3387         System Preferences) to display dates/calenders/etc according to a different region (like how
3388         I have my machine set to en-pl right now).
3389         
3390         It might be possible for the country code we get via kCFLocaleCountryCode to be something
3391         that our ICU doesn't handle. To defend against this, we search for the resulting country
3392         code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
3393         behavior.
3394
3395         * platform/mac/Language.mm:
3396         (WebCore::httpStyleLanguageCode):
3397         (WebCore::platformUserPreferredLanguages):
3398
3399 2016-04-26  Chris Dumez  <cdumez@apple.com>
3400
3401         [Web IDL] Specify default values for optional parameters of TypedArray types
3402         https://bugs.webkit.org/show_bug.cgi?id=157017
3403
3404         Reviewed by Darin Adler.
3405
3406         Specify default values for optional parameters of TypedArray types and let
3407         the bindings generator use WTF::Optional<> for the ones that do not have a
3408         default value.
3409
3410         * bindings/scripts/CodeGeneratorJS.pm:
3411         (CanUseWTFOptionalForParameter): Deleted.
3412         * html/HTMLMediaElement.cpp:
3413         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
3414         (WebCore::HTMLMediaElement::webkitAddKey):
3415         (WebCore::HTMLMediaElement::webkitCancelKeyRequest): Deleted.
3416         * html/HTMLMediaElement.h:
3417         * html/HTMLMediaElement.idl:
3418
3419 2016-04-26  Chris Dumez  <cdumez@apple.com>
3420
3421         [Web IDL] Specify default values for optional parameters of type 'long' / 'unrestricted double'
3422         https://bugs.webkit.org/show_bug.cgi?id=157012
3423
3424         Reviewed by Darin Adler.
3425
3426         Specify default values for optional parameters of type 'long' / 'unrestricted double'
3427         and let the bindings generator use WTF::Optional<> for the ones that do not have a
3428         default value.
3429
3430         * Modules/mediastream/RTCDTMFSender.cpp:
3431         (WebCore::RTCDTMFSender::insertDTMF):
3432         (WebCore::RTCDTMFSender::didPlayTone): Deleted.
3433         * Modules/mediastream/RTCDTMFSender.h:
3434         * Modules/webaudio/AudioBufferSourceNode.cpp:
3435         (WebCore::AudioBufferSourceNode::start):
3436         (WebCore::AudioBufferSourceNode::startPlaying): Deleted.
3437         * Modules/webaudio/AudioBufferSourceNode.h:
3438         * Modules/webaudio/AudioBufferSourceNode.idl:
3439         * Modules/webaudio/AudioContext.cpp:
3440         (WebCore::AudioContext::createDelay): Deleted.
3441         * Modules/webaudio/AudioContext.h:
3442         * Modules/webaudio/AudioContext.idl:
3443         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3444         (WebCore::AudioScheduledSourceNode::start): Deleted.
3445         (WebCore::AudioScheduledSourceNode::stop): Deleted.
3446         * Modules/webaudio/AudioScheduledSourceNode.h:
3447         * Modules/webaudio/OscillatorNode.idl:
3448         * bindings/scripts/CodeGeneratorJS.pm:
3449         (CanUseWTFOptionalForParameter): Deleted.
3450         * bindings/scripts/test/JS/JSTestObj.cpp:
3451         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):