REGRESSION (198056): Unable to use edit buttons on WordPress
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
2
3         REGRESSION (198056): Unable to use edit buttons on WordPress
4         https://bugs.webkit.org/show_bug.cgi?id=157475
5
6         Reviewed by Antti Koivisto.
7
8         Renamed Event.prototype.deepPath() to composedPath() per discussions on
9         https://github.com/whatwg/dom/issues/242 as the old name was not Web compatible.
10
11         Test: fast/shadow-dom/Extensions-to-Event-Interface.html
12
13         * dom/Event.cpp:
14         (WebCore::Event::composedPath): Renamed from deepPath.
15         * dom/Event.h:
16         * dom/Event.idl:
17
18 2016-05-09  Alex Christensen  <achristensen@webkit.org>
19
20         Don't use DiskCache for media resource loads
21         https://bugs.webkit.org/show_bug.cgi?id=157405
22
23         Reviewed by Darin Adler.
24
25         http/tests/security/video-cross-origin-caching.html was loading from the disk cache.
26         This patch adds an assertion that fires in that test without this fix.
27
28         * loader/MediaResourceLoader.cpp:
29         (WebCore::MediaResourceLoader::requestResource):
30         * platform/graphics/PlatformMediaResourceLoader.h:
31         * platform/network/ResourceRequestBase.h:
32         (WebCore::ResourceRequestBase::hiddenFromInspector):
33         (WebCore::ResourceRequestBase::setHiddenFromInspector):
34         (WebCore::ResourceRequestBase::requester):
35         (WebCore::ResourceRequestBase::setRequester):
36         * platform/network/cocoa/WebCoreNSURLSession.mm:
37         (-[WebCoreNSURLSessionDataTask _restart]):
38         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
39
40 2016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
41
42         Refactor FocusController::findFocusableElementRecursively
43         https://bugs.webkit.org/show_bug.cgi?id=157415
44
45         Reviewed by Darin Adler.
46
47         Refactor FocusController::findFocusableElementRecursively and related functions. Extracted two functions:
48         nextFocusableElementWithinScope and previousFocusableElementWithinScope out of it since they didn't really share
49         any code other than calling findFocusableElement at the beginning.
50
51         Also renamed internal variant of nextFocusableElement and previousFocusableElement to nextFocusableElementOrScopeOwner
52         and previousFocusableElementOrScopeOwner. It was confusing to have these internal functions in addition to public
53         member functions that are used in Objective-C DOM API.
54
55         No new tests are added since there should be no behavioral change.
56
57         * page/FocusController.cpp:
58         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument): Added a FIXME.
59         (WebCore::FocusController::advanceFocusInDocumentOrder): Use findFocusableElementAcrossFocusScope instead of manually
60         calling findFocusableElementRecursively and findFocusableElementDescendingDownIntoFrameDocument separately.
61         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Now that findFocusableElementWithinScope calls
62         findFocusableElementDescendingDownIntoFrameDocument internally, there is no need to keep around "found" local variable.
63         Introduce a few early exists for a better clarity.
64         (WebCore::FocusController::findFocusableElementWithinScope): Renamed from findFocusableElementRecursively. Also call
65         findFocusableElementDescendingDownIntoFrameDocument here instead of findFocusableElementAcrossFocusScope.
66         (WebCore::FocusController::nextFocusableElementWithinScope): Extracted from findFocusableElementRecursively.
67         (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
68         (WebCore::FocusController::findFocusableElement):
69         (WebCore::FocusController::nextFocusableElement): Added a FIXME.
70         (WebCore::FocusController::previousFocusableElement): Ditto.
71         (WebCore::FocusController::findFocusableElementOrScopeOwner): Renamed from findFocusableElement for clarity.
72         (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto from nextFocusableElement.
73         (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto from nextFocusableElement.
74         * page/FocusController.h:
75
76 2016-05-09  Manuel Rego Casasnovas  <rego@igalia.com>
77
78         [css-grid] Fix static position for positioned grid items
79         https://bugs.webkit.org/show_bug.cgi?id=157417
80
81         Reviewed by Darin Adler.
82
83         The spec was updated to define properly the static position
84         for positioned grid items, but we didn't update the implementation yet:
85         https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1
86
87         We were only setting the static position when the start line
88         was not auto. Otherwise we were using the default one
89         which includes the padding.
90         With the spec change we need to set it always,
91         even if the start line is auto.
92
93         * rendering/RenderGrid.cpp:
94         (WebCore::RenderGrid::layoutPositionedObject):
95         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
96
97 2016-05-08  Frederic Wang  <fwang@igalia.com>
98
99         RenderMathMLOperator: refactor management of stretchy data and italic correction
100         https://bugs.webkit.org/show_bug.cgi?id=156913
101
102         Reviewed by Darin Adler.
103
104         No new tests, behavior is not changed.
105
106         The stretchy data uses a shared space to describe horizontal / vertical directions and
107         unstretched / size variant / glyph assembly. We use a simple struct with some unions to
108         represent it instead of the current implementation with a class.
109         We also modify the signature of some functions to retrieve display operator and stretchy
110         data to use that new structure and prepare the move to a separate MathOperator class.
111         Finally, we introduce some helper functions to easily set the stretchy data.
112
113         * rendering/mathml/RenderMathMLOperator.cpp:
114         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the new data members and
115         function signatures.
116         (WebCore::RenderMathMLOperator::setSizeVariant): New helper function to set a size variant.
117         (WebCore::RenderMathMLOperator::setGlyphAssembly): New helper function to set a glyph
118         assembly.
119         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): We change the signature to use a
120         GlyphAssemblyData.
121         (WebCore::RenderMathMLOperator::findDisplayStyleLargeOperator): We rename the function and
122         change its signature to remove the return value. We now also set the italic correction when
123         a display operator is found.
124         (WebCore::RenderMathMLOperator::findStretchyData): We change the signature to introduce a
125         target size and remove the return value. This also does the early return when the base glyph
126         is large enough.
127         (WebCore::RenderMathMLOperator::updateStyle): We use the new data members and function
128         signatures. The check for the base glyph size is now done in findStretchyData, so we just
129         check whether m_stretchType is Unstretched to do an early return.
130         (WebCore::RenderMathMLOperator::firstLineBaseline): We use m_stretchType.
131         (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
132         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Use the new class members.
133         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Ditto.
134         (WebCore::RenderMathMLOperator::paint): Ditto.
135         (WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Ditto.
136         (WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Ditto.
137         (WebCore::RenderMathMLOperator::paintChildren): Ditto.
138         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
139         (WebCore::RenderMathMLOperator::italicCorrection): Moved to RenderMathMLOperator.h.
140         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): Deleted.
141         * rendering/mathml/RenderMathMLOperator.h:
142         (WebCore::RenderMathMLOperator::italicCorrection): We just return m_italicCorrection.
143         (WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): New class to store an
144         assembly of GlyphData.
145         (WebCore::RenderMathMLOperator::StretchyData::mode): Deleted.
146         (WebCore::RenderMathMLOperator::StretchyData::variant): Deleted.
147         (WebCore::RenderMathMLOperator::StretchyData::top): Deleted.
148         (WebCore::RenderMathMLOperator::StretchyData::extension): Deleted.
149         (WebCore::RenderMathMLOperator::StretchyData::bottom): Deleted.
150         (WebCore::RenderMathMLOperator::StretchyData::middle): Deleted.
151         (WebCore::RenderMathMLOperator::StretchyData::left): Deleted.
152         (WebCore::RenderMathMLOperator::StretchyData::right): Deleted.
153         (WebCore::RenderMathMLOperator::StretchyData::setNormalMode): Deleted.
154         (WebCore::RenderMathMLOperator::StretchyData::setSizeVariantMode): Deleted.
155         (WebCore::RenderMathMLOperator::StretchyData::setGlyphAssemblyMode): Deleted.
156         (WebCore::RenderMathMLOperator::StretchyData::StretchyData): Deleted.
157
158 2016-05-08  Zalan Bujtas  <zalan@apple.com>
159
160         iOS selection: Use inflow containing block for positioned <br>.
161         https://bugs.webkit.org/show_bug.cgi?id=157115
162         <rdar://problem/25969295>
163
164         Reviewed by Ryosuke Niwa.
165
166         Similarly to RenderText, we should just use the inflow containing block for
167         selected <br> even when it is positioned out of flow. This visually matches Mac OS X
168         behaviour (selection painting does not get extended to the positioned <br>).
169
170         Test: fast/text/fixed-positioned-br-crash.html
171
172         * rendering/RenderLineBreak.cpp:
173         (WebCore::RenderLineBreak::collectSelectionRects):
174
175 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
176
177         [iOS] Build fix after r200563
178
179         Unreviewed.
180
181         * editing/cocoa/HTMLConverter.mm:
182         (_font):
183
184 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
185
186         [OS X] Migrate our Font classes entirely off of NSFont
187         https://bugs.webkit.org/show_bug.cgi?id=157464
188
189         Reviewed by Darin Adler.
190
191         Because NSFont and CTFont are toll-free-bridged, we don't need NSFont at all anywhere.
192
193         No new tests because there is no behavior change.
194
195         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
196         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
197         (textMarkerRangeFromRange):
198         (visiblePositionForStartOfTextMarkerRange):
199         (visiblePositionForEndOfTextMarkerRange):
200         (AXAttributedStringRangeIsValid):
201         (AXAttributeStringSetFont):
202         (CreateCGColorIfDifferent):
203         (AXAttributeStringSetStyle):
204         (textMarkerRangeFromVisiblePositions):
205         * bindings/objc/DOM.mm:
206         (-[DOMElement _font]):
207         * bindings/objc/DOMPrivate.h:
208         * editing/cocoa/HTMLConverter.mm:
209         (_font):
210         (WebCore::editingAttributedStringFromRange):
211         * editing/mac/EditorMac.mm:
212         (WebCore::Editor::fontAttributesForSelectionStart):
213         * platform/graphics/Font.h:
214         (WebCore::Font::getCTFont):
215         (WebCore::Font::getNSFont): Deleted.
216         * platform/graphics/FontPlatformData.h:
217         (WebCore::FontPlatformData::nsFont): Deleted.
218         * platform/graphics/cocoa/FontCocoa.mm:
219         (WebCore::Font::determinePitch):
220         (WebCore::advanceForColorBitmapFont):
221         (WebCore::Font::platformWidthForGlyph):
222         (WebCore::renderingStyle): Deleted.
223         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
224
225 2016-05-08  Chris Dumez  <cdumez@apple.com>
226
227         [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
228         https://bugs.webkit.org/show_bug.cgi?id=157465
229
230         Reviewed by Darin Adler.
231
232         Simplify [RequiresExistingAtomicString] IDL extended attribute handling
233         in the bindings generator.
234
235         * bindings/scripts/CodeGeneratorJS.pm:
236         (GenerateParametersCheck):
237         Drop code specific to [RequiresExistingAtomicString].
238
239         (JSValueToNative):
240         Deal with [RequiresExistingAtomicString] IDL extended attribute,
241         similarly to [AtomicString] and [TreatNullAs].
242
243         * bindings/scripts/test/JS/JSTestObj.cpp:
244         * bindings/scripts/test/TestObj.idl:
245         Add bindings test coverage.
246
247         * dom/DocumentFragment.cpp:
248         (WebCore::DocumentFragment::getElementById):
249         * svg/SVGSVGElement.cpp:
250         (WebCore::SVGSVGElement::getElementById):
251         Add null check for the id parameter. The generated bindings used to do
252         this null check for us but it is no longer the case (to make the bindings
253         generator a bit simpler). This extended attribute is not commonly used
254         and is meant as a micro-optimization for getElementById().
255
256 2016-05-08  David Kilzer  <ddkilzer@apple.com>
257
258         Roll out: ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
259         <https://webkit.org/b/157462>
260
261         This reverts commit r200554.
262
263         This doesn't fix the data race, and the thread leak is a
264         separate issue.
265
266         * page/scrolling/ScrollingThread.cpp:
267         (WebCore::ScrollingThread::createThreadIfNeeded): Roll out the
268         change.
269
270 2016-05-08  Darin Adler  <darin@apple.com>
271
272         Follow-up to that last patch (missed review comments).
273
274         * page/EventSource.cpp:
275         (WebCore::EventSource::parseEventStream): Pre-increment, not post-increment.
276         (WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView.
277
278 2016-05-08  Darin Adler  <darin@apple.com>
279
280         Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
281         https://bugs.webkit.org/show_bug.cgi?id=157459
282
283         Reviewed by Chris Dumez.
284
285         Patch also includes some updating of EventSource class to modern idioms.
286
287         * page/EventSource.cpp:
288         (WebCore::EventSource::EventSource): Initialize based on Init.
289         (WebCore::EventSource::create): Take/pass Init instead of Dictionary.
290
291         * bindings/js/SerializedScriptValue.cpp:
292         (WebCore::CloneSerializer::serialize): Take a StringView instead of a string
293         so callers don't have to allocate a String just to use this.
294         (WebCore::SerializedScriptValue::create): Ditto.
295         * bindings/js/SerializedScriptValue.h: Ditto.
296
297         * page/EventSource.cpp: Changed defaultReconnectDelay to be a uint64_t
298         instead of an unsigned long long.
299         (WebCore::EventSource::EventSource): Changed constructor to take a struct
300         instead of a Dictionary for eventSourceInit. Also moved initialization of
301         data members to the header and used ASCIILiteral.
302         (WebCore::EventSource::create): Changed type to Init and streamlined code
303         a little bit using auto.
304         (WebCore::EventSource::connect): Used a reference instead of a pointer.
305         Also added a FIXME since I noticed that m_requestInFlight is probably not
306         needed, since it's basically the same thing as "is m_loader null".
307         (WebCore::EventSource::url): Moved to the header and made it inline.
308         (WebCore::EventSource::networkRequestEnded): Removed unneeded check that
309         is already done by all callers and turned it into an assertion.
310         (WebCore::EventSource::withCredentials): Ditto.
311         (WebCore::EventSource::readyState): Ditto.
312         (WebCore::EventSource::responseIsValid): Added. Helper function to make
313         the logic in didReceiveResponse easier to read. Fixed logic to compare
314         MIME type ignoring ASCII case, since that's how MIME types work.
315         (WebCore::EventSource::didReceiveResponse): Use the helper above, and also
316         move the m_eventStreamOrigin set up code into the valid response case,
317         since there is no point doing it if the response is not valid. Also use
318         the early return idiom.
319         (WebCore::EventSource::didReceiveData): Removed the unneeded explicit
320         conversion to StringView here. Also removed a FIXME that I fixed.
321         (WebCore::EventSource::didFinishLoading): Added code to flush the decoder
322         as mentioned in didReceiveData. Added FIXME about peculiar clearing code
323         that exists only here. Removed check for empty receive buffer and data
324         that is not needed since parseEventStream does sufficient checking.
325         (WebCore::EventSource::didFail): Added FIXME because of things that
326         didFinishLoading does that seem equally valuable here.
327         (WebCore::EventSource::parseEventStream): Tweaked types and names of local
328         variables, and changed to use Optional instead of magic number -1. Also
329         added a FIXME about how the buffer type is probably not right since we
330         keep moving the characters in the buffer as we consume the start of it.
331         (WebCore::EventSource::parseEventStreamLine): Refactor and reorganize so
332         this doesn't do so much string allocation and is easier to read
333         (WebCore::EventSource::canSuspendForDocumentSuspension): Tweaked comment.
334         (WebCore::EventSource::dispatchMessageEvent): Renamed this from
335         createMessageEvent, and moved more code in here. We now don't have to
336         allocate a temporary string just to pass it to SerializedScriptValue.
337
338         * page/EventSource.h: Updated for changes above. Use pragma once.
339         Define and use EventSource::Init struct. Other small cleanup.
340
341         * page/EventSource.idl: Define EventSourceInit dictionary and use it.
342         Other small cleanup.
343
344 2016-05-07  Darin Adler  <darin@apple.com>
345
346         Change HTMLSlotElement::assignedNodes to take a IDL dictionary instead of a WebCore::Dictionary
347         https://bugs.webkit.org/show_bug.cgi?id=157457
348
349         Reviewed by Chris Dumez.
350
351         * html/HTMLSlotElement.cpp:
352         (WebCore::HTMLSlotElement::removedFrom): Fixed typo in comment.
353         (WebCore::HTMLSlotElement::assignedNodes): Renamed assignedNodesForBindings back to this
354         and changed the argument type to Optional<AssignedNodesOptions> instead of Dictionary.
355         Also streamlined the logic a bit.
356         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Changed to use a pointer to the
357         enqueued event instead of a boolean. With only a boolean, we could end up clearing the
358         flag in cases where we don't really want to.
359         (WebCore::HTMLSlotElement::dispatchEvent): Ditto.
360         (WebCore::HTMLSlotElement::assignedNodesForBindings): Deleted.
361         * html/HTMLSlotElement.h: Use pragma once. Added AssignedNodeOptions. Changed for the
362         above, including changing the data member.
363         * html/HTMLSlotElement.idl: Removed use of ImplementedAs. Fixed the type of the options
364         dictionary.
365
366 2016-05-08  Chris Dumez  <cdumez@apple.com>
367
368         [Bindings] Add convert<>() template specializations for integer types
369         https://bugs.webkit.org/show_bug.cgi?id=157458
370
371         Reviewed by Darin Adler.
372
373         Add convert<>() template specializations for integer types and use them
374         in the JS bindings. Also, treat non-32bit types the same way as the
375         32bit ones, allowing the compiler to optimize out branching based on
376         the IntegerConversionConfiguration.
377
378         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
379
380         * bindings/js/JSDOMBinding.cpp:
381         (WebCore::enforceRange):
382         (WebCore::toSmallerInt):
383         (WebCore::toSmallerUInt):
384         (WebCore::toInt8EnforceRange):
385         (WebCore::toUInt8EnforceRange):
386         (WebCore::toInt8Clamp):
387         (WebCore::toUInt8Clamp):
388         (WebCore::toInt8):
389         (WebCore::toUInt8):
390         (WebCore::toInt16EnforceRange):
391         (WebCore::toUInt16EnforceRange):
392         (WebCore::toInt16Clamp):
393         (WebCore::toUInt16Clamp):
394         (WebCore::toInt16):
395         (WebCore::toUInt16):
396         (WebCore::toInt32EnforceRange):
397         (WebCore::toInt32Clamp):
398         (WebCore::toUInt32Clamp):
399         (WebCore::toUInt32EnforceRange):
400         (WebCore::toInt64EnforceRange):
401         (WebCore::toUInt64EnforceRange):
402         (WebCore::toInt64Clamp):
403         (WebCore::toUInt64Clamp):
404         (WebCore::toInt64):
405         (WebCore::toUInt64):
406         * bindings/js/JSDOMBinding.h:
407         - Splt some integer conversion functions into 3 Normal / Clamp /
408           Enforce versions, similarly to what was done for 32bit types already.
409           This is so that these can be called from the inline functions in
410           JSDOMConvert.h, allowing the compiler to optimize out the branches.
411         - Get rid of some unnecessary state.hadException() checks.
412
413         * bindings/js/JSDOMConvert.h:
414         Add convert<> specializations for integer types.
415
416         * bindings/js/JSNodeFilterCustom.cpp:
417         (WebCore::JSNodeFilter::acceptNode):
418
419         * bindings/scripts/CodeGenerator.pm:
420         - Add utility function to distinguish integer types.
421         - Have IsNumericType() using the integerType / floatingPointType
422           hashes to avoid duplication.
423         - Stop int / unsigned int from integer types as those are not
424           in Web IDL and they are not used.
425
426         * bindings/scripts/CodeGeneratorJS.pm:
427         (GetIntegerConversionType):
428         (JSValueToNative):
429         Use convert<>() for converting JSValue to integer types.
430
431         * bindings/scripts/IDLParser.pm:
432         Stop allowing int / unsigned int types as those are not in Web IDL.
433
434         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
435         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
436         * bindings/scripts/test/JS/JSTestObj.cpp:
437         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
438         Rebaseline bindings tests.
439
440 2016-05-08  Darin Adler  <darin@apple.com>
441
442         Correct dictionary bindings handling of optional, null, and undefined
443         https://bugs.webkit.org/show_bug.cgi?id=157463
444
445         Reviewed by Chris Dumez.
446
447         * bindings/js/JSDOMBinding.cpp:
448         (WebCore::propertyValue): Deleted.
449         * bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now.
450
451         * bindings/scripts/CodeGeneratorJS.pm:
452         (GenerateDictionaryImplementationContent): Added a new early exit for convert to
453         a dictionary type when the value is undefined or null and all members are either
454         optional or have a default value. This returns the default values for everything
455         without raising an exception. Added checking that requires that the dictionary
456         argument is an object and not a regular expression, since that's also called for
457         in the latest draft of the Web IDL specification. This ends up speeding up the
458         code a bit since we now use JSObject::get for properties instead of JSValue::get.
459         (GenerateParametersCheck): Renamed some local variables. Taught the code that
460         optional dictionaries all have a default value; before it was doing that for the
461         type "Dictionary" but not the real dictionary types (IsDictionaryType).
462
463         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
464
465         * css/FontFace.cpp:
466         (WebCore::FontFace::create): Changed argument to be Descriptors instead of
467         Optional<Descriptors>. It would have compiled the other way, but there is now
468         no caller that will pass a null. Because the IDL dictionary support was new,
469         this was the only place that was doing it wrong. Good that we "nipped it in the bud"
470         before doing this in more places.
471         * css/FontFace.h: Ditto.
472
473 2016-05-08  David Kilzer  <ddkilzer@apple.com>
474
475         ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
476         <https://webkit.org/b/157462>
477
478         Reviewed by Darin Adler.
479
480         Reproduced with multiple existing tests.
481
482         * page/scrolling/ScrollingThread.cpp:
483         (WebCore::ScrollingThread::createThreadIfNeeded): Use a
484         std::once_flag to initialize Scrolling Thread since this may be
485         called from background threads.
486
487 2016-05-08  Darin Adler  <darin@apple.com>
488
489         Try to fix build without rolling out that last change.
490
491         * bindings/js/JSDOMConvert.h:
492         (WebCore::convert<Vector<String>>): Make this an inline. Just call toNativeArray.
493
494 2016-05-07  Darin Adler  <darin@apple.com>
495
496         Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary
497         https://bugs.webkit.org/show_bug.cgi?id=157456
498
499         Reviewed by Chris Dumez.
500
501         * bindings/js/JSDOMConvert.h:
502         (WebCore::convertOptional): Use a specific Optional null rather than Nullopt so we
503         can compile the ternary operator.
504         (WebCore::convert<bool>): Added.
505         (WebCore::convert<Vector<String>>): Added. Later we probably need to change convert to use
506         a member function of a class template rather than a function template so we can make partial
507         specialization work and do this just once for all Vector<T>.
508
509         * bindings/js/JSMutationObserverCustom.cpp:
510         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Streamlined code and removed
511         some local variables. Changed to call the new observedNodes rather than getObservedNodes.
512
513         * bindings/scripts/CodeGeneratorJS.pm:
514         (GenerateDictionaryImplementationContent): Fixed bug where we tried to call the version of
515         the convert function with a default value even when there was none.
516
517         * bindings/scripts/test/TestObj.idl: Added a test case basically identical to what's needed
518         in MutationObserver.idl.
519         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
520
521         * dom/MutationObserver.cpp:
522         (WebCore::MutationObserver::observe): Chagned function to take a MutationObserver::Init
523         instead of a Dictionary.
524         (WebCore::MutationObserver::observationStarted): Changed argument type to a reference.
525         (WebCore::MutationObserver::observationEnded): Ditto.
526         (WebCore::MutationObserverMicrotask): Removed unneeded explicit constructor and destructor.
527         (WebCore::queueMutationObserverCompoundMicrotask): Got rid of unnneeded local variable.
528         (WebCore::MutationObserver::observedNodes): Renamed to remove the "get" prefix.
529
530         * dom/MutationObserver.h: Reduced includes. Added MutationObserver::Init struct and
531         used it for the type of the argument to the observe function. Changed a few argument
532         types and removed unused forward declarations.
533
534         * dom/MutationObserver.idl: Added MutationObserverInit and used it instead of Dictionary.
535
536         * dom/MutationObserverRegistration.cpp:
537         (WebCore::MutationObserverRegistration::MutationObserverRegistration): Pass a reference.
538         (WebCore::MutationObserverRegistration::~MutationObserverRegistration): Ditto.
539
540 2016-05-07  Chris Dumez  <cdumez@apple.com>
541
542         Reduce special handling of XPathNSResolver type in the bindings
543         https://bugs.webkit.org/show_bug.cgi?id=157454
544
545         Reviewed by Darin Adler.
546
547         Reduce special handling of XPathNSResolver type in the bindings.
548
549         * CMakeLists.txt:
550         * WebCore.xcodeproj/project.pbxproj:
551         * bindings/js/JSBindingsAllInOne.cpp:
552         Add new JSXPathNSResolverCustom.cpp file.
553
554         * bindings/js/JSDOMStringListCustom.cpp:
555         (WebCore::JSDOMStringList::toWrapped):
556         Take the ExecState by reference instead of pointer.
557
558         * bindings/js/JSDOMWindowCustom.cpp:
559         (WebCore::JSDOMWindow::toWrapped):
560         Update to take an ExecState& parameter. The bindings now pass
561         an ExecState to all custom toWrapped() methods for consistency
562         and flexibility.
563
564         * bindings/js/JSDictionary.cpp:
565         (WebCore::JSDictionary::convertValue):
566         Pass an ExecState now that those toWrapped() methods expect
567         it.
568
569         * bindings/js/JSEventTargetCustom.cpp:
570         (WebCore::JSEventTarget::toWrapped):
571         Update to take an ExecState& parameter.
572
573         * bindings/js/JSIDBDatabaseCustom.cpp:
574         (WebCore::JSIDBDatabase::transaction):
575         Pass ExecState by reference instead of pointer.
576
577         * bindings/js/JSMessageEventCustom.cpp:
578         (WebCore::handleInitMessageEvent):
579         Pass ExecState to JSDOMWindow::toWrapped().
580
581         * bindings/js/JSXPathNSResolverCustom.cpp: Added.
582         (WebCore::JSXPathNSResolver::toWrapped):
583         Provide a custom implementation of JSXPathNSResolver::toWrapped()
584         instead of having the custom code in the bindings generator.
585
586         * bindings/scripts/CodeGeneratorJS.pm:
587         (AddIncludesForType):
588         Drop special includes for XPathNSResolver as they are no longer needed.
589
590         (GenerateHeader):
591         Drop special casing of certain types for generating the toWrapped()
592         declaration by:
593         1. Relying on GetNativeType() for the return value as certain types
594            return a RefPtr instead of a raw pointer.
595         2. Adding an extra ExecState parameter when a custom implementation of
596            toWrapped() is provided, given that some of them need it.
597
598         (GenerateParametersCheck):
599         Drop custom code for XPathNSResolver and use the normal code path for
600         this type now. The custom code now resides in the custom implementation
601         of JSXPathNSResolver::toWrapped(), in custom bindings.
602
603         (JSValueToNative):
604         - Drop NodeFilter from the nativeType hash map as it was updated to
605           be a callback interface a while back.
606         - Add XPathNSResolver to nativeType hash map so that we now to use
607           a RefPtr<> instead of a raw pointer in the bindings. We should
608           probably add an IDL extended attribute for this at some point.
609         - Drop special casing for DOMStringList which was outdated since there
610           is no toDOMStringList() function. DOMStringList has a custom
611           toWrapped() function instead nowadays so we now call this one
612           instead. We apparently do not have any DOMStringList parameters
613           outside our bindings tests at the moment, which is why no one
614           noticed.
615         - Pass an ExecState to toWrapped() if the interface has the
616           JSCustomToNativeObject IDL extended attribute.
617
618         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
619         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
620         * bindings/scripts/test/JS/JSTestObj.cpp:
621         * bindings/scripts/test/ObjC/DOMTestObj.h:
622         * bindings/scripts/test/ObjC/DOMTestObj.mm:
623         * bindings/scripts/test/TestObj.idl:
624         Add bindings test coverage for having an operation with an
625         XPathNSResolver parameter.
626
627         * dom/Document.idl:
628         * xml/XPathEvaluator.idl:
629         Drop some unnecessary default parameter values.
630
631         * xml/XPathNSResolver.idl:
632         Add JSCustomToNativeObject IDL extended attribute so that we can
633         provide our own custom implementation of JSXPathNSResolver::toWrapped(),
634         instead of having the custom code in the bindings generator.
635
636         * dom/Document.cpp:
637         (WebCore::Document::createExpression):
638         (WebCore::Document::evaluate):
639         * dom/Document.h:
640         * inspector/InspectorNodeFinder.cpp:
641         * xml/XPathEvaluator.cpp:
642         (WebCore::XPathEvaluator::createExpression):
643         (WebCore::XPathEvaluator::evaluate):
644         * xml/XPathEvaluator.h:
645         * xml/XPathExpression.cpp:
646         (WebCore::XPathExpression::createExpression):
647         * xml/XPathExpression.h:
648         * xml/XPathParser.cpp:
649         (WebCore::XPath::Parser::Parser):
650         (WebCore::XPath::Parser::parseStatement):
651         * xml/XPathParser.h:
652         Take XPathNSResolver parameter as a Ref<XPathNSResolver>&& as this is
653         what the generated bindings now provide us, given that this sometimes
654         have to create a wrapper around a JSObject.
655
656 2016-05-07  Darin Adler  <darin@apple.com>
657
658         Fix crash introduced by the last patch.
659
660         Fix suggested by Chris Dumez.
661
662         * css/FontFace.cpp:
663         (WebCore::FontFace::FontFace): Roll out incorrect change. Things were getting
664         initialized in the wrong order in a change I had made to the FontFace constructor
665         that takes a CSSFontSelector.
666
667 2016-05-07  Chris Dumez  <cdumez@apple.com>
668
669         Unreviewed, rebaseline bindings tests after r200547.
670
671         * bindings/scripts/test/JS/JSTestObj.cpp:
672         (WebCore::convert<TestObj::FontFaceDescriptors>):
673
674 2016-05-07  Darin Adler  <darin@apple.com>
675
676         Next step on dictionary bindings, along with other bindings refinements
677         https://bugs.webkit.org/show_bug.cgi?id=157451
678
679         Reviewed by Chris Dumez.
680
681         Converted one dictionary, the one passed to the constructor in FontFace.
682
683         * WebCore.xcodeproj/project.pbxproj: Updated for name change of JSDOMBuild.h to
684         JSDOMConvert.h and also let Xcode update a file type.
685
686         * bindings/js/JSDOMBinding.cpp:
687         (WebCore::propertyValue): Added.
688         * bindings/js/JSDOMBinding.h: Use pragma once. Remove unnecessary forward declaration.
689         Move all declarations to the top of the file, separating them from definitions. This
690         is a small step toward better overview of what's in this file and paves the way for
691         future simplifications and improvements we can make after we observe patterns.
692         Also removed a couple unused functions.
693
694         * bindings/js/JSDOMConvert.h: Renamed from JSDOMBuild.h.
695         Renamed function templates from build to convert. Added convertOptional.
696
697         * bindings/js/ReadableStreamController.cpp:
698         (WebCore::callFunction): Use auto and remove some unneeded namespacing.
699         (WebCore::ReadableStreamController::invoke): Ditto. Also remove use of helper function
700         getPropertyFromObject, since this was the only call site and it was not very helpful.
701         (WebCore::ReadableStreamController::isControlledReadableStreamLocked): Ditto.
702         (WebCore::createReadableStream): Ditto.
703         (WebCore::getReadableStreamReader): Ditto.
704
705         * bindings/scripts/CodeGeneratorJS.pm:
706         (GenerateEnumerationImplementationContent): Updated for name change from build to
707         convert and JSDOMBuild.h to JSDOMConvert.h.
708         (GenerateDictionaryImplementationContent): Ditto. Also added code to handle optional
709         and added explicit exception checking, using local variables. Not clear longer term
710         if the local variable approach is OK since this will unnecessarily change types like
711         const String& to String.
712         (GenerateParametersCheck): Removed local variable $optional and use $parameter->isOptional
713         directly consistently. This is slightly clearer because the old code used a mix of the
714         two, and also is a better pattern for when we refactor this into smaller functions.
715         Note that this function name is not good any more--this is a lot more then parameter checks.
716         (GetNativeType): Return appropriate name for dictionary types.
717         (JSValueToNative): Updated for name change from build to convert and JSDOMBuild.h to
718         JSDOMConvert.h.
719
720         * bindings/scripts/test/JS/JSTestObj.cpp:
721         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
722         Regenerated results.
723
724         * bindings/scripts/test/TestObj.idl: Added another dictionary test case, just a copy
725         of the current state of the one in FontFace.idl.
726
727         * css/CSSFontFace.cpp:
728         (WebCore::CSSFontFace::setUnicodeRange): Update for simplified UnicodeRange struct.
729         (WebCore::CSSFontFace::setFeatureSettings): Fix to correctly handle being called
730         with "normal". Also fix so it doesn't call fontPropertyChanged if nothing changed.
731         Also got rid of return value, which had no real value: it was returning false for
732         some bad inputs, but others would just lead to assertions, and the real reason this
733         was OK is that this function is only passed known-valid values.
734
735         * css/CSSFontFace.h: Used prama once. Tweaked formatting. Removed return value from
736         the setFeatureSettings function. Changed UnicodeRange to be struct with public data
737         members instead a struct with a constructor and getter functions.
738
739         * css/CSSFontSelector.cpp:
740         (WebCore::CSSFontSelector::addFontFaceRule): Updated since setFeatureSettings no
741         longer has a boolean return value.
742
743         * css/CSSSegmentedFontFace.cpp:
744         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Updated for simplified
745         UnicodeRange struct.
746
747         * css/FontFace.cpp:
748         (WebCore::valueFromDictionary): Deleted.
749         (WebCore::FontFace::create): Updated to take the descriptors as a struct instead of
750         a WebCore::Dictionary. Also made that argument optional as specified in the current
751         specification draft.
752         (WebCore::FontFace::setFeatureSettings): Updated since setFeatureSettings no longer
753         has a boolean return value.
754         (WebCore::FontFace::unicodeRange): Updated for simplified UnicodeRange struct.
755
756         * css/FontFace.h: Used pragma once. Removed unneeded includes and forward declarations.
757         Derived privately from CSSFontFace::Client. Added a FontFace::Descriptors struct and
758         used it as an argument to the create function as described above.
759
760         * css/FontFace.idl: Added FontFaceDescriptors and changed the argument to the
761         constructor to be an optional FontFaceDescriptors instead of a Dictionary.
762
763 2016-05-07  Youenn Fablet  <youenn.fablet@crf.canon.fr>
764
765         Rework FontFace promise attribute handling
766         https://bugs.webkit.org/show_bug.cgi?id=157310
767
768         Reviewed by Myles C. Maxfield.
769
770         Making promise attributes cached attributes, so that they are created only once.
771         They are created in the custom binding code and passed to DOM class as needed.
772
773         Removed usage of ExecState& from DOM iterators.
774
775         No change should be visible from user scripts.
776
777         * Modules/fetch/FetchHeaders.cpp:
778         (WebCore::FetchHeaders::Iterator::next): Removing ExecState parameter.
779         * Modules/fetch/FetchHeaders.h:
780         * bindings/js/JSDOMIterator.h:
781         (WebCore::keyValueIteratorForEach):
782         (WebCore::JSDOMIterator<JSWrapper>::next): Ditto.
783         * bindings/js/JSDOMPromise.cpp:
784         (WebCore::DeferredWrapper::promise): Removed deferred() and added access to promise directly.
785         * bindings/js/JSDOMPromise.h:
786         * bindings/js/JSFontFaceCustom.cpp:
787         (WebCore::JSFontFace::loaded): Using cached attribute to call FontFace::loaded only once.
788         * bindings/js/JSFontFaceSetCustom.cpp:
789         (WebCore::JSFontFaceSet::ready): Using cached attribute to call FontFaceSet::ready only once.
790         * css/CSSFontFace.cpp:
791         (WebCore::CSSFontFace::wrapper): Removing ExecState parameter.
792         * css/CSSFontFace.h:
793         * css/FontFace.cpp:
794         (WebCore::FontFace::create): Ditto.
795         (WebCore::FontFace::FontFace): Ditto.
796         (WebCore::FontFace::fontStateChanged): Updating promise handling.
797         (WebCore::FontFace::registerLoaded): Resolving/rejecting promise if backing CSSFontFace loading is ended.
798         (WebCore::FontFace::load): Calling backing load.
799         * css/FontFace.h:
800         * css/FontFaceSet.cpp:
801         (WebCore::FontFaceSet::Iterator::next): Removing ExecState parameter.
802         (WebCore::FontFaceSet::load): Removing ExecState and ExceptionCode parameter.
803         (WebCore::FontFaceSet::registerReady): Resolving promise if ready otherwise storing it for resolving it later.
804         (WebCore::FontFaceSet::completedLoading): Resolving promise if any is stored.
805         (WebCore::FontFaceSet::create): Deleted.
806         * css/FontFaceSet.h:
807         * css/FontFaceSet.idl:
808
809 2016-05-07  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
810
811         Fix an incorrect usage of OS(DARWIN) with PLATFORM(COCOA)
812         https://bugs.webkit.org/show_bug.cgi?id=157167
813
814         Reviewed by Myles C. Maxfield.
815
816         * platform/graphics/FontPlatformData.h:
817         (WebCore::FontPlatformData::hash):
818
819 2016-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
820
821         REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
822         https://bugs.webkit.org/show_bug.cgi?id=153956
823
824         Reviewed by Chris Fleizach.
825
826         The reason the test began failing is that it was checking the new caret offset
827         synchronously. For most of the test cases, this was not a problem. But when the
828         caret was moved out of a focused link, the focus change (and associated repainting)
829         delayed the caret-moved event long enough to cause the associated test case to fail.
830         The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
831
832         The test also had a supposedly-correct expectation which was wrong: When moving the
833         caret to a valid accessible offset, the caret-moved event should be for that offset.
834         This was not the case for the list item test case because emitTextSelectionChange()
835         was not adjusting the offset for the RenderListMarker, the text of which is exposed
836         as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
837         updated accordingly.
838
839         No new tests are needed. The previously-failing test is now passing.
840
841         * editing/atk/FrameSelectionAtk.cpp:
842         (WebCore::emitTextSelectionChange):
843
844 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
845
846         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
847         https://bugs.webkit.org/show_bug.cgi?id=157447
848
849         Reviewed by Ryosuke Niwa.
850
851         HitTesting is intended to reach nodes inside shadow content. This property
852         on the HitTestRequest is intended to avoid hit testing in UserAgent shadow
853         content. Rename the enum value, and cascading methods for clarity.
854
855         * html/MediaElementSession.cpp:
856         (WebCore::isMainContent):
857         * page/EventHandler.cpp:
858         (WebCore::EventHandler::eventMayStartDrag):
859         (WebCore::EventHandler::updateSelectionForMouseDrag):
860         (WebCore::EventHandler::hitTestResultAtPoint):
861         (WebCore::EventHandler::handleMousePressEvent):
862         (WebCore::EventHandler::handleMouseDoubleClickEvent):
863         (WebCore::EventHandler::mouseMoved):
864         (WebCore::EventHandler::handleMouseMoveEvent):
865         (WebCore::EventHandler::handleMouseReleaseEvent):
866         (WebCore::EventHandler::handleMouseForceEvent):
867         (WebCore::EventHandler::updateDragAndDrop):
868         (WebCore::EventHandler::isInsideScrollbar):
869         (WebCore::EventHandler::sendContextMenuEvent):
870         (WebCore::EventHandler::sendContextMenuEventForKey):
871         (WebCore::EventHandler::hoverTimerFired):
872         (WebCore::EventHandler::dragSourceEndedAt):
873         (WebCore::EventHandler::handleDrag):
874         (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
875         * page/EventHandler.h:
876         * page/FocusController.cpp:
877         (WebCore::updateFocusCandidateIfNeeded):
878         * rendering/HitTestRequest.h:
879         (WebCore::HitTestRequest::HitTestRequest):
880         (WebCore::HitTestRequest::disallowsUserAgentShadowContent):
881         (WebCore::HitTestRequest::disallowsShadowContent): Deleted.
882         * rendering/HitTestResult.cpp:
883         (WebCore::HitTestResult::setToNonUserAgentShadowAncestor):
884         (WebCore::HitTestResult::addNodeToRectBasedTestResult):
885         (WebCore::HitTestResult::setToNonShadowAncestor): Deleted.
886         * rendering/HitTestResult.h:
887         * rendering/RenderEmbeddedObject.cpp:
888         (WebCore::RenderEmbeddedObject::isReplacementObscured):
889         * rendering/RenderLayer.cpp:
890         (WebCore::RenderLayer::calculateClipRects):
891         * rendering/svg/RenderSVGResourceClipper.cpp:
892         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
893         * testing/Internals.cpp:
894         (WebCore::Internals::nodesFromRect):
895
896 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
897
898         Web Inspector: Inspect Element and Element Selection searching should work with Shadow DOM Nodes
899         https://bugs.webkit.org/show_bug.cgi?id=157446
900         <rdar://problem/24688447>
901
902         Reviewed by Ryosuke Niwa.
903
904         * inspector/InspectorDOMAgent.cpp:
905         (WebCore::InspectorDOMAgent::innerParentNode):
906         The Inspector backend was informing the frontend that all ShadowRoots
907         were floating and had no parent. Get the host element for ShadowRoots.
908
909         * rendering/HitTestResult.cpp:
910         (WebCore::moveOutOfUserAgentShadowTree):
911         (WebCore::HitTestResult::setToNonShadowAncestor):
912         EventHandler::mouseMoved is calling setToNonShadowAncestor before
913         notifying Page::chrome / Inspector about the moused over element.
914         This should be the deepest non-user-agent-shadow node.
915
916 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
917
918         Web Inspector: Misc CommandLineAPI cleanup
919         https://bugs.webkit.org/show_bug.cgi?id=157450
920
921         Reviewed by Ryosuke Niwa.
922
923         * inspector/CommandLineAPIModuleSource.js:
924         (bind):
925
926 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
927
928         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
929         https://bugs.webkit.org/show_bug.cgi?id=157432
930         rdar://problem/16406720
931
932         Reviewed by Dean Jackson.
933
934         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
935
936         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
937         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
938         These two settings are shared with TEXT_AUTOSIZING.
939
940         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
941
942         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
943         without changes.
944
945         An implication of this set of changes is that the way clients enable text autosizing
946         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
947         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
948         on iPhone only, not iPad.
949
950         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
951         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
952
953         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
954         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
955         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
956
957         Test: fast/text-autosizing/ios/autosize-width.html
958
959         * Configurations/FeatureDefines.xcconfig:
960         * dom/Document.cpp:
961         (WebCore::Document::addAutoSizingNode):
962         * page/FrameView.cpp:
963         (WebCore::FrameView::layout):
964         * page/Settings.cpp:
965         (WebCore::Settings::Settings): Deleted.
966         (WebCore::Settings::setTextAutosizingEnabled): Deleted.
967         (WebCore::Settings::setTextAutosizingWindowSizeOverride): Deleted.
968         * page/Settings.h:
969         (WebCore::Settings::textAutosizingEnabled): Deleted.
970         (WebCore::Settings::textAutosizingWindowSizeOverride): Deleted.
971         * page/Settings.in:
972         * page/cocoa/SettingsCocoa.mm:
973         (WebCore::Settings::defaultMinimumZoomFontSize):
974         (WebCore::Settings::defaultTextAutosizingEnabled):
975         * platform/Logging.h:
976         * rendering/RenderBlockFlow.cpp:
977         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
978         * rendering/RenderElement.cpp:
979         (WebCore::includeNonFixedHeight):
980         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
981         (WebCore::RenderElement::resetTextAutosizing):
982         * rendering/RenderElement.h:
983         * rendering/RenderObject.cpp:
984         (WebCore::includeNonFixedHeight): Deleted.
985         (WebCore::RenderObject::adjustComputedFontSizesOnBlocks): Deleted.
986         (WebCore::RenderObject::resetTextAutosizing): Deleted.
987         * rendering/RenderObject.h:
988         * rendering/TextAutoSizing.cpp:
989         (WebCore::TextAutoSizingValue::adjustNodeSizes):
990         * testing/InternalSettings.cpp:
991         (WebCore::InternalSettings::Backup::Backup):
992         (WebCore::InternalSettings::Backup::restoreTo):
993         (WebCore::InternalSettings::setTextAutosizingEnabled):
994         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
995         * testing/InternalSettings.h:
996
997 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
998
999         Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope
1000         https://bugs.webkit.org/show_bug.cgi?id=150752
1001         <rdar://problem/23343385>
1002
1003         Reviewed by Mark Lam.
1004
1005         Test: inspector/runtime/evaluate-CommandLineAPI.html
1006
1007         * inspector/CommandLineAPIModuleSource.js:
1008         (bind):
1009         (this.member.toString):
1010         (CommandLineAPI):
1011         (CommandLineAPIImpl.prototype):
1012         (slice): Deleted.
1013         (bound): Deleted.
1014         (bound.toString): Deleted.
1015         (inScopeVariables): Deleted.
1016         (customToStringMethod): Deleted.
1017         Simplify now that we don't need to do our own variable shadow checking.
1018
1019 2016-05-06  Tim Horton  <timothy_horton@apple.com>
1020
1021         <attachment> element should understand UTIs
1022         https://bugs.webkit.org/show_bug.cgi?id=157425
1023         <rdar://problem/25585401>
1024
1025         Reviewed by Anders Carlsson.
1026
1027         UTIs are often much more specific than MIME types, so we should allow
1028         clients of <attachment> to use them to get more accurate icons.
1029
1030         Test: fast/attachment/attachment-uti.html
1031
1032         * platform/graphics/Icon.h:
1033         * platform/graphics/mac/IconMac.mm:
1034         (WebCore::Icon::createIconForMIMEType): Deleted.
1035         Remove the now-unused createIconForMIMEType.
1036
1037         * platform/network/mac/UTIUtilities.h:
1038         * platform/network/mac/UTIUtilities.mm:
1039         (WebCore::isDeclaredUTI):
1040         Expose UTTypeIsDeclared as isDeclaredUTI.
1041
1042         * rendering/RenderThemeIOS.mm:
1043         (WebCore::iconForAttachment):
1044         * rendering/RenderThemeMac.mm:
1045         (WebCore::iconForAttachment):
1046         If the attachment's type is a UTI, request the icon for it directly.
1047         If it's a MIME type, convert to a UTI before requesting.
1048
1049 2016-05-06  Chris Dumez  <cdumez@apple.com>
1050
1051         Clean up converting from JSValue to float / double in the bindings generator
1052         https://bugs.webkit.org/show_bug.cgi?id=157407
1053
1054         Reviewed by Darin Adler.
1055
1056         Clean up converting from JSValue to float / double in the bindings generator:
1057         - Handle all aspects of converting to float / double inside JSValueToNative()
1058           instead of relying partly on the call sites.
1059         - Add a build<>() template function to JSDOMBuild.h that is now
1060           called from the bindings to convert to float / double and deal with
1061           non-finite values.
1062         - Provide a better message with the TypeError that is thrown for non-finite
1063           values.
1064
1065         No new tests, rebaselined existing tests.
1066
1067         * bindings/js/JSDOMBinding.cpp:
1068         (WebCore::throwSequenceTypeError):
1069         (WebCore::throwNonFiniteTypeError):
1070         * bindings/js/JSDOMBinding.h:
1071         * bindings/js/JSDOMBuild.h:
1072         (WebCore::build):
1073         * bindings/scripts/CodeGenerator.pm:
1074         (IsFloatingPointType):
1075         * bindings/scripts/CodeGeneratorJS.pm:
1076         (JSValueToNative):
1077         (GenerateImplementation): Deleted.
1078         (GenerateParametersCheck): Deleted.
1079         (GenerateReturnParameters): Deleted.
1080         * bindings/scripts/test/JS/JSTestObj.cpp:
1081         (WebCore::setJSTestObjStrictFloat):
1082         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
1083         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
1084         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
1085         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1086         (WebCore::jsTestObjPrototypeFunctionAny):
1087         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1088         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1089         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1090         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1091
1092 2016-05-06  Dean Jackson  <dino@apple.com>
1093
1094         Regions, Shapes and Tracks don't need runtime features
1095         https://bugs.webkit.org/show_bug.cgi?id=157426
1096         <rdar://problem/26146262>
1097
1098         Reviewed by Simon Fraser.
1099
1100         The following RuntimeEnabledFeatures can be removed since
1101         we have no need to disable them (they are stable and have
1102         shipped for a while):
1103         - CSS Regions
1104         - CSS Shapes
1105         - Media tracks
1106
1107         * bindings/generic/RuntimeEnabledFeatures.cpp:
1108         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Deleted.
1109         * bindings/generic/RuntimeEnabledFeatures.h:
1110         (WebCore::RuntimeEnabledFeatures::setCSSShapesEnabled): Deleted.
1111         (WebCore::RuntimeEnabledFeatures::cssShapesEnabled): Deleted.
1112         (WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled): Deleted.
1113         (WebCore::RuntimeEnabledFeatures::cssRegionsEnabled): Deleted.
1114         (WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled): Deleted.
1115         (WebCore::RuntimeEnabledFeatures::cssCompositingEnabled): Deleted.
1116         (WebCore::RuntimeEnabledFeatures::webkitVideoTrackEnabled): Deleted.
1117         (WebCore::RuntimeEnabledFeatures::setWebkitVideoTrackEnabled): Deleted.
1118         * css/CSSParser.cpp:
1119         (WebCore::isSimpleLengthPropertyID):
1120         (WebCore::isValidKeywordPropertyAndValue):
1121         (WebCore::CSSParser::parseValue):
1122         (WebCore::CSSParser::parseFillProperty):
1123         (WebCore::CSSParser::createRegionRule):
1124         (WebCore::CSSParserContext::CSSParserContext): Deleted.
1125         (WebCore::operator==): Deleted.
1126         (WebCore::CSSParser::parseShapeProperty): Deleted.
1127         (WebCore::CSSParser::cssRegionsEnabled): Deleted.
1128         (WebCore::CSSParser::cssCompositingEnabled): Deleted.
1129         (WebCore::CSSParser::parseFlowThread): Deleted.
1130         (WebCore::CSSParser::parseRegionThread): Deleted.
1131         * css/CSSParser.h:
1132         * css/CSSParserMode.h:
1133         * dom/Document.cpp:
1134         (WebCore::Document::webkitGetNamedFlows):
1135         (WebCore::Document::cssRegionsEnabled): Deleted.
1136         (WebCore::Document::cssCompositingEnabled): Deleted.
1137         * dom/Document.h:
1138         * dom/Element.cpp:
1139         (WebCore::Element::unregisterNamedFlowContentElement):
1140         (WebCore::Element::webkitRegionOverset):
1141         (WebCore::Element::webkitGetRegionFlowRanges): Deleted.
1142         * html/HTMLMediaElement.cpp:
1143         (WebCore::HTMLMediaElement::scheduleDelayedAction):
1144         (WebCore::HTMLMediaElement::pendingActionTimerFired):
1145         (WebCore::HTMLMediaElement::prepareForLoad):
1146         (WebCore::HTMLMediaElement::loadInternal):
1147         (WebCore::HTMLMediaElement::setReadyState):
1148         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
1149         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1150         (WebCore::HTMLMediaElement::userCancelledLoad):
1151         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
1152         (WebCore::HTMLMediaElement::hasClosedCaptions):
1153         (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
1154         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
1155         (WebCore::HTMLMediaElement::finishParsingChildren): Deleted.
1156         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Deleted.
1157         (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Deleted.
1158         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Deleted.
1159         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Deleted.
1160         (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Deleted.
1161         (WebCore::HTMLMediaElement::addAudioTrack): Deleted.
1162         (WebCore::HTMLMediaElement::addTextTrack): Deleted.
1163         (WebCore::HTMLMediaElement::addVideoTrack): Deleted.
1164         (WebCore::HTMLMediaElement::removeAudioTrack): Deleted.
1165         (WebCore::HTMLMediaElement::removeTextTrack): Deleted.
1166         (WebCore::HTMLMediaElement::removeVideoTrack): Deleted.
1167         (WebCore::HTMLMediaElement::audioTracks): Deleted.
1168         (WebCore::HTMLMediaElement::textTracks): Deleted.
1169         (WebCore::HTMLMediaElement::videoTracks): Deleted.
1170         (WebCore::HTMLMediaElement::didAddTextTrack): Deleted.
1171         (WebCore::HTMLMediaElement::didRemoveTextTrack): Deleted.
1172         * html/HTMLTrackElement.cpp:
1173         (WebCore::HTMLTrackElement::parseAttribute):
1174         (WebCore::HTMLTrackElement::scheduleLoad): Deleted.
1175         (WebCore::HTMLTrackElement::canLoadURL): Deleted.
1176         * rendering/RenderBlockFlow.cpp:
1177         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
1178         * testing/InternalSettings.cpp:
1179         (WebCore::InternalSettings::Backup::Backup):
1180         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
1181         (WebCore::InternalSettings::setCSSShapesEnabled): Deleted.
1182         * testing/InternalSettings.h:
1183         * testing/InternalSettings.idl:
1184
1185 2016-05-06  Brady Eidson  <beidson@apple.com>
1186
1187         Modern IDB (Workers): Start running a lot of the workers tests.
1188         https://bugs.webkit.org/show_bug.cgi?id=157424
1189
1190         Reviewed by Sam Weinig.
1191
1192         No new tests (Covered by enabling a whole bunch of existing tests).
1193
1194         * Modules/indexeddb/IDBDatabase.cpp:
1195         (WebCore::IDBDatabase::stop): Call removeAllEventListeners() to clean up the Worker VM
1196           before it shuts down.
1197
1198         * Modules/indexeddb/IDBRequest.cpp:
1199         (WebCore::IDBRequest::stop): Call removeAllEventListeners()
1200
1201         * Modules/indexeddb/IDBTransaction.cpp:
1202         (WebCore::IDBTransaction::IDBTransaction): Initialize with the correct VM.
1203         (WebCore::IDBTransaction::stop): Call removeAllEventListeners()
1204         (WebCore::IDBTransaction::operationDidComplete):
1205
1206         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1207         (WebCore::IDBClient::IDBConnectionProxy::takeIDBOpenDBRequest):
1208         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): Don't take the request from
1209           the map, but rather let the request take itself from its appropriate thread.
1210         * Modules/indexeddb/client/IDBConnectionProxy.h:
1211
1212         * Modules/indexeddb/client/TransactionOperation.h:
1213         (WebCore::IDBClient::TransactionOperation::completed): Rework clearing out the completion 
1214           handler, as the handler itself might hold the last reference to `this`.
1215
1216         * page/SecurityOrigin.h:
1217         (WebCore::SecurityOrigin::hasUniversalAccess):
1218
1219         * workers/WorkerGlobalScope.cpp:
1220         (WebCore::WorkerGlobalScope::WorkerGlobalScope): If the parent context's SecurityOrigin had
1221           universal access, grant it to this one.
1222
1223 2016-05-06  Ryosuke Niwa  <rniwa@webkit.org>
1224
1225         FKA: No way to get focus from DOM to shadow DOM components (Was: HTML5 media controls not keyboard accessible)
1226         https://bugs.webkit.org/show_bug.cgi?id=117857
1227
1228         Reviewed by Jer Noble.
1229
1230         The bug was caused by hasCustomFocusLogic returning true on media elements.
1231
1232         Fix the bug by removing this function so that FocusController will walk into the shadow tree of media elements
1233         to look for focusable elements. This will allow AT such as Voice Over to iterate through controls.
1234
1235         We don't seem to draw focus rings inside the media elements but that could be tweaked in a separate patch.
1236
1237         Test: media/tab-focus-inside-media-elements.html
1238
1239         * html/HTMLMediaElement.cpp:
1240         (WebCore::HTMLMediaElement::hasCustomFocusLogic): Deleted.
1241         * html/HTMLMediaElement.h:
1242
1243 2016-05-06  Anders Carlsson  <andersca@apple.com>
1244
1245         Tidy up the LinkRelAttribute code
1246         https://bugs.webkit.org/show_bug.cgi?id=157429
1247
1248         Reviewed by Sam Weinig.
1249
1250         Get rid of IconURL.h and move the IconType enumeration inside LinkRelAttribute.
1251         Remove the InvalidIcon enum declaration and use WTF::Optional instead.
1252
1253         * WebCore.xcodeproj/project.pbxproj:
1254         * dom/IconURL.h: Removed.
1255         * html/HTMLLinkElement.cpp:
1256         (WebCore::HTMLLinkElement::iconType):
1257         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
1258         * html/HTMLLinkElement.h:
1259         * html/LinkRelAttribute.cpp:
1260         (WebCore::LinkRelAttribute::LinkRelAttribute):
1261         * html/LinkRelAttribute.h:
1262         * html/parser/HTMLPreloadScanner.cpp:
1263         (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
1264         * loader/FrameLoader.h:
1265         * loader/FrameLoaderClient.h:
1266         * loader/icon/IconController.cpp:
1267         (WebCore::iconFromLinkElements):
1268
1269 2016-05-06  Jer Noble  <jer.noble@apple.com>
1270
1271         Muted media elements should be allowed to autoplay, even if RequireUserGestureForAudioRateChange is set.
1272         https://bugs.webkit.org/show_bug.cgi?id=157404
1273         <rdar://problem/26016802>
1274
1275         Reviewed by Eric Carlson.
1276
1277         Test: media/audio-playback-restriction-play-muted.html
1278
1279         Add element.muted() as a critera of whether playback is permitted when
1280         RequireUserGestureForAudioRateChange is set. Also, make sure to re-evaluate whether the
1281         element should be playing when muted is changed without a user gesture.
1282
1283         * html/HTMLMediaElement.cpp:
1284         (WebCore::HTMLMediaElement::setMuted):
1285         * html/MediaElementSession.cpp:
1286         (WebCore::MediaElementSession::playbackPermitted):
1287
1288 2016-05-06  Brent Fulgham  <bfulgham@apple.com>
1289
1290         Don't use invalidated ResourceLoadStatistics iterators
1291         https://bugs.webkit.org/show_bug.cgi?id=157412
1292         <rdar://problem/26133153>
1293
1294         Reviewed by Chris Dumez.
1295
1296         ResourceLoadObserver::logFrameNavigation was using references bound to the 'value'
1297         member of iterators from the ResourceLoadStatistics HashMap. When new entries were
1298         added, these iterators were invalidated causing the references to refer to invalid
1299         memory.
1300
1301         Renamed 'resourceStatisticsForPrimaryDomain' to 'ensureResourceStatisticsForPrimaryDomain'
1302         to clarify that it may mutate the underlying HashMap, thereby invalidating any
1303         existing iterators.
1304
1305         * loader/ResourceLoadObserver.cpp:
1306         (WebCore::ResourceLoadObserver::logFrameNavigation): Protect against HashMap
1307         elements being copied/moved when new intries are added.
1308         * loader/ResourceLoadStatisticsStore.cpp:
1309         (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Added.
1310         * loader/ResourceLoadStatisticsStore.h:
1311
1312 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
1313
1314         [css-grid] Unprefix CSS Grid Layout properties
1315         https://bugs.webkit.org/show_bug.cgi?id=157137
1316
1317         Reviewed by Simon Fraser.
1318
1319         Remove "-webkit" prefix from all the grid layout properties,
1320         including the display value.
1321         Update the source code to remove the prefix where it was used too.
1322
1323         * css/CSSComputedStyleDeclaration.cpp:
1324         (WebCore::isLayoutDependent):
1325         (WebCore::ComputedStyleExtractor::propertyValue):
1326         * css/CSSParser.cpp:
1327         (WebCore::isSimpleLengthPropertyID):
1328         (WebCore::isValidKeywordPropertyAndValue):
1329         (WebCore::CSSParser::parseValue):
1330         (WebCore::CSSParser::parseGridGapShorthand):
1331         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
1332         (WebCore::CSSParser::parseGridTemplateShorthand):
1333         (WebCore::CSSParser::parseGridShorthand):
1334         (WebCore::CSSParser::parseGridAreaShorthand):
1335         * css/CSSPrimitiveValueMappings.h:
1336         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1337         * css/CSSPropertyNames.in:
1338         * css/CSSValueKeywords.in:
1339         * css/StyleBuilderCustom.h:
1340         (WebCore::StyleBuilderCustom::applyInitialGridTemplateAreas):
1341         (WebCore::StyleBuilderCustom::applyInheritGridTemplateAreas):
1342         (WebCore::StyleBuilderCustom::applyValueGridTemplateAreas):
1343         (WebCore::StyleBuilderCustom::applyInitialGridTemplateColumns):
1344         (WebCore::StyleBuilderCustom::applyInheritGridTemplateColumns):
1345         (WebCore::StyleBuilderCustom::applyValueGridTemplateColumns):
1346         (WebCore::StyleBuilderCustom::applyInitialGridTemplateRows):
1347         (WebCore::StyleBuilderCustom::applyInheritGridTemplateRows):
1348         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
1349         * css/StyleProperties.cpp:
1350         (WebCore::StyleProperties::getPropertyValue):
1351
1352 2016-05-06  Nan Wang  <n_wang@apple.com>
1353
1354         AX: <attachment> element should have a replacement character
1355         https://bugs.webkit.org/show_bug.cgi?id=157406
1356
1357         Reviewed by Chris Fleizach.
1358
1359         Make sure attachment element is considered as a replaced node.
1360
1361         Test: accessibility/mac/attachment-element-replacement-character.html
1362
1363         * editing/TextIterator.cpp:
1364         (WebCore::isRendererReplacedElement):
1365
1366 2016-05-06  Nan Wang  <n_wang@apple.com>
1367
1368         AX: String for document range is empty if end visible position anchors to a ignored replaced node
1369         https://bugs.webkit.org/show_bug.cgi?id=157403
1370
1371         Reviewed by Chris Fleizach.
1372
1373         The CharacterOffset that is converted from VisiblePositon is wrong when the VisiblePostion anchors
1374         to an ignored replaced node. Fixed it by adjusting the offset of the CharacterOffset correctly in 
1375         such case.
1376
1377         Test: accessibility/mac/text-marker-string-for-document-end-replaced-node.html
1378
1379         * accessibility/AXObjectCache.cpp:
1380         (WebCore::characterOffsetsInOrder):
1381         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
1382         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
1383
1384 2016-05-05  David Kilzer  <ddkilzer@apple.com>
1385
1386         [iOS] WebCore does not need to link to CoreAudio, GraphicsServices, SystemConfiguration frameworks
1387         <https://webkit.org/b/157413>
1388         <rdar://problem/26104189>
1389
1390         Reviewed by Gavin Barraclough.
1391
1392         * Configurations/WebCore.xcconfig:
1393         (OTHER_LDFLAGS_BASE_ios): Remove "-framework GraphicsServices".
1394         (OTHER_LDFLAGS_PLATFORM[sdk=macosx*]): Add "-framework CoreAudio"
1395         and "-framework SystemConfiguration".
1396         * WebCore.xcodeproj/project.pbxproj: Remove CoreAudio.framework
1397         and SystemConfiguration.framework from the project file.
1398
1399 2016-05-05  Brady Eidson  <beidson@apple.com>
1400
1401         Modern IDB (Workers): Get everything to the right threads.
1402         https://bugs.webkit.org/show_bug.cgi?id=157398
1403
1404         Reviewed by Alex Christensen.
1405
1406         No new tests (No current change in behavior, will be tested as bug 149953 is resolved, enabling IDB in workers).
1407
1408         * dom/ScriptExecutionContext.h:
1409         (WebCore::ScriptExecutionContext::postCrossThreadTask): Add a helper to post a CrossThreadTask to a context.
1410                 
1411         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1412         (WebCore::IDBClient::performCallbackOnCorrectThread): Helper to perform an IDB callback on either the main thread
1413           or Worker thread as necessary.
1414         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
1415         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
1416         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
1417         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
1418         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
1419         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
1420         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
1421         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
1422         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
1423         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
1424         (WebCore::IDBClient::IDBConnectionProxy::getCount):
1425         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
1426         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
1427         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
1428         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
1429         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
1430         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
1431         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
1432         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
1433         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
1434         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
1435         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
1436         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
1437         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
1438         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
1439         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
1440         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
1441         (WebCore::IDBClient::IDBConnectionProxy::scheduleMainThreadTasks):
1442         (WebCore::IDBClient::IDBConnectionProxy::handleMainThreadTasks):
1443         * Modules/indexeddb/client/IDBConnectionProxy.h:
1444         (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread): Helper to marshall IDB operations from the
1445           Worker thread to the main thread.
1446         (WebCore::IDBClient::IDBConnectionProxy::postMainThreadTask):
1447
1448         * Modules/indexeddb/IDBTransaction.cpp:
1449         (WebCore::IDBTransaction::originThreadID):
1450         * Modules/indexeddb/IDBTransaction.h:
1451         
1452         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1453         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
1454         * Modules/indexeddb/client/IDBConnectionToServer.h:
1455
1456         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1457
1458         * Modules/indexeddb/client/TransactionOperation.cpp:
1459         (WebCore::IDBClient::TransactionOperation::scriptExecutionContext):
1460         * Modules/indexeddb/client/TransactionOperation.h:
1461
1462         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1463         (WebCore::nextClientResourceNumber):
1464
1465         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1466         (WebCore::InProcessIDBServer::putOrAdd):
1467         * Modules/indexeddb/shared/InProcessIDBServer.h:
1468
1469 2016-05-05  Dean Jackson  <dino@apple.com>
1470
1471         4 and 8 digit color attributes should use the crazypants algorithm, not the CSS one.
1472         https://bugs.webkit.org/show_bug.cgi?id=157402
1473         <rdar://problem/26131142>
1474
1475         Reviewed by Simon Fraser.
1476
1477         Noel and Tab from Google alerted me to the fact I broke some legacy
1478         HTML color attributes when I added support for 4 and 8 digit hex colors
1479         in CSS. The fix is to favor the "crazy" parsing unless we know it is a 3 or 6
1480         digit hex value (in which case we try the CSS algorithm first).
1481
1482         Covered by reverting an existing test.
1483
1484         * html/HTMLElement.cpp:
1485         (WebCore::HTMLElement::addHTMLColorToStyle):
1486
1487 2016-05-05  Brady Eidson  <beidson@apple.com>
1488
1489         Modern IDB (Workers): Remove the need for IDBConnectionProxy to expose its IDBConnectionToServer.
1490         https://bugs.webkit.org/show_bug.cgi?id=157394
1491
1492         Reviewed by Alex Christensen.
1493
1494         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
1495
1496         * Modules/indexeddb/IDBDatabase.cpp:
1497         (WebCore::IDBDatabase::transaction):
1498         (WebCore::IDBDatabase::fireVersionChangeEvent):
1499         (WebCore::IDBDatabase::dispatchEvent):
1500         * Modules/indexeddb/IDBDatabase.h:
1501         (WebCore::IDBDatabase::serverConnection): Deleted.
1502
1503         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1504         (WebCore::IDBOpenDBRequest::requestCompleted):
1505
1506         * Modules/indexeddb/IDBRequest.cpp:
1507         (WebCore::IDBRequest::IDBRequest):
1508
1509         * Modules/indexeddb/IDBTransaction.cpp:
1510         (WebCore::IDBTransaction::connectionProxy):
1511         (WebCore::IDBTransaction::serverConnection): Deleted.
1512         * Modules/indexeddb/IDBTransaction.h:
1513
1514         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1515         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
1516         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer): Deleted.
1517         * Modules/indexeddb/client/IDBConnectionProxy.h:
1518
1519         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1520         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
1521
1522         * Modules/indexeddb/client/TransactionOperation.h:
1523         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
1524
1525         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1526         (WebCore::IDBCursorInfo::IDBCursorInfo):
1527
1528         * Modules/indexeddb/shared/IDBRequestData.cpp:
1529         (WebCore::IDBRequestData::IDBRequestData):
1530
1531         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1532         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
1533         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
1534
1535         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1536         (WebCore::IDBTransactionInfo::clientTransaction):
1537         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1538
1539 2016-05-05  Commit Queue  <commit-queue@webkit.org>
1540
1541         Unreviewed, rolling out r200479.
1542         https://bugs.webkit.org/show_bug.cgi?id=157397
1543
1544         A LayoutTest added with this change is crashing on Mac WK1
1545         test runs. (Requested by ryanhaddad on #webkit).
1546
1547         Reverted changeset:
1548
1549         "For keyboard users, activating a fragment URL should transfer
1550         focus and caret to the destination"
1551         https://bugs.webkit.org/show_bug.cgi?id=116046
1552         http://trac.webkit.org/changeset/200479
1553
1554 2016-05-05  Chris Dumez  <cdumez@apple.com>
1555
1556         CORS check is sometimes incorrectly failing for media loads
1557         https://bugs.webkit.org/show_bug.cgi?id=157370
1558         <rdar://problem/26071607>
1559
1560         Reviewed by Alex Christensen.
1561
1562         When the media library is issuing a conditional request for a media
1563         element that had the 'crossorigin' attribute, we would fail the CORS
1564         check and log an error if the server were to respond with a "304 Not
1565         Modified" response because the 304 response usually does not have
1566         the necessary "Access-Control-Allow-Origin: *" header (At least for
1567         Apache) and we cannot use the cached headers either since WebKit
1568         does not have them.
1569
1570         To work around the problem in the short term, we now drop the
1571         conditional headers from the request that the media library is
1572         giving us when the media element has the 'crossorigin' attribute
1573         set. As a result, the server will never respond with a 304 and we
1574         will be able to do a CORS check on the full (e.g. 206) response.
1575
1576         In the long term, we need to deal with this better as this means
1577         we may sometimes fail to reuse cached data. For now, this is only
1578         potentially inefficient in the cases that were broken (i.e. no
1579         video would play and we would log an error in the console).
1580
1581         Test: http/tests/security/video-cross-origin-caching.html
1582
1583         * loader/MediaResourceLoader.cpp:
1584         (WebCore::MediaResourceLoader::requestResource):
1585         Make the request unconditional if the media element has the
1586         'crossorigin' attribute set.
1587
1588         * platform/network/ResourceRequestBase.cpp:
1589         (WebCore::ResourceRequestBase::isConditional):
1590         (WebCore::ResourceRequestBase::makeUnconditional):
1591         When fixing the bug above, I noticed that those method do not do
1592         the right thing if the m_httpHeaderFields data member has not
1593         been populated yet. m_httpHeaderFields is lazily initialized so
1594         we need to call updateResourceRequest() before using it.
1595
1596 2016-05-05  Zalan Bujtas  <zalan@apple.com>
1597
1598         Stop traversing at the container block when computing RTL inline static distance.
1599         https://bugs.webkit.org/show_bug.cgi?id=157349
1600         <rdar://problem/25994087>
1601
1602         Reviewed by David Hyatt.
1603
1604         When computing the inline static distance for a child renderer, we start at its enclosing box
1605         and traverse up all the way to the container block.
1606         However when the enclosing box is the ancestor of the container block, we
1607         should just bail out right away since there's no container to use to adjust the position.
1608
1609         Test: fast/multicol/positioned-rtl-column-crash.html
1610
1611         * rendering/RenderBox.cpp:
1612         (WebCore::computeInlineStaticDistance):
1613
1614 2016-05-05  Ada Chan  <adachan@apple.com>
1615
1616         Add WebKitAdditions extension points in media controls related code in RenderThemeMac
1617         https://bugs.webkit.org/show_bug.cgi?id=157390
1618
1619         Reviewed by Anders Carlsson.
1620
1621         * rendering/RenderThemeMac.mm:
1622         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
1623         (WebCore::RenderThemeMac::mediaControlsScript):
1624
1625 2016-05-05  Jer Noble  <jer.noble@apple.com>
1626
1627         [WK2] Media controls don't update if controller is created after the interface is created
1628         https://bugs.webkit.org/show_bug.cgi?id=157376
1629
1630         Reviewed by Beth Dakin.
1631
1632         Add getter methods to WebPlaybackSessionModel so that the model's values can be retrieved
1633         if those values were missed before the equivalent WebPlaybackSessionInterface methods were
1634         called. This necessatates a bunch of changes in HTMLMediaElement and related classes to
1635         change PassRefPtr<TimeRanges> types to Ref<TimeRanges> (and one change in TimeRanges itself).
1636         WebPlaybackSessionModelMediaElement can implement these new getter methods by querying the
1637         values from the HTMLMediaElement, something it was doing already, so most of those changes
1638         are simple refactoring.
1639
1640         There's no reason any longer for WebVideoFullscreenModel to inherit from WebPlaybackSessionModel,
1641         so remove that superclass.
1642
1643         In WebPlaybackSessionInterfaceMac, when a new WebPlaybackControlsManager is set, use the new
1644         getter methods on WebPlaybackSessionModel to update the values in the manager.
1645
1646         * html/HTMLMediaElement.cpp:
1647         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
1648         (WebCore::HTMLMediaElement::maxBufferedTime):
1649         (WebCore::HTMLMediaElement::played):
1650         (WebCore::HTMLMediaElement::buffered): Deleted.
1651         (WebCore::HTMLMediaElement::seekable): Deleted.
1652         * html/HTMLMediaElement.h:
1653         * html/MediaController.cpp:
1654         (MediaController::buffered):
1655         (MediaController::seekable):
1656         (MediaController::played):
1657         * html/MediaController.h:
1658         * html/MediaControllerInterface.h:
1659         * html/TimeRanges.cpp:
1660         (WebCore::TimeRanges::copy):
1661         * html/TimeRanges.h:
1662         * platform/cocoa/WebPlaybackSessionModel.h:
1663         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1664         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1665         (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
1666         (WebPlaybackSessionModelMediaElement::updateForEventName):
1667         (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
1668         (WebPlaybackSessionModelMediaElement::observedEventNames):
1669         (WebPlaybackSessionModelMediaElement::eventNameAll):
1670         (WebPlaybackSessionModelMediaElement::duration):
1671         (WebPlaybackSessionModelMediaElement::currentTime):
1672         (WebPlaybackSessionModelMediaElement::bufferedTime):
1673         (WebPlaybackSessionModelMediaElement::isPlaying):
1674         (WebPlaybackSessionModelMediaElement::playbackRate):
1675         (WebPlaybackSessionModelMediaElement::seekableRanges):
1676         (WebPlaybackSessionModelMediaElement::canPlayFastReverse):
1677         (WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
1678         (WebPlaybackSessionModelMediaElement::audioMediaSelectedIndex):
1679         (WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions):
1680         (WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex):
1681         (WebPlaybackSessionModelMediaElement::externalPlaybackEnabled):
1682         (WebPlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled):
1683         * platform/cocoa/WebVideoFullscreenModel.h:
1684         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
1685         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
1686         (WebVideoFullscreenModelVideoElement::requestFullscreenMode): Deleted.
1687         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
1688         (WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
1689         (WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
1690         (WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
1691         (WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
1692         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
1693         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1694         (WebVideoFullscreenControllerContext::play): Deleted.
1695         (WebVideoFullscreenControllerContext::pause): Deleted.
1696         (WebVideoFullscreenControllerContext::togglePlayState): Deleted.
1697         (WebVideoFullscreenControllerContext::beginScrubbing): Deleted.
1698         (WebVideoFullscreenControllerContext::endScrubbing): Deleted.
1699         (WebVideoFullscreenControllerContext::seekToTime): Deleted.
1700         (WebVideoFullscreenControllerContext::fastSeek): Deleted.
1701         (WebVideoFullscreenControllerContext::beginScanningForward): Deleted.
1702         (WebVideoFullscreenControllerContext::beginScanningBackward): Deleted.
1703         (WebVideoFullscreenControllerContext::endScanning): Deleted.
1704         (WebVideoFullscreenControllerContext::selectAudioMediaOption): Deleted.
1705         (WebVideoFullscreenControllerContext::selectLegibleMediaOption): Deleted.
1706         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1707         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1708         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
1709         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1710         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1711         (WebCore::timeRangesToArray):
1712         (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
1713         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
1714         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1715
1716 2016-05-05  Brady Eidson  <beidson@apple.com>
1717
1718         Modern IDB (Workers): Move TransactionOperation management from IDBConnectionToServer to IDBConnectionProxy.
1719         https://bugs.webkit.org/show_bug.cgi?id=157392
1720
1721         Reviewed by Alex Christensen.
1722
1723         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
1724
1725         Set up TransactionOperations on the IDBConnectionProxy instead of the IDBConnectionToServer:
1726         * Modules/indexeddb/IDBTransaction.cpp:
1727         (WebCore::IDBTransaction::createObjectStoreOnServer):
1728         (WebCore::IDBTransaction::createIndexOnServer):
1729         (WebCore::IDBTransaction::openCursorOnServer):
1730         (WebCore::IDBTransaction::iterateCursorOnServer):
1731         (WebCore::IDBTransaction::getRecordOnServer):
1732         (WebCore::IDBTransaction::getCountOnServer):
1733         (WebCore::IDBTransaction::deleteRecordOnServer):
1734         (WebCore::IDBTransaction::clearObjectStoreOnServer):
1735         (WebCore::IDBTransaction::putOrAddOnServer):
1736         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
1737         (WebCore::IDBTransaction::deleteIndexOnServer):
1738         
1739         IDBConnectionProxy is now the owner of dispatched TransactionOperations:
1740         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1741         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
1742         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
1743         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
1744         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
1745         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
1746         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
1747         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
1748         (WebCore::IDBClient::IDBConnectionProxy::getCount):
1749         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
1750         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
1751         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
1752         (WebCore::IDBClient::IDBConnectionProxy::saveOperation):
1753         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
1754         * Modules/indexeddb/client/IDBConnectionProxy.h:
1755         
1756         Proxy this in-and-out calls to the ConnectionProxy:
1757         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1758         (WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
1759         (WebCore::IDBClient::IDBConnectionToServer::didCreateObjectStore):
1760         (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
1761         (WebCore::IDBClient::IDBConnectionToServer::didDeleteObjectStore):
1762         (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
1763         (WebCore::IDBClient::IDBConnectionToServer::didClearObjectStore):
1764         (WebCore::IDBClient::IDBConnectionToServer::createIndex):
1765         (WebCore::IDBClient::IDBConnectionToServer::didCreateIndex):
1766         (WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
1767         (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex):
1768         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
1769         (WebCore::IDBClient::IDBConnectionToServer::didPutOrAdd):
1770         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
1771         (WebCore::IDBClient::IDBConnectionToServer::didGetRecord):
1772         (WebCore::IDBClient::IDBConnectionToServer::getCount):
1773         (WebCore::IDBClient::IDBConnectionToServer::didGetCount):
1774         (WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
1775         (WebCore::IDBClient::IDBConnectionToServer::didDeleteRecord):
1776         (WebCore::IDBClient::IDBConnectionToServer::openCursor):
1777         (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
1778         (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
1779         (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
1780         (WebCore::IDBClient::IDBConnectionToServer::saveOperation): Deleted.
1781         (WebCore::IDBClient::IDBConnectionToServer::completeOperation): Deleted.
1782         * Modules/indexeddb/client/IDBConnectionToServer.h:
1783
1784         - Give TransactionOperation a ThreadIdentifier member
1785         - Privatize most public methods from TransactionOperation
1786         - Make IDBRequestData a friend so it can get at the private methods
1787         * Modules/indexeddb/client/TransactionOperation.h:
1788         (WebCore::IDBClient::TransactionOperation::~TransactionOperation):
1789         (WebCore::IDBClient::TransactionOperation::perform):
1790         (WebCore::IDBClient::TransactionOperation::completed):
1791         (WebCore::IDBClient::TransactionOperation::originThreadID):
1792         (WebCore::IDBClient::TransactionOperation::transactionIdentifier):
1793         (WebCore::IDBClient::TransactionOperation::objectStoreIdentifier):
1794         (WebCore::IDBClient::TransactionOperation::indexIdentifier):
1795         (WebCore::IDBClient::TransactionOperation::cursorIdentifier):
1796         (WebCore::IDBClient::TransactionOperation::transaction):
1797         (WebCore::IDBClient::TransactionOperation::indexRecordType):
1798
1799 2016-05-05  Zalan Bujtas  <zalan@apple.com>
1800
1801         Do not attempt to compute min/max width.
1802         https://bugs.webkit.org/show_bug.cgi?id=157320
1803
1804         Reviewed by David Hyatt.
1805
1806         Replaced elements with no intrinsic size (only with ratio) should not call the containing
1807         block to compute the min/max width when the containing block's min/max width
1808         depends on the children's intrinsic size. It could lead to infinite recursion.
1809
1810         Test: fast/replaced/before-content-intrinsic-crash.html
1811
1812         * rendering/RenderBox.cpp:
1813         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth): Unrelated code change.
1814         * rendering/RenderImage.cpp: Unrelated code change.
1815         (WebCore::RenderImage::RenderImage): Deleted.
1816         * rendering/RenderImage.h:
1817         * rendering/RenderReplaced.cpp:
1818         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
1819
1820 2016-05-04  Brady Eidson  <beidson@apple.com>
1821
1822         Modern IDB: Move all IDB DOM object management from IDBConnectionToServer to IDBConnectionProxy.
1823         https://bugs.webkit.org/show_bug.cgi?id=157348
1824
1825         Reviewed by Alex Christensen.
1826
1827         No new tests (Refactor, no change in behavior yet).
1828
1829         This is in-progress IDB-in-Workers code that is isolated enough to land right now.
1830         
1831         The goal is to have IDBConnectionToServer be a main-thread-only object, leaving IDBConnectionProxy
1832         as the threading bridge between the worker thread and the main thread.
1833         
1834         As such, IDBConnectionToServer no longer maintains maps of IDB DOM objects, but instead the proxy
1835         does and guards that access with locks.
1836         
1837         No threading changes takes place in this patch but it does scatter some isMainThread() checks and FIXMEs 
1838         accurately representing where threading changes will take place once I can return to this.
1839         
1840         * Modules/indexeddb/IDBDatabase.cpp:
1841         (WebCore::IDBDatabase::IDBDatabase):
1842         (WebCore::IDBDatabase::~IDBDatabase):
1843         (WebCore::IDBDatabase::maybeCloseInServer):
1844
1845         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1846         (WebCore::IDBOpenDBRequest::dispatchEvent):
1847
1848         * Modules/indexeddb/IDBTransaction.cpp:
1849         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
1850         (WebCore::IDBTransaction::commitOnServer):
1851         (WebCore::IDBTransaction::establishOnServer):
1852
1853         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1854         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
1855         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
1856         (WebCore::IDBClient::IDBConnectionProxy::didOpenDatabase):
1857         (WebCore::IDBClient::IDBConnectionProxy::didDeleteDatabase):
1858         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
1859         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
1860         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
1861         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
1862         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
1863         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
1864         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
1865         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
1866         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
1867         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
1868         (WebCore::IDBClient::IDBConnectionProxy::hasRecordOfTransaction):
1869         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
1870         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
1871         (WebCore::IDBClient::IDBConnectionProxy::registerDatabaseConnection):
1872         (WebCore::IDBClient::IDBConnectionProxy::unregisterDatabaseConnection):
1873         * Modules/indexeddb/client/IDBConnectionProxy.h:
1874         
1875         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1876         (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
1877         (WebCore::IDBClient::IDBConnectionToServer::didDeleteDatabase):
1878         (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
1879         (WebCore::IDBClient::IDBConnectionToServer::didOpenDatabase):
1880         (WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
1881         (WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
1882         (WebCore::IDBClient::IDBConnectionToServer::didCommitTransaction):
1883         (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
1884         (WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
1885         (WebCore::IDBClient::IDBConnectionToServer::didAbortTransaction):
1886         (WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
1887         (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
1888         (WebCore::IDBClient::IDBConnectionToServer::didStartTransaction):
1889         (WebCore::IDBClient::IDBConnectionToServer::notifyOpenDBRequestBlocked):
1890         (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
1891         (WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection): Deleted.
1892         (WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection): Deleted.
1893         (WebCore::IDBClient::IDBConnectionToServer::hasRecordOfTransaction): Deleted.
1894         * Modules/indexeddb/client/IDBConnectionToServer.h:
1895         
1896         * Modules/indexeddb/shared/IDBRequestData.cpp:
1897         (WebCore::IDBRequestData::IDBRequestData):
1898         * Modules/indexeddb/shared/IDBRequestData.h:
1899         
1900         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1901         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
1902         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
1903
1904 2016-05-04  Brady Eidson  <beidson@apple.com>
1905
1906         Modern IDB: Add isolatedCopy to a few more objects.
1907         https://bugs.webkit.org/show_bug.cgi?id=157330
1908
1909         Reviewed by Alex Christensen.
1910
1911         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
1912
1913         * Modules/indexeddb/shared/IDBRequestData.cpp:
1914         (WebCore::IDBRequestData::IDBRequestData):
1915         (WebCore::IDBRequestData::isolatedCopy):
1916         * Modules/indexeddb/shared/IDBRequestData.h:
1917
1918         * Modules/indexeddb/shared/IDBResultData.cpp:
1919         (WebCore::IDBResultData::IDBResultData):
1920         (WebCore::IDBResultData::isolatedCopy):
1921         * Modules/indexeddb/shared/IDBResultData.h:
1922
1923 2016-05-04  Brady Eidson  <beidson@apple.com>
1924
1925         Modern IDB: Add thread identifiers and assertions to IDB DOM objects.
1926         https://bugs.webkit.org/show_bug.cgi?id=157329
1927
1928         Reviewed by Alex Christensen.
1929
1930         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
1931
1932         * Modules/indexeddb/IDBCursor.cpp:
1933         (WebCore::IDBCursor::IDBCursor):
1934         (WebCore::IDBCursor::~IDBCursor):
1935         (WebCore::IDBCursor::sourcesDeleted):
1936         (WebCore::IDBCursor::transaction):
1937         (WebCore::IDBCursor::direction):
1938         (WebCore::IDBCursor::update):
1939         (WebCore::IDBCursor::advance):
1940         (WebCore::IDBCursor::continueFunction):
1941         (WebCore::IDBCursor::uncheckedIterateCursor):
1942         (WebCore::IDBCursor::deleteFunction):
1943         (WebCore::IDBCursor::setGetResult):
1944         
1945         * Modules/indexeddb/IDBDatabase.cpp:
1946         (WebCore::IDBDatabase::~IDBDatabase):
1947         (WebCore::IDBDatabase::hasPendingActivity):
1948         (WebCore::IDBDatabase::name):
1949         (WebCore::IDBDatabase::version):
1950         (WebCore::IDBDatabase::objectStoreNames):
1951         (WebCore::IDBDatabase::createObjectStore):
1952         (WebCore::IDBDatabase::transaction):
1953         (WebCore::IDBDatabase::deleteObjectStore):
1954         (WebCore::IDBDatabase::close):
1955         (WebCore::IDBDatabase::maybeCloseInServer):
1956         (WebCore::IDBDatabase::activeDOMObjectName):
1957         (WebCore::IDBDatabase::canSuspendForDocumentSuspension):
1958         (WebCore::IDBDatabase::stop):
1959         (WebCore::IDBDatabase::startVersionChangeTransaction):
1960         (WebCore::IDBDatabase::didStartTransaction):
1961         (WebCore::IDBDatabase::willCommitTransaction):
1962         (WebCore::IDBDatabase::didCommitTransaction):
1963         (WebCore::IDBDatabase::willAbortTransaction):
1964         (WebCore::IDBDatabase::didAbortTransaction):
1965         (WebCore::IDBDatabase::didCommitOrAbortTransaction):
1966         (WebCore::IDBDatabase::fireVersionChangeEvent):
1967         (WebCore::IDBDatabase::dispatchEvent):
1968         (WebCore::IDBDatabase::didCreateIndexInfo):
1969         (WebCore::IDBDatabase::didDeleteIndexInfo):
1970         * Modules/indexeddb/IDBDatabase.h:
1971         (WebCore::IDBDatabase::originThreadID):
1972         
1973         * Modules/indexeddb/IDBIndex.cpp:
1974         (WebCore::IDBIndex::IDBIndex):
1975         (WebCore::IDBIndex::~IDBIndex):
1976         (WebCore::IDBIndex::name):
1977         (WebCore::IDBIndex::objectStore):
1978         (WebCore::IDBIndex::keyPath):
1979         (WebCore::IDBIndex::unique):
1980         (WebCore::IDBIndex::multiEntry):
1981         (WebCore::IDBIndex::openCursor):
1982         (WebCore::IDBIndex::doCount):
1983         (WebCore::IDBIndex::openKeyCursor):
1984         (WebCore::IDBIndex::doGet):
1985         (WebCore::IDBIndex::doGetKey):
1986         (WebCore::IDBIndex::markAsDeleted):
1987         
1988         * Modules/indexeddb/IDBObjectStore.cpp:
1989         (WebCore::IDBObjectStore::IDBObjectStore):
1990         (WebCore::IDBObjectStore::~IDBObjectStore):
1991         (WebCore::IDBObjectStore::name):
1992         (WebCore::IDBObjectStore::keyPath):
1993         (WebCore::IDBObjectStore::indexNames):
1994         (WebCore::IDBObjectStore::transaction):
1995         (WebCore::IDBObjectStore::autoIncrement):
1996         (WebCore::IDBObjectStore::openCursor):
1997         (WebCore::IDBObjectStore::get):
1998         (WebCore::IDBObjectStore::putOrAdd):
1999         (WebCore::IDBObjectStore::doDelete):
2000         (WebCore::IDBObjectStore::clear):
2001         (WebCore::IDBObjectStore::createIndex):
2002         (WebCore::IDBObjectStore::index):
2003         (WebCore::IDBObjectStore::deleteIndex):
2004         (WebCore::IDBObjectStore::doCount):
2005         (WebCore::IDBObjectStore::markAsDeleted):
2006         (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
2007         
2008         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2009         (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
2010         (WebCore::IDBOpenDBRequest::onError):
2011         (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
2012         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
2013         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
2014         (WebCore::IDBOpenDBRequest::dispatchEvent):
2015         (WebCore::IDBOpenDBRequest::onSuccess):
2016         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
2017         (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
2018         (WebCore::IDBOpenDBRequest::requestCompleted):
2019         (WebCore::IDBOpenDBRequest::requestBlocked):
2020         
2021         * Modules/indexeddb/IDBRequest.cpp:
2022         (WebCore::IDBRequest::~IDBRequest):
2023         (WebCore::IDBRequest::errorCode):
2024         (WebCore::IDBRequest::error):
2025         (WebCore::IDBRequest::setSource):
2026         (WebCore::IDBRequest::setVersionChangeTransaction):
2027         (WebCore::IDBRequest::transaction):
2028         (WebCore::IDBRequest::readyState):
2029         (WebCore::IDBRequest::sourceObjectStoreIdentifier):
2030         (WebCore::IDBRequest::sourceIndexIdentifier):
2031         (WebCore::IDBRequest::requestedIndexRecordType):
2032         (WebCore::IDBRequest::eventTargetInterface):
2033         (WebCore::IDBRequest::activeDOMObjectName):
2034         (WebCore::IDBRequest::canSuspendForDocumentSuspension):
2035         (WebCore::IDBRequest::hasPendingActivity):
2036         (WebCore::IDBRequest::stop):
2037         (WebCore::IDBRequest::enqueueEvent):
2038         (WebCore::IDBRequest::dispatchEvent):
2039         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
2040         (WebCore::IDBRequest::setResult):
2041         (WebCore::IDBRequest::setResultToStructuredClone):
2042         (WebCore::IDBRequest::clearResult):
2043         (WebCore::IDBRequest::setResultToUndefined):
2044         (WebCore::IDBRequest::resultCursor):
2045         (WebCore::IDBRequest::willIterateCursor):
2046         (WebCore::IDBRequest::didOpenOrIterateCursor):
2047         (WebCore::IDBRequest::requestCompleted):
2048         (WebCore::IDBRequest::onError):
2049         (WebCore::IDBRequest::onSuccess):
2050         * Modules/indexeddb/IDBRequest.h:
2051         (WebCore::IDBRequest::originThreadID):
2052         
2053         * Modules/indexeddb/IDBTransaction.cpp:
2054         (WebCore::IDBTransaction::IDBTransaction):
2055         (WebCore::IDBTransaction::~IDBTransaction):
2056         (WebCore::IDBTransaction::mode):
2057         (WebCore::IDBTransaction::db):
2058         (WebCore::IDBTransaction::serverConnection):
2059         (WebCore::IDBTransaction::error):
2060         (WebCore::IDBTransaction::objectStore):
2061         (WebCore::IDBTransaction::abortDueToFailedRequest):
2062         (WebCore::IDBTransaction::transitionedToFinishing):
2063         (WebCore::IDBTransaction::abort):
2064         (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
2065         (WebCore::IDBTransaction::activeDOMObjectName):
2066         (WebCore::IDBTransaction::canSuspendForDocumentSuspension):
2067         (WebCore::IDBTransaction::hasPendingActivity):
2068         (WebCore::IDBTransaction::stop):
2069         (WebCore::IDBTransaction::isActive):
2070         (WebCore::IDBTransaction::isFinishedOrFinishing):
2071         (WebCore::IDBTransaction::addRequest):
2072         (WebCore::IDBTransaction::removeRequest):
2073         (WebCore::IDBTransaction::scheduleOperation):
2074         (WebCore::IDBTransaction::scheduleOperationTimer):
2075         (WebCore::IDBTransaction::operationTimerFired):
2076         (WebCore::IDBTransaction::commit):
2077         (WebCore::IDBTransaction::commitOnServer):
2078         (WebCore::IDBTransaction::finishAbortOrCommit):
2079         (WebCore::IDBTransaction::didStart):
2080         (WebCore::IDBTransaction::notifyDidAbort):
2081         (WebCore::IDBTransaction::didAbort):
2082         (WebCore::IDBTransaction::didCommit):
2083         (WebCore::IDBTransaction::fireOnComplete):
2084         (WebCore::IDBTransaction::fireOnAbort):
2085         (WebCore::IDBTransaction::enqueueEvent):
2086         (WebCore::IDBTransaction::dispatchEvent):
2087         (WebCore::IDBTransaction::createObjectStore):
2088         (WebCore::IDBTransaction::createObjectStoreOnServer):
2089         (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
2090         (WebCore::IDBTransaction::createIndex):
2091         (WebCore::IDBTransaction::createIndexOnServer):
2092         (WebCore::IDBTransaction::didCreateIndexOnServer):
2093         (WebCore::IDBTransaction::requestOpenCursor):
2094         (WebCore::IDBTransaction::doRequestOpenCursor):
2095         (WebCore::IDBTransaction::openCursorOnServer):
2096         (WebCore::IDBTransaction::didOpenCursorOnServer):
2097         (WebCore::IDBTransaction::iterateCursor):
2098         (WebCore::IDBTransaction::iterateCursorOnServer):
2099         (WebCore::IDBTransaction::didIterateCursorOnServer):
2100         (WebCore::IDBTransaction::requestGetRecord):
2101         (WebCore::IDBTransaction::requestGetValue):
2102         (WebCore::IDBTransaction::requestGetKey):
2103         (WebCore::IDBTransaction::requestIndexRecord):
2104         (WebCore::IDBTransaction::getRecordOnServer):
2105         (WebCore::IDBTransaction::didGetRecordOnServer):
2106         (WebCore::IDBTransaction::requestCount):
2107         (WebCore::IDBTransaction::getCountOnServer):
2108         (WebCore::IDBTransaction::didGetCountOnServer):
2109         (WebCore::IDBTransaction::requestDeleteRecord):
2110         (WebCore::IDBTransaction::deleteRecordOnServer):
2111         (WebCore::IDBTransaction::didDeleteRecordOnServer):
2112         (WebCore::IDBTransaction::requestClearObjectStore):
2113         (WebCore::IDBTransaction::clearObjectStoreOnServer):
2114         (WebCore::IDBTransaction::didClearObjectStoreOnServer):
2115         (WebCore::IDBTransaction::requestPutOrAdd):
2116         (WebCore::IDBTransaction::putOrAddOnServer):
2117         (WebCore::IDBTransaction::didPutOrAddOnServer):
2118         (WebCore::IDBTransaction::deleteObjectStore):
2119         (WebCore::IDBTransaction::deleteObjectStoreOnServer):
2120         (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
2121         (WebCore::IDBTransaction::deleteIndex):
2122         (WebCore::IDBTransaction::deleteIndexOnServer):
2123         (WebCore::IDBTransaction::didDeleteIndexOnServer):
2124         (WebCore::IDBTransaction::operationDidComplete):
2125         (WebCore::IDBTransaction::establishOnServer):
2126         (WebCore::IDBTransaction::activate):
2127         (WebCore::IDBTransaction::deactivate):
2128
2129 2016-05-05  Nan Wang  <n_wang@apple.com>
2130
2131         For keyboard users, activating a fragment URL should transfer focus and caret to the destination
2132         https://bugs.webkit.org/show_bug.cgi?id=116046
2133
2134         Reviewed by Ryosuke Niwa.
2135
2136         Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed
2137         and there is no focused element, we start searching for next focus candidates at the sequential
2138         focus navigation node.
2139
2140         Test: fast/events/sequential-focus-navigation-starting-point.html
2141
2142         * dom/Document.cpp:
2143         (WebCore::Document::removedLastRef):
2144         (WebCore::Document::destroyRenderTree):
2145         (WebCore::Document::removeFocusedNodeOfSubtree):
2146         (WebCore::Document::hoveredElementDidDetach):
2147         (WebCore::Document::setFocusedElement):
2148         (WebCore::isNodeFrameOrDocument):
2149         (WebCore::Document::setFocusNavigationStartingNode):
2150         (WebCore::Document::focusNavigationStartingNode):
2151         (WebCore::Document::setCSSTarget):
2152         (WebCore::Document::nodeChildrenWillBeRemoved):
2153         (WebCore::Document::nodeWillBeRemoved):
2154         (WebCore::fallbackFocusNavigationStartingNodeAfterRemoval):
2155         (WebCore::Document::updateFocusNavigationStartingNodeWithNodeRemoval):
2156         (WebCore::Document::textInserted):
2157         * dom/Document.h:
2158         (WebCore::Document::userActionElements):
2159         * page/EventHandler.cpp:
2160         (WebCore::EventHandler::handleMousePressEvent):
2161         * page/FocusController.cpp:
2162         (WebCore::FocusController::advanceFocusInDocumentOrder):
2163         * page/FrameView.cpp:
2164         (WebCore::FrameView::scrollToAnchor):
2165
2166 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
2167
2168         Another iOS debug build fix after r200464.
2169
2170         * dom/EventContext.h:
2171         (WebCore::EventContext::isUnreachableNode):
2172
2173 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
2174
2175         iOS debug build fix after r200464.
2176
2177         * dom/EventContext.cpp:
2178         (WebCore::TouchEventContext::checkReachability):
2179
2180 2016-05-05  Simon Fraser  <simon.fraser@apple.com>
2181
2182         Revert r200390, thus putting r199259 and r200161 and back.
2183
2184         * loader/HistoryController.cpp:
2185         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
2186         * page/FrameView.cpp:
2187         (WebCore::FrameView::adjustTiledBackingScrollability):
2188         * page/Page.h:
2189         (WebCore::Page::obscuredInset):
2190         (WebCore::Page::setObscuredInset):
2191         (WebCore::Page::enclosedInScrollableAncestorView):
2192         (WebCore::Page::setEnclosedInScrollableAncestorView):
2193         * platform/ScrollView.h:
2194         (WebCore::ScrollView::platformObscuredInset): Deleted.
2195         (WebCore::ScrollView::platformSetObscuredInset): Deleted.
2196
2197 2016-05-05  Sam Weinig  <sam@webkit.org>
2198
2199         Fix the build.
2200
2201         * platform/network/cf/CertificateInfo.h:
2202
2203 2016-05-05  Eric Carlson  <eric.carlson@apple.com>
2204
2205         [iOS] Media information is sometimes not shown in Control Center
2206         https://bugs.webkit.org/show_bug.cgi?id=157377
2207
2208         Reviewed by Jer Noble.
2209
2210         * platform/audio/ios/MediaSessionManagerIOS.h:
2211         * platform/audio/ios/MediaSessionManagerIOS.mm:
2212         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Store values passed to MPNowPlayingInfoCenter
2213           individually instead of in a dictionary.
2214
2215 2016-05-04  Simon Fraser  <simon.fraser@apple.com>
2216
2217         Comments on wired.com are blurry
2218         https://bugs.webkit.org/show_bug.cgi?id=148630
2219         rdar://problem/22499655
2220
2221         Reviewed by Tim Horton.
2222
2223         Make sure to set -rasterizationScale on TileGrid container layers to avoid blurry layers
2224         with some configurations of transforms, perspective and clipping.
2225
2226         Test: compositing/contents-scale/rasterization-scale.html
2227
2228         * platform/graphics/ca/TileController.cpp:
2229         (WebCore::TileController::TileController): Initialize m_deviceScaleFactor before m_tileGrid,
2230         because TileGrid's constructor needs to read the device scale.
2231         * platform/graphics/ca/TileController.h:
2232         * platform/graphics/ca/TileGrid.cpp:
2233         (WebCore::TileGrid::TileGrid): Push a contentsScale (which also sets rasterizationScale) onto 
2234         the tile grid container layer on constructions, and in setScale().
2235         (WebCore::TileGrid::setScale):
2236
2237 2016-05-05  Ryosuke Niwa  <rniwa@webkit.org>
2238
2239         event.target shouldn't be retargeted as the event bubbles into a slot
2240         https://bugs.webkit.org/show_bug.cgi?id=157369
2241
2242         Reviewed by Antti Koivisto.
2243
2244         When an event bubbles up from an assigned node to its assigned slot, we shouldn't be adjusting
2245         event.target to point to the slot. Since a shadow tree should have access to nodes outside
2246         the shadow tree, event.target is accessible inside the shadow tree of such a slot.
2247
2248         New behavior matches the behavior of Google Chrome Canary as well as the shadow DOM specification:
2249         http://w3c.github.io/webcomponents/spec/shadow/#dfn-retargeting-algorithm
2250
2251         Test: fast/shadow-dom/event-inside-slotted-node.html
2252
2253         * dom/Event.cpp:
2254         (WebCore::Event::deepPath):
2255         * dom/EventContext.h:
2256         (WebCore::EventContext::isUnreachableNode): Use Node::isUnclosedNode instead of isReachable.
2257         (WebCore::EventContext::isReachable): Deleted.
2258         * dom/EventPath.cpp:
2259         (WebCore::EventPath::EventPath): Don't set the target to the slot when entering a slot. Also moved
2260         the code to adjust the target as we exit a shadow tree to the end of the outer loop for clarity.
2261         (WebCore::isUnclosedNodeOf): Deleted. Renamed to Node::isUnclosedNode.
2262         (WebCore::EventPath::setRelatedTarget):
2263         (WebCore::EventPath::computePathUnclosedToTarget): Renamed from computePathDisclosedToTarget.
2264         (WebCore::moveOutOfAllShadowRoots): Extracted from RelatedNodeRetargeter::RelatedNodeRetargeter.
2265         (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter): Fixed a bug that we were exiting early
2266         without setting m_hasDifferentTreeRoot true when target and relatedNode are disconnected from
2267         a document.
2268         (WebCore::RelatedNodeRetargeter::currentNode):
2269         (WebCore::RelatedNodeRetargeter::checkConsistency): Updated to match the spec with one exception.
2270         We don't use null as the adjusted related target when the (original) related target and the target
2271         are in two distinct disconnected trees since such a behavior is not Web compatible. This spec bug is
2272         tracked by https://github.com/w3c/webcomponents/issues/494
2273         * dom/EventPath.h:
2274         (WebCore::EventPath::eventTargetRespectingTargetRules): Returns Node* instead of EventTarget* since
2275         we need a Node in RelatedNodeRetargeter::checkConsistency.
2276         * dom/Node.cpp:
2277         (WebCore::Node::isUnclosedNode): Moved from RelatedNodeRetargeter.cpp
2278         * dom/Node.h:
2279
2280 2016-05-02  Sam Weinig  <sam@webkit.org>
2281
2282         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
2283         https://bugs.webkit.org/show_bug.cgi?id=157220
2284
2285         Reviewed by Darin Adler.
2286
2287         * platform/network/cf/CertificateInfo.h:
2288         (WebCore::CertificateInfo::CertificateInfo):
2289         (WebCore::CertificateInfo::trust):
2290         (WebCore::CertificateInfo::isEmpty):
2291         (WebCore::CertificateInfo::setCertificateChain): Deleted.
2292         (WebCore::CertificateInfo::certificateChain): Deleted.
2293         * platform/network/mac/CertificateInfoMac.mm:
2294         (WebCore::CertificateInfo::type):
2295         (WebCore::CertificateInfo::certificateChain):
2296         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
2297         (WebCore::CertificateInfo::dump):
2298         When supported, allow CertificateInfo to contain a SecTrustRef instead of a certificate chain. We keep
2299         support for holding on to a certificate chain as well, since there is API that depends on this.
2300
2301         * platform/network/cocoa/ResourceResponseCocoa.mm:
2302         (WebCore::ResourceResponse::platformCertificateInfo):
2303         When supported, use the SecTrustRef from the error instead of extracting it's certificate chain.
2304
2305 2016-05-04  Ada Chan  <adachan@apple.com>
2306
2307         When exiting fullscreen, call a JS method immediately to implement the style changes for the presentation mode change right away
2308         https://bugs.webkit.org/show_bug.cgi?id=157359
2309
2310         Reviewed by Eric Carlson.
2311
2312         No new tests as this is done to just mitigate a visual glitch.
2313
2314         * html/HTMLMediaElement.cpp:
2315         (WebCore::HTMLMediaElement::exitFullscreen):
2316         (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
2317         * html/HTMLMediaElement.h:
2318
2319 2016-05-04  Alex Christensen  <achristensen@webkit.org>
2320
2321         Blocked redirected main resource requests need descriptive errors
2322         https://bugs.webkit.org/show_bug.cgi?id=156828
2323         rdar://problem/25711316
2324
2325         Reviewed by Daniel Bates.
2326
2327         Test: http/tests/contentextensions/main-resource-redirect-error.html
2328
2329         * loader/DocumentLoader.cpp:
2330         (WebCore::DocumentLoader::startLoadingMainResource):
2331         Call cancelMainResourceLoad() so that InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame()
2332         is called to be consistent with blocked redirected main resource requests.
2333         * loader/ResourceLoader.cpp:
2334         (WebCore::ResourceLoader::willSendRequestInternal):
2335         (WebCore::ResourceLoader::blockedError):
2336         (WebCore::ResourceLoader::blockedByContentBlockerError):
2337         (WebCore::ResourceLoader::cannotShowURLError):
2338         * loader/ResourceLoader.h:
2339         Use a blockedByContentBlockerError() instead of a cannotShowURLError() when we blocked the load.
2340
2341 2016-05-05  Zan Dobersek  <zdobersek@igalia.com>
2342
2343         Fix assertions in debug builds for the GTK+ port.
2344
2345         Rubber-stamped by Carlos Garcia Campos.
2346
2347         * platform/graphics/texmap/TextureMapperGL.cpp:
2348         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
2349         Switch back to the find() + add() combo for retrieving the pointer
2350         to the SharedGLData object stored for the specific GraphicsContext3D.
2351         add() + isNewEntry is causing assertions in debug builds when adding
2352         the first entry.
2353
2354 2016-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2355
2356         [GStreamer] Adaptive streaming issues
2357         https://bugs.webkit.org/show_bug.cgi?id=144040
2358
2359         Reviewed by Philippe Normand.
2360
2361         In the case of adaptive streaming, the GST URI downloader object is creating the source object, in our case
2362         WebKitWebSrc, without taking its ownership. This is breaking the lifetime of the WebKitWebSrc element. We are
2363         using GRefPtr in WebKitWebSrc to ref/unref the object when sending notifications to the main thread, ensuring
2364         that the object is not destroyed before the main thread dispatches the message. But our smart pointers are so
2365         smart that in case of receiving a floating reference, it's converted to a full reference, so that the first time
2366         we try to take a ref of a WebKitWebSrc having a floating reference we are actually taking the ownership
2367         instead. When we try to release the reference, we are actuallty destroying the object, something that the actual
2368         owner is not expecting and causing runtime critical warnings and very often web process crashes.
2369
2370             (WebKitWebProcess:6863): GStreamer-CRITICAL **:
2371             Trying to dispose element appsrc1, but it is in READY instead of the NULL state.
2372             You need to explicitly set elements to the NULL state before
2373             dropping the final reference, to allow them to clean up.
2374             This problem may also be caused by a refcounting bug in the
2375             application or some element.
2376
2377             (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_handler_get_uri: assertion 'GST_IS_URI_HANDLER(handler)' failed
2378
2379             (WebKitWebProcess:6863): GStreamer-CRITICAL **: gst_uri_get_protocol: assertion 'uri != NULL' failed
2380
2381         This should be fixed in GST, but we can workaround it in WebKit while it's fixed in GST or to prevent this from
2382         happening if other users make the same mistake. The idea is to add a ensureGRef() only available for GRefPtr
2383         when using WebKitWebSrc objects that consumes the floating reference if needed before taking the actual reference.
2384
2385         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
2386         (WTF::ensureGRef): Consume the floating ref if needed.
2387         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
2388         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2389         (webKitWebSrcChangeState): Use ensureGRef().
2390
2391 2016-05-05  Csaba Osztrogonác  <ossy@webkit.org>
2392
2393         [Mac][cmake] Unreviewed speculative buildfix after r200433, just for fun.
2394
2395         * PlatformMac.cmake:
2396
2397 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
2398
2399         [TexMap] Clean up TextureMapperShaderProgram
2400         https://bugs.webkit.org/show_bug.cgi?id=157302
2401
2402         Reviewed by Carlos Garcia Campos.
2403
2404         Clean up the header and the implementation file of the
2405         TextureMapperShaderProgram class. Reference the GraphicsContext3D
2406         object through a Ref<>, and have the context() return a reference,
2407         not a pointer.
2408
2409         Sort the parts of the implementation file into something more
2410         sensible. StringBuilder usage in create() is improved. getLocation()
2411         only needs to do one lookup in the m_variables map by using ensure().
2412
2413         No new tests -- no change in behavior.
2414
2415         * platform/graphics/surfaces/GLTransportSurface.cpp:
2416         (WebCore::GLTransportSurface::initializeShaderProgram):
2417         * platform/graphics/texmap/TextureMapperGL.cpp:
2418         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram):
2419         (WebCore::prepareFilterProgram):
2420         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2421         (WebCore::TextureMapperShaderProgram::create):
2422         (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
2423         (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
2424         (WebCore::TextureMapperShaderProgram::setMatrix):
2425         (WebCore::TextureMapperShaderProgram::getLocation):
2426         * platform/graphics/texmap/TextureMapperShaderProgram.h:
2427         (WebCore::TextureMapperShaderProgram::context):
2428
2429 2016-05-03  Darin Adler  <darin@apple.com>
2430
2431         Start on dictionary support for IDL, getting enough to work for one dictionary
2432         https://bugs.webkit.org/show_bug.cgi?id=157336
2433
2434         Reviewed by Alex Christensen.
2435
2436         * bindings/js/JSDOMBinding.h: Return RefPtr instead of PassRefPtr for the return
2437         value of toArrayBufferView. Not only is this the correct modern idiom, it also
2438         works properly with auto, and PassRefPtr does not.
2439
2440         * bindings/js/JSDOMBuild.h: Added. This has the build function template in it.
2441         It's used to build values like dictionaries. We specialize and call the tempate
2442         in generated code. This is only the initial simplistic version; will be refining
2443         for exception handling, optional handling, default value handling, and lots of
2444         other things not yet needed for this first dictionary.
2445
2446         * bindings/scripts/CodeGenerator.pm:
2447         (ProcessDocument): Handle dictionaries much like how we handle enumerations.
2448         (SkipIncludeHeader): Moved small list of special types here from CodeGeneratorJS.
2449         (IsDictionaryType): Added.
2450         (IsRefPtrType): Make this return 0 for dictionary types.
2451
2452         * bindings/scripts/CodeGeneratorJS.pm:
2453         (GenerateInterface): Added handling for dictionaries.
2454         (SkipIncludeHeader): Deleted.
2455         (AddIncludesForType): Call the the SkipIncludeHeader from CodeGenerator.pm directly.
2456         (GetNestedClassName): Factored out the work that was previously in
2457         GetEnumerationClassName so we could reuse it for dictionaries too.
2458         (GetEnumerationClassName): Changed to call GetNestedClassName.
2459         (GetEnumerationClassIdentifier): Deleted. Instead of using this, we now use templates
2460         so we can use the actual class name.
2461         (GenerateEnumerationImplementationContent): Changed parse and expectedEnumerationValues
2462         to use function template specialization instead of functions. This cleans up the code
2463         a bit and makes it eaiser to use from other templates. Later we may want to merge the
2464         parse function template build function template from JSDOMBuild.h. Added specialization
2465         of the build function template.
2466         (GetDictionaryClassName): Added. Calls GetNestedClassName.
2467         (GenerateDictionaryImplementationContent): Added. Generates the build function for each
2468         dictionary type. Initial simplistic version to be refined.
2469         (GenerateImplementation): Added dictionaries argument and called the
2470         GenerateDictionaryImplementationContent function. Also changed many functions to take
2471         interface arguments and also removed redundant interfaceName arguments from functions
2472         that formerly took both.
2473         (GenerateParametersCheck): Updated for changes above. That includes calling the new
2474         parse function template. Also changed to use auto and WTFMove, which makes the code
2475         both more generic and potentially more efficient and obviates the need for a special
2476         case for dictionary types.
2477         (GenerateCallbackHeader): Updated for changes above.
2478         (GenerateCallbackImplementation): Ditto.
2479         (GenerateImplementationFunctionCall): Ditto.
2480         (GetNativeTypeFromSignature): Ditto.
2481         (GetNativeType): Changed this function to take the interface because that's needed to
2482         get the type name right for enumeration types rather than returning "auto". Made that
2483         change as well. Moved one type, DOMStringList, into the nativeType hash instead of
2484         having explicit code here for it. Didn't add a dictionary type case here yet, but
2485         probably will need to do that in the next patch.
2486         (ShouldPassWrapperByReference): Pass interface in to GetNativeType.
2487         (GetNativeVectorInnerType): Removed unneeded special case for DOMString.
2488         (GetNativeTypeForCallbacks): Changed to take the interface.
2489         (GetNativeTypeForMemoization): Ditto.
2490         (JSValueToNative): Changed expression for Dictionary (the thing I am working to make
2491         obsolete) to name the type so it will work with auto. Added a case for dictionary
2492         types and updated the case for enumeration types.
2493         (NativeToJSValue): Updated to take an interface rather than an interface name, and to
2494         pass that along as needed.
2495
2496         * bindings/scripts/IDLParser.pm:
2497         (Parse): Add dictionaries to a list.
2498         (parseDictionary): Put name, extended attributes, and members into the dictionary.
2499         (parseDictionaryMembers): Build up a members array.
2500         (parseDictionaryMember): Put isOptional, type, name, and default value into the
2501         dictionary member.
2502
2503         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2504         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2505         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2506         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2507         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2508         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2509         * bindings/scripts/test/JS/JSTestInterface.cpp:
2510         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2511         * bindings/scripts/test/JS/JSTestNode.cpp:
2512         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2513         * bindings/scripts/test/JS/JSTestObj.cpp:
2514         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2515         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2516         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2517         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2518         * bindings/scripts/test/ObjC/DOMTestObj.h:
2519         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2520         Regenerated.
2521
2522         * bindings/scripts/test/TestObj.idl: Added some test cases that I was using to
2523         get the bindings script to work. Right now this is basically identical to the
2524         actual use of this in Element.idl, but over time I will modify it to cover more
2525         features of dictionaries. Also fixed some incorrect test cases trying to use
2526         the type "bool", which doesn't exist in IDL.
2527
2528         * dom/Element.cpp:
2529         (WebCore::Element::canHaveUserAgentShadowRoot): Added. The existing code used a
2530         combination of a virtual function on HTMLElement and type checking. It's better
2531         to just use a virtual function on Element.
2532         (WebCore::Element::attachShadow): Updated to take a ShadowRootInit struct instead
2533         of a Dictionary. Also tweaked the code in a couple other minor ways.
2534
2535         * dom/Element.h: Added the ShadowRootMode enum class and the ShadowRootInit struct,
2536         and changed attachShadow to take ShadowRootInit instead of Dictionary. Also added
2537         the private canHaveUserAgentShadowRoot virtual function.
2538
2539         * dom/Element.idl: Added ShadowRootMode, ShadowRootInit, and used them in as the
2540         arguemnt type for attachShadow.
2541
2542         * html/HTMLElement.h: Made canHaveUserAgentShadowRoot a private override instead
2543         of a public virtual function.
2544
2545 2016-05-04  Eric Carlson  <eric.carlson@apple.com>
2546
2547         [iOS] Playback does not pause when locking screen after playing to AirPlay.
2548         https://bugs.webkit.org/show_bug.cgi?id=157366
2549         <rdar://problem/22100651>
2550
2551         Reviewed by Dean Jackson.
2552
2553         * platform/audio/PlatformMediaSession.cpp:
2554         (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTargetChanged): Save and restore
2555           m_interruptionCount around calling sessionIsPlayingToWirelessPlaybackTargetChanged because
2556           it will call beginInterruption if we are already in the background and the counter will
2557           get out of sync.
2558
2559 2016-05-04  Daniel Bates  <dabates@apple.com>
2560
2561         CSP: Perform case sensitive match against path portion of source expression URL that ends in '/'
2562         https://bugs.webkit.org/show_bug.cgi?id=157275
2563
2564         Reviewed by Darin Adler.
2565
2566         Merged from Blink:
2567         <https://chromium.googlesource.com/chromium/src/+/7bd0a75e3f71a10e71ded31ea5905d5ee3d992eb>
2568
2569         Perform a case-sensitive prefix match of the path portion a source expression that ends in '/'
2570         against the path portion of a request URL as per step 8.5.4 of section Does url match expression
2571         in origin with redirect count of the Content Security Policy Level 3 spec., <https://w3c.github.io/webappsec-csp>
2572         (Editor's Draft, 27 April 2016).
2573
2574         * page/csp/ContentSecurityPolicySource.cpp:
2575         (WebCore::ContentSecurityPolicySource::pathMatches):
2576
2577 2016-05-04  Aaron Chu  <aaron_chu@apple.com>
2578
2579         AX: Nonfunctional controls appear before every HTML5 video when using VoiceOver
2580         https://bugs.webkit.org/show_bug.cgi?id=153089
2581         <rdar://problem/24050668>
2582
2583         Reviewed by Dean Jackson.
2584
2585         Test: media/video-controls-show-on-kb-or-ax-event.html
2586
2587         * Modules/mediacontrols/mediaControlsApple.js:
2588         (Controller):
2589         (Controller.prototype.createControls):
2590         (Controller.prototype.updateControls):
2591         (Controller.prototype.handlePlayButtonClicked):
2592         (Controller.prototype.setPlaying):
2593         (Controller.prototype.showShowControlsButton):
2594         (Controller.prototype.showControls):
2595         (Controller.prototype.hideControls):
2596         * Modules/mediacontrols/mediaControlsiOS.js:
2597         (ControllerIOS.prototype.addStartPlaybackControls):
2598         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd):
2599         (ControllerIOS.prototype.showControls):
2600
2601         Fix to make sure the showControls button in a media player behaves correctly.
2602
2603 2016-05-04  Dean Jackson  <dino@apple.com>
2604
2605         Disabling WebGL2 should mean no context is created
2606         https://bugs.webkit.org/show_bug.cgi?id=157352
2607         <rdar://problem/26096346>
2608
2609         Reviewed by Eric Carlson.
2610
2611         If WebGL2 is disabled by the runtime flag, we should
2612         not create a context.
2613
2614         Test: fast/canvas/webgl/webgl2-runtime-flag.html
2615
2616         * html/canvas/WebGLRenderingContextBase.cpp:
2617         (WebCore::WebGLRenderingContextBase::create):
2618         * testing/Internals.cpp: Added some helpers to toggle the runtime setting.
2619         (WebCore::Internals::webGL2Enabled):
2620         (WebCore::Internals::setWebGL2Enabled):
2621         * testing/Internals.h:
2622         * testing/Internals.idl:
2623
2624 2016-05-04  Anders Carlsson  <andersca@apple.com>
2625
2626         Add an override point for drawing named images in ThemeCocoa
2627         https://bugs.webkit.org/show_bug.cgi?id=157357
2628         rdar://problem/25878445
2629
2630         Reviewed by Dean Jackson.
2631
2632         Rename ThemeCocoa.cpp to ThemeCocoa.mm and rearrange the code that draws the wireless-playback image
2633         so we can import ThemeCocoaDrawNamedImage.mm below.
2634
2635         * WebCore.xcodeproj/project.pbxproj:
2636         * platform/cocoa/ThemeCocoa.cpp:
2637         (WebCore::fitContextToBox): Deleted.
2638         (WebCore::ThemeCocoa::drawNamedImage): Deleted.
2639         * platform/cocoa/ThemeCocoa.mm: Renamed from Source/WebCore/platform/cocoa/ThemeCocoa.cpp.
2640         (WebCore::fitContextToBox):
2641         (WebCore::ThemeCocoa::drawNamedImage):
2642
2643 2016-05-04  Jeremy Jones  <jeremyj@apple.com>
2644
2645         Don't disconnect WebAVPlayerController from its delegate since there is no way to reconnect it.
2646         https://bugs.webkit.org/show_bug.cgi?id=157337
2647
2648         Reviewed by Jer Noble.
2649
2650         WebAVPlayerController used to be deleted and recreated each time we begin fullscreen video mode.
2651         Since it is now preserved, we shouldn't paritally tear it down in cleanupFullscreen by disconnecting it
2652         from its delegate, especially since we have no way to reconnect it.
2653
2654         The side effect of leaving it connected is that it can continue to make callbacks during cleanup.
2655         Of importance is that it sets the audio and legible media selctions to nil. We don't want to change 
2656         the selection as a result of teardown. Nil selection is unsupported by WebVideoFullscreenModelVideoElement
2657         and causes an assert. This transition to nil selection is now ignored.
2658
2659         * platform/ios/WebAVPlayerController.mm:
2660         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
2661         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
2662         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2663         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
2664
2665 2016-05-04  Chris Dumez  <cdumez@apple.com>
2666
2667         Media elements should not be paused right away when removed from the document
2668         https://bugs.webkit.org/show_bug.cgi?id=157347
2669         <rdar://problem/25888758>
2670
2671         Reviewed by Alex Christensen.
2672
2673         Media elements should not be paused right away when removed from the document.
2674         Instead we should allow the task that removed the media element from the
2675         document to finish because considering pausing.
2676
2677         This avoid inadvertently pausing media elements when the JS merely moves them
2678         on the page (e.g. using Node.replaceChild()).
2679
2680         Text from the HTML specification:
2681         """
2682         When a media element is removed from a Document, the user agent must run the
2683         following steps:
2684         1.  Await a stable state, allowing the task that removed the media element
2685             from the Document to continue. The synchronous section consists of all the
2686             remaining steps of this algorithm. (Steps in the synchronous section are
2687             marked with ⌛.)
2688         2. ⌛ If the media element is in a Document, abort these steps.
2689         3. ⌛ Run the internal pause steps for the media element.
2690         """
2691
2692         c.f. https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
2693
2694         Test: media/replaceChild-should-not-pause-video.html
2695
2696         * dom/GenericEventQueue.cpp:
2697         (WebCore::GenericEventQueue::sharedTimerFired):
2698         Copy the queue of events before processing it so that we don't fire events that
2699         get scheduled by the event handlers as a result of us firing the pending events.
2700         Otherwise, we end up firing events synchronously right after they've been queued,
2701         which is wrong. This was causing several W3C tests to fail.
2702
2703         * html/HTMLMediaElement.cpp:
2704         (WebCore::HTMLMediaElement::HTMLMediaElement):
2705         (WebCore::HTMLMediaElement::pauseAfterDetachedTimerFired):
2706         (WebCore::HTMLMediaElement::removedFrom):
2707         * html/HTMLMediaElement.h:
2708         After the media element gets removed from the document, schedule a 0 timer before
2709         pausing the media element, to give the task that removed us a chance to finish.
2710         When the timer fires, we check if we were added back into an active document and
2711         avoid pausing in such case.
2712
2713 2016-05-04  Filip Pizlo  <fpizlo@apple.com>
2714
2715         Speed up JSGlobalObject initialization by making some properties lazy
2716         https://bugs.webkit.org/show_bug.cgi?id=157045
2717
2718         Reviewed by Keith Miller.
2719
2720         No new tests because no change in behavior.
2721         
2722         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
2723         that this was using a curious choice of global object, which may not be right. I decided
2724         to do a very literal refactoring that exactly preserves what this code got before, but I
2725         added a FIXME to reconsider this later.
2726
2727         * bindings/js/JSHTMLElementCustom.cpp:
2728         (WebCore::JSHTMLElement::pushEventHandlerScope):
2729
2730 2016-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
2731
2732         [css-grid] Refactor information stored related to column positions
2733         https://bugs.webkit.org/show_bug.cgi?id=157342
2734
2735         Reviewed by Darin Adler.
2736
2737         In m_columnPositions we were storing position of each column
2738         including the alignment offset, always from the logical left,
2739         and the border and padding, depending on the direction.
2740
2741         This was really confusing as in the case of RTL direction
2742         we were adding the offset from the left and
2743         the right border and padding.
2744
2745         This patches changes it to store always the info from the left,
2746         so even in RTL direction we use the left border and padding.
2747
2748         This allows us to simplify translateRTLCoordinate() as
2749         it doesn't need to care about border and padding anymore.
2750         And also to refactor offsetAndBreadthForPositionedChild()
2751         which became really complex after adding RTL support.
2752
2753         No new tests, no change of behavior.
2754
2755         * rendering/RenderGrid.cpp:
2756         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2757         (WebCore::RenderGrid::populateGridPositions):
2758         (WebCore::RenderGrid::translateRTLCoordinate):
2759
2760 2016-05-04  Mark Lam  <mark.lam@apple.com>
2761
2762         ES6 Function.name inferred from property names of literal objects can break some websites.
2763         https://bugs.webkit.org/show_bug.cgi?id=157246
2764
2765         Reviewed by Geoffrey Garen.
2766
2767         Test: js/dom/regress-157246.html
2768
2769         * bindings/js/JSDOMWindowBase.cpp:
2770         (WebCore::JSDOMWindowBase::finishCreation):
2771         - Set the needsSiteSpecificQuirks flag in the JSGlobalObject if needed.
2772
2773 2016-05-04  Konstantin Tokarev  <annulen@yandex.ru>
2774
2775         Deduplicated initializer lists of BitmapImage constructors.
2776         https://bugs.webkit.org/show_bug.cgi?id=157249
2777
2778         Reviewed by Darin Adler.
2779
2780         No new tests needed.
2781
2782         * platform/graphics/BitmapImage.cpp:
2783         (WebCore::BitmapImage::BitmapImage): Added new private constructor of
2784         BitmapImage for delegation purpose only.
2785         * platform/graphics/BitmapImage.h: Use inline initialization for some
2786         BitmapImage fields.
2787         * platform/graphics/cairo/BitmapImageCairo.cpp:
2788         (WebCore::BitmapImage::BitmapImage): Delegate field initialization to
2789         new private constructor.
2790         * platform/graphics/cg/BitmapImageCG.cpp:
2791         (WebCore::BitmapImage::BitmapImage): Ditto.
2792
2793 2016-05-04  Chris Dumez  <cdumez@apple.com>
2794
2795         Unreviewed, rolling out r200383 and r200406.
2796
2797         Seems to have caused crashes on iOS / ARMv7s
2798
2799         Reverted changesets:
2800
2801         "Speed up JSGlobalObject initialization by making some
2802         properties lazy"
2803         https://bugs.webkit.org/show_bug.cgi?id=157045
2804         http://trac.webkit.org/changeset/200383
2805
2806         "REGRESSION(r200383): Setting lazily initialized properties
2807         across frame boundaries crashes"
2808         https://bugs.webkit.org/show_bug.cgi?id=157333
2809         http://trac.webkit.org/changeset/200406
2810
2811 2016-05-04  Joanmarie Diggs  <jdiggs@igalia.com>
2812
2813         AX: ARIA 'region' role is now a landmark; HTML 'section' element should be a landmark only if named
2814         https://bugs.webkit.org/show_bug.cgi?id=157331
2815
2816         Reviewed by Chris Fleizach.
2817
2818         The 'region' role is now mapped as a landmark: The WebCore DocumentRegionRole
2819         AccessibilityRole has been renamed to LandmarkRegionRole. The AXDocumentRegion
2820         subrole has been renamed to AXLandmarkRegion. A 'section' element is mapped to
2821         the LandmarkRegionRole if it has an author-provided accessible name via either
2822         the aria-label or aria-labelledby attribute. Otherwise, it is mapped as GroupRole
2823         with no subrole.
2824
2825         Our existing test coverage for exposure of the 'region' role and the 'section'
2826         element is sufficient. These tests were updated to reflect the new behavior.
2827         Several new test cases were added to cover both sections with accessible names
2828         and those without.
2829
2830         * accessibility/AccessibilityObject.cpp:
2831         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
2832         (WebCore::AccessibilityObject::isLandmark):
2833         (WebCore::initializeRoleMap):
2834         * accessibility/AccessibilityObject.h:
2835         * accessibility/AccessibilityRenderObject.cpp:
2836         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2837         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2838         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2839         (atkRole):
2840         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2841         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2842         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2843         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2844         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
2845         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2846         (createAccessibilityRoleMap):
2847         (-[WebAccessibilityObjectWrapper subrole]):
2848         * platform/LocalizedStrings.cpp:
2849         (WebCore::AXARIAContentGroupText):
2850
2851 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2852
2853         Clicks inside button elements are sometimes discarded when the mouse moves
2854         https://bugs.webkit.org/show_bug.cgi?id=39620
2855
2856         Reviewed by Darin Adler.
2857
2858         Test: fast/events/click-over-descendant-elements.html
2859
2860         * dom/Node.cpp:
2861         (WebCore::ancestor):
2862         (WebCore::commonAncestor): Method inspired from
2863         http://src.chromium.org/viewvc/blink?view=revision&revision=162081.
2864         (WebCore::commonAncestorCrossingShadowBoundary): Helper routine
2865         that handles the case of nodes into a shadow node.
2866         * dom/Node.h:
2867         * page/EventHandler.cpp:
2868         (WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event
2869         target node according commonAncestorOverShadowBoundary method.
2870         (WebCore::EventHandler::targetNodeForClickEvent): Deleted.
2871
2872 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
2873
2874         Unreviewed, fixing crashing GTK+ tests after r200407.
2875
2876         * platform/graphics/texmap/TextureMapperGL.cpp:
2877         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
2878         Don't use RELEASE_ASSERT. Also fix the actual assertion,
2879         checking that any of the values in the map matches the object
2880         that's being destroyed, instead of checking the keys.
2881
2882 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2883
2884         Add WKPreference for SelectionPaintingWithoutSelectionGaps
2885         https://bugs.webkit.org/show_bug.cgi?id=156900
2886
2887         Reviewed by Michael Catanzaro.
2888
2889         Unlike other browsers WebKit has been drawing selection gaps
2890         between render blocks during the text selection. This often
2891         cause text selection screen looks messy.
2892
2893         This patch adds a setting method to disable the functionality,
2894         and EFL port disables it by default.
2895
2896         * page/Settings.in:
2897         * rendering/RenderBlock.cpp:
2898         (WebCore::RenderBlock::shouldPaintSelectionGaps):
2899
2900 2016-05-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2901
2902         Rename JSKeyValueIterator as JSDOMIterator
2903         https://bugs.webkit.org/show_bug.cgi?id=157308
2904
2905         Reviewed by Darin Adler.
2906
2907         No change of behavior.
2908
2909         * bindings/js/JSDOMIterator.h: Renamed from Source/WebCore/bindings/js/JSKeyValueIterator.h.
2910         (WebCore::JSDOMIteratorPrototype::create):
2911         (WebCore::JSDOMIteratorPrototype::createStructure):
2912         (WebCore::JSDOMIteratorPrototype::JSDOMIteratorPrototype):
2913         (WebCore::createKeyValueIterator):
2914         (WebCore::keyValueIteratorForEach):
2915         (WebCore::JSDOMIterator<JSWrapper>::destroy):
2916         (WebCore::JSDOMIterator<JSWrapper>::next):
2917         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
2918         (WebCore::JSDOMIteratorPrototype<JSWrapper>::finishCreation):
2919         * bindings/js/JSFontFaceSetCustom.cpp:
2920         * bindings/scripts/CodeGeneratorJS.pm:
2921         (GenerateImplementationIterableFunctions):
2922         * bindings/scripts/test/JS/JSTestObj.cpp:
2923
2924 2016-05-04  Jiewen Tan  <jiewen_tan@apple.com>
2925
2926         CrashTracer: [USER] com.apple.WebKit.WebContent at …ple.WebCore: WebCore::EditCommandComposition::unapply + 105
2927         https://bugs.webkit.org/show_bug.cgi?id=157282
2928         <rdar://problem/25391441>
2929
2930         Reviewed by Darin Adler.
2931
2932         A frame could be destroyed in the middle of executing undo/redo command.
2933         Therefore, add an early return.
2934
2935         * editing/CompositeEditCommand.cpp:
2936         (WebCore::EditCommandComposition::unapply):
2937         (WebCore::EditCommandComposition::reapply):
2938
2939 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
2940
2941         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
2942         https://bugs.webkit.org/show_bug.cgi?id=157305
2943
2944         Reviewed by Carlos Garcia Campos.
2945
2946         Split out handling of the root compositing and the view overlay layers
2947         into two separate methods. Both do nothing if the passed-in layer is
2948         the same as the current one. Otherwise, the current one is removed
2949         from the tree and the new one added to it.
2950
2951         No change in behavior is expected.
2952
2953         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
2954         (WebCore::CompositingCoordinator::setRootCompositingLayer):
2955         (WebCore::CompositingCoordinator::setViewOverlayRootLayer):
2956         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
2957
2958 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
2959
2960         [TexMap] Clean up TextureMapperGLData, TextureMapperGLData::SharedGLData
2961         https://bugs.webkit.org/show_bug.cgi?id=157303
2962
2963         Reviewed by Carlos Garcia Campos.
2964
2965         Torch the TextureMapperGLData and TextureMapperGLData::SharedGLData
2966         classes into a better form.
2967
2968         SharedGLData is now private to the TextureMapperGLData class, but
2969         lists that class as a friend. This enables moving the getShaderProgram()
2970         method to TextureMapperGLData and removes the need to expose the
2971         SharedGLData publicly. SharedGLData also doesn't have to keep a
2972         reference to the GraphicsContext3D object.
2973
2974         TextureMapperGLData now default-initializes the publicly accessible
2975         member variables while making some other members private, not exposing
2976         anything that isn't necessary.
2977
2978         Usual whitespace cleanup included. More elegant HashMap::ensure()
2979         insertions are used where they don't obfuscate object creation.
2980
2981         No new tests -- no change in behavior.
2982
2983         * platform/graphics/texmap/TextureMapperGL.cpp:
2984         (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
2985         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
2986         (WebCore::TextureMapperGLData::SharedGLData::contextDataMap):
2987         (WebCore::TextureMapperGLData::SharedGLData::SharedGLData):
2988         (WebCore::TextureMapperGLData::TextureMapperGLData):
2989         (WebCore::TextureMapperGLData::~TextureMapperGLData):
2990         (WebCore::TextureMapperGLData::initializeStencil):
2991         (WebCore::TextureMapperGLData::getStaticVBO):
2992         (WebCore::TextureMapperGLData::getShaderProgram):
2993         (WebCore::TextureMapperGL::TextureMapperGL):
2994         (WebCore::TextureMapperGL::drawBorder):
2995         (WebCore::TextureMapperGL::drawTexture):
2996         (WebCore::TextureMapperGL::drawSolidColor):
2997         (WebCore::TextureMapperGL::drawFiltered):
2998         (WebCore::TextureMapperGL::beginClip):
2999         (WebCore::TextureMapperGLData::SharedGLData::glContextDataMap): Deleted.
3000         (WebCore::TextureMapperGLData::SharedGLData::getShaderProgram): Deleted.
3001         (WebCore::TextureMapperGLData::sharedGLData): Deleted.
3002         * platform/graphics/texmap/TextureMapperGL.h:
3003
3004 2016-05-03  Chris Dumez  <cdumez@apple.com>
3005
3006         Optimize [StrictTypeChecking] on IDL attributes
3007         https://bugs.webkit.org/show_bug.cgi?id=157321
3008
3009         Reviewed by Geoffrey Garen.
3010
3011         Optimize [StrictTypeChecking] on IDL attributes:
3012         - Only generate extra code for nullable attributes because for non-nullable
3013           attributes, JSXXX::toWrapped() will return null in case of a bad input
3014           type. We will then throw a TypeError when null-checking it already.
3015         - After the JSValue::isNullOrUndefined() check, avoid calling
3016           JSXXX::toWrapped() and set nativeValue to nullptr directly.
3017         - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
3018           check on the value returned by JSXXX::toWrapped(). toWrapped() already
3019           does a JSValue::inherits(JSXXX::info() check. Since we only call
3020           toWrapped() if the JSValue is not null/undefined, a null return value
3021           always indicates a bad input type.
3022
3023         * bindings/scripts/CodeGeneratorJS.pm:
3024         (GenerateImplementation):
3025         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3026         (webkit_dom_test_obj_set_strict_type_checking_attribute):
3027         * bindings/scripts/test/JS/JSTestObj.cpp:
3028         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
3029         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3030         (-[DOMTestObj setStrictTypeCheckingAttribute:]):
3031         * bindings/scripts/test/TestObj.idl:
3032
3033 2016-05-03  Chris Dumez  <cdumez@apple.com>
3034
3035         Unreviewed, rolling out r199259 and r200161.
3036
3037         Seems to have caused a ~1.2% PLT regression on iOS
3038
3039         Reverted changesets:
3040
3041         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
3042         determine tiling area"
3043         https://bugs.webkit.org/show_bug.cgi?id=156429
3044         http://trac.webkit.org/changeset/199259
3045
3046         "[iOS WK2] When determining tile size, check whether ancestor
3047         UIScrollViews are actually scrollable"
3048         https://bugs.webkit.org/show_bug.cgi?id=157107
3049         http://trac.webkit.org/changeset/200161
3050
3051 2016-05-03  Filip Pizlo  <fpizlo@apple.com>
3052
3053         Speed up JSGlobalObject initialization by making some properties lazy
3054         https://bugs.webkit.org/show_bug.cgi?id=157045
3055
3056         Reviewed by Keith Miller.
3057
3058         No new tests because no change in behavior.
3059         
3060         This adapts JSHTMLElementCustom.cpp to the new JSWithScope API. Note that this revealed
3061         that this was using a curious choice of global object, which may not be right. I decided
3062         to do a very literal refactoring that exactly preserves what this code got before, but I
3063         added a FIXME to reconsider this later.
3064
3065         * bindings/js/JSHTMLElementCustom.cpp:
3066         (WebCore::JSHTMLElement::pushEventHandlerScope):
3067
3068 2016-05-03  Per Arne Vollan  <peavo@outlook.com>
3069
3070         [Win] Remove Windows XP Compatibility Requirements
3071         https://bugs.webkit.org/show_bug.cgi?id=152899
3072
3073         Reviewed by Brent Fulgham.
3074
3075         Windows XP is not supported anymore, we can remove compatibility workarounds.
3076
3077         * platform/text/win/LocaleWin.cpp:
3078         (WebCore::extractLanguageCode):
3079         (WebCore::LCIDFromLocaleInternal):
3080         (WebCore::LCIDFromLocale):
3081         (WebCore::removeLastComponent): Deleted.
3082         (WebCore::ensureNameToLCIDMap): Deleted.
3083         (WebCore::convertLocaleNameToLCID): Deleted.
3084
3085 2016-05-02  Antti Koivisto  <antti@apple.com>
3086
3087         REGRESSION (r198943): Transitions don't work if they animate display property
3088         https://bugs.webkit.org/show_bug.cgi?id=157244
3089         <rdar://problem/26042189>
3090
3091         Reviewed by Simon Fraser.
3092
3093         Test: transitions/transition-display-property.html
3094
3095         * style/RenderTreeUpdater.cpp:
3096         (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
3097
3098             Call the common function for ::before/::after updates.
3099
3100         * style/StyleTreeResolver.cpp:
3101         (WebCore::Style::TreeResolver::resolveElement):
3102         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3103
3104             If animation forces render tree reconstruction use the original rather than animated style for update.
3105             Because animations are tied to renderers we start them during renderer construction in this case.
3106
3107             Factor to a function.
3108
3109         (WebCore::Style::elementImplicitVisibility):
3110         * style/StyleTreeResolver.h:
3111
3112 2016-05-03  Pranjal Jumde  <pjumde@apple.com>
3113
3114         WorkerGlobalScope's self, location and navigator attributes should not be replaceable
3115         https://bugs.webkit.org/show_bug.cgi?id=157296
3116         <rdar://problem/25962738>
3117
3118         Reviewed by Chris Dumez.
3119
3120         Tests: http/tests/workers/location-readonly.html
3121                http/tests/workers/navigator-readonly.html
3122                http/tests/workers/self-readonly.html
3123
3124         * workers/WorkerGlobalScope.idl:
3125         The 'self', 'location', and 'navigator' properties of the WorkerGlobalScope must be immutable.
3126         See: https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
3127
3128 2016-05-03  Chris Dumez  <cdumez@apple.com>
3129
3130         Drop some unnecessary exception checking in the generated bindings
3131         https://bugs.webkit.org/show_bug.cgi?id=157299
3132
3133         Reviewed by Darin Adler.
3134
3135         Drop some unnecessary exception checking in the generated bindings.
3136         Only do a check for state->hadException() after converting a JSValue
3137         to a native value when necessary. Update JSValueToNative() to
3138         indicate the caller if converting to the native value may throw an
3139         exception.
3140
3141         This gets rid of a lot of unnecessary branching in the bindings.
3142
3143         No new tests, no intended web-exposed behavior change.
3144
3145         * bindings/scripts/CodeGeneratorJS.pm:
3146         (GenerateImplementation):
3147         (GenerateParametersCheck):
3148         (JSValueToNative):
3149         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3150         * bindings/scripts/test/JS/JSTestInterface.cpp:
3151         * bindings/scripts/test/JS/JSTestObj.cpp:
3152         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3153
3154 2016-05-03  Brady Eidson  <beidson@apple.com>
3155
3156         Add/refactor isolatedCopy methods for 3 IDB classes.
3157         https://bugs.webkit.org/show_bug.cgi?id=157289
3158
3159         Reviewed by Alex Christensen.
3160
3161         No new tests (Refactor, no behavior change).
3162
3163         In an upcoming, much larger patch, I'll need the ability to directly construct these three objects
3164         as isolated copies.
3165         
3166         This is a nice standalone refactor that enables that ability.
3167
3168         * Modules/indexeddb/IDBGetResult.cpp:
3169         (WebCore::IDBGetResult::IDBGetResult):
3170         (WebCore::IDBGetResult::isolatedCopy):
3171         * Modules/indexeddb/IDBGetResult.h:
3172         
3173         * Modules/indexeddb/IDBKeyData.cpp:
3174         (WebCore::IDBKeyData::IDBKeyData):
3175         (WebCore::IDBKeyData::isolatedCopy):
3176         * Modules/indexeddb/IDBKeyData.h:
3177
3178         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
3179         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
3180         (WebCore::IDBTransactionInfo::isolatedCopy):
3181         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3182
3183 2016-05-03  Joanmarie Diggs  <jdiggs@igalia.com>
3184
3185         [ATK] accessibility/content-editable-as-textarea.html fails
3186         https://bugs.webkit.org/show_bug.cgi?id=155353
3187
3188         Reviewed by Darin Adler.
3189
3190         The test was timing out because it expected an AXValueChanged notification.
3191         In ATK, AXValueChanged notifications are made for widgets which implement
3192         the AtkValue interface (sliders, progress bars, etc.). We should be listening
3193         for AXTextChanged instead.
3194
3195         In addition, for contenteditable elements, we should emit the notification on
3196         the element itself. Because we were handling the notification in the same way
3197         as native text controls (where the notification we receive from WebCore is for
3198         StaticTextRole children), we were attempting to emit the notification from
3199         the parent of the contenteditable.
3200
3201         Lastly, ATK's AccessibilityUIElement support had a number of unimplemented
3202         methods that are being used as part of the previously-failing test. Those
3203         methods are now implemented so that the ATK results are much more similar
3204         to those on the Mac.
3205
3206         No new tests needed. The previously-failing test now passes.
3207
3208         * accessibility/AccessibilityNodeObject.cpp:
3209         (WebCore::AccessibilityNodeObject::childrenChanged):
3210         * accessibility/AccessibilityObject.cpp:
3211         (WebCore::AccessibilityObject::isNonNativeTextControl):
3212         * accessibility/AccessibilityObject.h:
3213         * accessibility/AccessibilityRenderObject.cpp:
3214         (WebCore::AccessibilityRenderObject::textChanged):
3215         * accessibility/atk/AXObjectCacheAtk.cpp:
3216         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
3217
3218 2016-05-02  Sergio Villar Senin  <svillar@igalia.com>
3219
3220         [css-grid] Add support for position resolution with auto-repeat tracks
3221         https://bugs.webkit.org/show_bug.cgi?id=157260
3222
3223         Reviewed by Darin Adler.
3224
3225         This is a generalization of our position resolution code so it now supports every possible
3226         type of resolution (definite position, position spans, automatic resolution, named lines
3227         resolution, grid areas...) under the presence of auto-repeat tracks, i.e., tracks that are
3228         dynamically created by the LayoutGrid depending on the available space and that cannot be
3229         directly inferred from the CSS declarations.
3230
3231         This means that we need two extra things to resolve positions:
3232         - the LayoutGrid needs to provide the number of auto-repeat tracks per axis
3233         - a wrapper is needed to hide the eventual presence of auto-repeat tracks (with their line
3234         names) from the rest of the resolution code which should remain mostly unchanged.
3235
3236         The former is trivial (requires passing a new argument to some functions at the most) but
3237         the latter requires a new class called NamedLineCollection. This class allow us to locate
3238         and resolve named lines without having to insert the auto-repeat named lines in the already
3239         existing data structures. It does it in a very compact representation as it does not
3240         duplicate the names for every single repetition.
3241
3242         No new tests required as there is no change in behavior because the auto-repeat tracks
3243         computation is not implemented yet. Current tests already test this code extensively, and
3244         the auto-repeat code paths will be tested later once
3245         RenderGrid::computeAutoRepeatTracksCount() is implemented.
3246
3247         * rendering/RenderGrid.cpp:
3248         (WebCore::RenderGrid::computeAutoRepeatTracksCount): New method with empty implementation.
3249         (WebCore::RenderGrid::placeItemsOnGrid): Initialize the auto repeat tracks count.
3250         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3251         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3252         * rendering/RenderGrid.h:
3253         * rendering/style/GridPositionsResolver.cpp:
3254         (WebCore::directionFromSide):
3255         (WebCore::NamedLineCollection::NamedLineCollection): New class which is able to resolve the
3256         positions of a given named line in the presence of auto-repeat and "normal" tracks.
3257         (WebCore::NamedLineCollection::isValidNamedLineOrArea): Checks whether the given named line
3258         is a valid line name or area.
3259         (WebCore::NamedLineCollection::hasNamedLines): Checks whether the named line exists in the
3260         given axis (either specified by auto-repeat or "normal" tracks).
3261         (WebCore::NamedLineCollection::find): Looks for a line number whithin the line numbers where
3262         the given named line was found.
3263         (WebCore::NamedLineCollection::contains):
3264         (WebCore::NamedLineCollection::firstPosition): Returns the first line where the given named
3265         line is located.
3266         (WebCore::adjustGridPositionsFromStyle): Use NamedLineCollection.
3267         (WebCore::GridPositionsResolver::explicitGridColumnCount): Include auto repeat tracks.
3268         (WebCore::GridPositionsResolver::explicitGridRowCount): Ditto.
3269         (WebCore::explicitGridSizeForSide): Ditto.
3270         (WebCore::lookAheadForNamedGridLine): Use NamedLineCollection.
3271         (WebCore::lookBackForNamedGridLine): Ditto.
3272         (WebCore::resolveNamedGridLinePositionFromStyle):
3273         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
3274         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
3275         (WebCore::resolveGridPositionAgainstOppositePosition):
3276         (WebCore::resolveGridPositionFromStyle):
3277         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
3278         (WebCore::gridLinesForSide): Deleted.
3279         (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea): Deleted.
3280         * rendering/style/GridPositionsResolver.h:
3281
3282 2016-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3283
3284         Unreviewed. Fix GObject DOM bindings API break after r200316.
3285
3286         webkit_dom_tree_walker_set_current_node no longer raises exceptions after r200316, so mark it accordingly.
3287
3288         * bindings/scripts/CodeGeneratorGObject.pm:
3289         (FunctionUsedToRaiseException):
3290
3291 2016-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3292
3293         [OpenType] OpenTypeVerticalData object should not be created if the font is not OpenType
3294         https://bugs.webkit.org/show_bug.cgi?id=157172
3295
3296         Reviewed by Michael Catanzaro.
3297
3298         It's a bit weird that the object is always created and has an isOpenType() method to check whether it's an
3299         OpenType or not. The caller is always deleting the object when it's not an OpenType, so it would be better if
3300         the create method returned nullptr instead of creating the object when the font is not OpenType.
3301
3302         * platform/graphics/FontCache.cpp:
3303         (WebCore::FontCache::verticalData): Do not use isOpenType(), we can now simply use the return value of OpenTypeVerticalData::create().
3304         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
3305         (WebCore::loadHmtxTable): Moved to a helper funtion that returns false if the font is not OpenType.
3306         (WebCore::OpenTypeVerticalData::create): Try to load the Hmtx table, and create the object if succeeded or
3307         return nullptr otherwise.
3308         (WebCore::OpenTypeVerticalData::OpenTypeVerticalData): Receive the advanceWidths as constructor parameter.
3309         (WebCore::OpenTypeVerticalData::loadMetrics): Load all other tables.
3310         * platform/graphics/opentype/OpenTypeVerticalData.h:
3311         (WebCore::OpenTypeVerticalData::isOpenType): Deleted.
3312
3313 2016-05-02  Darin Adler  <darin@apple.com>
3314
3315         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
3316         https://bugs.webkit.org/show_bug.cgi?id=157257
3317
3318         Reviewed by Chris Dumez.
3319
3320         Chris and Alex requested this alternate style, where the enum class for each enumeration
3321         goes inside the class for the interface the enumeration is used in. Also made a rule that
3322         keeps the names short and not redundant with the class name they are nested in.
3323
3324         * Modules/fetch/FetchOptions.h: Moved all the enum class types into the struct.
3325
3326         * Modules/fetch/FetchRequest.cpp:
3327         (WebCore::setReferrerPolicy): Updated.
3328         (WebCore::setMode): Ditto.
3329         (WebCore::setCredentials): Ditto.
3330         (WebCore::setCache): Ditto.
3331         (WebCore::setRedirect): Ditto.
3332         (WebCore::buildOptions): Ditto.
3333         (WebCore::buildHeaders): Ditto.
3334         (WebCore::FetchRequest::create): Ditto.
3335         * Modules/fetch/FetchRequest.h: Used "using" to repeat the types from FetchOptions
3336         here in FetchRequest. That way the generated bindings can find the types, and we don't
3337         need to do any trick like [ImplementedAs] in thd IDL to make it work.
3338
3339         * Modules/fetch/FetchResponse.cpp:
3340         (WebCore::FetchResponse::error): Updated.
3341         (WebCore::FetchResponse::redirect): Ditto.
3342         (WebCore::FetchResponse::FetchResponse): Ditto.
3343         (WebCore::FetchResponse::startFetching): Ditto.
3344         * Modules/fetch/FetchResponse.h: Moved enum class into the class.
3345
3346         * Modules/mediacontrols/MediaControlsHost.cpp:
3347         (WebCore::MediaControlsHost::externalDeviceType): Updated.
3348         * Modules/mediacontrols/MediaControlsHost.h: Moved enum classs into the class.
3349
3350         * Modules/mediasession/MediaSession.cpp:
3351         (WebCore::MediaSession::MediaSession): Updated.
3352         * Modules/mediasession/MediaSession.h: Moved enum classs into the class.
3353
3354         * Modules/mediasource/MediaSource.cpp:
3355         (WebCore::MediaSource::addSourceBuffer): Updated.
3356         (WebCore::MediaSource::removeSourceBuffer): Ditto.
3357
3358         * Modules/mediasource/MediaSource.h: Moved enum class into the class.
3359
3360         * Modules/mediasource/SourceBuffer.cpp:
3361         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Updated.
3362         (WebCore::SourceBuffer::appendError): Ditto.
3363         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
3364         (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
3365
3366         * Modules/mediasource/SourceBuffer.h: Removed incorrect forward declaration
3367         of EndOfStreamError that also now seems to be unneeded. Moved enum class into
3368         the class.
3369
3370         * Modules/mediastream/MediaDeviceInfo.cpp:
3371         (WebCore::MediaDeviceInfo::MediaDeviceInfo): Updated.
3372         (WebCore::MediaDeviceInfo::create): Ditto.
3373         * Modules/mediastream/MediaDeviceInfo.h: Moved enum class into the class.