Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-02-10  Csaba Osztrogonác  <ossy@webkit.org>
2
3         Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
4         https://bugs.webkit.org/show_bug.cgi?id=154035
5
6         Reviewed by Antti Koivisto.
7
8         * dom/ComposedTreeIterator.h:
9         (WebCore::ComposedTreeIterator::Context::Context):
10
11 2016-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
12
13         [GTK] Toggle buttons are blurry with GTK+ 3.19
14         https://bugs.webkit.org/show_bug.cgi?id=154007
15
16         Reviewed by Michael Catanzaro.
17
18         Use min-width/min-height style properties when GTK+ >= 3.19.7 to
19         get the size of toggle buttons.
20
21         * rendering/RenderThemeGtk.cpp:
22         (WebCore::setToggleSize):
23         (WebCore::paintToggle):
24
25 2016-02-09  Aakash Jain  <aakash_jain@apple.com>
26
27         Headers that use WEBCORE_EXPORT should include PlatformExportMacros.h
28         https://bugs.webkit.org/show_bug.cgi?id=146984
29
30         Reviewed by Alexey Proskuryakov.
31
32         * Modules/speech/SpeechSynthesis.h:
33         * contentextensions/ContentExtensionError.h:
34         * dom/DeviceOrientationClient.h:
35         * platform/graphics/Color.h:
36         * platform/ios/wak/WebCoreThread.h:
37         * platform/network/CacheValidation.h:
38         * platform/network/cf/CertificateInfo.h:
39
40 2016-02-09  Nan Wang  <n_wang@apple.com>
41
42         AX: Implement word related text marker functions using TextIterator
43         https://bugs.webkit.org/show_bug.cgi?id=153939
44         <rdar://problem/24269605>
45
46         Reviewed by Chris Fleizach.
47
48         Using CharacterOffset to implement word related text marker calls. Reused
49         logic from previousBoundary and nextBoundary in VisibleUnits class.
50
51         Test: accessibility/mac/text-marker-word-nav.html
52
53         * accessibility/AXObjectCache.cpp:
54         (WebCore::AXObjectCache::traverseToOffsetInRange):
55         (WebCore::AXObjectCache::rangeForNodeContents):
56         (WebCore::isReplacedNodeOrBR):
57         (WebCore::characterOffsetsInOrder):
58         (WebCore::resetNodeAndOffsetForReplacedNode):
59         (WebCore::setRangeStartOrEndWithCharacterOffset):
60         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
61         (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
62         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
63         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
64         (WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
65         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
66         (WebCore::AXObjectCache::previousNode):
67         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
68         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
69         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
70         (WebCore::AXObjectCache::nextCharacterOffset):
71         (WebCore::AXObjectCache::previousCharacterOffset):
72         (WebCore::startWordBoundary):
73         (WebCore::endWordBoundary):
74         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
75         (WebCore::AXObjectCache::endCharacterOffsetOfWord):
76         (WebCore::AXObjectCache::previousWordStartCharacterOffset):
77         (WebCore::AXObjectCache::nextWordEndCharacterOffset):
78         (WebCore::AXObjectCache::leftWordRange):
79         (WebCore::AXObjectCache::rightWordRange):
80         (WebCore::characterForCharacterOffset):
81         (WebCore::AXObjectCache::characterAfter):
82         (WebCore::AXObjectCache::characterBefore):
83         (WebCore::parentEditingBoundary):
84         (WebCore::AXObjectCache::nextWordBoundary):
85         (WebCore::AXObjectCache::previousWordBoundary):
86         (WebCore::AXObjectCache::rootAXEditableElement):
87         * accessibility/AXObjectCache.h:
88         (WebCore::AXObjectCache::removeNodeForUse):
89         (WebCore::AXObjectCache::isNodeInUse):
90         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
91         (-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]):
92         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:ignoreStart:]):
93         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]):
94         (textMarkerForCharacterOffset):
95         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
96         * editing/VisibleUnits.cpp:
97         (WebCore::rightWordPosition):
98         (WebCore::prepend):
99         (WebCore::appendRepeatedCharacter):
100         (WebCore::suffixLengthForRange):
101         (WebCore::prefixLengthForRange):
102         (WebCore::backwardSearchForBoundaryWithTextIterator):
103         (WebCore::forwardSearchForBoundaryWithTextIterator):
104         (WebCore::previousBoundary):
105         (WebCore::nextBoundary):
106         * editing/VisibleUnits.h:
107
108 2016-02-09  Daniel Bates  <dabates@apple.com>
109
110         CSP: Extract helper classes into their own files
111         https://bugs.webkit.org/show_bug.cgi?id=154040
112         <rdar://problem/24571189>
113
114         Reviewed by Brent Fulgham.
115
116         No functionality was changed. So, no new tests.
117
118         * CMakeLists.txt: Add files ContentSecurityPolicy{DirectiveList, MediaListDirective, Source, SourceList, SourceListDirective}.cpp.
119         * WebCore.xcodeproj/project.pbxproj: Ditto.
120         * page/csp/ContentSecurityPolicy.cpp: Clean up #includes. Include header ParsingUtilities.h so that we can remove our own
121         variants of skip{Exactly, Until, While}(). Update code as necessary for class renames.
122         (WebCore::skipExactly): Deleted; instead use the analogous function in ParsingUtilities.h.
123         (WebCore::skipUntil): Deleted; instead use the analogous function in ParsingUtilities.h.
124         (WebCore::skipWhile): Deleted; instead use the analogous function in ParsingUtilities.h.
125         (WebCore::isSourceListNone): Moved to file ContentSecurityPolicySourceList.cpp.
126         (WebCore::CSPSource): Deleted; moved implementation to files ContentSecurityPolicySource.{cpp, h}.
127         (WebCore::CSPSourceList): Deleted; moved implementation to files ContentSecurityPolicySourceList.{cpp, h}.
128         (WebCore::CSPDirective): Deleted; moved implementation to file ContentSecurityPolicyDirective.h.
129         (WebCore::MediaListDirective): Deleted; moved implementation to files ContentSecurityPolicyMediaListDirective.{cpp, h}.
130         (WebCore::SourceListDirective): Deleted; moved implementation to files ContentSecurityPolicySourceListDirective.{cpp, h}.
131         (WebCore::CSPDirectiveList): Deleted; moved implementation to files ContentSecurityPolicyDirectiveList.{cpp, h}.
132         * page/csp/ContentSecurityPolicy.h:
133         * page/csp/ContentSecurityPolicyDirective.h: Added.
134         * page/csp/ContentSecurityPolicyDirectiveList.cpp: Added; removed use of ternary operator where it made the code less readable.
135         Updated code to make use of the functions defined in ParsingUtilities.h.
136         (WebCore::isExperimentalDirectiveName): Moved from file ContentSecurityPolicy.cpp.
137         (WebCore::isCSPDirectiveName): Ditto.
138         (WebCore::isDirectiveNameCharacter): Ditto.
139         (WebCore::isDirectiveValueCharacter): Ditto.
140         (WebCore::isNotASCIISpace): Ditto.
141         * page/csp/ContentSecurityPolicyDirectiveList.h: Added.
142         * page/csp/ContentSecurityPolicyMediaListDirective.cpp: Added. Updated code to make use of the functions defined in ParsingUtilities.h.
143         (WebCore::isMediaTypeCharacter): Moved from file ContentSecurityPolicy.cpp.
144         (WebCore::isNotASCIISpace): Ditto.
145         * page/csp/ContentSecurityPolicyMediaListDirective.h: Added.
146         * page/csp/ContentSecurityPolicySource.cpp: Added.
147         * page/csp/ContentSecurityPolicySource.h: Added.
148         * page/csp/ContentSecurityPolicySourceList.cpp: Added. Updated code to make use of the functions defined in ParsingUtilities.h.
149         (WebCore::isSourceCharacter): Moved from file ContentSecurityPolicy.cpp.
150         (WebCore::isHostCharacter): Ditto.
151         (WebCore::isPathComponentCharacter): Ditto.
152         (WebCore::isSchemeContinuationCharacter): Ditto.
153         (WebCore::isNotColonOrSlash): Ditto.
154         (WebCore::isSourceListNone): Ditto.
155         * page/csp/ContentSecurityPolicySourceList.h: Added.
156         * page/csp/ContentSecurityPolicySourceListDirective.cpp: Added.
157         * page/csp/ContentSecurityPolicySourceListDirective.h: Added.
158
159 2016-02-09  Brady Eidson  <beidson@apple.com>
160
161         Modern IDB: TransactionOperation objects leak.
162         https://bugs.webkit.org/show_bug.cgi?id=154054
163
164         Reviewed by Alex Christensen.
165
166         No new tests (Currently untestable).
167
168         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
169         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests): Remove the TransactionOperation from
170           the map, as this operation doesn't complete "normally" like most others.
171         (WebCore::IDBClient::IDBTransaction::commitOnServer): Ditto.
172         
173         * Modules/indexeddb/client/TransactionOperation.h:
174         (WebCore::IDBClient::TransactionOperation::perform): Clear the m_performFunction after use,
175           as it holds a lambda that holds a RefPtr to the IDBTransaction, as well as a self-ref.
176         (WebCore::IDBClient::TransactionOperation::completed): Clear m_completeFunction for the same reasons.
177
178 2016-02-09  Jer Noble  <jer.noble@apple.com>
179
180         [Mac] Graphical corruption in videos when enabling custom loading path
181         https://bugs.webkit.org/show_bug.cgi?id=154044
182
183         Reviewed by Alex Christensen.
184
185         The NSOperationQueue provided by AVFoundation from the AVAssetResourceLoader queue is not
186         set to be a serial queue. So when adding dataReceived operations to that queue, there exists
187         the possibility that some operations are handled before others, and the client will receieve
188         data out of order.
189
190         A real NSURLSession object will only issue another operation when the first operation
191         completes, so emulate this behavior in WebCoreNSURLSession by using a serial dispatch queue.
192         The internal queue will enqueue an operation to the resource loader's queue, and block until
193         that operation completes, thus ensuring ordering of the data (and other) operations.
194
195         * platform/network/cocoa/WebCoreNSURLSession.h:
196         * platform/network/cocoa/WebCoreNSURLSession.mm:
197         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Initialize _internalQueue
198         (-[WebCoreNSURLSession addDelegateOperation:]): Added utility method.
199         (-[WebCoreNSURLSession taskCompleted:]): Call -addDelegateOperation:
200         (-[WebCoreNSURLSession finishTasksAndInvalidate]): Ditto.
201         (-[WebCoreNSURLSession resetWithCompletionHandler:]): Ditto.
202         (-[WebCoreNSURLSession flushWithCompletionHandler:]): Ditto.
203         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
204         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
205         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Ditto.
206         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]): Ditto.
207         (-[WebCoreNSURLSessionDataTask resourceFinished:]): Ditto.
208
209         Drive-by fix:
210         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]): Set countOfBytesReceived outside the operation,
211             queue, matching NSURLSessionDataTask's behavior.
212
213 2016-02-09  Nan Wang  <n_wang@apple.com>
214
215         [iOS Simulator] accessibility/text-marker/text-marker-range-stale-node-crash.html crashing
216         https://bugs.webkit.org/show_bug.cgi?id=154039
217
218         Reviewed by Chris Fleizach.
219
220         We are accessing the derefed node in the CharacterOffset object, we should create an empty
221         CharacterOffset object if the node is not in use.
222
223         It's covered by the test accessibility/text-marker/text-marker-range-stale-node-crash.html.
224
225         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
226         (-[WebAccessibilityTextMarker characterOffset]):
227         (-[WebAccessibilityTextMarker isIgnored]):
228
229 2016-02-09  Myles C. Maxfield  <mmaxfield@apple.com>
230
231         Unreviewed build fix after r196322
232
233         Unreviewed.
234
235         * css/CSSFontFace.cpp:
236         (WebCore::CSSFontFace::font):
237
238 2016-02-09  Zalan Bujtas  <zalan@apple.com>
239
240         Outline corners do not align properly for multiline inlines.
241         https://bugs.webkit.org/show_bug.cgi?id=154025
242
243         Reviewed by David Hyatt.
244
245         Adjust border position when outline-offset > 0. This patch also
246         removes integral pixelsnapping (drawLineForBoxSide takes care of
247         device pixelsnapping). 
248
249         Test: fast/inline/outline-corners-with-offset.html
250
251         * rendering/RenderInline.cpp:
252         (WebCore::RenderInline::paintOutlineForLine):
253
254 2016-02-09  Jer Noble  <jer.noble@apple.com>
255
256         [Mac] Adopt NSURLSession properties in AVAssetResourceLoader
257
258         Rubber-stamped by Eric Carlson;
259
260         Set the correct global variable from setAVFoundationNSURLSessionEnabled().
261
262         * page/Settings.cpp:
263         (WebCore::Settings::setAVFoundationNSURLSessionEnabled):
264
265 2016-02-07  Gavin Barraclough  <barraclough@apple.com>
266
267         GetValueFunc/PutValueFunc should not take both slotBase and thisValue
268         https://bugs.webkit.org/show_bug.cgi?id=154009
269
270         Reviewed by Geoff Garen.
271
272         In JavaScript there are two types of properties - regular value properties, and accessor properties.
273         One difference between these is how they are reflected by getOwnPropertyDescriptor, and another is
274         what object they operate on in the case of a prototype access. If you access a value property of a
275         prototype object it return a value pertinent to the prototype, but in the case of a prototype object
276         returning an accessor, then the accessor function is applied to the base object of the access.
277
278         JSC supports special 'custom' properties implemented as a c++ callback, and these custom properties
279         can be used to implement either value- or accessor-like behavior. getOwnPropertyDescriptor behavior
280         is selected via the CustomAccessor attribute. Value- or accessor-like object selection is current
281         supported by passing both the slotBase and the thisValue to the callback,and hoping it uses the
282         right one. This is probably inefficient, bug-prone, and leads to crazy like JSBoundSlotBaseFunction.
283
284         Instead, just pass one thisValue to the callback functions, consistent with CustomAccessor.
285
286         * bindings/js/JSDOMBinding.cpp:
287         (WebCore::printErrorMessageForFrame):
288         (WebCore::objectToStringFunctionGetter):
289         * bindings/js/JSDOMBinding.h:
290         (WebCore::propertyNameToString):
291         (WebCore::getStaticValueSlotEntryWithoutCaching<JSDOMObject>):
292         (WebCore::nonCachingStaticFunctionGetter):
293         * bindings/js/JSDOMWindowCustom.cpp:
294         (WebCore::JSDOMWindow::visitAdditionalChildren):
295         (WebCore::childFrameGetter):
296         (WebCore::namedItemGetter):
297         (WebCore::jsDOMWindowWebKit):
298         (WebCore::jsDOMWindowIndexedDB):
299             - add missing null check, in case indexDB acessor is applied to non-window object.
300         * bindings/js/JSPluginElementFunctions.cpp:
301         (WebCore::pluginScriptObject):
302         (WebCore::pluginElementPropertyGetter):
303         * bindings/js/JSPluginElementFunctions.h:
304         * bindings/scripts/CodeGeneratorJS.pm:
305         (GenerateHeader):
306         (GenerateImplementation):
307         * bridge/runtime_array.cpp:
308         (JSC::RuntimeArray::destroy):
309         (JSC::RuntimeArray::lengthGetter):
310         * bridge/runtime_array.h:
311         * bridge/runtime_method.cpp:
312         (JSC::RuntimeMethod::finishCreation):
313         (JSC::RuntimeMethod::lengthGetter):
314         * bridge/runtime_method.h:
315         * bridge/runtime_object.cpp:
316         (JSC::Bindings::RuntimeObject::invalidate):
317         (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
318         (JSC::Bindings::RuntimeObject::fieldGetter):
319         (JSC::Bindings::RuntimeObject::methodGetter):
320         * bridge/runtime_object.h:
321             - Merged slotBase & thisValue to custom property callbacks.
322
323 2016-02-09  Jer Noble  <jer.noble@apple.com>
324
325         Build-fix; add Nullibility macros around previously un-macro'd class definitions.
326
327         * platform/spi/mac/AVFoundationSPI.h:
328
329 2016-02-04  Jer Noble  <jer.noble@apple.com>
330
331         [Mac] Adopt NSURLSession properties in AVAssetResourceLoader
332         https://bugs.webkit.org/show_bug.cgi?id=153873
333
334         Reviewed by Eric Carlson.
335
336         Adopt a new AVAssetResourceLoader API allowing clients to specify a NSURLSession object to
337         use for media loading, and control the use of this property with a new Setting.
338
339         * page/Settings.cpp:
340         (WebCore::Settings::setAVFoundationNSURLSessionEnabled):
341         * page/Settings.h:
342         (WebCore::Settings::isAVFoundationNSURLSessionEnabled):
343         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
344         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
345         * platform/spi/mac/AVFoundationSPI.h:
346
347 2016-02-09  Myles C. Maxfield  <mmaxfield@apple.com>
348
349         Decouple font creation from font loading
350         https://bugs.webkit.org/show_bug.cgi?id=153414
351
352         Reviewed by Darin Adler.
353
354         Previously, CSSFontFaceSource never triggered a font download until that font was actually used. This means
355         that the function which triggers the download also has the goal of returning a font to use. However,
356         the CSS Font Loading JavaScript API requires being able to trigger a font download without this extra font
357         creation overhead.
358
359         In addition, this patch adds an explicit (and enforced) state transition diagram. The diagram looks like
360         this:
361                             => Success
362                           //
363         Pending => Loading
364                           \\
365                             => Failure
366
367         Therefore, the API for CSSFontFaceSource has changed to expose the concept of these new states. This means
368         that its user (CSSSegmentedFontFaceSource) has been updated to handle each possible state that its constituent
369         CSSFontFaceSources may be in.
370
371         No new tests because there is no behavior change.
372
373         * css/CSSFontFace.cpp:
374         (WebCore::CSSFontFace::allSourcesFailed): Renamed to make the name clearer.
375         (WebCore::CSSFontFace::addedToSegmentedFontFace): Use references instead of pointers.
376         (WebCore::CSSFontFace::removedFromSegmentedFontFace): Ditto.
377         (WebCore::CSSFontFace::adoptSource): Renamed to make the name clearer.
378         (WebCore::CSSFontFace::fontLoaded): Use references instead of pointers. Also, remove old dead code.
379         (WebCore::CSSFontFace::font): Adapt to the new API of CSSFontFaceSource.
380         (WebCore::CSSFontFace::isValid): Deleted.
381         (WebCore::CSSFontFace::addSource): Deleted.
382         (WebCore::CSSFontFace::notifyFontLoader): Deleted. Old dead code.
383         (WebCore::CSSFontFace::notifyLoadingDone): Deleted. Old dead code.
384         * css/CSSFontFace.h:
385         (WebCore::CSSFontFace::create): Remove old dead code.
386         (WebCore::CSSFontFace::CSSFontFace): Use references instead of pointers.
387         (WebCore::CSSFontFace::loadState): Deleted. Remove old dead code.
388         * css/CSSFontFaceSource.cpp:
389         (WebCore::CSSFontFaceSource::setStatus): Enforce state transitions.
390         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Explicitly handle new state transitions.
391         (WebCore::CSSFontFaceSource::fontLoaded): Update for new states.
392         (WebCore::CSSFontFaceSource::load): Pulled out code from font().
393         (WebCore::CSSFontFaceSource::font): Moved code into load().
394         (WebCore::CSSFontFaceSource::isValid): Deleted.
395         (WebCore::CSSFontFaceSource::isDecodeError): Deleted.
396         (WebCore::CSSFontFaceSource::ensureFontData): Deleted.
397         * css/CSSFontFaceSource.h: Much cleaner API.
398         * css/CSSFontSelector.cpp:
399         (WebCore::createFontFace): Migrate to references instead of pointers. This requires a little
400         reorganization.
401         (WebCore::registerLocalFontFacesForFamily): Update to new CSSFontFaceSource API.
402         (WebCore::CSSFontSelector::addFontFaceRule): Ditto.
403         (WebCore::CSSFontSelector::getFontFace): Ditto.
404         * css/CSSSegmentedFontFace.cpp:
405         (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace): Migrate to references instead of pointers.
406         (WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace): Ditto.
407         (WebCore::CSSSegmentedFontFace::fontLoaded): Remove old dead code.
408         (WebCore::CSSSegmentedFontFace::appendFontFace): Cleanup.
409         (WebCore::CSSSegmentedFontFace::fontRanges): Adopt to new API.
410         (WebCore::CSSSegmentedFontFace::pruneTable): Deleted.
411         (WebCore::CSSSegmentedFontFace::isLoading): Deleted. Old dead code.
412         (WebCore::CSSSegmentedFontFace::checkFont): Deleted. Ditto.
413         (WebCore::CSSSegmentedFontFace::loadFont): Deleted. Ditto.
414         * css/CSSSegmentedFontFace.h:
415         (WebCore::CSSSegmentedFontFace::create): Migrate to references instead of pointers.
416         (WebCore::CSSSegmentedFontFace::fontSelector): Ditto.
417         (WebCore::CSSSegmentedFontFace::LoadFontCallback::~LoadFontCallback): Deleted.
418         * loader/cache/CachedFont.cpp:
419         (WebCore::CachedFont::didAddClient): Migrate to references instead of pointers.
420         (WebCore::CachedFont::checkNotify): Ditto.
421         * loader/cache/CachedFontClient.h:
422         (WebCore::CachedFontClient::fontLoaded): Ditto.
423
424 2016-02-09  Brady Eidson  <beidson@apple.com>
425
426         Modern IDB: IDBOpenDBRequests leak.
427         https://bugs.webkit.org/show_bug.cgi?id=154032
428
429         Reviewed by Alex Christensen.
430
431         No new tests (Currently untestable).
432
433         * CMakeLists.txt:
434         * WebCore.xcodeproj/project.pbxproj:
435
436         Add a simple Event subclass that holds a ref to an IDBRequest, to make sure that we
437         drop the last ref to the request after its last event fires or is otherwise destroyed:
438         * Modules/indexeddb/IDBRequestCompletionEvent.cpp: Added.
439         (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
440         * Modules/indexeddb/IDBRequestCompletionEvent.h: Added.
441         (WebCore::IDBRequestCompletionEvent::create):
442
443         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
444         (WebCore::IDBClient::IDBOpenDBRequest::onError): IDBRequestCompletionEvent instead of Event.
445         (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Ditto.
446         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Ditto.
447         (WebCore::IDBClient::IDBOpenDBRequest::onSuccess): Ditto.
448
449         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
450         (WebCore::IDBClient::IDBTransaction::dispatchEvent): After setting up the request's 
451           completion event to fire, clear the back-ref to the request.
452
453 2016-02-09  Commit Queue  <commit-queue@webkit.org>
454
455         Unreviewed, rolling out r196286.
456         https://bugs.webkit.org/show_bug.cgi?id=154026
457
458         Looks like 5% iOS PLT regression (Requested by kling on
459         #webkit).
460
461         Reverted changeset:
462
463         "[iOS] Throw away some unlinked code when navigating to a new
464         page."
465         https://bugs.webkit.org/show_bug.cgi?id=154014
466         http://trac.webkit.org/changeset/196286
467
468 2016-02-08  Chris Dumez  <cdumez@apple.com>
469
470         Attribute getters should not require an explicit 'this' value for Window properties
471         https://bugs.webkit.org/show_bug.cgi?id=153968
472
473         Reviewed by Darin Adler.
474
475         Attribute getters should not require an explicit 'this' value for
476         Window properties. This is because the Window interface is marked
477         as [ImplicitThis]:
478         - http://heycam.github.io/webidl/#ImplicitThis
479         - https://www.w3.org/Bugs/Public/show_bug.cgi?id=29421
480
481         This matches the behavior of Firefox and the expectations of the W3C
482         web-platform-tests.
483
484         No new tests, already covered by existing tests.
485
486         * bindings/scripts/CodeGeneratorJS.pm:
487         In attribute getters of an interface marked as [ImplicitThis],
488         if 'thisValue' is undefined or null, fall back to using the
489         global object as 'thisValue'.
490
491         * bindings/scripts/IDLAttributes.txt:
492         Add support for [ImplicitThis]:
493         http://heycam.github.io/webidl/#ImplicitThis
494
495         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
496         * bindings/scripts/test/JS/JSTestException.cpp:
497         * bindings/scripts/test/JS/JSTestInterface.cpp:
498         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
499         * bindings/scripts/test/JS/JSTestNode.cpp:
500         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
501         * bindings/scripts/test/JS/JSTestObj.cpp:
502         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
503         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
504         * bindings/scripts/test/JS/JSattribute.cpp:
505         Rebaseline bindings tests.
506
507         * page/DOMWindow.idl:
508         Mark Window as [ImplicitThis]:
509         http://heycam.github.io/webidl/#ImplicitThis
510
511 2016-02-08  Nan Wang  <n_wang@apple.com>
512
513         AX: crash at WebCore::Range::selectNodeContents(WebCore::Node*, int&)
514         https://bugs.webkit.org/show_bug.cgi?id=154018
515
516         Reviewed by Chris Fleizach.
517
518         Sometimes rangeForUnorderedCharacterOffsets call is accessing derefed node objects
519         and leading to a crash. Fixed it by checking isNodeInUse before creating the CharacterOffset
520         object.
521
522         Test: accessibility/text-marker/text-marker-range-stale-node-crash.html
523
524         * accessibility/AXObjectCache.cpp:
525         (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
526         (WebCore::AXObjectCache::characterOffsetForTextMarkerData):
527         (WebCore::AXObjectCache::traverseToOffsetInRange):
528         * accessibility/AXObjectCache.h:
529         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
530         (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]):
531         (characterOffsetForTextMarker):
532         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
533         (textMarkerForVisiblePosition):
534
535 2016-02-08  Andreas Kling  <akling@apple.com>
536
537         [iOS] Throw away some unlinked code when navigating to a new page.
538         <https://webkit.org/b/154014>
539
540         Reviewed by Gavin Barraclough.
541
542         Extended the mechanism introduced earlier to also throw away unlinked code
543         that's only relevant to the page that we're navigating away from.
544
545         The new JSC::VM API is deleteAllCodeExceptCaches() and it does what it sounds
546         like, deleting unlinked and linked code but leaving code caches alone.
547
548         This means that if the page we're navigating to wants to parse some of the
549         same JS that the page we're leaving had on it, it might still be found in the
550         JSC::CodeCache.
551
552         Doing a back navigation to a PageCache'd page may now incur some reparsing,
553         just like leaving the app or tab would.
554
555         * bindings/js/GCController.cpp:
556         (WebCore::GCController::deleteAllCodeExceptCaches):
557         (WebCore::GCController::deleteAllLinkedCode): Deleted.
558         * bindings/js/GCController.h:
559         * loader/FrameLoader.cpp:
560         (WebCore::FrameLoader::commitProvisionalLoad):
561
562 2016-02-08  Daniel Bates  <dabates@apple.com>
563
564         CSP connect-src directive should block redirects
565         https://bugs.webkit.org/show_bug.cgi?id=69359
566         <rdar://problem/24383025>
567
568         Reviewed by Brent Fulgham.
569
570         Inspired by Blink patch:
571         <https://src.chromium.org/viewvc/blink?revision=150246&view=revision>
572
573         Apply the connect-src directive of the Content Security Policy for the document or worker to the redirect URL
574         of an XMLHttpRequest and EventSource load so as to conform to section Paths and Redirects of the CSP 2.0 spec.,
575         <https://w3c.github.io/webappsec-csp/2/#source-list-paths-and-redirects> (29 August 2015).
576
577         Additionally, check that each requested script URL passed to WorkerGlobalScope.importScripts() is allowed by
578         the CSP of the worker before initiating a load for it. If some URL i is blocked by the CSP policy
579         then we do not try to load URLs j >= i.
580
581         Tests: http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-block-aborts-all-subsequent-imports.html
582                http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-redirect-cross-origin-blocked.html
583                http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html
584                http/tests/security/contentSecurityPolicy/worker-csp-importScripts-redirect-cross-origin-allowed.html
585                http/tests/security/contentSecurityPolicy/worker-csp-importScripts-redirect-cross-origin-blocked.html
586                http/tests/security/contentSecurityPolicy/worker-without-csp-importScripts-redirect-cross-origin-allowed.html
587                http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-redirect.html
588                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-importScript-redirect-cross-origin.html
589                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-importScripts-redirect-cross-origin.html
590                http/tests/security/isolatedWorld/bypass-worker-csp-for-xhr-redirect-cross-origin.html
591                http/tests/security/isolatedWorld/bypass-worker-csp-for-xhr.html
592
593         * fileapi/FileReaderLoader.cpp:
594         (WebCore::FileReaderLoader::start): Do not enforce a CSP directive as CSP is not applicable to File API.
595         * inspector/InspectorNetworkAgent.cpp:
596         (WebCore::InspectorNetworkAgent::loadResource): Do not enforce a CSP directive as CSP should not interfere
597         with the Web Inspector.
598         * loader/DocumentThreadableLoader.cpp:
599         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Modified to take an optional ContentSecurityPolicy
600         and pass it through to DocumentThreadableLoader::create().
601         (WebCore::DocumentThreadableLoader::create): Modified to take an optional ContentSecurityPolicy and pass it through
602         to DocumentThreadableLoader::DocumentThreadableLoader().
603         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Modified to take an optional ContentSecurityPolicy.
604         Asserts that the CSP allows the load of the request URL so as to catch when a caller creates a loader for a request
605         that is not allowed by the CSP. The caller should not create a loader for such a request.
606         (WebCore::DocumentThreadableLoader::redirectReceived): Check if the CSP allows the redirect URL. If it does not
607         then notify the client that the redirect check failed.
608         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
609         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Checks that the specified URL is allowed
610         by the enforced CSP directive.
611         (WebCore::DocumentThreadableLoader::contentSecurityPolicy): Returns the ContentSecurityPolicy object passed to
612         DocumentThreadableLoader on instantiation or the ContentSecurityPolicy object of the associated document.
613         * loader/DocumentThreadableLoader.h: Add overloaded variants of DocumentThreadableLoader::{create, loadResourceSynchronously}()
614         that take a std::unique_ptr<ContentSecurityPolicy>&&. Remove some unnecessary headers.
615         * loader/ThreadableLoader.cpp:
616         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Take the CSP directive to enforce and store it.
617         (WebCore::ThreadableLoaderOptions::isolatedCopy): Copy the CSP directive to enforce.
618         * loader/ThreadableLoader.h: Added member field to store the CSP directive to enforce (defaults to enforce the
619         directive connect-src - the most appropriate directive in most circumstances). As of the time of writing,
620         only WorkerGlobalScope.importScripts() enforces a different directive: script-src.
621         * loader/WorkerThreadableLoader.cpp:
622         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Pass the SecurityOrigin and ContentSecurityPolicy associated
623         with the WorkerGlobalScope to WorkerThreadableLoader::MainThreadBridge::MainThreadBridge().
624         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass a copy of the worker's ContentSecurityPolicy
625         to the DocumentThreadableLoader.
626         * loader/WorkerThreadableLoader.h:
627         * page/EventSource.cpp:
628         (WebCore::EventSource::connect): Enforce the CSP directive connect-src on redirects unless we are running in an isolated world.
629         * workers/AbstractWorker.cpp:
630         (WebCore::AbstractWorker::resolveURL): Modified to take a boolean whether to bypass the main world Content Security Policy
631         instead of querying for it directly.
632         * workers/AbstractWorker.h:
633         * workers/Worker.cpp:
634         (WebCore::Worker::create): Added FIXME to enforce child-src directive of the document's CSP to the worker's script URL
635         on redirect once we fix <https://bugs.webkit.org/show_bug.cgi?id=153562>. For now, do not enforce a CSP policy on redirect
636         of the worker's script URL.
637         * workers/WorkerGlobalScope.cpp:
638         (WebCore::WorkerGlobalScope::importScripts): Check that the requested URL is allowed by the CSP of the worker (if applicable).
639         Enforce the CSP directive script-src on redirects unless we are running in an isolated world.
640         * workers/WorkerScriptLoader.cpp:
641         (WebCore::WorkerScriptLoader::loadSynchronously): Pass SecurityOrigin and ContentSecurityPolicyEnforcement to WorkerThreadableLoader.
642         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
643         * workers/WorkerScriptLoader.h:
644         * xml/XMLHttpRequest.cpp:
645         (WebCore::XMLHttpRequest::createRequest): Enforce the CSP directive connect-src on redirects unless we are running in
646         an isolated world.
647
648 2016-02-08  Antti Koivisto  <antti@apple.com>
649
650         Try to fix Yosemite build.
651
652         * dom/ComposedTreeIterator.h:
653         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
654         (WebCore::ComposedTreeIterator::traverseNext):
655
656 2016-02-08  Antti Koivisto  <antti@apple.com>
657
658         Implement ComposedTreeIterator in terms of ElementAndTextDescendantIterator
659         https://bugs.webkit.org/show_bug.cgi?id=154003
660
661         Reviewed by Darin Adler.
662
663         Currently ComposedTreeIterator implements tree traversal using NodeTraversal. This makes it overly complicated.
664         It can also return nodes other than Element and Text which should not be part of the composed tree.
665
666         This patch adds a new iterator type, ElementAndTextDescendantIterator, similar to the existing ElementDescendantIterator.
667         ComposedTreeIterator is then implemented using this new iterator.
668
669         When entering a shadow tree or a slot the local iterator is pushed along with the context stack and a new local
670         iterator is initialized for the new context. When leaving a shadow tree the context stack is popped and the previous
671         local iterator becomes active.
672
673         * WebCore.xcodeproj/project.pbxproj:
674         * dom/ComposedTreeIterator.cpp:
675         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
676         (WebCore::ComposedTreeIterator::initializeContextStack):
677         (WebCore::ComposedTreeIterator::pushContext):
678         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
679         (WebCore::ComposedTreeIterator::traverseNextLeavingContext):
680         (WebCore::ComposedTreeIterator::advanceInSlot):
681         (WebCore::ComposedTreeIterator::traverseSiblingInSlot):
682         (WebCore::ComposedTreeIterator::initializeShadowStack): Deleted.
683         (WebCore::ComposedTreeIterator::traverseParentInShadowTree): Deleted.
684         (WebCore::ComposedTreeIterator::traverseNextSiblingSlot): Deleted.
685         (WebCore::ComposedTreeIterator::traversePreviousSiblingSlot): Deleted.
686         * dom/ComposedTreeIterator.h:
687         (WebCore::ComposedTreeIterator::operator*):
688         (WebCore::ComposedTreeIterator::operator->):
689         (WebCore::ComposedTreeIterator::operator==):
690         (WebCore::ComposedTreeIterator::operator!=):
691         (WebCore::ComposedTreeIterator::operator++):
692         (WebCore::ComposedTreeIterator::Context::Context):
693         (WebCore::ComposedTreeIterator::context):
694         (WebCore::ComposedTreeIterator::current):
695         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
696         (WebCore::ComposedTreeIterator::traverseNext):
697         (WebCore::ComposedTreeIterator::traverseNextSkippingChildren):
698         (WebCore::ComposedTreeIterator::traverseNextSibling):
699         (WebCore::ComposedTreeIterator::traversePreviousSibling):
700         (WebCore::ComposedTreeDescendantAdapter::ComposedTreeDescendantAdapter):
701         (WebCore::ComposedTreeDescendantAdapter::begin):
702         (WebCore::ComposedTreeDescendantAdapter::end):
703         (WebCore::ComposedTreeDescendantAdapter::at):
704         (WebCore::ComposedTreeChildAdapter::Iterator::Iterator):
705         (WebCore::ComposedTreeChildAdapter::ComposedTreeChildAdapter):
706         (WebCore::ComposedTreeChildAdapter::begin):
707         (WebCore::ComposedTreeChildAdapter::end):
708         (WebCore::ComposedTreeChildAdapter::at):
709         (WebCore::ComposedTreeIterator::ShadowContext::ShadowContext): Deleted.
710         (WebCore::ComposedTreeIterator::traverseParent): Deleted.
711         * dom/ElementAndTextDescendantIterator.h: Added.
712
713             New iterator type that traverses Element and Text nodes (that is renderable nodes only).
714             It also tracks depth for future use.
715
716 2016-02-08  Joseph Pecoraro  <pecoraro@apple.com>
717
718         Web Inspector: copy({x:1}) should copy "{x:1}", not "[object Object]"
719         https://bugs.webkit.org/show_bug.cgi?id=148605
720
721         Reviewed by Brian Burg.
722
723         Test: inspector/console/command-line-api-copy.html
724
725         * inspector/CommandLineAPIModuleSource.js:
726         (CommandLineAPIImpl.prototype.copy):
727         Support copying different types. This is meant to be more
728         convenient then just JSON.stringify, so it handles types
729         like Node, Symbol, RegExp, and Function a bit better.
730
731 2016-02-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
732
733         REGRESSION(r181345): SVG polyline and polygon leak page
734         https://bugs.webkit.org/show_bug.cgi?id=152759
735
736         Reviewed by Darin Adler.
737
738         The leak happens because of cyclic reference between SVGListPropertyTearOff 
739         and SVGAnimatedListPropertyTearOff which is derived from SVGAnimatedProperty.
740         There is also cyclic reference between SVGAnimatedProperty and SVGElement
741         and this causes the whole document to be leaked. So if the JS requests, for
742         example, an instance of SVGPolylineElement.points, the whole document will be
743         leaked.
744
745         The fix depends on having the cyclic reference as is since the owning and the
746         owned classes have to live together if any of them is referenced. But the owning
747         class caches a raw 'ref-counted' pointer of the owned class. If it is requested
748         for an instance of the owned class it returned a RefPtr<> of it. Once the owned
749         class is not used, it can delete itself. The only thing needed here is to notify
750         the owner class of the deletion so it cleans its caches and be able to create a
751         new pointer if it is requested for an instance of the owned class later.
752
753         Revert the change of r181345 in SVGAnimatedProperty::lookupOrCreateWrapper()
754         to break the cyclic reference between SVGElement and SVGAnimatedProperty.
755         
756         Also apply the same approach in SVGAnimatedListPropertyTearOff::baseVal() and
757         animVal() to break cyclic reference between SVGListPropertyTearOff and
758         SVGAnimatedListPropertyTearOff.
759
760         Test: svg/animations/smil-leak-list-property-instances.svg
761
762         * bindings/scripts/CodeGeneratorJS.pm:
763         (NativeToJSValue): The SVG non-string list tear-off properties became of
764         type RefPtr<>. So we need to use get() with the casting expressions.
765         
766         * svg/SVGMarkerElement.cpp:
767         (WebCore::SVGMarkerElement::orientType):
768         Use 'auto' type for the return of SVGAnimatedProperty::lookupWrapper().
769
770         * svg/SVGPathElement.cpp:
771         (WebCore::SVGPathElement::pathByteStream):
772         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
773         Since SVGAnimatedProperty::lookupWrappe() returns a RefPtr<> we need to 
774         use get() for the casting expressions.
775         
776         (WebCore::SVGPathElement::pathSegList):
777         (WebCore::SVGPathElement::normalizedPathSegList):
778         (WebCore::SVGPathElement::animatedPathSegList):
779         (WebCore::SVGPathElement::animatedNormalizedPathSegList):
780         * svg/SVGPathElement.h:
781         Change the return value from raw pointer to RefPtr<>.
782
783         * svg/SVGPathSegWithContext.h:
784         (WebCore::SVGPathSegWithContext::animatedProperty):
785         Change the return type to be RefPtr<> to preserve the value from being deleted.
786         
787         * svg/SVGPolyElement.cpp:
788         (WebCore::SVGPolyElement::parseAttribute):
789         Since SVGAnimatedProperty::lookupWrapper() returns a RefPtr<> we need to 
790         use get() for the casting expressions.
791         
792         (WebCore::SVGPolyElement::points):
793         (WebCore::SVGPolyElement::animatedPoints):
794         * svg/SVGPolyElement.h:
795         Change the return value from raw pointer to RefPtr<>.
796         
797         * svg/SVGViewSpec.cpp:
798         (WebCore::SVGViewSpec::setTransformString):
799         Since SVGAnimatedProperty::lookupWrapper() returns a RefPtr<> we need to 
800         use get() for the casting expressions.
801
802         (WebCore::SVGViewSpec::transform):
803         * svg/SVGViewSpec.h:
804         Change the return value from raw pointer to RefPtr<>.
805         
806         * svg/properties/SVGAnimatedListPropertyTearOff.h:
807         (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
808         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
809         Change the return value from raw pointer to RefPtr<> and change the cached
810         value from RefPtr<> to raw pointer. If the property is null, it will be
811         created, its raw pointer will be cached and the only ref-counted RefPtr<>
812         will be returned. This will guarantee, the RefPtr<> will be deleted once
813         it is not used anymore. 
814         
815         (WebCore::SVGAnimatedListPropertyTearOff::propertyWillBeDeleted):
816         Clean the raw pointer caches m_baseVal and m_animVal upon deleting the
817         actual pointer. This function will be called from the destructor of
818         SVGListPropertyTearOff.
819         
820         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
821         (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList):
822         We have to ensure the baseVal() is created before using it.
823         
824         (WebCore::SVGAnimatedListPropertyTearOff::detachListWrappers):
825         (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue):
826         (WebCore::SVGAnimatedListPropertyTearOff::animationStarted):
827         (WebCore::SVGAnimatedListPropertyTearOff::animationEnded):
828         (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
829         (WebCore::SVGAnimatedListPropertyTearOff::animValWillChange):
830         (WebCore::SVGAnimatedListPropertyTearOff::animValDidChange):
831         For animation, a separate RefPtr<> 'm_animatingAnimVal' will be assigned
832         to the animVal(). This will prevent deleting m_animVal while animation.
833         
834         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
835         (WebCore::SVGAnimatedPathSegListPropertyTearOff::baseVal):
836         (WebCore::SVGAnimatedPathSegListPropertyTearOff::animVal):
837         Same as what is done in SVGAnimatedListPropertyTearOff.
838         
839         (WebCore::SVGAnimatedPathSegListPropertyTearOff::findItem):
840         (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList):
841         Same as what is done in SVGAnimatedListPropertyTearOff.
842         
843         * svg/properties/SVGAnimatedProperty.h:
844         (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
845         Change the return value from raw reference to Ref<> and change the
846         cached value from Ref<> to raw pointer. This reverts the change of
847         r181345 in this function.
848         
849         (WebCore::SVGAnimatedProperty::lookupWrapper):
850         Change the return value from raw pointer to RefPtr<>.
851         
852         * svg/properties/SVGAnimatedPropertyMacros.h:
853         Use 'auto' type for the return of SVGAnimatedProperty::lookupWrapper().
854         
855         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
856         (WebCore::SVGAnimatedTransformListPropertyTearOff::baseVal):
857         (WebCore::SVGAnimatedTransformListPropertyTearOff::animVal):
858         Same as what is done in SVGAnimatedListPropertyTearOff.
859
860         * svg/properties/SVGListPropertyTearOff.h:
861         (WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
862         Call the SVGAnimatedListPropertyTearOff::propertyWillBeDeleted() to clean
863         its raw pointers when the RefPtr<> deletes itself.
864
865 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
866
867         [GTK] WebKitWebView should send crossing events to the WebProcess
868         https://bugs.webkit.org/show_bug.cgi?id=153740
869
870         Reviewed by Michael Catanzaro.
871
872         Update the target element under the mouse also when only updating
873         scrollbars, so that if the mouse enters the page when the window
874         is not active, the scroll animator is notified that the mouse
875         entered the scrollable area.
876
877         * page/EventHandler.cpp:
878         (WebCore::EventHandler::handleMouseMoveEvent): Call
879         updateMouseEventTargetNode() before early returning in case of
880         only updating scrollbars.
881
882 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
883
884         PiP and external playback are mutually exclusive.
885         https://bugs.webkit.org/show_bug.cgi?id=153988
886         rdar://problem/24108661
887
888         Reviewed by Eric Carlson.
889
890         Adding isPlayingOnSecondScreen to isPlayingOnExternalScreen allows AVKit to disable PiP
891         when appropriate. Testing video fullscreen mode in updateDisableExternalPlayback allows us to 
892         turn-off external playback when entering picture-in-picture.
893
894         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
895         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
896         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
897         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
898         (-[WebAVPlayerController isPlayingOnExternalScreen]):
899         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
900
901 2016-02-08  Commit Queue  <commit-queue@webkit.org>
902
903         Unreviewed, rolling out r196253.
904         https://bugs.webkit.org/show_bug.cgi?id=153990
905
906         Caused several crashes in GTK+ bots (Requested by KaL on
907         #webkit).
908
909         Reverted changeset:
910
911         "[GTK] WebKitWebView should send crossing events to the
912         WebProcess"
913         https://bugs.webkit.org/show_bug.cgi?id=153740
914         http://trac.webkit.org/changeset/196253
915
916 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
917
918         WebAVPlayerController should implement currentTimeWithinEndTimes.
919         https://bugs.webkit.org/show_bug.cgi?id=153983
920         rdar://problem/22864621
921
922         Reviewed by Eric Carlson.
923
924         Implement currentTimeWithinEndTimes in terms of seekToTime and AVTiming. This is a trivial
925         implementation becuase AVPlayer start and end times aren't used.
926
927         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
928         (-[WebAVPlayerController currentTimeWithinEndTimes]):
929         (-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
930         (+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
931
932 2016-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
933
934         [GTK] WebKitWebView should send crossing events to the WebProcess
935         https://bugs.webkit.org/show_bug.cgi?id=153740
936
937         Reviewed by Michael Catanzaro.
938
939         Update the target element under the mouse also when only updating
940         scrollbars, so that if the mouse enters the page when the window
941         is not active, the scroll animator is notified that the mouse
942         entered the scrollable area.
943
944         * page/EventHandler.cpp:
945         (WebCore::EventHandler::handleMouseMoveEvent): Call
946         updateMouseEventTargetNode() before early returning in case of
947         only updating scrollbars.
948
949 2016-02-08  Jeremy Jones  <jeremyj@apple.com>
950
951         WebVideoFullscreenInterface should handle video resizing.
952         https://bugs.webkit.org/show_bug.cgi?id=153982
953         rdar://problem/22031249
954
955         Reviewed by Eric Carlson.
956
957         Video fullscreen can be initiated before video dimension are available.
958         Protect against an initial width or height of zero and observe resize events 
959         to update once video dimensions become available or change.
960
961         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
962         (WebVideoFullscreenModelVideoElement::updateForEventName):
963         (WebVideoFullscreenModelVideoElement::observedEventNames):
964         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
965         (-[WebAVPlayerLayer layoutSublayers]):
966         (-[WebAVPlayerLayer videoRect]):
967         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
968
969 2016-02-08  Adrien Plazas  <aplazas@igalia.com>
970
971         Indent inline box test fails due to assertion in VisibleSelection::selectionFromContentsOfNode()
972         https://bugs.webkit.org/show_bug.cgi?id=153824
973
974         Reviewed by Michael Catanzaro.
975
976         * editing/markup.cpp:
977         (WebCore::highestAncestorToWrapMarkup):
978
979 2016-02-07  Sam Weinig  <sam@webkit.org>
980
981         Remove unused enum ScrollbarOverlayState.
982
983         Rubber-stamped by Dan Bernstein.
984
985         * platform/ScrollTypes.h:
986
987 2016-02-07  Sam Weinig  <sam@webkit.org>
988
989         Remove unnecessary respondsToSelector checks for methods that exist on all supported platforms
990         https://bugs.webkit.org/show_bug.cgi?id=153970
991
992         Reviewed by Dan Bernstein.
993
994         -[NSScrollerImp mouseEnteredScroller], -[NSScrollerImp expansionTransitionProgress],
995         -[NSScrollerImpPair contentAreaScrolledInDirection:], and -[NSScrollerImp setExpanded:]
996         are now available on all supported OS's. No need to check for them.
997
998         * platform/mac/ScrollAnimatorMac.mm:
999         (macScrollbarTheme):
1000         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1001         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1002         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
1003         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
1004         (WebCore::ScrollAnimatorMac::sendContentAreaScrolled):
1005         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired):
1006         (supportsUIStateTransitionProgress): Deleted.
1007         (supportsExpansionTransitionProgress): Deleted.
1008         (supportsContentAreaScrolledInDirection): Deleted.
1009         * platform/mac/ScrollbarThemeMac.mm:
1010         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
1011         (+[WebScrollbarPrefsObserver behaviorPrefsChanged:]):
1012         (WebCore::ScrollbarThemeMac::scrollbarThickness):
1013
1014 2016-02-07  Sam Weinig  <sam@webkit.org>
1015
1016         Use modern SPI header idiom for NSScrollerImp and NSScrollerImpPair
1017         https://bugs.webkit.org/show_bug.cgi?id=153969
1018
1019         Reviewed by Dan Bernstein.
1020
1021         * WebCore.xcodeproj/project.pbxproj:
1022         Add new file NSScrollerImpSPI.h
1023
1024         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1025         Use new include of NSScrollerImpSPI.h.
1026
1027         * platform/ScrollbarThemeComposite.h:
1028         Define ScrollbarPainter more precisely as NSScrollerImp * now that the type is available to us.
1029
1030         * platform/mac/NSScrollerImpDetails.h:
1031         Remove NSObject category based SPI usage with the modern one NSScrollerImpSPI.h
1032
1033         * platform/mac/NSScrollerImpDetails.mm:
1034         (WebCore::recommendedScrollerStyle):
1035         Simplify recommendedScrollerStyle() now that all OS's we ship on have +[NSScroller preferredScrollerStyle].
1036
1037         * platform/mac/ScrollAnimatorMac.mm:
1038         (supportsUIStateTransitionProgress):
1039         (supportsExpansionTransitionProgress):
1040         (supportsContentAreaScrolledInDirection):
1041         Stop using NSClassFromString now that we can reference the classes explicitly.
1042
1043         (-[WebScrollbarPainterControllerDelegate invalidate]):
1044         (-[WebScrollbarPainterControllerDelegate contentAreaRectForScrollerImpPair:]):
1045         (-[WebScrollbarPainterControllerDelegate inLiveResizeForScrollerImpPair:]):
1046         (-[WebScrollbarPainterControllerDelegate mouseLocationInContentAreaForScrollerImpPair:]):
1047         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
1048         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
1049         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
1050         (-[WebScrollbarPainterDelegate layer]):
1051         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
1052         (-[WebScrollbarPainterDelegate convertRectToLayer:]):
1053         (-[WebScrollbarPainterDelegate shouldUseLayerPerPartForScrollerImp:]):
1054         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
1055         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1056         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1057         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1058         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1059         (-[WebScrollbarPainterDelegate scrollerImp:overlayScrollerStateChangedTo:]):
1060         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
1061         (WebCore::ScrollAnimatorMac::lockOverlayScrollbarStateToHidden):
1062         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
1063         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
1064         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1065         Add proper conforming to protocols and replace ids with proper types.
1066
1067         * platform/mac/ScrollbarThemeMac.mm:
1068         (WebCore::supportsExpandedScrollbars):
1069         (WebCore::ScrollbarThemeMac::registerScrollbar):
1070         (WebCore::ScrollbarThemeMac::scrollbarThickness):
1071         (WebCore::ScrollbarThemeMac::setUpContentShadowLayer):
1072         Stop using NSClassFromString now that we can reference the classes explicitly.
1073
1074         * platform/spi/mac/NSScrollerImpSPI.h: Added.
1075
1076 2016-02-07  Zalan Bujtas  <zalan@apple.com>
1077
1078         Outline does not clip when ancestor has overflow: hidden and requires layer.
1079         https://bugs.webkit.org/show_bug.cgi?id=153901
1080
1081         Now that outline is part of visual overflow, we no longer need the special outline cliprect.
1082         PaintPhaseChildOutlines drawing will switch to foreground cliprect. It ensures proper overflow clipping
1083         at parent level. PaintPhaseSelfOutline drawing will start using the visual overflow inflated background cliprect.
1084         With this change, outline will be using the same cliprects as the other visual overflow properties (box-shadow etc). 
1085
1086         Reviewed by David Hyatt.
1087
1088         Test: fast/repaint/outline-with-overflow-hidden-ancestor.html
1089
1090         * rendering/LayerFragment.h:
1091         (WebCore::LayerFragment::setRects):
1092         (WebCore::LayerFragment::moveBy): Deleted.
1093         (WebCore::LayerFragment::intersect): Deleted.
1094         * rendering/RenderLayer.cpp:
1095         (WebCore::RenderLayer::collectFragments):
1096         (WebCore::RenderLayer::paintOutlineForFragments):
1097         (WebCore::RenderLayer::calculateClipRects):
1098         (WebCore::RenderLayer::paintForegroundForFragments): Deleted.
1099         * rendering/RenderLayer.h:
1100         * rendering/RenderTreeAsText.cpp:
1101         (WebCore::write):
1102         (WebCore::writeLayers):
1103
1104 2016-02-07  Daniel Bates  <dabates@apple.com>
1105
1106         CSP: Allow Web Workers initiated from an isolated world to bypass the main world Content Security Policy
1107         https://bugs.webkit.org/show_bug.cgi?id=153622
1108         <rdar://problem/24400023>
1109
1110         Reviewed by Gavin Barraclough.
1111
1112         Fixes an issue where Web Workers initiated from an isolated world (say, a Safari Content Script Extension)
1113         would be subject to the Content Security Policy of the page.
1114
1115         Currently code in an isolated world that does not execute in a Web Worker is exempt from the CSP of
1116         the page. However, code that runs inside a Web Worker that was initiated from an isolated world is
1117         subject to the CSP of the page. Instead, such Web Worker code should also be exempt from the CSP of
1118         the page.
1119
1120         Tests: http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-eval.html
1121                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-blob-xhr.html
1122                http/tests/security/isolatedWorld/bypass-main-world-csp-worker.html
1123
1124         * Modules/websockets/WebSocket.cpp:
1125         (WebCore::WebSocket::connect): Modified to ask the script execution context whether to bypass the
1126         main world Content Security Policy now that script execution context knows this information.
1127         * bindings/js/ScriptController.cpp:
1128         (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy): Deleted; moved logic from here...
1129         * bindings/js/ScriptController.h:
1130         * dom/Document.cpp:
1131         (WebCore::Document::shouldBypassMainWorldContentSecurityPolicy): ...to here.
1132         * dom/Document.h:
1133         * dom/ScriptExecutionContext.h:
1134         (WebCore::ScriptExecutionContext::shouldBypassMainWorldContentSecurityPolicy): Added; defaults to false -
1135         do not bypass the main world Content Security Policy.
1136         * page/EventSource.cpp:
1137         (WebCore::EventSource::create): Modified to ask the script execution context whether to bypass the
1138         main world Content Security Policy now that script execution context knows this information.
1139         * page/csp/ContentSecurityPolicy.cpp:
1140         (WebCore::ContentSecurityPolicy::shouldBypassMainWorldContentSecurityPolicy): Deleted.
1141         * page/csp/ContentSecurityPolicy.h:
1142         * workers/AbstractWorker.cpp:
1143         (WebCore::AbstractWorker::resolveURL): Bypass the main world Content Security Policy if applicable.
1144         Added FIXME comment to enforce the child-src directive of the document's CSP (as opposed to the script-src
1145         directive) on the worker's script URL. Also, scriptExecutionContext()->contentSecurityPolicy() should
1146         always be non-null just as we expect scriptExecutionContext()->securityOrigin() to be non-null. Assert
1147         this invariant to catch cases where a ScriptExecutionContext is not properly initialized.
1148         * workers/DedicatedWorkerGlobalScope.cpp:
1149         (WebCore::DedicatedWorkerGlobalScope::create): Modified to take boolean argument shouldBypassMainWorldContentSecurityPolicy
1150         as to whether to bypass the main world Content Security Policy and only apply the Content Security
1151         Policy headers when shouldBypassMainWorldContentSecurityPolicy is false.
1152         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope): Pass through a boolean argument shouldBypassMainWorldContentSecurityPolicy
1153         as to whether to bypass the main world Content Security Policy.
1154         * workers/DedicatedWorkerGlobalScope.h:
1155         * workers/DedicatedWorkerThread.cpp:
1156         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): Ditto.
1157         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Ditto.
1158         * workers/DedicatedWorkerThread.h:
1159         * workers/Worker.cpp:
1160         (WebCore::Worker::create): Store whether we should bypass the main world Content Security Policy so
1161         that we can pass it to WorkerMessagingProxy::startWorkerGlobalScope() in Worker::notifyFinished().
1162         We need to store this decision here as opposed to determining it at any later time (say, in Worker::notifyFinished())
1163         because it is dependent on the current JavaScript program stack at the time this function is invoked.
1164         (WebCore::Worker::notifyFinished): Pass whether to bypass the main world Content Security Policy.
1165         * workers/Worker.h:
1166         * workers/WorkerGlobalScope.cpp:
1167         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Modified to take a boolean as to whether to bypass the
1168         main world Content Security Policy and store it in a member field. Also, always instantiate a Content
1169         Security Policy object as our current code assumes that one is always created.
1170         * workers/WorkerGlobalScope.h:
1171         * workers/WorkerGlobalScopeProxy.h:
1172         * workers/WorkerMessagingProxy.cpp:
1173         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Pass through a boolean argument shouldBypassMainWorldContentSecurityPolicy
1174         as to whether to bypass the main world Content Security Policy.
1175         * workers/WorkerMessagingProxy.h:
1176         * workers/WorkerThread.cpp:
1177         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Modified to take a boolean argument as to
1178         whether to bypass the main world Content Security Policy and store it in a member field.
1179         (WebCore::WorkerThread::WorkerThread): Pass through a boolean argument shouldBypassMainWorldContentSecurityPolicy
1180         as to whether to bypass the main world Content Security Policy.
1181         (WebCore::WorkerThread::workerThread): Ditto.
1182         * workers/WorkerThread.h:
1183         * xml/XMLHttpRequest.cpp:
1184         (WebCore::XMLHttpRequest::open): Modified to ask the script execution context whether to bypass the
1185         main world Content Security Policy now that script execution context knows this information.
1186
1187 2016-02-07  Dan Bernstein  <mitz@apple.com>
1188
1189         [Cocoa] Replace __has_include guards around inclusion of Apple-internal-SDK headers with USE(APPLE_INTERNAL_SDK)
1190         https://bugs.webkit.org/show_bug.cgi?id=153963
1191
1192         Reviewed by Sam Weinig.
1193
1194         * accessibility/mac/AXObjectCacheMac.mm:
1195         * crypto/CommonCryptoUtilities.cpp:
1196         * crypto/CommonCryptoUtilities.h:
1197         * editing/mac/TextUndoInsertionMarkupMac.h:
1198         * editing/mac/TextUndoInsertionMarkupMac.mm:
1199         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
1200         * platform/graphics/cg/ImageSourceCG.cpp:
1201         * platform/graphics/mac/PDFDocumentImageMac.mm:
1202         * platform/network/ios/NetworkStateNotifierIOS.mm:
1203         * platform/network/mac/BlobDataFileReferenceMac.mm:
1204         * platform/network/mac/ResourceHandleMac.mm:
1205         * rendering/RenderThemeMac.mm:
1206
1207 2016-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1208
1209         REGRESSION(r195661): [GTK] Scrollbar tests crashing after overlay scrollbar groundwork
1210         https://bugs.webkit.org/show_bug.cgi?id=153695
1211
1212         Reviewed by Michael Catanzaro.
1213
1214         The problem is that ScrollAnimation objects are not destroyed by
1215         the ScrollAnimator destructor, because I forgot to add a virtual
1216         destructor for ScrollAnimation in r195661.
1217
1218         * platform/ScrollAnimation.h:
1219         (WebCore::ScrollAnimation::~ScrollAnimation):
1220
1221 2016-02-06  Chris Dumez  <cdumez@apple.com>
1222
1223         Prevent cross-origin access to window.history
1224         https://bugs.webkit.org/show_bug.cgi?id=153931
1225
1226         Reviewed by Darin Adler.
1227
1228         Prevent cross-origin access to window.history to match the specification [1]
1229         and the behavior of other browsers (tested Firefox and Chrome).
1230
1231         [1] https://html.spec.whatwg.org/multipage/browsers.html#security-window
1232
1233         No new tests, already covered by existing tests that
1234         were updated in this patch.
1235
1236         * bindings/js/JSHistoryCustom.cpp:
1237         (WebCore::JSHistory::pushState):
1238         (WebCore::JSHistory::replaceState):
1239         (WebCore::JSHistory::state): Deleted.
1240         * page/DOMWindow.idl:
1241         * page/History.idl:
1242
1243 2016-02-06  Beth Dakin  <bdakin@apple.com>
1244
1245         ScrollbarPainters needs to be deallocated on the main thread
1246         https://bugs.webkit.org/show_bug.cgi?id=153932
1247         -and corresponding-
1248         rdar://problem/24015483
1249
1250         Reviewed by Dan Bernstein.
1251
1252         Darin pointed out that this was still race-y. There was still a race 
1253         condition between the destruction of the two local variables and the
1254         destruction of the lambda on the main thread. This should fix that. 
1255         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1256         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1257         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
1258         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread):
1259         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
1260
1261 2016-02-06  Darin Adler  <darin@apple.com>
1262
1263         Finish auditing call sites of upper() and lower(), eliminate many, and rename the functions
1264         https://bugs.webkit.org/show_bug.cgi?id=153905
1265
1266         Reviewed by Sam Weinig.
1267
1268         * Modules/mediasource/MediaSource.cpp:
1269         (WebCore::MediaSource::isTypeSupported): Use convertToASCIILowercase on MIME type.
1270
1271         * accessibility/AccessibilityObject.cpp:
1272         (WebCore::AccessibilityObject::selectText): Use new names for lower and upper. Also
1273         tweaked style a tiny bit and used u_toupper rather than converting an entire
1274         string to uppercase.
1275
1276         * dom/Document.cpp:
1277         (WebCore::Document::addImageElementByCaseFoldedUsemap): Renamed to reflect the use
1278         of case folding rather than lowercasing.
1279         (WebCore::Document::removeImageElementByCaseFoldedUsemap): Ditto.
1280         (WebCore::Document::imageElementByCaseFoldedUsemap): Ditto.
1281         * dom/Document.h: Ditto.
1282         * dom/DocumentOrderedMap.cpp:
1283         (WebCore::DocumentOrderedMap::getElementByCaseFoldedMapName): Ditto.
1284         (WebCore::DocumentOrderedMap::getElementByCaseFoldedUsemap): Ditto.
1285         * dom/DocumentOrderedMap.h: Ditto.
1286
1287         * dom/TreeScope.cpp:
1288         (WebCore::TreeScope::getImageMap): Removed unneeded special case for null string.
1289         Simplified logic for cases where the URL does not have a "#" character in it.
1290         Use case folding instead of lowercase.
1291
1292         * editing/cocoa/HTMLConverter.mm:
1293         (HTMLConverter::_processText): Removed unneded special case for the empty string.
1294         Use makCapitalized instead of Cocoa function for "capitalize". Use upper and lower
1295         functions by their new names.
1296
1297         * html/HTMLImageElement.cpp:
1298         (WebCore::HTMLImageElement::parseAttribute): Use case folding instead of
1299         lowerasing for the usemap attribute.
1300         (WebCore::HTMLImageElement::insertedInto): Ditto.
1301         (WebCore::HTMLImageElement::removedFrom): Ditto.
1302         (WebCore::HTMLImageElement::matchesCaseFoldedUsemap): Ditto.
1303         * html/HTMLImageElement.h: Rename since usemap is case folded now, not lowercased.
1304
1305         * html/HTMLMapElement.cpp:
1306         (WebCore::HTMLMapElement::imageElement): Use case folding instead of lowercasing
1307         for usemap.
1308         (WebCore::HTMLMapElement::parseAttribute): Ditto.
1309
1310         * platform/Language.cpp:
1311         (WebCore::canonicalLanguageIdentifier): Use convertToASCIILowercase for language code.
1312         (WebCore::indexOfBestMatchingLanguageInList): Ditto.
1313
1314         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1315         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Use new name for the upper function.
1316
1317         * platform/network/HTTPParsers.cpp:
1318         (WebCore::parseContentTypeOptionsHeader): Use equalLettersIgnoringASCIICase instead
1319         of lowercasing to check for a specific header value.
1320
1321         * platform/network/MIMEHeader.cpp:
1322         (WebCore::retrieveKeyValuePairs): Use convertToASCIILowercase for MIME header name.
1323         (WebCore::MIMEHeader::parseContentTransferEncoding): Use equalLettersIgnoringASCIICase
1324         instead of lowercasing.
1325
1326         * platform/network/cf/ResourceHandleCFNet.cpp:
1327         (WebCore::allowsAnyHTTPSCertificateHosts): Make this hash ASCII case-insensitive.
1328         (WebCore::clientCertificates): Ditto.
1329         (WebCore::ResourceHandle::createCFURLConnection): Remove call to lower since the
1330         set is now ASCII case-insensitive.
1331         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Ditto.
1332         (WebCore::ResourceHandle::setClientCertificate): Ditto.
1333
1334         * platform/network/curl/CookieJarCurl.cpp:
1335         (WebCore::getNetscapeCookieFormat): Use equalLettersIgnoringASCIICase instead of
1336         lowercasing.
1337
1338         * platform/network/curl/MultipartHandle.cpp:
1339         (WebCore::MultipartHandle::didReceiveResponse): Use convertToASCIILowercase to
1340         make a MIME type lowercase.
1341
1342         * platform/network/curl/ResourceHandleCurl.cpp:
1343         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Removed unneeded
1344         conversion to lowercase now that the set is ASCII case-insensitive.
1345         (WebCore::ResourceHandle::setClientCertificate): Removed code that populates a map
1346         that is then never used for anything.
1347
1348         * platform/network/curl/ResourceHandleManager.cpp:
1349         (WebCore::headerCallback): Use convertToASCIILowercase for MIME type.
1350
1351         * platform/network/curl/SSLHandle.cpp: Made hash maps keyed by host names
1352         ASCII case-insensitive.
1353         (WebCore::addAllowedClientCertificate): Removed lowercasing since the map itself
1354         is now ASCII case insensitve.
1355         (WebCore::setSSLClientCertificate): Ditto. Also use auto for iterator type so we
1356         don't have to write out the map type.
1357         (WebCore::sslIgnoreHTTPSCertificate): Ditto.
1358         (WebCore::certVerifyCallback): Ditto.
1359
1360         * platform/network/soup/ResourceHandleSoup.cpp: Made hash maps keyed by host names
1361         ASCII case-insensitive.
1362         (WebCore::allowsAnyHTTPSCertificateHosts): Ditto.
1363         (WebCore::handleUnignoredTLSErrors): Ditto.
1364         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate): Ditto.
1365         (WebCore::ResourceHandle::setClientCertificate): Ditto.
1366
1367         * platform/text/LocaleToScriptMappingDefault.cpp: Made hash maps keyed by script
1368         names ASCII case-insensitive. USE WTF_ARRAY_LENGTH as appropriate.
1369         (WebCore::scriptNameToCode): Use modern style to initialize the map. Removed
1370         unnecessary lowercasing of the script name before looking at the map.
1371         (WebCore::localeToScriptCodeForFontSelection): Ditto.
1372
1373         * platform/text/win/LocaleWin.cpp:
1374         (WebCore::convertLocaleNameToLCID): Made map ASCII case-insensitive and removed
1375         unneeded lowercasing.
1376
1377         * platform/win/PasteboardWin.cpp:
1378         (WebCore::clipboardTypeFromMIMEType): Use equalLettersIgnoringASCIICase instead
1379         of lowercasing.
1380
1381         * rendering/RenderText.cpp:
1382         (WebCore::applyTextTransform): Use new names for the upper and lower functions.
1383
1384         * xml/XMLHttpRequest.cpp:
1385         (WebCore::XMLHttpRequest::responseIsXML): Remove unneeded lowercasing, since
1386         DOMImplementation now has ASCII case-insensitive handling of MIME types.
1387
1388 2016-02-06  Zalan Bujtas  <zalan@apple.com>
1389
1390         Outline should contribute to visual overflow.
1391         https://bugs.webkit.org/show_bug.cgi?id=153299
1392
1393         This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
1394         Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
1395         outline borders.
1396         This patch fixes several focusring related repaint issues. However when both the outline: auto
1397         and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
1398         (Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
1399         It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.
1400
1401         Reviewed by David Hyatt.
1402
1403         Test: fast/repaint/focus-ring-repaint.html
1404               fast/repaint/focus-ring-repaint-with-negative-offset.html
1405
1406         * css/html.css: resetting to old behavior.
1407         (:focus):
1408         (input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus):
1409         * rendering/InlineFlowBox.cpp:
1410         (WebCore::InlineFlowBox::addToLine):
1411         (WebCore::InlineFlowBox::addOutlineVisualOverflow):
1412         (WebCore::InlineFlowBox::computeOverflow):
1413         (WebCore::InlineFlowBox::paint): Deleted.
1414         * rendering/InlineFlowBox.h:
1415         * rendering/RenderBlock.cpp:
1416         (WebCore::RenderBlock::computeOverflow):
1417         (WebCore::RenderBlock::outlineStyleForRepaint):
1418         (WebCore::RenderBlock::paint): Deleted.
1419         * rendering/RenderBlockFlow.cpp:
1420         (WebCore::RenderBlockFlow::layoutBlock): Deleted.
1421         (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren): Deleted.
1422         * rendering/RenderBlockLineLayout.cpp:
1423         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
1424         * rendering/RenderBox.cpp:
1425         (WebCore::RenderBox::addVisualEffectOverflow):
1426         (WebCore::RenderBox::applyVisualEffectOverflow):
1427         (WebCore::RenderBox::clippedOverflowRectForRepaint): Deleted.
1428         * rendering/RenderBoxModelObject.h:
1429         * rendering/RenderDetailsMarker.cpp:
1430         (WebCore::RenderDetailsMarker::paint): Deleted.
1431         * rendering/RenderElement.cpp:
1432         (WebCore::RenderElement::insertChildInternal):
1433         (WebCore::RenderElement::styleDidChange):
1434         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
1435         (WebCore::RenderElement::issueRepaintForOutlineAuto):
1436         (WebCore::RenderElement::updateOutlineAutoAncestor):
1437         (WebCore::RenderElement::computeMaxOutlineSize): Deleted.
1438         (WebCore::RenderElement::styleWillChange): Deleted.
1439         * rendering/RenderElement.h:
1440         (WebCore::RenderElement::hasContinuation):
1441         * rendering/RenderInline.cpp:
1442         (WebCore::RenderInline::paintOutlineForLine): Deleted.
1443         * rendering/RenderLayer.cpp:
1444         (WebCore::RenderLayer::calculateClipRects):
1445         * rendering/RenderLineBoxList.cpp:
1446         (WebCore::RenderLineBoxList::anyLineIntersectsRect):
1447         (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
1448         (WebCore::RenderLineBoxList::paint):
1449         (WebCore::isOutlinePhase): Deleted.
1450         * rendering/RenderLineBoxList.h:
1451         * rendering/RenderListBox.cpp:
1452         (WebCore::RenderListBox::computePreferredLogicalWidths):
1453         * rendering/RenderListMarker.cpp:
1454         (WebCore::RenderListMarker::paint): Deleted.
1455         * rendering/RenderObject.cpp:
1456         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded): The renderer with outline: auto is responsible for
1457         painting focusring around the descendants. If we issued repaint only on the descendant when it changes,
1458         the focusring would not refresh properly. We have to find the ancestor with outline: auto, inflate the repaint rect and
1459         issue the repaint on the ancestor if we crossed repaint container.
1460  
1461         (WebCore::RenderObject::repaintUsingContainer):
1462         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
1463         (WebCore::RenderObject::setHasOutlineAutoAncestor):
1464         (WebCore::RenderObject::adjustRectWithMaximumOutline): Deleted.
1465         
1466         * rendering/RenderObject.h: We mark the descendants of outline: auto so that
1467         when a child renderer changes we can propagate the repaint to the ancestor with outline.
1468
1469         (WebCore::RenderObject::hasOutlineAutoAncestor):
1470         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
1471         * rendering/RenderRegion.cpp:
1472         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
1473         * rendering/RenderReplaced.cpp:
1474         (WebCore::RenderReplaced::shouldPaint): Deleted.
1475         (WebCore::RenderReplaced::clippedOverflowRectForRepaint): Deleted.
1476         * rendering/RenderTable.cpp:
1477         (WebCore::RenderTable::paint): Deleted.
1478         * rendering/RenderTableCell.cpp:
1479         (WebCore::RenderTableCell::clippedOverflowRectForRepaint): Deleted.
1480         (WebCore::RenderTableCell::paintCollapsedBorders): Deleted.
1481         * rendering/RenderTableRow.cpp:
1482         (WebCore::RenderTableRow::layout):
1483         (WebCore::RenderTableRow::clippedOverflowRectForRepaint): Deleted.
1484         * rendering/RenderTableSection.cpp:
1485         (WebCore::RenderTableSection::layoutRows):
1486         (WebCore::RenderTableSection::computeOverflowFromCells): Deleted.
1487         (WebCore::RenderTableSection::paintObject): Deleted.
1488         * rendering/RenderTheme.h:
1489         (WebCore::RenderTheme::platformFocusRingWidth):
1490         * rendering/RenderView.cpp:
1491         (WebCore::RenderView::setMaximalOutlineSize): Deleted.
1492         * rendering/RenderView.h:
1493         * rendering/style/RenderStyle.cpp:
1494         (WebCore::RenderStyle::changeAffectsVisualOverflow):
1495         (WebCore::RenderStyle::outlineWidth):
1496         * rendering/style/RenderStyle.h:
1497
1498 2016-02-06  Andreas Kling  <akling@apple.com>
1499
1500         [iOS] Throw away linked code when navigating to a new page.
1501         <https://webkit.org/b/153851>
1502
1503         Reviewed by Gavin Barraclough.
1504
1505         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
1506         Linked code is tied to a specific global object, and as we're creating a new one for the
1507         new page, none of it is useful to us here.
1508
1509         In the event that the user navigates back, the cost of relinking some code will be far
1510         lower than the memory cost of keeping all of it around.
1511
1512         This landed previously but was rolled out due to a Speedometer regression. I've made one
1513         minor but important change here: only throw away code if we're navigating away from an
1514         existing history item. Or in other words, don't throw away code for "force peeks" or any
1515         other navigations that are not traditional top-level main frame navigations.
1516
1517         * bindings/js/GCController.cpp:
1518         (WebCore::GCController::deleteAllLinkedCode):
1519         * bindings/js/GCController.h:
1520         * loader/FrameLoader.cpp:
1521         (WebCore::FrameLoader::commitProvisionalLoad):
1522
1523 2016-02-06  Konstantin Tokarev  <annulen@yandex.ru>
1524
1525         Added implementations of AXObjectCache methods for !HAVE(ACCESSIBILITY).
1526         https://bugs.webkit.org/show_bug.cgi?id=153924
1527
1528         Reviewed by Andreas Kling.
1529
1530         No new tests needed.
1531
1532         * accessibility/AXObjectCache.h:
1533         (WebCore::AXObjectCache::ariaModalNode): Added stub implementation.
1534         (WebCore::AXObjectCache::postLiveRegionChangeNotification): Ditto.
1535         (WebCore::AXObjectCache::rangeForNodeContents): Ditto.
1536         (WebCore::AXObjectCache::setIsSynchronizingSelection): Ditto.
1537         (WebCore::AXObjectCache::setTextSelectionIntent): Ditto.
1538         (WebCore::AXAttributeCacheEnabler::AXAttributeCacheEnabler): Ditto.
1539         (WebCore::AXAttributeCacheEnabler::~AXAttributeCacheEnabler): Ditto.
1540
1541 2016-02-04  Antti Koivisto  <antti@apple.com>
1542
1543         Use scope stack instead of nested TreeResolvers for shadow trees
1544         https://bugs.webkit.org/show_bug.cgi?id=153893
1545
1546         Reviewed by Andreas Kling.
1547
1548         Make TreeResolver per-document. This is a step towards iterative style resolve.
1549
1550         This is done replacing use of nested TreeResolvers with a scope stack that maintains
1551         the style resolver and the selector filter for the current tree scope.
1552
1553         * style/StyleTreeResolver.cpp:
1554         (WebCore::Style::ensurePlaceholderStyle):
1555         (WebCore::Style::TreeResolver::Scope::Scope):
1556         (WebCore::Style::TreeResolver::TreeResolver):
1557         (WebCore::Style::shouldCreateRenderer):
1558         (WebCore::Style::TreeResolver::styleForElement):
1559         (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot):
1560         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
1561         (WebCore::Style::TreeResolver::createRenderTreeRecursively):
1562         (WebCore::Style::TreeResolver::resolveLocally):
1563         (WebCore::Style::TreeResolver::resolveShadowTree):
1564         (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement):
1565         (WebCore::Style::TreeResolver::resolveChildren):
1566         (WebCore::Style::TreeResolver::resolveSlotAssignees):
1567         (WebCore::Style::TreeResolver::resolveRecursively):
1568         (WebCore::Style::TreeResolver::resolve):
1569         (WebCore::Style::detachRenderTree):
1570         * style/StyleTreeResolver.h:
1571         (WebCore::Style::TreeResolver::scope):
1572         (WebCore::Style::TreeResolver::pushScope):
1573         (WebCore::Style::TreeResolver::pushEnclosingScope):
1574         (WebCore::Style::TreeResolver::popScope):
1575
1576 2016-02-06  Commit Queue  <commit-queue@webkit.org>
1577
1578         Unreviewed, rolling out r196104.
1579         https://bugs.webkit.org/show_bug.cgi?id=153940
1580
1581         Regressed Speedometer on iOS (Requested by kling on #webkit).
1582
1583         Reverted changeset:
1584
1585         "[iOS] Throw away linked code when navigating to a new page."
1586         https://bugs.webkit.org/show_bug.cgi?id=153851
1587         http://trac.webkit.org/changeset/196104
1588
1589 2016-02-05  Beth Dakin  <bdakin@apple.com>
1590
1591         ScrollbarPainters needs to be deallocated on the main thread
1592         https://bugs.webkit.org/show_bug.cgi?id=153932
1593         -and corresponding-
1594         rdar://problem/24015483
1595
1596         Reviewed by Geoff Garen.
1597
1598         Follow-up fix since the first one was still race-y.
1599         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1600         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
1601         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
1602
1603 2016-02-05  Beth Dakin  <bdakin@apple.com>
1604
1605         ScrollbarPainters needs to be deallocated on the main thread
1606         https://bugs.webkit.org/show_bug.cgi?id=153932
1607         -and corresponding-
1608         rdar://problem/24015483
1609
1610         Reviewed by Tim Horton.
1611
1612         Ensure the the destructor of ScrollingTreeFrameScrollingNodeMac and the 
1613         assignments done in this class are not responsible for deallocating the 
1614         ScrollbarPainter. 
1615         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1616         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
1617         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
1618
1619 2016-02-05  Chris Dumez  <cdumez@apple.com>
1620
1621         Instance property getters / setters cannot be called on another instance of the same type
1622         https://bugs.webkit.org/show_bug.cgi?id=153895
1623
1624         Reviewed by Gavin Barraclough.
1625
1626         It should be possible to call instance property getters / setters on
1627         other instances of the same type, as per the WEB IDL specification:
1628         - http://heycam.github.io/webidl/#dfn-attribute-getter
1629         - http://heycam.github.io/webidl/#dfn-attribute-setter
1630
1631         This matches the behavior of Firefox.
1632
1633         The issue without our bindings was that the getters / setters were
1634         using |slotBase| instead of |thisValue| and therefore ended up using
1635         the instance the getter was taken from instead of the actual target
1636         object.
1637
1638         Test:
1639         js/instance-property-getter-other-instance.html
1640         js/instance-property-setter-other-instance.html
1641
1642         * bindings/scripts/CodeGeneratorJS.pm:
1643         (GenerateImplementation):
1644         - Have instance getters / setters use thisValue instead of slotBase.
1645         - In the case of interfaces that have attributes on the instance for
1646           compatibility reasons, try the prototype object if |thisValue| does
1647           does have the right type, instead of using slotBase like previously.
1648           I believe this maintains the original compatibility intention while
1649           also behaving correctly when called on another instance.
1650
1651         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1652         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1653         * bindings/scripts/test/JS/JSTestException.cpp:
1654         * bindings/scripts/test/JS/JSTestInterface.cpp:
1655         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1656         * bindings/scripts/test/JS/JSTestNode.cpp:
1657         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1658         * bindings/scripts/test/JS/JSTestObj.cpp:
1659         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1660         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1661         * bindings/scripts/test/JS/JSattribute.cpp:
1662         Rebaseline bindings tests.
1663
1664 2016-02-05  Brady Eidson  <beidson@apple.com>
1665
1666         Modern IDB: UniqueIDBDatabase's m_databaseInfo is unsafely used from multiple threads.
1667         https://bugs.webkit.org/show_bug.cgi?id=153912
1668
1669         Reviewed by Alex Christensen.
1670
1671         No new tests (Anything testable about this patch is already covered by existing tests).
1672
1673         * Modules/indexeddb/server/IDBBackingStore.h:
1674
1675         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1676         (WebCore::IDBServer::MemoryIDBBackingStore::infoForObjectStore):
1677         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1678
1679         Teach the SQLiteIDBBackingStore to actually keep its m_databaseInfo up to date as it changes,
1680         and to revert it when version change transactions abort:
1681         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1682         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1683         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
1684         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
1685         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1686         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
1687         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1688         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1689         (WebCore::IDBServer::SQLiteIDBBackingStore::infoForObjectStore):
1690         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1691
1692         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1693         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Use the IDBBackingStore's copy of the 
1694           IDBObjectStoreInfo, meant only for the database thread, instead of the UniqueIDBDatabase's copy, 
1695           which is meant only for the main thread.
1696
1697 2016-02-05  Alex Christensen  <achristensen@webkit.org>
1698
1699         Clean up Blob code
1700         https://bugs.webkit.org/show_bug.cgi?id=153910
1701
1702         Reviewed by Alexey Proskuryakov.
1703
1704         No new tests, no change in behavior.
1705
1706         * css/StyleSheet.h:
1707         * fileapi/Blob.cpp:
1708         (WebCore::Blob::Blob):
1709         (WebCore::Blob::normalizedContentType):
1710         (WebCore::Blob::isNormalizedContentType):
1711         (WebCore::Blob::registry):
1712         * fileapi/Blob.h:
1713         * fileapi/BlobURL.cpp:
1714         (WebCore::BlobURL::createPublicURL):
1715         * fileapi/BlobURL.h:
1716         (WebCore::BlobURL::BlobURL):
1717         (WebCore::BlobURL::blobProtocol): Deleted.
1718         * platform/PlatformStrategies.cpp:
1719         (WebCore::setPlatformStrategies):
1720         (WebCore::hasPlatformStrategies): Deleted.
1721         * platform/PlatformStrategies.h:
1722         * platform/network/BlobRegistry.cpp:
1723         (WebCore::blobRegistry):
1724         * platform/network/BlobRegistry.h:
1725         * platform/network/BlobRegistryImpl.cpp:
1726         (WebCore::BlobRegistryImpl::~BlobRegistryImpl):
1727         (WebCore::createResourceHandle):
1728         (WebCore::registerBlobResourceHandleConstructor):
1729         (WebCore::BlobRegistryImpl::createResourceHandle):
1730         (WebCore::BlobRegistryImpl::appendStorageItems):
1731         (WebCore::BlobRegistryImpl::registerFileBlobURL):
1732         (WebCore::BlobRegistryImpl::registerBlobURL):
1733         * platform/network/BlobRegistryImpl.h:
1734         * platform/network/BlobResourceHandle.cpp:
1735         (WebCore::BlobResourceHandle::loadResourceSynchronously):
1736         (WebCore::BlobResourceHandle::BlobResourceHandle):
1737         * platform/network/ResourceHandle.h:
1738
1739 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1740
1741         [GTK] Scrollbars incorrectly rendered with older versions of GTK+
1742         https://bugs.webkit.org/show_bug.cgi?id=153861
1743
1744         Reviewed by Michael Catanzaro.
1745
1746         The theme doesn't really know it's a scrollbar. Older versions of
1747         GTK+ require to explicitly add the scrollbar style class to the
1748         child GtkStyleContext.
1749
1750         * platform/gtk/ScrollbarThemeGtk.cpp:
1751         (WebCore::createChildStyleContext):
1752
1753 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1754
1755         [GTK] Scrollbars not correctly rendered in non GNOME environments
1756         https://bugs.webkit.org/show_bug.cgi?id=153860
1757
1758         Reviewed by Michael Catanzaro.
1759
1760         I noticed this in a matchbox environment, where there's no
1761         gnome-setting-daemon running. The problem is only with the
1762         scrollbars, because we initialize the GtkSettings in
1763         RenderThemeGtk and notify the ScrollbarTheme when it changes, but
1764         ScrollbarTheme is created before RenderThemeGtk so we initialize
1765         the theme properties before the GtkSettings have been
1766         initialized. We can just let the ScrollbarTheme monitor the
1767         theme itself instead of relying on being notified by the WebCore
1768         layer.
1769
1770         * platform/gtk/ScrollbarThemeGtk.cpp:
1771         (WebCore::themeChangedCallback):
1772         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
1773         * rendering/RenderThemeGtk.cpp:
1774         (WebCore::gtkStyleChangedCallback): Deleted.
1775
1776 2016-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1777
1778         Remove DOMWrapped parameter from JSKeyValueIterator
1779         https://bugs.webkit.org/show_bug.cgi?id=153859
1780
1781         Reviewed by Sam Weinig.
1782
1783         No change in behavior.
1784
1785         Using std::declval to infer DOMWrapped from JSWrapper::wrapped.
1786
1787         * bindings/js/JSFetchHeadersCustom.cpp:
1788         (WebCore::JSFetchHeaders::entries):
1789         (WebCore::JSFetchHeaders::keys):
1790         (WebCore::JSFetchHeaders::values):
1791         * bindings/js/JSKeyValueIterator.h:
1792         (WebCore::createIterator):
1793         (WebCore::JSKeyValueIterator<JSWrapper>::destroy):
1794         (WebCore::JSKeyValueIterator<JSWrapper>::next):
1795         (WebCore::JSKeyValueIteratorPrototypeFunctionNext):
1796         (WebCore::JSKeyValueIteratorPrototype<JSWrapper>::finishCreation):
1797
1798 2016-02-05  Nan Wang  <n_wang@apple.com>
1799
1800         AX: WebKit hanging when VoiceOver attempts to focus in on page
1801         https://bugs.webkit.org/show_bug.cgi?id=153899
1802         <rdar://problem/24506603>
1803
1804         Reviewed by Chris Fleizach.
1805
1806         The VisiblePosition to CharacterOffset conversion will lead to an infinite loop if the
1807         nextVisiblePostion call is returning the original VisiblePosition. Fixed it by breaking out
1808         of the loop early in that situation. 
1809
1810         Test: accessibility/text-marker/character-offset-visible-position-conversion-hang.html
1811
1812         * accessibility/AXObjectCache.cpp:
1813         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
1814
1815 2016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
1816
1817         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
1818         https://bugs.webkit.org/show_bug.cgi?id=153500
1819         <rdar://problem/24352458>
1820
1821         Reviewed by Timothy Hatcher.
1822
1823         * bindings/js/JSDOMWindowBase.cpp:
1824         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
1825         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
1826         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
1827         * bindings/js/JSDOMWindowBase.h:
1828         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1829         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
1830         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
1831         * bindings/js/JSWorkerGlobalScopeBase.h:
1832         * inspector/InspectorController.h:
1833         * inspector/InspectorController.cpp:
1834         (WebCore::InspectorController::legacyProfilerEnabled):
1835         (WebCore::InspectorController::setLegacyProfilerEnabled):
1836         Be more explicit about enabling legacy profiling.
1837
1838         * inspector/InspectorTimelineAgent.cpp:
1839         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
1840         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
1841         TimelineAgent doesn't need to recompile if using the sampling profiler.
1842         This breaks console.profile, but console.profile should move to using
1843         the sampling profiler as well.
1844
1845         (WebCore::InspectorTimelineAgent::startFromConsole):
1846         (WebCore::InspectorTimelineAgent::stopFromConsole):
1847         (WebCore::startProfiling): Deleted.
1848         (WebCore::stopProfiling): Deleted.
1849         Inlined the use once static functions.
1850
1851         * page/PageConsoleClient.cpp:
1852         (WebCore::PageConsoleClient::profile):
1853         (WebCore::PageConsoleClient::profileEnd):
1854         Added FIXMEs for improving console.profile and profileEnd.
1855
1856         * testing/Internals.cpp:
1857         (WebCore::Internals::resetToConsistentState):
1858         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
1859         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
1860         * testing/Internals.h:
1861         * testing/Internals.idl:
1862         Be more explicit about enabling legacy profiling.
1863
1864 2016-02-04  Brent Fulgham  <bfulgham@apple.com>
1865
1866         Follow-up: Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
1867         https://bugs.webkit.org/show_bug.cgi?id=153657
1868         <rdar://problem/24413107>
1869
1870         Reviewed by Darin Adler.
1871
1872         * plugins/PluginData.cpp:
1873         (WebCore::shouldBePubliclyVisible): Revise comments to provide a
1874         better explanation of the function and why it exists.
1875
1876 2016-02-04  Jonathan Davis  <jond@apple.com>
1877
1878         Add Fetch API and CSS Variables to feature status
1879         https://bugs.webkit.org/show_bug.cgi?id=153896
1880
1881         Reviewed by Timothy Hatcher.
1882
1883         * features.json:
1884
1885 2016-02-04  Daniel Bates  <dabates@apple.com>
1886
1887         WebKit for iOS Simulator fails to build with public iOS SDK
1888         https://bugs.webkit.org/show_bug.cgi?id=153881
1889
1890         Reviewed by Alex Christensen.
1891
1892         Make constants have internal linkage to match the Apple Internal SDK.
1893
1894         * platform/spi/ios/MobileGestaltSPI.h:
1895
1896 2016-02-04  Chris Dumez  <cdumez@apple.com>
1897
1898         Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
1899         https://bugs.webkit.org/show_bug.cgi?id=153817
1900
1901         Reviewed by Geoffrey Garen.
1902
1903         Update the bindings generator so that property getters / setters now
1904         make sure |this| has the right type and throw a TypeError if it does
1905         not, as per:
1906         - http://heycam.github.io/webidl/#dfn-attribute-getter (step 2.4.2)
1907         - http://heycam.github.io/webidl/#dfn-attribute-setter (step 3.5)
1908
1909         This was an issue when doing something like:
1910         Object.getOwnPropertyDescriptor(window, "location").get.call(nonWindow)
1911
1912         We would call toJSDOMWindow(thisValue), which would return null as
1913         thisValue is not a JSDOMWindow. We would then dereference this null
1914         pointer and crash. We now do a null check and throw a TypeError in
1915         this case, as per the Web IDL specification.
1916
1917         The generated bindings still have some non-spec compliant behavior
1918         though:
1919         1. The getters / setters of instance properties use slotBase instead
1920            of thisValue, which means that calling instanceA's getter on
1921            instanceB returns instanceA's property insteas of instanceB's.
1922         2. Global object property getters should not require an explicit
1923            |this| so calling the following should work:
1924            - Object.getOwnPropertyDescriptor(window, "location").get.call()
1925            We currently throw in this case.
1926
1927         These issues will be addressed in follow-up patches.
1928
1929         Tests: js/getOwnPropertyDescriptor-unforgeable-attributes.html
1930                js/getOwnPropertyDescriptor-window-attributes.html
1931                js/instance-property-getter-other-instance.html
1932
1933         * bindings/scripts/CodeGeneratorJS.pm:
1934         (GenerateImplementation):
1935         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1936         (WebCore::jsTestActiveDOMObjectExcitingAttr):
1937         * bindings/scripts/test/JS/JSTestException.cpp:
1938         (WebCore::jsTestExceptionName):
1939         * bindings/scripts/test/JS/JSTestObj.cpp:
1940         (WebCore::jsTestObjConstructorTestSubObj):
1941         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
1942         (WebCore::jsTestObjConditionalAttr4Constructor):
1943         (WebCore::jsTestObjConditionalAttr5Constructor):
1944         (WebCore::jsTestObjConditionalAttr6Constructor):
1945         (WebCore::jsTestObjContentDocument):
1946         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
1947         (WebCore::setJSTestObjConditionalAttr4Constructor):
1948         (WebCore::setJSTestObjConditionalAttr5Constructor):
1949         (WebCore::setJSTestObjConditionalAttr6Constructor):
1950         (WebCore::setJSTestObjConstructor): Deleted.
1951         (WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
1952         (WebCore::setJSTestObjConditionalAttr3): Deleted.
1953         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1954         (WebCore::jsTestTypedefsConstructorTestSubObj):
1955
1956 2016-02-04  Brady Eidson  <beidson@apple.com>
1957
1958         Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
1959         https://bugs.webkit.org/show_bug.cgi?id=153438.
1960
1961         Reviewed by Alex Christensen.
1962
1963         Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
1964                storage/indexeddb/modern/idbkey-array-equality.html
1965
1966         * Modules/indexeddb/IDBKeyData.cpp:
1967         (WebCore::IDBKeyData::loggingString):
1968         (WebCore::IDBKeyData::operator==): Fix obvious bug.
1969
1970 2016-02-04  Chris Dumez  <cdumez@apple.com>
1971
1972         Unreviewed, fix the EFL clean build after r196123
1973         https://bugs.webkit.org/show_bug.cgi?id=153875
1974
1975         * CMakeLists.txt:
1976         * PlatformGTK.cmake:
1977         * PlatformMac.cmake:
1978         * html/DOMSettableTokenList.h:
1979         * html/DOMSettableTokenList.idl:
1980
1981 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
1982
1983         PageGroup::captionPreferences should return a reference
1984         https://bugs.webkit.org/show_bug.cgi?id=153877
1985         <rdar://problem/24506917>
1986
1987         Reviewed by Jer Noble.
1988
1989         No new tests, no functional change.
1990
1991         * Modules/mediacontrols/MediaControlsHost.cpp:
1992         (WebCore::MediaControlsHost::sortedTrackListForMenu):
1993         (WebCore::MediaControlsHost::displayNameForTrack):
1994         (WebCore::MediaControlsHost::captionMenuOffItem):
1995         (WebCore::MediaControlsHost::captionDisplayMode):
1996         * dom/Document.cpp:
1997         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
1998         * html/HTMLMediaElement.cpp:
1999         (WebCore::HTMLMediaElement::HTMLMediaElement):
2000         (WebCore::HTMLMediaElement::addTextTrack):
2001         (WebCore::HTMLMediaElement::configureTextTrackGroup):
2002         (WebCore::HTMLMediaElement::setSelectedTextTrack):
2003         (WebCore::HTMLMediaElement::configureTextTracks):
2004         (WebCore::HTMLMediaElement::captionPreferencesChanged):
2005         (WebCore::HTMLMediaElement::mediaPlayerPreferredAudioCharacteristics):
2006         * html/shadow/MediaControlElements.cpp:
2007         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2008         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
2009         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
2010         * page/PageGroup.cpp:
2011         (WebCore::PageGroup::captionPreferencesChanged):
2012         (WebCore::PageGroup::captionPreferences):
2013         * page/PageGroup.h:
2014         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2015         (WebVideoFullscreenModelVideoElement::updateLegibleOptions):
2016         * testing/InternalSettings.cpp:
2017         (WebCore::InternalSettings::setShouldDisplayTrackKind):
2018         (WebCore::InternalSettings::shouldDisplayTrackKind):
2019         * testing/Internals.cpp:
2020         (WebCore::Internals::resetToConsistentState):
2021         (WebCore::Internals::Internals):
2022         (WebCore::Internals::userPreferredAudioCharacteristics):
2023         (WebCore::Internals::setUserPreferredAudioCharacteristic):
2024         (WebCore::Internals::captionsStyleSheetOverride):
2025         (WebCore::Internals::setCaptionsStyleSheetOverride):
2026         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
2027         (WebCore::Internals::setCaptionDisplayMode):
2028
2029 2016-02-04  Konstantin Tokarev  <annulen@yandex.ru>
2030
2031         Removed unused Settings::setPrivateBrowsingEnabled.
2032         https://bugs.webkit.org/show_bug.cgi?id=153869
2033
2034         Reviewed by Alexey Proskuryakov.
2035
2036         Implementation of Settings::setPrivateBrowsingEnabled was removed
2037         in r166661, but declaration is still here.
2038
2039         No new tests needed.
2040
2041         * page/Settings.h:
2042         (WebCore::Settings::setPrivateBrowsingEnabled): Deleted.
2043
2044 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
2045
2046         Don't discard in-band cues with negative start times
2047         https://bugs.webkit.org/show_bug.cgi?id=153867
2048         <rdar://problem/19588632>
2049
2050         Reviewed by Jer Noble.
2051
2052         No new tests, updated and un-skipped http/tests/media/track-in-band-hls-metadata.html.
2053
2054         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
2055         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):  ASSERT if passed negative time value.
2056         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto. Correct logging.
2057
2058         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2059         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): ASSERT if passed negative time value.
2060         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Convert negative cue times to zero.
2061         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2062           Ditto.
2063
2064 2016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
2065
2066         Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
2067         https://bugs.webkit.org/show_bug.cgi?id=150925
2068
2069         Reviewed by Darin Adler.
2070
2071         createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
2072         for invalid numberOfInputs value.
2073         createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
2074
2075         Tests: webaudio/audiochannelmerger-basic.html
2076                webaudio/audiochannelsplitter.html
2077                webaudio/periodicwave-lengths.html
2078
2079         * Modules/webaudio/AudioContext.cpp:
2080         (WebCore::AudioContext::createChannelSplitter):
2081         (WebCore::AudioContext::createChannelMerger):
2082         (WebCore::AudioContext::createPeriodicWave):
2083
2084 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2085
2086         [Fetch API] Add support for iterating over Headers
2087         https://bugs.webkit.org/show_bug.cgi?id=153787
2088
2089         Reviewed by Darin Adler.
2090
2091         Relanding, updating bindings/js/JSKeyValueIterator.h for Windows bots.
2092
2093         Covered by updated tests.
2094         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
2095         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
2096         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
2097
2098         * CMakeLists.txt:
2099         * Modules/fetch/FetchHeaders.cpp:
2100         (WebCore::FetchHeaders::Iterator::next):
2101         (WebCore::FetchHeaders::Iterator::Iterator):
2102         * Modules/fetch/FetchHeaders.h:
2103         (WebCore::FetchHeaders::createIterator):
2104         * Modules/fetch/FetchHeaders.idl:
2105         * WebCore.xcodeproj/project.pbxproj:
2106         * bindings/js/JSBindingsAllInOne.cpp:
2107         * bindings/js/JSDOMBinding.h:
2108         (WebCore::jsPair):
2109         * bindings/js/JSFetchHeadersCustom.cpp: Added.
2110         (WebCore::JSFetchHeaders::entries):
2111         (WebCore::JSFetchHeaders::keys):
2112         (WebCore::JSFetchHeaders::values):
2113         * bindings/js/JSKeyValueIterator.h: Added.
2114         (WebCore::JSKeyValueIteratorPrototype::create):
2115         (WebCore::JSKeyValueIteratorPrototype::createStructure):
2116         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
2117         (WebCore::createIterator):
2118         (WebCore::DOMWrapped>::destroy):
2119         (WebCore::DOMWrapped>::next):
2120         (WebCore::DOMWrapped>::finishCreation):
2121
2122 2016-02-04  Chris Dumez  <cdumez@apple.com>
2123
2124         Merge DOMTokenList and DOMSettableTokenList
2125         https://bugs.webkit.org/show_bug.cgi?id=153677
2126         <rdar://problem/24419675>
2127
2128         Reviewed by Sam Weinig.
2129
2130         Merge DOMTokenList and DOMSettableTokenList, as per a recent
2131         specification change:
2132         - https://github.com/whatwg/dom/pull/120
2133         - https://github.com/whatwg/html/issues/361
2134
2135         No new tests, already covered by existing tests.
2136
2137         * CMakeLists.txt:
2138         * DerivedSources.cpp:
2139         * WebCore.vcxproj/WebCore.vcxproj:
2140         * WebCore.vcxproj/WebCore.vcxproj.filters:
2141         * WebCore.xcodeproj/project.pbxproj:
2142         * dom/Element.idl:
2143         * dom/Node.h:
2144         * dom/NodeRareData.h:
2145         * html/AttributeDOMTokenList.h:
2146         * html/DOMSettableTokenList.cpp: Removed.
2147         * html/DOMSettableTokenList.h:
2148         * html/DOMSettableTokenList.idl:
2149         * html/DOMTokenList.cpp:
2150         (WebCore::DOMTokenList::setValue):
2151         * html/DOMTokenList.h:
2152         * html/DOMTokenList.idl:
2153         * html/HTMLAnchorElement.idl:
2154         * html/HTMLAreaElement.idl:
2155         * html/HTMLElement.cpp:
2156         * html/HTMLElement.idl:
2157         * html/HTMLIFrameElement.cpp:
2158         (WebCore::HTMLIFrameElement::sandbox):
2159         * html/HTMLIFrameElement.h:
2160         * html/HTMLIFrameElement.idl:
2161         * html/HTMLLinkElement.cpp:
2162         (WebCore::HTMLLinkElement::sizes):
2163         * html/HTMLLinkElement.h:
2164         * html/HTMLLinkElement.idl:
2165         * html/HTMLOutputElement.cpp:
2166         (WebCore::HTMLOutputElement::htmlFor):
2167         * html/HTMLOutputElement.h:
2168         * html/HTMLOutputElement.idl:
2169         * html/HTMLTableCellElement.idl:
2170         * page/DOMWindow.cpp:
2171         * page/DOMWindow.idl:
2172
2173 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2174
2175         Unreviewed.
2176         Reverting r196115 and r19116, related tohttps://bugs.webkit.org/show_bug.cgi?id=153787.
2177
2178 2016-02-04  Alejandro G. Castro  <alex@igalia.com>
2179
2180         [GTK] Implement mediastream mediaplayer
2181         https://bugs.webkit.org/show_bug.cgi?id=153541
2182
2183         Reviewed by Martin Robinson.
2184
2185         Added the implementation of the mediaplayer for the
2186         mediastream. The code was implemented by Philippe Normand and
2187         Alessandro Decina.
2188
2189         * PlatformGTK.cmake: Added the file to the compilation.
2190         * html/HTMLMediaElement.cpp:
2191         (WebCore::HTMLMediaElement::setSrcObject): Set the src of the
2192         media element to the mediastream.
2193         * platform/graphics/MediaPlayer.cpp:
2194         (WebCore::buildMediaEnginesVector): Register the mediastream
2195         mediaplayer as an option in the media engines vector.
2196         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Added.
2197         (WebCore::MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr):
2198         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
2199         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
2200         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
2201         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo):
2202         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio):
2203         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
2204         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
2205         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed):
2206         (WebCore::MediaPlayerPrivateGStreamerOwr::didLoadingProgress):
2207         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
2208         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
2209         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
2210         (WebCore::MediaPlayerPrivateGStreamerOwr::getSupportedTypes):
2211         (WebCore::MediaPlayerPrivateGStreamerOwr::supportsType):
2212         (WebCore::MediaPlayerPrivateGStreamerOwr::isAvailable):
2213         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
2214         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped):
2215         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
2216         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
2217         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
2218         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
2219         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Added.
2220         (WebCore::MediaPlayerPrivateGStreamerOwr::engineDescription):
2221         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
2222         (WebCore::MediaPlayerPrivateGStreamerOwr::cancelLoad):
2223         (WebCore::MediaPlayerPrivateGStreamerOwr::prepareToPlay):
2224         (WebCore::MediaPlayerPrivateGStreamerOwr::duration):
2225         (WebCore::MediaPlayerPrivateGStreamerOwr::seek):
2226         (WebCore::MediaPlayerPrivateGStreamerOwr::seeking):
2227         (WebCore::MediaPlayerPrivateGStreamerOwr::setRate):
2228         (WebCore::MediaPlayerPrivateGStreamerOwr::setPreservesPitch):
2229         (WebCore::MediaPlayerPrivateGStreamerOwr::paused):
2230         (WebCore::MediaPlayerPrivateGStreamerOwr::hasClosedCaptions):
2231         (WebCore::MediaPlayerPrivateGStreamerOwr::setClosedCaptionsVisible):
2232         (WebCore::MediaPlayerPrivateGStreamerOwr::maxTimeSeekable):
2233         (WebCore::MediaPlayerPrivateGStreamerOwr::buffered):
2234         (WebCore::MediaPlayerPrivateGStreamerOwr::totalBytes):
2235         (WebCore::MediaPlayerPrivateGStreamerOwr::bytesLoaded):
2236         (WebCore::MediaPlayerPrivateGStreamerOwr::canLoadPoster):
2237         (WebCore::MediaPlayerPrivateGStreamerOwr::setPoster):
2238         (WebCore::MediaPlayerPrivateGStreamerOwr::isLiveStream):
2239         (WebCore::MediaPlayerPrivateGStreamerOwr::audioSink):
2240
2241 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2242
2243         [Fetch API] Add support for iterating over Headers
2244         https://bugs.webkit.org/show_bug.cgi?id=153787
2245
2246         Reviewed by Darin Adler.
2247
2248         Covered by updated tests.
2249         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
2250         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
2251         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
2252
2253         * CMakeLists.txt:
2254         * Modules/fetch/FetchHeaders.cpp:
2255         (WebCore::FetchHeaders::Iterator::next):
2256         (WebCore::FetchHeaders::Iterator::Iterator):
2257         * Modules/fetch/FetchHeaders.h:
2258         (WebCore::FetchHeaders::createIterator):
2259         * Modules/fetch/FetchHeaders.idl:
2260         * WebCore.xcodeproj/project.pbxproj:
2261         * bindings/js/JSDOMBinding.h:
2262         (WebCore::jsPair):
2263         * bindings/js/JSBindingsAllInOne.cpp:
2264         * bindings/js/JSFetchHeadersCustom.cpp: Added.
2265         (WebCore::JSFetchHeaders::entries):
2266         (WebCore::JSFetchHeaders::keys):
2267         (WebCore::JSFetchHeaders::values):
2268         * bindings/js/JSKeyValueIterator.h: Added.
2269         (WebCore::JSKeyValueIteratorPrototype::create):
2270         (WebCore::JSKeyValueIteratorPrototype::createStructure):
2271         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
2272         (WebCore::JSKeyValueIteratorPrototypeFuncNext):
2273
2274 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2275
2276         Do not show context menu when right clicking on a scrollbar
2277         https://bugs.webkit.org/show_bug.cgi?id=153493
2278
2279         Reviewed by Michael Catanzaro.
2280
2281         Scrollbars don't currently handle right clicks, but we are showing
2282         the context menu when they are right clicked. This is not desired
2283         at least in GTK+ and I've checked that it isn't consistent with
2284         other applications in Mac either.
2285
2286         Test: fast/events/contextmenu-on-scrollbars.html
2287
2288         * page/EventHandler.cpp:
2289         (WebCore::EventHandler::sendContextMenuEvent):
2290
2291 2016-02-03  Andreas Kling  <akling@apple.com>
2292
2293         [iOS] Throw away linked code when navigating to a new page.
2294         <https://webkit.org/b/153851>
2295
2296         Reviewed by Gavin Barraclough.
2297
2298         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
2299         Linked code is tied to a specific global object, and as we're creating a new one for the
2300         new page, none of it is useful to us here.
2301         In the event that the user navigates back, the cost of relinking some code will be far
2302         lower than the memory cost of keeping all of it around.
2303
2304         * bindings/js/GCController.cpp:
2305         (WebCore::GCController::deleteAllLinkedCode):
2306         * bindings/js/GCController.h:
2307         * loader/FrameLoader.cpp:
2308         (WebCore::FrameLoader::commitProvisionalLoad):
2309
2310 2016-02-03  Alex Christensen  <achristensen@webkit.org>
2311
2312         Report wasBlocked and cannotShowURL errors when using NetworkSession
2313         https://bugs.webkit.org/show_bug.cgi?id=153846
2314
2315         Reviewed by Antti Koivisto.
2316
2317         No new tests, but this fixes http/tests/xmlhttprequest/redirect-cross-origin-2.html
2318         when using NetworkSession.
2319
2320         * platform/URL.h:
2321         WEBCORE_EXPORT because we are using portAllowed in WebKit2 now.
2322
2323 2016-02-03  Jer Noble  <jer.noble@apple.com>
2324
2325         iOS build fix after Yosemite build fix broke iOS build.
2326
2327         * platform/network/cocoa/WebCoreNSURLSession.h:
2328         * platform/network/cocoa/WebCoreNSURLSession.mm:
2329
2330 2016-02-03  Beth Dakin  <bdakin@apple.com>
2331
2332         Accepted candidates should not be autocorrected
2333         https://bugs.webkit.org/show_bug.cgi?id=153813
2334         -and corresponding-
2335         rdar://problem/24066924
2336
2337         Reviewed by Darin Adler.
2338
2339         New document marker to mark inserted candidates. This was we can treat 
2340         inserted candidates just like a RejectedCorrection and we won’t accidentally 
2341         autocorrect them later on.
2342         * dom/DocumentMarker.h:
2343         (WebCore::DocumentMarker::AllMarkers::AllMarkers):
2344         * editing/AlternativeTextController.cpp:
2345         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
2346
2347         When handling an acceptant candidate, set m_isHandlingAcceptedCandidate to
2348         true while the text is being inserted, and then mark the range as an accepted 
2349         candidate.
2350         * editing/Editor.cpp:
2351         (WebCore::Editor::handleAcceptedCandidate):
2352         * editing/Editor.h:
2353         (WebCore::Editor::isHandlingAcceptedCandidate):
2354
2355         If frame.editor. isHandlingAcceptedCandidate() then return early from 
2356         markMisspellingsAfterTyping.
2357         * editing/TypingCommand.cpp:
2358         (WebCore::TypingCommand::markMisspellingsAfterTyping):
2359
2360         Add some test infrastructure. 
2361         * testing/Internals.cpp:
2362         (WebCore::Internals::handleAcceptedCandidate):
2363         * testing/Internals.h:
2364         * testing/Internals.idl:
2365
2366 2016-02-03  Jer Noble  <jer.noble@apple.com>
2367
2368         [Win] Pass entire request (rather than just URL) to clients of WebCoreAVCFResourceLoader
2369         https://bugs.webkit.org/show_bug.cgi?id=153653
2370
2371         Reviewed by Brent Fulgham.
2372
2373         This will allow those clients to see the byte-range request ("Range:") header and respond
2374         appropriately.
2375
2376         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2377         (WebCore::WebCoreAVCFResourceLoader::startLoading):
2378
2379 2016-02-03  Jer Noble  <jer.noble@apple.com>
2380
2381         Yosemite build fix; hide the entire WebCoreNSURLSessionDataTask class from Yosemite and prior.
2382
2383         * platform/network/cocoa/WebCoreNSURLSession.h:
2384         * platform/network/cocoa/WebCoreNSURLSession.mm:
2385         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
2386         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
2387
2388 2016-02-03  Jer Noble  <jer.noble@apple.com>
2389
2390         [EME][Mac] MediaKeys.createSession() fails with initData containing a contentId whose length is > 1/2 the initData.
2391         https://bugs.webkit.org/show_bug.cgi?id=153517
2392         <rdar://problem/24303782>
2393
2394         Reviewed by Eric Carlson.
2395
2396         The length of contentId is given in bytes, not Uint16 characters. Use the former when extracting
2397         the contentId string from the initData.
2398
2399         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2400         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
2401
2402 2016-02-03  Jer Noble  <jer.noble@apple.com>
2403
2404         [Mac] Wrap a resource and resource loader in a NSURLSession-like object for use by lower level frameworks
2405         https://bugs.webkit.org/show_bug.cgi?id=153669
2406
2407         Reviewed by Alex Christensen.
2408
2409         API Test: WebCore.WebCoreNSURLSession
2410
2411         Add a NSURLSession-like object, which wraps a CachedResourceLoader and CachedRawResource, which we can
2412         hand to lower-level frameworks, so that network loads by those frameworks use WebKit's loader.
2413
2414         * platform/network/cocoa/WebCoreNSURLSession.h: Added.
2415         * platform/network/cocoa/WebCoreNSURLSession.mm: Added.
2416         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]):
2417         (-[WebCoreNSURLSession dealloc]):
2418         (-[WebCoreNSURLSession copyWithZone:]):
2419         (-[WebCoreNSURLSession delegateQueue]):
2420         (-[WebCoreNSURLSession configuration]):
2421         (-[WebCoreNSURLSession loader]):
2422         (-[WebCoreNSURLSession finishTasksAndInvalidate]):
2423         (-[WebCoreNSURLSession invalidateAndCancel]):
2424         (-[WebCoreNSURLSession resetWithCompletionHandler:]):
2425         (-[WebCoreNSURLSession flushWithCompletionHandler:]):
2426         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]):
2427         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]):
2428         (-[WebCoreNSURLSession dataTaskWithRequest:]):
2429         (-[WebCoreNSURLSession dataTaskWithURL:]):
2430         (-[WebCoreNSURLSession uploadTaskWithRequest:fromFile:]):
2431         (-[WebCoreNSURLSession uploadTaskWithRequest:fromData:]):
2432         (-[WebCoreNSURLSession uploadTaskWithStreamedRequest:]):
2433         (-[WebCoreNSURLSession downloadTaskWithRequest:]):
2434         (-[WebCoreNSURLSession downloadTaskWithURL:]):
2435         (-[WebCoreNSURLSession downloadTaskWithResumeData:]):
2436         (-[WebCoreNSURLSession streamTaskWithHostName:port:]):
2437         (-[WebCoreNSURLSession streamTaskWithNetService:]):
2438         (-[WebCoreNSURLSession isKindOfClass:]):
2439
2440         Add a C++ class which can act as a CachedRawResourceClient, passing the results back to a WebCoreNSURLSessionDataTask:
2441
2442         (WebCore::WebCoreNSURLSessionDataTaskClient::WebCoreNSURLSessionDataTaskClient):
2443         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
2444         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
2445         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
2446         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
2447         (WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished):
2448
2449         Add a NSURLSessionDataTask-like object, which takes a request, then uses it to create and wrap a CachedRawResource.
2450         Becase NSURSessionDataTask is intended to be used off-main-thread, care must be taken to dispatch back to the main-
2451         (or web-) thread before calling CachedRawResource functions.
2452
2453         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
2454         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
2455         (-[WebCoreNSURLSessionDataTask copyWithZone:]):
2456         (-[WebCoreNSURLSessionDataTask _restart]):
2457         (-[WebCoreNSURLSessionDataTask _cancel]):
2458         (-[WebCoreNSURLSessionDataTask _finish]):
2459         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]):
2460         (-[WebCoreNSURLSessionDataTask cancel]):
2461         (-[WebCoreNSURLSessionDataTask suspend]):
2462         (-[WebCoreNSURLSessionDataTask resume]):
2463         (-[WebCoreNSURLSessionDataTask _timingData]):
2464         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]):
2465         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
2466         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
2467         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
2468         (-[WebCoreNSURLSessionDataTask resourceFinished:]):
2469         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
2470
2471 2016-02-03  Darin Adler  <darin@apple.com>
2472
2473         Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
2474         https://bugs.webkit.org/show_bug.cgi?id=153789
2475
2476         Reviewed by Sam Weinig.
2477
2478         * dom/DOMImplementation.cpp:
2479         (WebCore::DOMImplementation::isXMLMIMEType): Use equalLettersIgnoringASCIICase
2480         and the boolean argument to endsWith to ignore ASCII case.
2481         (WebCore::DOMImplementation::isTextMIMEType): Ditto. Also simplified the logic
2482         by removing an if statement.
2483
2484         * dom/Document.cpp:
2485         (WebCore::isSeparator): Deleted. Moved to WindowFeatures.cpp.
2486         (WebCore::processArguments): Ditto.
2487         (WebCore::Document::processViewport): Call the processFeaturesString function
2488         from WindowFeatures.h; the code here was originally just a pasted copy of that code!
2489         (WebCore::Document::processFormatDetection): Ditto.
2490
2491         * html/HTMLCanvasElement.cpp:
2492         (WebCore::HTMLCanvasElement::toEncodingMimeType): Remove now-unneeded
2493         lowercasing of MIME type before calling isSupportedImageMIMETypeForEncoding,
2494         since the MIME type registry now ignores ASCII case. Use convertToASCIILowercase
2495         on the return value, to preserve behavior.
2496         (WebCore::HTMLCanvasElement::toDataURL): Minor coding style tweaks.
2497
2498         * html/HTMLEmbedElement.cpp:
2499         (WebCore::HTMLEmbedElement::parseAttribute): Use convertToASCIILowercase for
2500         the service type here.
2501
2502         * html/HTMLImageElement.cpp:
2503         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Remove now-unneeded
2504         lowercasing since MIME type registry now ignores ASCII case. And use
2505         equalLettersIgnoringASCIICase for the case here.
2506
2507         * html/HTMLInputElement.cpp:
2508         (WebCore::parseAcceptAttribute): Use convertToASCIILowercase for the type here.
2509
2510         * html/HTMLLinkElement.cpp:
2511         (WebCore::HTMLLinkElement::parseAttribute): Use convertToASCIILowercase for the
2512         media value here.
2513
2514         * html/HTMLMediaElement.cpp:
2515         (WebCore::HTMLMediaElement::canPlayType): Use convertToASCIILowercase for the
2516         content type here.
2517         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
2518
2519         * html/HTMLObjectElement.cpp:
2520         (WebCore::HTMLObjectElement::parseAttribute): Use convertToASCIILowercase for
2521         the service type here.
2522
2523         * html/HTMLTrackElement.cpp:
2524         (WebCore::HTMLTrackElement::parseAttribute): Use convertToASCIILowercase for
2525         the kind here.
2526         (WebCore::HTMLTrackElement::ensureTrack): Ditto. Also use fastGetAttribute
2527         since this is neither the style attribute nor an animatable SVG attribute.
2528
2529         * html/parser/HTMLTreeBuilder.cpp:
2530         (WebCore::createCaseMap): Use convertToASCIILowercase for the local names here.
2531
2532         * inspector/DOMPatchSupport.cpp:
2533         (WebCore::DOMPatchSupport::patchNode): Use containsIgnoringASCIICase instead
2534         of combining lower with find == notFound here.
2535         (WebCore::nodeName): Use convertToASCIILowercase here.
2536
2537         * inspector/InspectorOverlay.cpp:
2538         (WebCore::buildObjectForElementData): Use convertToASCIILowercase for node
2539         name here.
2540
2541         * inspector/InspectorPageAgent.cpp:
2542         (WebCore::createXHRTextDecoder): Remove a now-unneeded call to lower since
2543         DOMImplementation::isXMLMIMEType now ignores ASCII case.
2544
2545         * inspector/InspectorStyleSheet.cpp:
2546         (WebCore::lowercasePropertyName): Use convertToASCIILowercase for property
2547         names here. Also use startsWith rather than a hand-written alternative.
2548         (WebCore::InspectorStyle::populateAllProperties): Use the return value of
2549         the add function to avoid doing a double hash table lookp.
2550         (WebCore::InspectorStyle::styleWithProperties): Use convertToASCIILowercase
2551         to lowercase the property name.
2552
2553         * inspector/NetworkResourcesData.cpp:
2554         (WebCore::createOtherResourceTextDecoder): Remove unneeded call to lower since
2555         DOMImplement::isXMLMIMEType now ignores ASCII case.
2556
2557         * loader/CrossOriginAccessControl.cpp:
2558         (WebCore::createAccessControlPreflightRequest): Use convertToASCIILowercase
2559         to lowercase the access control request header field value.
2560
2561         * loader/cache/CachedScript.cpp:
2562         (WebCore::CachedScript::mimeType): Use convertToASCIILowercase on the content type.
2563
2564         * page/CaptionUserPreferencesMediaAF.cpp:
2565         (WebCore::languageIdentifier): Use convertToASCIILowercase on the language code.
2566
2567         * page/DOMWindow.cpp:
2568         (WebCore::DOMWindow::open): Call parseWindowFeatures instead of using the
2569         constructor for WindowFeatures.
2570         (WebCore::DOMWindow::showModalDialog): Call parseDialogFeatures instead of
2571         using the constructor for WindowFeatures.
2572
2573         * page/EventHandler.cpp:
2574         (WebCore::findDropZone): Remove unneeded lowercasing and empty string checking,
2575         and use the option SpaceSplitString already has to convert to lowercase.
2576         (WebCore::EventHandler::handleAccessKey): Remove unneeded call to lower since
2577         getElementByAccessKey now ignores case. Also tweaked coding style a bit.
2578
2579         * page/OriginAccessEntry.cpp:
2580         (WebCore::OriginAccessEntry::OriginAccessEntry): Use convertToASCIILowercase
2581         on the protocol and host.
2582         (WebCore::OriginAccessEntry::matchesOrigin): Ditto.
2583
2584         * page/SecurityOrigin.cpp:
2585         (WebCore::shouldTreatAsUniqueOrigin): Remove unneeded call to lower since
2586         SchemeRegistry now ignores ASCII case.
2587         (WebCore::SecurityOrigin::SecurityOrigin): Use convertToASCIILowercase on
2588         the protocol and host.
2589         (WebCore::SecurityOrigin::setDomainFromDOM): Use convertToASCIILowercase on
2590         the domain.
2591         (WebCore::SecurityOrigin::canDisplay): Remove call to lower since SchemeRegistry
2592         now ignores ASCII case and because this now uses equalIgnoringASCIICase in
2593         one place that used to use exact matching.
2594
2595         * page/WindowFeatures.cpp: Refactored so this is now some helper functions
2596         plus a struct rather than a class.
2597         (WebCore::isSeparator): Renamed this and removed special handling for NUL.
2598         (WebCore::parseWindowFeatures): Moved the code that was formerly in the
2599         WindowFeatures constructor in here. Refactored the parsing into the
2600         processFeaturesString function, shared with the functions in Document that
2601         do the same kind of parsing. Removed the code that converts the entire string
2602         to lowercase before parsing.
2603         (WebCore::processFeaturesString): Moved the improved version of this function
2604         here from Document.cpp; more efficient because it doesn't allocate strings.
2605         (WebCore::setWindowFeature): Changed to be a function private to this file
2606         with internal linkage. Use equalLettersIgnoringASCIICase so we no longer
2607         rely on converting the string to lowercase before parsing.
2608         (WebCore::parseDialogFeatures): Similar refactoring, but also changed all
2609         the default handling to use Optional<> instead of default values.
2610         (WebCore::boolFeature): Changed to use option and to ignore ASCII case.
2611         (WebCore::floatFeature): Ditto.
2612         (WebCore::parseDialogFeaturesMap): Removed the calls to lower, which are
2613         not needed any more.
2614
2615         * page/WindowFeatures.h: Added default values for all the data members,
2616         and removed all the functions from the WindowFeatures struct. Added the two
2617         functions for parsing window and dialog features. Also added the
2618         processFeaturesString function so we can share it with Document.cpp.
2619
2620         * platform/SchemeRegistry.cpp:
2621         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Use
2622         equalLettersIgnoringASCIICase to ignore ASCII case.
2623
2624         * platform/efl/MIMETypeRegistryEfl.cpp:
2625         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
2626         and equalIgnoringASCIICase rather than calling lower.
2627
2628         * platform/graphics/MediaPlayer.cpp:
2629         (WebCore::MediaPlayer::load): Use convertToASCIILowercase on MIME type and
2630         key system.
2631         (WebCore::MediaPlayer::generateKeyRequest): Ditto.
2632         (WebCore::MediaPlayer::addKey): Ditto.
2633         (WebCore::MediaPlayer::cancelKeyRequest): Ditto.
2634
2635         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2636         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Use
2637         convertToASCIILowercase on vendor string.
2638
2639         * platform/gtk/MIMETypeRegistryGtk.cpp:
2640         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
2641         and equalIgnoringASCIICase rather than calling lower.
2642
2643         * platform/mac/PasteboardMac.mm:
2644         (WebCore::cocoaTypeFromHTMLClipboardType): Use convertToASCIILowercase
2645         on the type. Also did a bit of renaming and tweaking the logic.
2646
2647 2016-02-03  Dave Hyatt  <hyatt@apple.com>
2648
2649         Implement hanging-punctuation property parsing.
2650         https://bugs.webkit.org/show_bug.cgi?id=18109.
2651
2652         Reviewed by Zalan Bujtas.
2653
2654         Added parsing test in fast/css.
2655
2656         * css/CSSComputedStyleDeclaration.cpp:
2657         (WebCore::renderEmphasisPositionFlagsToCSSValue):
2658         (WebCore::hangingPunctuationToCSSValue):
2659         (WebCore::fillRepeatToCSSValue):
2660         (WebCore::ComputedStyleExtractor::propertyValue):
2661         * css/CSSParser.cpp:
2662         (WebCore::CSSParser::parseValue):
2663         (WebCore::CSSParser::parseTextIndent):
2664         (WebCore::CSSParser::parseHangingPunctuation):
2665         (WebCore::CSSParser::parseLineBoxContain):
2666         * css/CSSParser.h:
2667         * css/CSSPrimitiveValueMappings.h:
2668         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2669         (WebCore::CSSPrimitiveValue::operator HangingPunctuation):
2670         (WebCore::CSSPrimitiveValue::operator LineBreak):
2671         * css/CSSPropertyNames.in:
2672         * css/CSSValueKeywords.in:
2673         * css/StyleBuilderConverter.h:
2674         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
2675         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
2676         * rendering/style/RenderStyle.cpp:
2677         (WebCore::RenderStyle::changeRequiresLayout):
2678         * rendering/style/RenderStyle.h:
2679         * rendering/style/RenderStyleConstants.h:
2680         (WebCore::operator| ):
2681         (WebCore::operator|= ):
2682         * rendering/style/StyleRareInheritedData.cpp:
2683         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2684         (WebCore::StyleRareInheritedData::operator==):
2685         * rendering/style/StyleRareInheritedData.h:
2686
2687 2016-02-03  Jessie Berlin  <jberlin@webkit.org>
2688
2689         Build fix.
2690
2691         [NSEvent context] has always returned nil. Replace uses with nullptr.
2692
2693         * page/mac/EventHandlerMac.mm:
2694         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
2695
2696 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2697
2698         [GTK] Layout Test http/tests/appcache/different-https-origin-resource-main.html is failing
2699         https://bugs.webkit.org/show_bug.cgi?id=145253
2700
2701         Reviewed by Michael Catanzaro.
2702
2703         The problem is that when the load is cancelled while the
2704         connection is still being established,
2705         SoupMessage::notify::tls-errors is emitted and the handler calls
2706         ResourceHandleClient::didFail() which can delete the ResourceHandle.
2707
2708         * platform/network/soup/ResourceHandleSoup.cpp:
2709         (WebCore::tlsErrorsChangedCallback): Protect the ResourceHandle
2710         for the scope of the callback because
2711         ResourceHandleClient::didFail() could delete the object.
2712
2713 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2714
2715         REGRESSION(r191948): [GStreamer] 4 new timeouts on layout tests.
2716         https://bugs.webkit.org/show_bug.cgi?id=152797
2717
2718         Reviewed by Darin Adler.
2719
2720         Always schedule messages to the main thread, even when the bus
2721         sync handlder was called in the main thread. It seems that
2722         GStreamer expects things to happen in the next main loop
2723         iteration.
2724
2725         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2726         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2727
2728 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
2729
2730         [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
2731         https://bugs.webkit.org/show_bug.cgi?id=152058
2732
2733         Reviewed by Michael Catanzaro.
2734
2735         Previously, the CompositingCoordinator only added the overlay layer to the
2736         layer tree, but flushing its compositing state is also required. For that to
2737         happen, CompositingCoordinator has to store a pointer to the overlay layer
2738         object and flush it in ::flushPendingLayerChanges().
2739
2740         Overlay layers are most prominently used by the Web Inspector to highlight
2741         the DOM elements on the Web page that are being hovered in the inspector.
2742
2743         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
2744         (WebCore::CompositingCoordinator::CompositingCoordinator):
2745         (WebCore::CompositingCoordinator::setRootCompositingLayer):
2746         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
2747         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
2748
2749 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
2750
2751         [CoordinatedGraphics] CompositingCoordinator destructor is scheduling layer flushes
2752         https://bugs.webkit.org/show_bug.cgi?id=153823
2753
2754         Reviewed by Carlos Garcia Campos.
2755
2756         Purging the backing stores during the CompositingCoordinator destructor
2757         is also scheduling layer flushes in the object's client, which is an object
2758         of the LayerTreeHost-deriving class that owns the CompositingCoordinator
2759         object in question and is also being destroyed.
2760
2761         In case of ThreadedCoordinatedLayerTreeHost, this scheduling can access
2762         the RunLoop::Timer object which has already been destroyed, causing a
2763         crash. Another problem with this is that we're invoking a virtual function
2764         on an object that's being destructed, which works well enough in this case
2765         but should be discouraged in general.
2766
2767         In order to avoid this, add the m_isDestructing boolean to the
2768         CompositingCoordinator class, flip it to true during the destruction,
2769         and check for its falseness before scheduling a layer flush.
2770
2771         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
2772         (WebCore::CompositingCoordinator::CompositingCoordinator):
2773         (WebCore::CompositingCoordinator::~CompositingCoordinator):
2774         (WebCore::CompositingCoordinator::notifyFlushRequired):
2775         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
2776
2777 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
2778
2779         [TexMap] Don't use RELEASE_ASSERT in TextureMapperLayer::computeTransformsRecursive()
2780         https://bugs.webkit.org/show_bug.cgi?id=153822
2781
2782         Reviewed by Carlos Garcia Campos.
2783
2784         * platform/graphics/texmap/TextureMapperLayer.cpp:
2785         (WebCore::TextureMapperLayer::computeTransformsRecursive):
2786         Use ASSERT to check that the m_children members are indeed children
2787         of the current layer, RELEASE_ASSERT probably slipped in unnoticed
2788         at some point.
2789
2790 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
2791
2792         PlatformPathCairo: Lazily allocate the path surface
2793         https://bugs.webkit.org/show_bug.cgi?id=153821
2794
2795         Reviewed by Carlos Garcia Campos.
2796
2797         Move the static variable that holds the Cairo surface into
2798         the pathSurface() function (previously getPathSurface). This
2799         way the surface will only be allocated once the function is
2800         called for the first time from the CairoPath surface.
2801
2802         No change in functionality, just a cleanup.
2803
2804         * platform/graphics/cairo/PlatformPathCairo.cpp:
2805         (WebCore::pathSurface):
2806         (WebCore::CairoPath::CairoPath):
2807         (WebCore::getPathSurface): Deleted.
2808
2809 2016-02-02  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
2810
2811         ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
2812         https://bugs.webkit.org/show_bug.cgi?id=153576
2813
2814         Reviewed by Darin Adler.
2815
2816         Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html
2817
2818         The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
2819         because of the uniqueness of LayoutUnit::round introduced by this bug
2820         <https://bugs.webkit.org/show_bug.cgi?id=107208>.
2821         Should convert a FloatPoint to a LayoutPoint before rounding.
2822
2823         * rendering/RenderGeometryMap.cpp:
2824         (WebCore::RenderGeometryMap::mapToContainer):
2825
2826 2016-02-02  Aakash Jain  <aakash_jain@apple.com>
2827
2828         Remove references to CallFrameInlines.h
2829         https://bugs.webkit.org/show_bug.cgi?id=153810
2830
2831         Reviewed by Mark Lam.
2832
2833         * ForwardingHeaders/interpreter/CallFrameInlines.h: Removed.
2834
2835 2016-02-02  Jinyoung Hur  <hur.ims@navercorp.com>
2836
2837         WEBGL_debug_shaders should be disabled for OpenGLES backend also
2838         https://bugs.webkit.org/show_bug.cgi?id=153788
2839
2840         Reviewed by Darin Adler.
2841
2842         WEBGL_debug_shaders extension is disabled for OpenGL backed platform
2843         because the implementation is not fully compliant to the spec yet.
2844         Because this is not an OpenGL-specific problem, WEBGL_debug_shaders extension
2845         should be disabled for OpenGLES backed platforms also.
2846
2847         No new tests, already covered by existing tests.
2848
2849         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2850         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
2851         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2852         (WebCore::Extensions3DOpenGLCommon::supports):
2853
2854 2016-02-02  Brady Eidson  <beidson@apple.com>
2855
2856         Modern IDB: storage/indexeddb/cursor-primary-key-order.html fails with SQLite backend.
2857         https://bugs.webkit.org/show_bug.cgi?id=153800
2858
2859         Reviewed by Alex Christensen.
2860
2861         No new tests (Existing tests now unskipped).
2862
2863         The IndexRecords SQL schema did not order things by primaryKey.
2864         
2865         Easy fix to the schema. Sadly requires a migration...
2866
2867         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2868         (WebCore::IDBServer::v1IndexRecordsTableSchema):
2869         (WebCore::IDBServer::v1IndexRecordsTableSchemaAlternate):
2870         (WebCore::IDBServer::v2IndexRecordsTableSchema):
2871         (WebCore::IDBServer::v2IndexRecordsTableSchemaAlternate):
2872         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
2873         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
2874         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2875
2876 2016-02-02  Tim Horton  <timothy_horton@apple.com>
2877
2878         <attachment> should attempt to guess the icon from the file extension if all else fails
2879         https://bugs.webkit.org/show_bug.cgi?id=153804
2880         <rdar://problem/24448146>
2881
2882         Reviewed by Anders Carlsson.
2883
2884         Test: fast/attachment/attachment-icon-from-file-extension.html
2885
2886         * platform/graphics/Icon.h:
2887         * platform/graphics/mac/IconMac.mm:
2888         (WebCore::Icon::createIconForFileExtension):
2889         * rendering/RenderThemeMac.mm:
2890         (WebCore::iconForAttachment):
2891         If we can't find an icon any other way, try assuming that the title is a filename,
2892         grab its extension, and have NSWorkspace try to work out an icon for it.
2893
2894 2016-02-02  Antti Koivisto  <antti@apple.com>
2895
2896         Factor style sharing code out of StyleResolver
2897         https://bugs.webkit.org/show_bug.cgi?id=153768
2898
2899         Reviewed by Darin Adler.
2900
2901         Move the code to a new class, Style::SharingResolver.
2902
2903         When resolving document style we query the sharing resolver first before using the regular style resolver.
2904         Other paths that call style resolver were mostly already disabling it with DisallowStyleSharing flag.
2905
2906         * WebCore.xcodeproj/project.pbxproj:
2907         * css/ElementRuleCollector.cpp:
2908         (WebCore::MatchRequest::MatchRequest):
2909         (WebCore::ElementRuleCollector::matchAllRules):
2910         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
2911
2912             More const.
2913
2914         * css/ElementRuleCollector.h:
2915         (WebCore::ElementRuleCollector::setRegionForStyling):
2916         (WebCore::ElementRuleCollector::setMedium):
2917         * css/MediaQueryMatcher.cpp:
2918         (WebCore::MediaQueryMatcher::prepareEvaluator):
2919         * css/StyleMedia.cpp:
2920         (WebCore::StyleMedia::matchMedium):
2921         * css/StyleResolver.cpp:
2922         (WebCore::StyleResolver::State::cacheBorderAndBackground):
2923         (WebCore::StyleResolver::StyleResolver):
2924         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
2925         (WebCore::StyleResolver::State::State):
2926         (WebCore::StyleResolver::State::setStyle):
2927         (WebCore::isAtShadowBoundary):
2928         (WebCore::StyleResolver::styleForElement):
2929         (WebCore::StyleResolver::classNamesAffectedByRules): Deleted.
2930         (WebCore::parentElementPreventsSharing): Deleted.
2931         (WebCore::StyleResolver::locateCousinList): Deleted.
2932         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): Deleted.
2933         (WebCore::StyleResolver::canShareStyleWithControl): Deleted.
2934         (WebCore::elementHasDirectionAuto): Deleted.
2935         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
2936         (WebCore::StyleResolver::canShareStyleWithElement): Deleted.
2937         (WebCore::StyleResolver::findSiblingForStyleSharing): Deleted.
2938         (WebCore::StyleResolver::locateSharedStyle): Deleted.
2939
2940             Style sharing code moves to SharingResolver.
2941
2942         * css/StyleResolver.h:
2943         (WebCore::StyleResolver::mediaQueryEvaluator):
2944         (WebCore::StyleResolver::State::regionForStyling):
2945         (WebCore::StyleResolver::State::elementLinkState):
2946         (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle):
2947         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
2948         (WebCore::StyleResolver::state):
2949         (WebCore::StyleResolver::setTextOrientation):
2950         (WebCore::StyleResolver::State::setElementAffectedByClassRules): Deleted.
2951         (WebCore::StyleResolver::State::elementAffectedByClassRules): Deleted.
2952         (WebCore::StyleResolver::styleNotYetAvailable): Deleted.
2953
2954             Placeholder code moves to TreeResolver.
2955
2956         * dom/VisitedLinkState.cpp:
2957         (WebCore::linkAttribute):
2958         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
2959         (WebCore::linkHashForElement):
2960         (WebCore::VisitedLinkState::invalidateStyleForLink):
2961         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
2962         * dom/VisitedLinkState.h:
2963         (WebCore::VisitedLinkState::determineLinkState):
2964         * html/HTMLFormControlElement.h:
2965         * rendering/RenderElement.cpp:
2966         (WebCore::RenderElement::getUncachedPseudoStyle):
2967         * rendering/RenderNamedFlowFragment.cpp:
2968         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
2969         * rendering/style/RenderStyle.cpp:
2970         (WebCore::RenderStyle::isStyleAvailable):
2971         (WebCore::RenderStyle::hasUniquePseudoStyle):
2972         * style/StyleSharingResolver.cpp: Added.
2973         (WebCore::Style::SharingResolver::SharingResolver):
2974         (WebCore::Style::parentElementPreventsSharing):
2975         (WebCore::Style::elementHasDirectionAuto):
2976         (WebCore::Style::SharingResolver::searchSimilar):
2977         (WebCore::Style::SharingResolver::findSibling):
2978         (WebCore::Style::SharingResolver::locateCousinList):
2979         (WebCore::Style::canShareStyleWithControl):
2980         (WebCore::Style::SharingResolver::canShareStyleWithElement):
2981         (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet):
2982         (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
2983         (WebCore::Style::SharingResolver::classNamesAffectedByRules):
2984         * style/StyleSharingResolver.h: Added.
2985         * style/StyleTreeResolver.cpp:
2986         (WebCore::Style::ensurePlaceholderStyle):
2987         (WebCore::Style::TreeResolver::TreeResolver):
2988         (WebCore::Style::TreeResolver::styleForElement):
2989
2990             Try to use SharingResolver first.
2991             Also move placeholder style handling here, it is only relevant when resolving document style.
2992
2993         (WebCore::Style::postResolutionCallbacksAreSuspended):
2994         (WebCore::Style::isPlaceholderStyle):
2995         * style/StyleTreeResolver.h:
2996         * svg/SVGElement.cpp:
2997         (WebCore::SVGElement::customStyleForRenderer):
2998         * svg/SVGElementRareData.h:
2999         (WebCore::SVGElementRareData::overrideComputedStyle):
3000
3001 2016-02-02  Tim Horton  <timothy_horton@apple.com>
3002
3003         <attachment> icon should be a folder for the custom MIME type multipart/x-folder
3004         https://bugs.webkit.org/show_bug.cgi?id=153795
3005         <rdar://problem/24416632>
3006
3007         Reviewed by Anders Carlsson.
3008
3009         Test: fast/attachment/attachment-folder-icon.html
3010
3011         * rendering/RenderThemeMac.mm:
3012         (WebCore::iconForAttachment):
3013         (WebCore::paintAttachmentIcon):
3014         Mail uses this special MIME type to indicate that something is a folder, which there
3015         isn't a normal non-deprecated MIME type for.
3016
3017 2016-02-02  Brady Eidson  <beidson@apple.com>
3018
3019         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
3020         https://bugs.webkit.org/show_bug.cgi?id=153791
3021
3022         Reviewed by Alex Christensen.
3023
3024         No new tests (Existing test now unskipped).
3025
3026         There was a preexisting check in the SQLite cursor for remembering the current record and
3027         refusing to refetch it.
3028         
3029         This check was causing this bug, because we needed to refetch the current record.
3030         
3031         Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.
3032
3033         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3034         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
3035         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
3036         * Modules/indexeddb/server/SQLiteIDBCursor.h:
3037
3038 2016-02-01  Dave Hyatt  <hyatt@apple.com>
3039
3040         Add a line grid pagination SPI to WebKit.
3041         https://bugs.webkit.org/show_bug.cgi?id=153757
3042         <rdar://problem/23041598>
3043
3044         Reviewed by Anders Carlsson.
3045
3046         New tests in fast/multicol/pagination.
3047
3048         * page/Page.cpp:
3049         (WebCore::Page::setPaginationLineGridEnabled):
3050         * page/Page.h:
3051         (WebCore::Page::paginationLineGridEnabled):
3052         Add a boolean to the page to turn the line grid on and off.
3053
3054         * rendering/RenderBox.cpp:
3055         (WebCore::RenderBox::styleDidChange):
3056         Propagate the body's font up to the paginated RenderView so that
3057         it can be used to establish the line grid.
3058
3059         * style/StyleResolveForDocument.cpp:
3060         (WebCore::Style::resolveForDocument):
3061         Set up a line grid with containment snapping by default if the
3062         line grid enabled flag is set.
3063
3064         * testing/Internals.cpp:
3065         (WebCore::Internals::resetToConsistentState):
3066         (WebCore::Internals::setPagination):
3067         (WebCore::Internals::setPaginationLineGridEnabled):
3068         (WebCore::Internals::configurationForViewport):
3069         * testing/Internals.h:
3070         (WebCore::Internals::setPagination):
3071         * testing/Internals.idl:
3072         Add support for testing the grid being enabled.
3073
3074 2016-02-01  Antti Koivisto  <antti@apple.com>
3075
3076         Tab suspension code shouldn't use page cache cacheability logic
3077         https://bugs.webkit.org/show_bug.cgi?id=153680
3078
3079         Reviewed by Andreas Kling.
3080
3081         Most of PageCache::canCache() is unnecessary for tab suspension.
3082
3083         Also improve robustness and introduce 1 minute delay before suspending.
3084
3085         * page/Page.cpp:
3086         (WebCore::Page::setPageActivityState):
3087         (WebCore::Page::setIsVisible):
3088         (WebCore::Page::setIsVisibleInternal):
3089         (WebCore::Page::setIsPrerender):
3090         (WebCore::Page::canTabSuspend):
3091
3092             Include visibility test here.
3093
3094             Instead of calling PageCache::canCache() just check for each frame
3095             - that the document is loaded
3096             - that active DOM objects allow suspension
3097
3098         (WebCore::Page::setIsTabSuspended):
3099         (WebCore::Page::setTabSuspensionEnabled):
3100         (WebCore::Page::updateTabSuspensionState):
3101
3102             Refactor for robustness.
3103
3104         (WebCore::Page::tabSuspensionTimerFired):
3105
3106             Call canTabSuspend, the result might have changed.
3107
3108         (WebCore::Page::scheduleTabSuspension): Deleted.
3109         * page/Page.h:
3110
3111 2016-02-02  Yusuke Suzuki  <utatane.tea@gmail.com>
3112
3113         [JSC] Introduce BytecodeIntrinsic constant rep like @undefined
3114         https://bugs.webkit.org/show_bug.cgi?id=153737
3115
3116         Reviewed by Darin Adler.
3117
3118         * Modules/fetch/FetchHeaders.js:
3119         (initializeFetchHeaders):
3120         * Modules/streams/ReadableStream.js:
3121         (initializeReadableStream):
3122         (closeDestination):
3123         (abortDestination):
3124         (pipeTo):
3125         * Modules/streams/ReadableStreamInternals.js:
3126         (privateInitializeReadableStreamController):
3127         (teeReadableStream):
3128         (isReadableStreamReader):
3129         (errorReadableStream):
3130         (finishClosingReadableStream):
3131         (enqueueInReadableStream):
3132         (readFromReadableStreamReader):
3133         * Modules/streams/ReadableStreamReader.js:
3134         (releaseLock):
3135         * Modules/streams/StreamInternals.js:
3136         (shieldingPromiseResolve):
3137         (promiseInvokeOrNoopNoCatch):
3138         (promiseInvokeOrFallbackOrNoop):
3139         (validateAndNormalizeQueuingStrategy):
3140         * Modules/streams/WritableStream.js:
3141         (initializeWritableStream):
3142         (write):
3143         * Modules/streams/WritableStreamInternals.js:
3144         (errorWritableStream):
3145
3146 2016-02-02  Brady Eidson  <beidson@apple.com>
3147
3148         Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
3149         https://bugs.webkit.org/show_bug.cgi?id=153790
3150
3151         Reviewed by Tim Horton.
3152
3153         No new tests (Failing test now unskipped).
3154
3155         This test uncovered an unhandled race where the main thread tried to perform an OpenDB operation 
3156         multiple times while it was already in-progress on the server thread.
3157
3158         There was already a flag meant to cover this race, and it just needed to be applied to one more site.
3159         
3160         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3161         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
3162         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
3163
3164 2016-02-02  Daniel Bates  <dabates@apple.com>
3165
3166         CSP: Support checking content security policy without a script execution context
3167         https://bugs.webkit.org/show_bug.cgi?id=153748
3168         <rdar://problem/24439149>
3169
3170         Reviewed by Darin Alder.
3171
3172         Towards checking a Web Worker's content security policy against a redirected worker
3173         script load or redirected XHR request for an XHR request initiated from it, we should
3174         support instantiating a ContentSecurityPolicy object without a ScriptExecutionContext.
3175
3176         No functionality was changed. So, no new tests.
3177
3178         * dom/Document.cpp:
3179         (WebCore::Document::initSecurityContext): Pass |this| as a reference instead of as a pointer.
3180         * page/csp/ContentSecurityPolicy.cpp: Remove extraneous includes ScriptState.h, TextEncoding.h,
3181         and URL.h as they are included by ContentSecurityPolicy.h, FormDataList.h and FormData.h, respectively.
3182         (WebCore::CSPSource::CSPSource): Take a constant reference to a ContentSecurityPolicy instead
3183         of a pointer since we never expected a null pointer.
3184         (WebCore::CSPSource::schemeMatches): Move logic for checking the protocol of source "self"
3185         from here to ContentSecurityPolicy::protocolMatchesSelf() because we may not have a security
3186         origin if ContentSecurityPolicy was initiated without a ScriptExecutionContext object.
3187         (WebCore::CSPSourceList::allowSelf): Added.
3188         (WebCore::CSPSourceList::CSPSourceList): Take a constant reference to a ContentSecurityPolicy
3189         instead of a pointer since we never expected a null pointer. Remove fields from member
3190         initialization list that can be initialized using C++11 in-class initialization syntax.
3191         (WebCore::CSPSourceList::matches): Call ContentSecurityPolicy::urlMatchesSelf() to match the
3192         effective URL against the URL of source "self".
3193         (WebCore::CSPSourceList::parse): Update code as necessary now that m_policy is a reference
3194         instead of a pointer.
3195         (WebCore::CSPSourceList::parseSource): Simplify code by setting internal member fields directly
3196         instead of via member functions.
3197         (WebCore::CSPSourceList::parsePath): Update code as necessary now that m_policy is a reference
3198         instead of a pointer.
3199         (WebCore::CSPDirective::CSPDirective): Take a constant reference to a ContentSecurityPolicy
3200         instead of a pointer since we never expected a null pointer.
3201         (WebCore::CSPDirective::policy): Return a reference to a const ContentSecurityPolicy.
3202         (WebCore::MediaListDirective::MediaListDirective): Take a constant reference to a ContentSecurityPolicy
3203         instead of a pointer since we never expected a null pointer.
3204         (WebCore::MediaListDirective::parse): Update code as necessary now that m_policy is a reference
3205         instead of a pointer.
3206         (WebCore::SourceListDirective::SourceListDirective): Take a constant reference to a ContentSecurityPolicy
3207         instead of a pointer since we never expected a null pointer.
3208         (WebCore::SourceListDirective::allows): Write in terms of CSPSourceList::allowSelf() because we
3209         may not have a security origin to get a URL from if ContentSecurityPolicy was initiated without
3210         a ScriptExecutionContext object.
3211         (WebCore::CSPDirectiveList::reportURIs): Change return type from Vector<URL> to Vector<String>
3212         The caller will convert the strings to URLs with respect to the script execution context.
3213         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
3214         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
3215         was initiated without a ScriptExecutionContext object.
3216         (WebCore::CSPDirectiveList::CSPDirectiveList): Take a reference to a ContentSecurityPolicy
3217         instead of a pointer since we never expected a null pointer. It would be better to take a const
3218         reference to a ContentSecurityPolicy, but ContentSecurityPolicy::applySandboxPolicy() needs to set
3219         state on ContentSecurityPolicy :(
3220         (WebCore::CSPDirectiveList::create): Ditto.
3221         (WebCore::CSPDirectiveList::reportViolation): Update code as necessary now that m_policy is a reference
3222         instead of a pointer.
3223         (WebCore::CSPDirectiveList::checkEvalAndReportViolation): Ditto.
3224         (WebCore::CSPDirectiveList::checkInlineAndReportViolation): Ditto.
3225         (WebCore::CSPDirectiveList::parseDirective): Ditto.
3226         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
3227         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
3228         was initiated without a ScriptExecutionContext object.
3229         (WebCore::CSPDirectiveList::setCSPDirective): Update code as necessary now that m_policy is a reference
3230         instead of a pointer.
3231         (WebCore::CSPDirectiveList::applySandboxPolicy): Ditto.
3232         (WebCore::CSPDirectiveList::parseReflectedXSS): Ditto.
3233         (WebCore::CSPDirectiveList::addDirective): Ditto.
3234         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Modified to take the ScriptExecutionObject
3235         as a reference and compute the CSPSource object for "self" and cache the protocol for "self". Removed
3236         field m_overrideInlineStyleAllowed from the member initialization list and used C++11 in-class
3237         initialization syntax to initialize it. Added overloaded constructor that takes a SecurityOrigin object.
3238         We are not making use of this overloaded constructor at this time. We will in a subsequent patch.
3239         (WebCore::ContentSecurityPolicy::didReceiveHeader): Store the eval disabled error message for
3240         the last parsed policy in a member field instead of using it as part of disabling eval execution
3241         on the script execution context because we may not have such a context.
3242         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Applies the content security
3243         policy eval and sandbox restrictions to the script execution context.
3244         (WebCore::ContentSecurityPolicy::urlMatchesSelf): Match the specified URL against the URL for
3245         source "self".
3246         (WebCore::ContentSecurityPolicy::protocolMatchesSelf): Match the protocol of the specified URL
3247         against the protocol for source "self".
3248         (WebCore::ContentSecurityPolicy::gatherReportURIs): Modified to use the script execution context
3249         to compute the absolute URL for each report URI.
3250         (WebCore::ContentSecurityPolicy::reportViolation): Bail out if we do not have a script execution
3251         context.
3252         (WebCore::ContentSecurityPolicy::logToConsole): Only log to the console if we have a script
3253         execution context.
3254         (WebCore::ContentSecurityPolicy::reportBlockedScriptExecutionToInspector): Only report blocked
3255         script execution to the Web Inspector if we have a script execution context.
3256         (WebCore::CSPSourceList::addSourceSelf): Deleted.
3257         (WebCore::CSPSourceList::addSourceStar): Deleted.
3258         (WebCore::CSPSourceList::addSourceUnsafeInline): Deleted.
3259         (WebCore::CSPSourceList::addSourceUnsafeEval): Deleted.
3260         (WebCore::CSPDirectiveList::gatherReportURIs): Deleted.
3261         (WebCore::ContentSecurityPolicy::securityOrigin): Deleted.
3262         (WebCore::ContentSecurityPolicy::url): Deleted.
3263         (WebCore::ContentSecurityPolicy::completeURL): Deleted.
3264         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Deleted.
3265         * page/csp/ContentSecurityPolicy.h:
3266         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Accumulates the parsed sandbox flags. We
3267         will apply the sandbox flags in ContentSecurityPolicy::applyPolicyToScriptExecutionContext().
3268         * workers/WorkerGlobalScope.cpp:
3269         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate ContentSecurityPolicy.
3270         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Move instantiation of
3271         ContentSecurityPolicy from here to constructor.
3272
3273 2016-02-02  Eric Carlson  <eric.carlson@apple.com>
3274
3275         Allow ports to disable automatic text track selection
3276         https://bugs.webkit.org/show_bug.cgi?id=153761
3277         <rdar://problem/24416768>
3278
3279         Reviewed by Darin Adler.
3280
3281         Test: media/track/track-manual-mode.html
3282
3283         * Modules/mediacontrols/MediaControlsHost.cpp:
3284         (WebCore::MediaControlsHost::manualKeyword): New.
3285         (WebCore::MediaControlsHost::captionDisplayMode): Support 'manual' mode.
3286         * Modules/mediacontrols/MediaControlsHost.h:
3287
3288         * Modules/mediacontrols/mediaControlsApple.js:
3289         (Controller.prototype.buildCaptionMenu): Check the 'off' item when in manual mode.
3290
3291         * html/HTMLMediaElement.cpp:
3292         (WebCore::HTMLMediaElement::addTextTrack): Update m_captionDisplayMode when called for the first
3293           time so it is always correct. Set the track's manual selection mode as appropriate.
3294         (WebCore::HTMLMediaElement::captionPreferencesChanged): Set each track's manual selection 
3295           mode as appropriate.
3296
3297         * html/track/TextTrack.cpp:
3298         (WebCore::TextTrack::kind): Return 'subtitles' for forced tracks when in manual mode.
3299         * html/track/TextTrack.h:
3300
3301         * html/track/TrackBase.h:
3302         (WebCore::TrackBase::kind): Make virtual.
3303
3304         * page/CaptionUserPreferences.cpp:
3305         (WebCore::CaptionUserPreferences::beginBlockingNotifications): New.
3306         (WebCore::CaptionUserPreferences::endBlockingNotifications): Ditto.
3307         (WebCore::CaptionUserPreferences::notify): Don't notify when blocked.
3308         * page/CaptionUserPreferences.h:
3309
3310         * page/CaptionUserPreferencesMediaAF.cpp:
3311         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF): Set manual mode 
3312           when appropriate.
3313         (WebCore::CaptionUserPreferencesMediaAF::captionDisplayMode): Check manual mode.
3314         (WebCore::CaptionUserPreferencesMediaAF::setCaptionDisplayMode): Ditto.
3315         (WebCore::CaptionUserPreferencesMediaAF::setPreferredLanguage): Ditto.
3316         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Return zero when in manual mode.
3317         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Consider manual mode. Fix
3318           typos in logging.
3319
3320         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3321         (WebCore::mediaDescriptionForKind): Return 'auxiliary' when in manual mode.
3322
3323         * testing/Internals.cpp:
3324         (WebCore::Internals::setCaptionDisplayMode): Support manual mode.
3325
3326 2016-02-02  Adrien Plazas  <aplazas@igalia.com>
3327
3328         REGRESSION(r195899): ASSERTION FAILED: is<Target>(source) in EventPath::retargetTouch() since r195899
3329         https://bugs.webkit.org/show_bug.cgi?id=153741
3330
3331         Reviewed by Ryosuke Niwa.
3332
3333         * dom/EventDispatcher.cpp:
3334         (WebCore::EventPath::retargetTouch):
3335
3336 2016-02-01  Joseph Pecoraro  <pecoraro@apple.com>
3337
3338         Web Inspector: High Level Memory Overview Instrument
3339         https://bugs.webkit.org/show_bug.cgi?id=153516
3340         <rdar://problem/24356378>
3341
3342         Reviewed by Brian Burg.
3343
3344         Add a new agent that gathers data from the ResourceUsageThread
3345         and sends to the frontend.
3346
3347         Test: inspector/memory/tracking.html
3348
3349         * CMakeLists.txt:
3350         * Configurations/FeatureDefines.xcconfig:
3351         * WebCore.xcodeproj/project.pbxproj:
3352         New files.
3353
3354         * inspector/InspectorController.cpp:
3355         (WebCore::InspectorController::InspectorController):
3356         Add the new agent.
3357
3358         * inspector/InspectorMemoryAgent.h: Added.
3359         * inspector/InspectorMemoryAgent.cpp: Added.
3360         (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
3361         (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
3362         (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
3363         (WebCore::InspectorMemoryAgent::startTracking):
3364         (WebCore::InspectorMemoryAgent::stopTracking):
3365         (WebCore::InspectorMemoryAgent::collectSample):
3366         Implement the agent by adding / removing it as a ResourceUsage
3367         observer. When receiving the data forward it to the frontend.
3368
3369 2016-02-01  Alex Christensen  <achristensen@webkit.org>
3370
3371         Fix CMake build.
3372
3373         * PlatformMac.cmake:
3374
3375 2016-02-01  Brady Eidson  <beidson@apple.com>
3376
3377         Modern IDB: Cursors (still) do not keep their opening request alive.
3378         https://bugs.webkit.org/show_bug.cgi?id=153724