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