Unreviewed build fix after r191295.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-10-19  Alex Christensen  <achristensen@webkit.org>
2
3         Unreviewed build fix after r191295.
4
5         * platform/graphics/cairo/GraphicsContextCairo.cpp:
6         (WebCore::GraphicsContext::translatePlatformCTM):
7         (WebCore::GraphicsContext::setPlatformFillColor):
8         (WebCore::GraphicsContext::concatPlatformCTM):
9         (WebCore::GraphicsContext::setPlatformCTM):
10         (WebCore::GraphicsContext::setPlatformShadow):
11         (WebCore::GraphicsContext::rotatePlatformCTM):
12         (WebCore::GraphicsContext::scalePlatformCTM):
13         (WebCore::GraphicsContext::clipOut):
14         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
15         (WebCore::GraphicsContextPlatformPrivate::save):
16         (WebCore::GraphicsContextPlatformPrivate::restore):
17         (WebCore::GraphicsContextPlatformPrivate::flush):
18         (WebCore::GraphicsContextPlatformPrivate::clip):
19         (WebCore::GraphicsContextPlatformPrivate::scalePlatformCTM):
20         (WebCore::GraphicsContextPlatformPrivate::rotatePlatformCTM):
21         (WebCore::GraphicsContextPlatformPrivate::translatePlatformCTM):
22         (WebCore::GraphicsContextPlatformPrivate::concatPlatformCTM):
23         (WebCore::GraphicsContextPlatformPrivate::setPlatformCTM):
24         (WebCore::GraphicsContextPlatformPrivate::syncContext):
25         (WebCore::GraphicsContextPlatformPrivate::scale): Deleted.
26         (WebCore::GraphicsContextPlatformPrivate::rotate): Deleted.
27         (WebCore::GraphicsContextPlatformPrivate::translate): Deleted.
28         (WebCore::GraphicsContextPlatformPrivate::concatCTM): Deleted.
29         (WebCore::GraphicsContextPlatformPrivate::setCTM): Deleted.
30
31 2015-10-19  Tim Horton  <timothy_horton@apple.com>
32
33         Add magnify and rotate gesture event support for Mac
34         https://bugs.webkit.org/show_bug.cgi?id=150179
35         <rdar://problem/8036240>
36
37         Reviewed by Darin Adler.
38
39         No new tests.
40
41         * Configurations/FeatureDefines.xcconfig:
42         New feature flag.
43
44         * Configurations/WebCore.xcconfig:
45         Don't exclude generated gesture sources; they are already #ifdef-guarded.
46
47         * DerivedSources.make:
48         Add GestureEvent.idl for ENABLE_MAC_GESTURE_EVENTS too.
49
50         * WebCore.xcodeproj/project.pbxproj:
51         Add GestureEvents.cpp.
52
53         * bindings/objc/DOMEvents.mm:
54         (kitClass):
55         Support DOMGestureEvent on Mac if the new flag is enabled.
56
57         * dom/mac/GestureEvents.cpp: Added.
58         * page/mac/EventHandlerMac.mm:
59
60         * page/EventHandler.cpp:
61         (WebCore::EventHandler::clear):
62         * page/EventHandler.h:
63         Enable some gesture-related code on Mac if the new flag is enabled.
64
65         * platform/PlatformEvent.h:
66
67 2015-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
68
69         [iOS] Build fix after r191295
70
71         Unreviewed.
72
73         * platform/graphics/cg/GraphicsContextCG.cpp:
74         (WebCore::GraphicsContext::resetPlatformCTM):
75
76 2015-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
77
78         Host GraphicsContext's CTM inside GraphicsContextState
79         https://bugs.webkit.org/show_bug.cgi?id=150146
80
81         Reviewed by Simon Fraser.
82
83         There are 6 operations which interact with CTMs:
84         - Get
85         - Set
86         - Concatenate
87         - Scale
88         - Rotate
89         - Translate
90
91         This patch modifies all these operations so that these operations shadow the
92         platform's CTM inside GraphicsContextState. This way, we don't have to consult
93         with the underlying graphics context in order to know the current CTM.
94
95         There are currently many places in the Core Graphics ports where we will change
96         the platform's CTM out from under the GraphicsContext. This patch migrates
97         those users to going through GraphicsContext, thereby preserving the integrity
98         of the shadowed state.
99
100         No new tests because there is no behavior change.
101
102         * platform/graphics/GraphicsContext.cpp: Setters deletate to platform calls.
103         The getter can just consult with the shadowed state.
104         (WebCore::GraphicsContext::concatCTM):
105         (WebCore::GraphicsContext::scale):
106         (WebCore::GraphicsContext::rotate):
107         (WebCore::GraphicsContext::translate):
108         (WebCore::GraphicsContext::setCTM):
109         (WebCore::GraphicsContext::getCTM):
110         (WebCore::GraphicsContext::beginTransparencyLayer):
111         (WebCore::GraphicsContext::applyDeviceScaleFactor):
112         * platform/graphics/GraphicsContext.h:
113         (WebCore::GraphicsContext::scale):
114         (WebCore::GraphicsContext::checkCTMInvariants): Make sure the shadowed state
115         matches the platform graphics context's state.
116         * platform/graphics/cairo/GraphicsContextCairo.cpp: Renaming functions.
117         (WebCore::GraphicsContext::resetPlatformCTM):
118         (WebCore::GraphicsContext::getPlatformCTM):
119         (WebCore::GraphicsContext::translatePlatformCTM):
120         (WebCore::GraphicsContext::concatPlatformCTM):
121         (WebCore::GraphicsContext::setPlatformCTM):
122         (WebCore::GraphicsContext::rotatePlatformCTM):
123         (WebCore::GraphicsContext::scalePlatformCTM):
124         (WebCore::GraphicsContext::getCTM): Deleted.
125         (WebCore::GraphicsContext::translate): Deleted.
126         (WebCore::GraphicsContext::concatCTM): Deleted.
127         (WebCore::GraphicsContext::setCTM): Deleted.
128         (WebCore::GraphicsContext::rotate): Deleted.
129         (WebCore::GraphicsContext::scale): Deleted.
130         * platform/graphics/cg/GraphicsContextCG.cpp: Renaming functions. Also,
131         migrate CTM setters to go through GraphicsContext.
132         (WebCore::GraphicsContext::resetPlatformCTM):
133         (WebCore::GraphicsContext::platformInit):
134         (WebCore::GraphicsContext::drawNativeImage):
135         (WebCore::drawPatternCallback):
136         (WebCore::GraphicsContext::drawPattern):
137         (WebCore::GraphicsContext::fillPath):
138         (WebCore::GraphicsContext::strokePath):
139         (WebCore::GraphicsContext::fillRect):
140         (WebCore::GraphicsContext::strokeRect):
141         (WebCore::GraphicsContext::scalePlatformCTM):
142         (WebCore::GraphicsContext::rotatePlatformCTM):
143         (WebCore::GraphicsContext::translatePlatformCTM):
144         (WebCore::GraphicsContext::concatPlatformCTM):
145         (WebCore::GraphicsContext::setPlatformCTM):
146         (WebCore::GraphicsContext::getPlatformCTM):
147         (WebCore::GraphicsContext::scale): Deleted.
148         (WebCore::GraphicsContext::rotate): Deleted.
149         (WebCore::GraphicsContext::translate): Deleted.
150         (WebCore::GraphicsContext::concatCTM): Deleted.
151         (WebCore::GraphicsContext::setCTM): Deleted.
152         (WebCore::GraphicsContext::getCTM): Deleted.
153         * platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
154         (WebCore::GraphicsContextPlatformPrivate::save):
155         (WebCore::GraphicsContextPlatformPrivate::restore):
156         (WebCore::GraphicsContextPlatformPrivate::flush):
157         (WebCore::GraphicsContextPlatformPrivate::clip):
158         (WebCore::GraphicsContextPlatformPrivate::scale):
159         (WebCore::GraphicsContextPlatformPrivate::rotate):
160         (WebCore::GraphicsContextPlatformPrivate::translate):
161         (WebCore::GraphicsContextPlatformPrivate::concatCTM):
162         (WebCore::GraphicsContextPlatformPrivate::setCTM):
163         * platform/graphics/transforms/AffineTransform.h:
164         (WebCore::AffineTransform::isEssentiallyEqualTo): Equality comparison on floats
165         is not a good idea. Instead, this function is more valuable. (However, note that
166         it is expected for values in a CTM to hold values close to 0, which means that
167         this function might erroneously return false (similar to operator=()).
168         * platform/graphics/win/GraphicsContextWin.cpp:
169         (WebCore::GraphicsContextPlatformPrivate::scale):
170         (WebCore::GraphicsContextPlatformPrivate::concatPlatformCTM):
171         (WebCore::GraphicsContextPlatformPrivate::setPlatformCTM):
172         (WebCore::GraphicsContextPlatformPrivate::concatCTM): Deleted.
173         (WebCore::GraphicsContextPlatformPrivate::setCTM): Deleted.
174         * platform/mac/DragImageMac.mm:
175         (WebCore::drawAtPoint):
176
177 2015-10-19  Chris Dumez  <cdumez@apple.com>
178
179         Null dereference loading Blink layout test fast/forms/color/input-color-onchange-event.html
180         https://bugs.webkit.org/show_bug.cgi?id=150192
181         <rdar://problem/23135050>
182
183         Reviewed by Darin Adler.
184
185         Calling internals.selectColorInColorChooser() with a non-Element would
186         cause a null dereference. This is because in such case, the implementation
187         method is passed a null pointer and we would fail to null-check it. This
188         patch now does the null-check.
189
190         No new tests, existing test was updated.
191
192         * testing/Internals.cpp:
193         (WebCore::Internals::selectColorInColorChooser):
194
195 2015-10-19  Csaba Osztrogonác  <ossy@webkit.org>
196
197         Fix the !ENABLE(CSS_GRID_LAYOUT) build after r190840
198         https://bugs.webkit.org/show_bug.cgi?id=150322
199
200         Reviewed by Ryosuke Niwa.
201
202         * html/HTMLDetailsElement.cpp:
203
204 2015-10-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
205
206         Binding generator should generate names for JSBuiltins partial interface methods using ImplementedBy value
207         https://bugs.webkit.org/show_bug.cgi?id=150163
208
209         Reviewed by Darin Adler.
210
211         Covered by updated binding tests.
212
213         Updating generation of JS built-in function/attribute name to use the ImplementedBy value of the interface if any.
214         This allows splitting JS built-ins just like is done for IDLs.
215         Updated accordingly the JS Builtin header include.
216
217         * bindings/scripts/CodeGeneratorJS.pm:
218         (GetAttributeGetterName): Updated to pass function object and not only function name.
219         (GetAttributeSetterName): Ditto.
220         (GetFunctionName): Removed unneeded code plus updated to pass function object and not only function name.
221         (GenerateConstructorHelperMethods): Making direct use of GetJSBuiltinFunctionNameFromString since there is no function object for the constructor.
222         (GetJSBuiltinFunctionName): Updated to take into accound ImplementedBy value if any.
223         (GetJSBuiltinFunctionNameFromString):
224         (GetJSBuiltinScopeName): Returns either the interface name or its ImplementedBy value.
225         (AddJSBuiltinIncludesIfNeeded): Updating name of the header in case of partial interface.
226         * bindings/scripts/test/JS/JSTestInterface.cpp:
227         * bindings/scripts/test/ObjC/DOMTestInterface.h:
228         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
229         (-[DOMTestInterface builtinAttribute]):
230         (-[DOMTestInterface setBuiltinAttribute:]):
231         (-[DOMTestInterface builtinFunction]):
232         * bindings/scripts/test/TestSupplemental.idl: Added JSBuiltin attribute and function.
233
234 2015-10-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
235
236         Binding generator should allow generating private JS functions
237         https://bugs.webkit.org/show_bug.cgi?id=150167
238
239         Reviewed by Darin Adler.
240
241         Introducing the "Private" keyword for that purpose.
242         Applying it to MediaDevices.getUserMedia which can be used directly or through navigator.webkitGetUserMedia
243         which could be implemented as JS builtin based on it.
244
245         "Private" functions are added to the prototype with a corresponding private symbol.
246         This symbol must be defined in bindings/js/WebCoreBuiltinNames.h.
247
248         Adding a getUserMediaFromJS function visible from builtins script.
249         Implementing MediaDevices.getUserMedia as a JS builtin based on it.
250
251         Adding binding generator test.
252
253         * CMakeLists.txt: Adding MediaDevices.js.
254         * DerivedSources.make: Ditto.
255         * Modules/mediastream/MediaDevices.h:
256         (WebCore::MediaDevices::getUserMediaFromJS):
257         * Modules/mediastream/MediaDevices.idl: Marking getUserMediaFromJS private and getUserMedia JSBuiltin.
258         * Modules/mediastream/MediaDevices.js: Added.
259         (getUserMedia):
260         * bindings/js/WebCoreBuiltinNames.h:
261         * bindings/js/WebCoreJSBuiltins.cpp:
262         * bindings/js/WebCoreJSBuiltins.h:
263         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
264         (WebCore::JSBuiltinFunctions::mediaDevicesBuiltins):
265         * bindings/scripts/CodeGeneratorGObject.pm: Skipping generation of Private functions.
266         (SkipFunction):
267         * bindings/scripts/CodeGeneratorJS.pm:
268         (GenerateImplementation): Disabling addition of private function in table and adding private member field to the prototype.
269         * bindings/scripts/CodeGeneratorObjC.pm: Skipping generation of Private functions.
270         (SkipFunction):
271         * bindings/scripts/IDLAttributes.txt: Adding Private keyword.
272         * bindings/scripts/test/JS/JSTestObj.cpp: Adding Private keyword test.
273         (WebCore::JSTestObjPrototype::finishCreation):
274         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
275         * bindings/scripts/test/TestObj.idl:
276
277 2015-10-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
278
279         [Streams API] Implement ReadableStream tee
280         https://bugs.webkit.org/show_bug.cgi?id=146315
281
282         Reviewed by Darin Adler.
283
284         Covered by rebased test.
285
286         * Modules/streams/ReadableStream.js:
287         (tee): Removing not implemented exception throwing.
288         * Modules/streams/ReadableStreamInternals.js:
289         (teeReadableStream): Implementing as per spec.
290         (teeReadableStreamPullFunction): Ditto.
291         (teeReadableStreamBranch2CancelFunction): Ditto.
292
293 2015-10-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
294
295         [Streams API] Add skeleton for initial WritableStream support
296         https://bugs.webkit.org/show_bug.cgi?id=149951
297
298         Reviewed by Darin Adler.
299
300         This basically adds an empty WritableStream object without initializing the object. It also adds all empty
301         methods by raising an exception.
302
303         The reason why the object is not fully initialized is that it requires some other support and some refactorings
304         to share more code with ReadableStream and we will make in following patches.
305
306         Tests are covered by current set and their expectations are properly updated.
307
308         * CMakeLists.txt:
309         * DerivedSources.cpp:
310         * DerivedSources.make:
311         * WebCore.vcxproj/WebCore.vcxproj:
312         * WebCore.vcxproj/WebCore.vcxproj.filters:
313         * WebCore.xcodeproj/project.pbxproj:
314         * bindings/js/WebCoreJSBuiltins.cpp:
315         * bindings/js/WebCoreJSBuiltins.h: Build infrastructure.
316         * Modules/streams/WritableStream.idl: Added all methods and attributes.
317         * Modules/streams/WritableStream.js:
318         (initializeWritableStream):
319         (abort):
320         (close):
321         (write):
322         (closed):
323         (ready):
324         (state): Added all by throwing an EvalError.
325
326 2015-10-18  Chris Dumez  <cdumez@apple.com>
327
328         Script element with an empty for or event attributes should not execute
329         https://bugs.webkit.org/show_bug.cgi?id=148855
330         <rdar://problem/22588156>
331
332         Reviewed by Darin Adler.
333
334         A script element with an empty for or event attributes should not execute
335         as per:
336         https://html.spec.whatwg.org/multipage/scripting.html#prepare-a-script (step 12)
337
338         Our implementation had a bug where it would not correctly differentiate
339         an empty attribute from a missing one. This patch fixes this.
340
341         No new tests, already covered by existing test.
342
343         * dom/ScriptElement.cpp:
344         (WebCore::ScriptElement::isScriptForEventSupported):
345
346 2015-10-18  Chris Dumez  <cdumez@apple.com>
347
348         WebKit must support all JavaScript MIME types in HTML5 spec
349         https://bugs.webkit.org/show_bug.cgi?id=148854
350         <rdar://problem/22588195>
351
352         Reviewed by Darin Adler.
353
354         WebKit did not execute certain EcmaScript MIME types although the HTML
355         specification says all user agents should support those:
356         https://html.spec.whatwg.org/multipage/scripting.html#javascript-mime-type
357
358         In particular, the following MIME types are now recognized as valid and
359         executed: "application/x-ecmascript", "text/javascript1.0",
360         "text/javascript1.4", "text/javascript1.5", "text/x-javascript",
361         "text/x-ecmascript".
362
363         The new behavior is consistent with Firefox.
364
365         No new tests, already covered by existing test.
366
367         * platform/MIMETypeRegistry.cpp:
368         (WebCore::initializeSupportedJavaScriptMIMETypes):
369
370 2015-10-18  Sungmann Cho  <sungmann.cho@navercorp.com>
371
372         [Win] Fix the Windows builds.
373         https://bugs.webkit.org/show_bug.cgi?id=150300
374
375         Reviewed by Darin Adler.
376
377         Add missing files to WebCore.vcxproj.
378         Add missing #includes to CSSAllInOne.cpp and HTMLElementsAllInOne.cpp.
379
380         No new tests, no behavior change.
381
382         * WebCore.vcxproj/WebCore.vcxproj:
383         * WebCore.vcxproj/WebCore.vcxproj.filters:
384         * css/CSSAllInOne.cpp:
385         * html/HTMLElementsAllInOne.cpp:
386
387 2015-10-18  Sungmann Cho  <sungmann.cho@navercorp.com>
388
389         Fix the builds with ENABLE_CONTENT_EXTENSIONS=OFF.
390         https://bugs.webkit.org/show_bug.cgi?id=150302
391
392         Reviewed by Darin Adler.
393
394         Add missing #if ENABLE(CONTENT_EXTENSIONS).
395
396         No new tests, no behavior change.
397
398         * page/UserContentController.h:
399
400 2015-10-18  Joonghun Park  <jh718.park@samsung.com>
401
402         [EFL] Fix debug build break since r191198
403         https://bugs.webkit.org/show_bug.cgi?id=150277
404
405         Reviewed by Darin Adler.
406
407         No new tests, no new behaviours.
408
409         Use the correct %"PRIu64" for uint64_t,
410         instead of %llu.
411
412         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
413         (WebCore::IDBClient::IDBDatabase::fireVersionChangeEvent):
414         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
415         (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
416         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp:
417         (WebCore::IDBDatabaseBackend::processPendingOpenCalls):
418         (WebCore::IDBDatabaseBackend::openConnectionInternal):
419         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
420         (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChange):
421
422 2015-10-18  Sungmann Cho  <sungmann.cho@navercorp.com>
423
424         Fix the builds with ENABLE_INDEX_DATABASE=OFF.
425         https://bugs.webkit.org/show_bug.cgi?id=150301
426
427         Reviewed by Darin Adler.
428
429         Add missing #if ENABLE(INDEXED_DATABASE).
430
431         No new tests, no behavior change.
432
433         * page/Page.cpp:
434
435 2015-10-18  Myles C. Maxfield  <mmaxfield@apple.com>
436
437         [Cocoa] [Win] Remove unused code from GraphicsContext
438         https://bugs.webkit.org/show_bug.cgi?id=150304
439
440         Reviewed by Darin Adler.
441
442         No new tests because there is no behavior change.
443
444         * platform/graphics/GraphicsContext.h:
445         * platform/graphics/cg/GraphicsContextCG.cpp:
446         (WebCore::GraphicsContext::setAllowsFontSmoothing): Deleted.
447
448 2015-10-18  Antti Koivisto  <antti@apple.com>
449
450         Computed style should work correctly with slotted elements that have display:none
451         https://bugs.webkit.org/show_bug.cgi?id=150237
452
453         Reviewed by Andreas Kling..
454
455         If an element has display:none we don't normally retain or even compute its style (as it is not rendered).
456         If getComputedStyle is invoked for such element we resolve the style (along with any ancestors) and cache
457         it separately to rare data. This path needs to work with slotted elements in shadow trees.
458
459         This patch also make computedStyle() iterative rather than recursive.
460
461         Test: fast/shadow-dom/computed-style-display-none.html
462
463         * dom/Document.cpp:
464         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
465
466             Pass in the parent style instead of invoking computedStyle() recursively.
467
468         * dom/Document.h:
469         * dom/Element.cpp:
470         (WebCore::beforeOrAfterPseudoElement):
471         (WebCore::Element::existingComputedStyle):
472         (WebCore::Element::resolveComputedStyle):
473
474             Iterative resolve function that uses composed tree iterator.
475
476         (WebCore::Element::computedStyle):
477
478             Factor into helpers.
479
480         * dom/Element.h:
481         * dom/Node.cpp:
482         (WebCore::Node::computedStyle):
483
484             Use the composed tree iterator.
485
486         * html/HTMLSelectElement.cpp:
487         (WebCore::HTMLSelectElement::selectOption):
488
489             Call updateValidity() before calling renderer->updateFromElement(). Calling updateFromElement()
490             may end up in Element::computedStyle() which can asserts if validity is not up to date.
491
492 2015-10-18  Myles C. Maxfield  <mmaxfield@apple.com>
493
494         Stop honoring the user default "WebKitKerningAndLigaturesEnabledByDefault"
495         https://bugs.webkit.org/show_bug.cgi?id=150287
496
497         Reviewed by Simon Fraser.
498
499         This user default is currently on by default. Therefore, by setting the user default,
500         users can only disable kerning / ligatures (rather than enable it).
501
502         There are a few reasons why we should stop honoring it:
503
504         1. In the brave new world of font-feature-settings and font-variant-ligatures, there
505         are many different kinds of ligatures which may be enabled at will. The simplistic
506         statement of "turn on ligatures" no longer has any meaning.
507
508         2. If a user wants to disable kerning / ligatures, he/she can do it with a user
509         stylesheet.
510
511         3. The default isn't able to be tested with DumpRenderTree or WebKitTestRunner.
512
513         4. I have never heard of anyone actually using this user default.
514
515         * platform/graphics/FontCascade.cpp:
516         (WebCore::FontCascade::setDefaultKerning): Deleted.
517         (WebCore::FontCascade::setDefaultLigatures): Deleted.
518         * platform/graphics/FontCascade.h:
519         (WebCore::FontCascade::advancedTextRenderingMode):
520
521 2015-10-18  Commit Queue  <commit-queue@webkit.org>
522
523         Unreviewed, rolling out r191250 and r191253.
524         https://bugs.webkit.org/show_bug.cgi?id=150296
525
526         Broke all the tests on Windows (Requested by ap on #webkit).
527
528         Reverted changesets:
529
530         "Stop honoring the user default
531         "WebKitKerningAndLigaturesEnabledByDefault""
532         https://bugs.webkit.org/show_bug.cgi?id=150287
533         http://trac.webkit.org/changeset/191250
534
535         "Build fix after r191250"
536         http://trac.webkit.org/changeset/191253
537
538 2015-10-17  David Hyatt  <hyatt@apple.com>
539
540         Implement the CSS4 'revert' keyword.
541         https://bugs.webkit.org/show_bug.cgi?id=149702
542
543         Reviewed by Simon Fraser.
544
545         Added new tests in fast/css and fast/css/variables.
546
547         * CMakeLists.txt:
548         * WebCore.xcodeproj/project.pbxproj:
549         Add CSSRevertValue to the project and makefiles.
550
551         * css/CSSParser.cpp:
552         (WebCore::parseKeywordValue):
553         Make sure to handle "revert" in the keyword parsing path (along with inherit/initial/unset).
554
555         (WebCore::CSSParser::parseValue):
556         (WebCore::CSSParser::parseCustomPropertyDeclaration):
557         At the parser level, "revert" is just like inherit/initial/unset and gets its own special
558         singleton value, CSSRevertValue.
559
560         * css/CSSRevertValue.cpp: Added.
561         (WebCore::CSSRevertValue::customCSSText):
562         * css/CSSRevertValue.h: Added.
563         (WebCore::CSSRevertValue::create):
564         (WebCore::CSSRevertValue::equals):
565         (WebCore::CSSRevertValue::CSSRevertValue):
566         This value is identical to the inherit/initial/unset values, i.e., its own special value
567         that can be used to indicate a revert when doing style resolution.
568
569         * css/CSSValue.cpp:
570         (WebCore::CSSValue::cssValueType):
571         (WebCore::CSSValue::equals):
572         (WebCore::CSSValue::cssText):
573         (WebCore::CSSValue::destroy):
574         * css/CSSValue.h:
575         (WebCore::CSSValue::isInheritedValue):
576         (WebCore::CSSValue::isInitialValue):
577         (WebCore::CSSValue::isUnsetValue):
578         (WebCore::CSSValue::isRevertValue):
579         Add the RevertClass to CSSValue and make sure it is handled in all the appropriate methods.
580
581         * css/CSSValueKeywords.in:
582         Add the "revert" keyword to the list of allowed CSS keywords.
583
584         * css/CSSValuePool.cpp:
585         (WebCore::CSSValuePool::CSSValuePool):
586         * css/CSSValuePool.h:
587         (WebCore::CSSValuePool::createRevertValue):
588         Add support for a CSSRevertValue singleton, just like inherit/unset/initial.
589
590         * css/FontLoader.cpp:
591         (WebCore::FontLoader::resolveFontStyle):
592         Add "unset" and "revert" as special keywords to be ignored. This code seems to be turned off,
593         but patching it anyway.
594
595         * css/SelectorChecker.h:
596         Add a MatchDefault value of 0 to the LinkMatchMask. This enables it to be used as an index
597         to the correct value in Property (in the style resolution code).
598
599         * css/StyleResolver.cpp:
600         (WebCore::StyleResolver::State::initForStyleResolve):
601         Delete any lingering old CascadedProperty rollbacks for UA/user rules.
602
603         (WebCore::StyleResolver::styleForKeyframe):
604         (WebCore::StyleResolver::styleForPage):
605         (WebCore::StyleResolver::applyMatchedProperties):
606         Pass along the MatchResult as an additional parameter, since we need it to lazily compute
607         the cascade rollbacks if the "revert" keyword is encountered.
608
609         (WebCore::StyleResolver::cascadedPropertiesForRollback):
610         This method will lazily create and return a new CascadedProperties pointer that is cached
611         in the StyleResolver's state. This will contain only UA rules (for user reverts) and UA/user
612         rules (for author reverts). These will only be computed at most once for a given element
613         when doing a reversion, and they will be computed lazily, i.e., only if a revert is
614         requested.
615
616         (WebCore::StyleResolver::applyProperty):
617         Pass along the LinkMatchMask and the MatchResult to applyProperty. This way we know specifically
618         which link type we were computing if we have to revert (so that we roll back and look at the
619         same index in the reverted version). The MatchResult is passed along because it is needed
620         to build the CascadedProperties rollbacks.
621
622         The basic idea is that if a revert is encountered, the level that the rule came from is
623         checked. If it is UA level, just treat as "unset." If it is author or user level, get
624         the correct CascadedProperties rollback and repeat the applyProperty using the property
625         found in the rollback. If the property is not present in the cascade rollback, then the
626         revert becomes an unset.
627
628         (WebCore::StyleResolver::CascadedProperties::hasCustomProperty):
629         (WebCore::StyleResolver::CascadedProperties::customProperty):
630         Helpers used by applyProperty to check on custom properties, since they can revert too
631         just like a regular property can.
632
633         (WebCore::StyleResolver::CascadedProperties::setPropertyInternal):
634         (WebCore::StyleResolver::CascadedProperties::set):
635         (WebCore::StyleResolver::CascadedProperties::setDeferred):
636         Passing along the CascadeLevel (UA, User, Author) so that it can be stored in the Property.
637         This way when we do property application, we always know where the rule came from so
638         that the reversion can be handled properly.
639
640         (WebCore::StyleResolver::CascadedProperties::addStyleProperties):
641         (WebCore::cascadeLevelForIndex):
642         (WebCore::StyleResolver::CascadedProperties::addMatches):
643         When style properties are added, also figure out the CascadeLevel and pass it along to be
644         stored in the Property. We use the MatchResult's ranges to know where a property comes from.
645
646         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
647         (WebCore::StyleResolver::CascadedProperties::Property::apply):
648         (WebCore::StyleResolver::applyCascadedProperties):
649         Pass along the MatchResult so we know how to build the rollback.
650
651         * css/StyleResolver.h:
652         (WebCore::StyleResolver::State::cascadeLevel):
653         (WebCore::StyleResolver::State::setCascadeLevel):
654         (WebCore::StyleResolver::State::authorRollback):
655         (WebCore::StyleResolver::State::userRollback):
656         (WebCore::StyleResolver::State::setAuthorRollback):
657         (WebCore::StyleResolver::State::setUserRollback):
658         (WebCore::StyleResolver::state):
659         (WebCore::StyleResolver::cascadeLevel):
660         (WebCore::StyleResolver::setCascadeLevel):
661         Move CascadedProperties into the header. Add CascadeLevel to Property. Add the level and
662         rollbacks to the resolver's state.
663
664 2015-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
665
666         Delete FontPlatformData::allowsLigatures()
667         https://bugs.webkit.org/show_bug.cgi?id=150286
668
669         Reviewed by Dan Bernstein.
670
671         This function is only used to force ligatures on for complex fonts (where "complex"
672         means "does not support the letter 'a'"). However, ligatures are turned on for all
673         fonts by default, which means that this function is unnecessary.
674
675         Required ligatures, such as those which make these complex scripts legible, are always
676         enabled, no matter what.
677
678         Test: fast/text/required-ligatures.html
679
680         * platform/graphics/FontPlatformData.h:
681         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
682         (WebCore::FontPlatformData::allowsLigatures): Deleted.
683         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
684         (WebCore::Font::getCFStringAttributes):
685
686 2015-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
687
688         Stop honoring the user default "WebKitKerningAndLigaturesEnabledByDefault"
689         https://bugs.webkit.org/show_bug.cgi?id=150287
690
691         Reviewed by Simon Fraser.
692
693         This user default is currently on by default. Therefore, by setting the user default,
694         users can only disable kerning / ligatures (rather than enable it).
695
696         There are a few reasons why we should stop honoring it:
697
698         1. In the brave new world of font-feature-settings and font-variant-ligatures, there
699         are many different kinds of ligatures which may be enabled at will. The simplistic
700         statement of "turn on ligatures" no longer has any meaning.
701
702         2. If a user wants to disable kerning / ligatures, he/she can do it with a user
703         stylesheet.
704
705         3. The default isn't able to be tested with DumpRenderTree or WebKitTestRunner.
706
707         4. I have never heard of anyone actually using this user default.
708
709         * platform/graphics/FontCascade.cpp:
710         (WebCore::FontCascade::setDefaultKerning): Deleted.
711         (WebCore::FontCascade::setDefaultLigatures): Deleted.
712         * platform/graphics/FontCascade.h:
713         (WebCore::FontCascade::advancedTextRenderingMode):
714
715 2015-10-17  Dan Bernstein  <mitz@apple.com>
716
717         [Cocoa] Stop using WKAXRegisterRemoteApp
718         https://bugs.webkit.org/show_bug.cgi?id=150283
719
720         Reviewed by Alexey Proskuryakov.
721
722         * platform/spi/ios/GraphicsServicesSPI.h: Added declaration of GSSystemRootDirectory.
723
724 2015-10-17  Chris Dumez  <cdumez@apple.com>
725
726         td and th should use HTMLTableDataCellElement and HTMLTableHeaderCellElement interfaces
727         https://bugs.webkit.org/show_bug.cgi?id=148859
728         <rdar://problem/22588664>
729
730         Reviewed by Ryosuke Niwa.
731
732         td and th should use HTMLTableDataCellElement and HTMLTableHeaderCellElement interfaces
733         as per the latest HTML specification:
734         https://html.spec.whatwg.org/multipage/tables.html#htmltabledatacellelement
735         https://html.spec.whatwg.org/multipage/tables.html#htmltableheadercellelement
736
737         This patch aligns our behavior with the specification and IE. Firefox and Chrome do not
738         seem to expose HTMLTableDataCellElement / HTMLTableHeaderCellElement at this time.
739
740         The compatibility risk is low, given that the API stays the same and those new
741         interfaces inherit the pre-existing HTMLTableCellElement interface.
742
743         No new tests, already covered by existing tests.
744
745         * CMakeLists.txt:
746         * DerivedSources.cpp:
747         * DerivedSources.make:
748         * WebCore.vcxproj/WebCore.vcxproj:
749         * WebCore.vcxproj/WebCore.vcxproj.filters:
750         * WebCore.xcodeproj/project.pbxproj:
751         * html/HTMLTableCellElement.cpp:
752         (WebCore::HTMLTableCellElement::HTMLTableCellElement):
753         (WebCore::HTMLTableCellElement::colSpan): Deleted.
754         * html/HTMLTableCellElement.h:
755         * html/HTMLTableCellElement.idl:
756         * html/HTMLTableDataCellElement.h: Added.
757         * html/HTMLTableDataCellElement.idl: Added.
758         * html/HTMLTableHeaderCellElement.h: Added.
759         * html/HTMLTableHeaderCellElement.idl: Added.
760         * html/HTMLTableRowElement.cpp:
761         (WebCore::HTMLTableRowElement::insertCell):
762         * html/HTMLTagNames.in:
763
764 2015-10-17  Zalan Bujtas  <zalan@apple.com>
765
766         RenderBlockFlow::xPositionForFloatIncludingMargin/yPositionForFloatIncludingMargin/flipFloatForWritingModeForChild
767         should all take FloatingObject reference.
768         https://bugs.webkit.org/show_bug.cgi?id=150267
769
770         Reviewed by Simon Fraser.
771
772         No change in behaviour.
773
774         * rendering/RenderBlockFlow.cpp:
775         (WebCore::RenderBlockFlow::addOverflowFromFloats):
776         (WebCore::RenderBlockFlow::paintFloats):
777         (WebCore::RenderBlockFlow::clipOutFloatingObjects):
778         (WebCore::RenderBlockFlow::addOverhangingFloats):
779         (WebCore::RenderBlockFlow::flipFloatForWritingModeForChild):
780         (WebCore::RenderBlockFlow::hitTestFloats):
781         (WebCore::RenderBlockFlow::adjustForBorderFit):
782         * rendering/RenderBlockFlow.h:
783         (WebCore::RenderBlockFlow::xPositionForFloatIncludingMargin):
784         (WebCore::RenderBlockFlow::yPositionForFloatIncludingMargin):
785
786 2015-10-17  Simon Fraser  <simon.fraser@apple.com>
787
788         Sort the project file.
789
790         * WebCore.xcodeproj/project.pbxproj:
791
792 2015-10-16  Simon Fraser  <simon.fraser@apple.com>
793
794         Enhance TextStream for logging, remove subclasses, log more things
795         https://bugs.webkit.org/show_bug.cgi?id=150269
796
797         Reviewed by Zalan Bujtas.
798
799         Remove the various TextStream subclasses that only existed to support indenting,
800         and output additional types. Add output for more WebCore and WebKit2 types, and
801         just use TextStream everywhere.
802         
803         TextStream is enhance to support grouping (open paren and intent), with a 
804         stack-based class to open/end a group.
805         
806         Remove some SVG-specific duplicate output functions.
807         
808         Outdent namespace contents of GraphicsTypes.h.
809         
810         * CMakeLists.txt:
811         * WebCore.xcodeproj/project.pbxproj:
812         * dom/ViewportArguments.cpp:
813         (WebCore::operator<<):
814         * dom/ViewportArguments.h:
815         * page/ViewportConfiguration.cpp:
816         (WebCore::operator<<):
817         (WebCore::ViewportConfiguration::description):
818         (WebCore::ViewportConfigurationTextStream::ViewportConfigurationTextStream): Deleted.
819         (WebCore::ViewportConfigurationTextStream::increaseIndent): Deleted.
820         (WebCore::ViewportConfigurationTextStream::decreaseIndent): Deleted.
821         (WebCore::dumpProperty): Deleted.
822         (WebCore::ViewportConfigurationTextStream::writeIndent): Deleted.
823         (WebCore::ViewportConfigurationTextStream::operator<<): Deleted.
824         * page/ViewportConfiguration.h:
825         * page/scrolling/ScrollingConstraints.cpp:
826         (WebCore::operator<<):
827         * page/scrolling/ScrollingConstraints.h:
828         * page/scrolling/ScrollingCoordinator.cpp:
829         (WebCore::operator<<):
830         * page/scrolling/ScrollingCoordinator.h:
831         * platform/animation/TimingFunction.cpp: Added.
832         (WebCore::operator<<):
833         * platform/animation/TimingFunction.h:
834         * platform/graphics/Color.cpp:
835         (WebCore::operator<<):
836         * platform/graphics/Color.h:
837         * platform/graphics/FloatPoint3D.cpp:
838         (WebCore::operator<<):
839         * platform/graphics/FloatPoint3D.h:
840         * platform/graphics/FloatRoundedRect.cpp:
841         (WebCore::operator<<):
842         * platform/graphics/FloatRoundedRect.h:
843         * platform/graphics/GraphicsLayer.cpp:
844         (WebCore::operator<<):
845         * platform/graphics/GraphicsLayer.h:
846         * platform/graphics/GraphicsTypes.cpp:
847         (WebCore::operator<<):
848         * platform/graphics/GraphicsTypes.h:
849         * platform/graphics/ca/PlatformCAAnimation.cpp: Added.
850         (WebCore::operator<<):
851         * platform/graphics/ca/PlatformCAAnimation.h:
852         * platform/graphics/ca/PlatformCALayer.cpp:
853         (WebCore::operator<<):
854         * platform/graphics/ca/PlatformCALayer.h:
855         * platform/graphics/filters/FilterOperation.cpp:
856         (WebCore::operator<<):
857         * platform/graphics/filters/FilterOperation.h:
858         * platform/graphics/filters/FilterOperations.cpp:
859         (WebCore::operator<<):
860         * platform/graphics/filters/FilterOperations.h:
861         * platform/graphics/filters/PointLightSource.cpp:
862         (WebCore::operator<<): Deleted.
863         * platform/graphics/filters/SpotLightSource.cpp:
864         (WebCore::operator<<): Deleted.
865         * platform/graphics/transforms/AffineTransform.cpp:
866         (WebCore::operator<<):
867         * platform/graphics/transforms/AffineTransform.h:
868         * platform/graphics/transforms/TransformationMatrix.cpp:
869         (WebCore::operator<<):
870         * platform/graphics/transforms/TransformationMatrix.h:
871         * platform/text/TextStream.cpp:
872         (WebCore::TextStream::startGroup):
873         (WebCore::TextStream::endGroup):
874         (WebCore::TextStream::nextLine):
875         (WebCore::TextStream::writeIndent):
876         * platform/text/TextStream.h:
877         (WebCore::TextStream::operator<<):
878         (WebCore::TextStream::dumpProperty):
879         (WebCore::TextStream::increaseIndent):
880         (WebCore::TextStream::decreaseIndent):
881         (WebCore::TextStream::GroupScope::GroupScope):
882         (WebCore::TextStream::GroupScope::~GroupScope):
883         * rendering/svg/SVGRenderTreeAsText.cpp:
884         (WebCore::operator<<): Deleted.
885         * rendering/svg/SVGRenderTreeAsText.h:
886
887 2015-10-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
888
889         Finalize bug 149952 patch
890         https://bugs.webkit.org/show_bug.cgi?id=150238
891
892         Reviewed by Darin Adler.
893
894         No change in behavior.
895
896         * bindings/js/JSDOMConstructor.h:
897         (WebCore::JSDOMConstructor<JSClass>::finishCreation): Marked as inline.
898         (WebCore::JSDOMConstructor<JSClass>::getConstructData): Marked as inline.
899
900 2015-10-16  Zalan Bujtas  <zalan@apple.com>
901
902         RenderBlockFlow::*logical*ForFloat should take FloatingObject reference.
903         https://bugs.webkit.org/show_bug.cgi?id=150266
904
905         Reviewed by Simon Fraser.
906
907         No change in behaviour.
908
909         * rendering/FloatingObjects.cpp:
910         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
911         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
912         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
913         (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining):
914         (WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded):
915         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
916         (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
917         * rendering/RenderBlockFlow.cpp:
918         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
919         (WebCore::RenderBlockFlow::repaintOverhangingFloats):
920         (WebCore::RenderBlockFlow::insertFloatingObject):
921         (WebCore::RenderBlockFlow::removeFloatingObject):
922         (WebCore::RenderBlockFlow::removeFloatingObjectsBelow):
923         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
924         (WebCore::RenderBlockFlow::positionNewFloats):
925         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
926         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
927         (WebCore::RenderBlockFlow::addOverhangingFloats):
928         (WebCore::RenderBlockFlow::hasOverhangingFloat):
929         (WebCore::RenderBlockFlow::addIntrudingFloats):
930         * rendering/RenderBlockFlow.h:
931         (WebCore::RenderBlockFlow::logicalTopForFloat):
932         (WebCore::RenderBlockFlow::logicalBottomForFloat):
933         (WebCore::RenderBlockFlow::logicalLeftForFloat):
934         (WebCore::RenderBlockFlow::logicalRightForFloat):
935         (WebCore::RenderBlockFlow::logicalWidthForFloat):
936         (WebCore::RenderBlockFlow::logicalHeightForFloat):
937         (WebCore::RenderBlockFlow::setLogicalTopForFloat):
938         (WebCore::RenderBlockFlow::setLogicalLeftForFloat):
939         (WebCore::RenderBlockFlow::setLogicalHeightForFloat):
940         (WebCore::RenderBlockFlow::setLogicalWidthForFloat):
941         (WebCore::RenderBlockFlow::logicalSizeForFloat): Deleted.
942         * rendering/RenderBlockLineLayout.cpp:
943         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
944         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
945         (WebCore::RenderBlockFlow::positionNewFloatOnLine):
946         * rendering/RenderBox.cpp:
947         (WebCore::RenderBox::addOverflowFromChild):
948         * rendering/RenderBox.h:
949         (WebCore::RenderBox::addOverflowFromChild):
950         * rendering/line/BreakingContext.h:
951         (WebCore::BreakingContext::handleFloat):
952         * rendering/line/LineWidth.cpp:
953         (WebCore::newFloatShrinksLine):
954         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
955         * rendering/shapes/ShapeOutsideInfo.cpp:
956         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):
957
958 2015-10-16  Jiewen Tan  <jiewen_tan@apple.com>
959
960         Avoid to insert TAB before HTML element.
961         https://bugs.webkit.org/show_bug.cgi?id=149295
962         <rdar://problem/22746706>
963
964         Reviewed by Ryosuke Niwa.
965
966         This is a merge of Blink r175047:
967         https://codereview.chromium.org/306583005
968
969         This patch avoids InsertTextCommand::insertTab before HTML element because
970         we can't set Text node as document element.
971
972         Test: editing/execCommand/insert-tab-to-html-element-crash.html
973
974         * editing/InsertTextCommand.cpp:
975         (WebCore::InsertTextCommand::insertTab):
976
977 2015-10-16  Commit Queue  <commit-queue@webkit.org>
978
979         Unreviewed, rolling out r191204.
980         https://bugs.webkit.org/show_bug.cgi?id=150263
981
982         This change is causing existing tests to fail (Requested by
983         ryanhaddad on #webkit).
984
985         Reverted changeset:
986
987         "Computed style should work correctly with slotted elements
988         that have display:none"
989         https://bugs.webkit.org/show_bug.cgi?id=150237
990         http://trac.webkit.org/changeset/191204
991
992 2015-10-16  Alex Christensen  <achristensen@webkit.org>
993
994         Disabled content blockers should not block any loads
995         https://bugs.webkit.org/show_bug.cgi?id=150261
996
997         Reviewed by Brady Eidson.
998
999         This fix was tested manually by reloading without content blockers
1000         on websites with iframes and content blockers that block the contents of the iframes.
1001
1002         * page/UserContentController.cpp:
1003         (WebCore::UserContentController::removeAllUserContentExtensions):
1004         (WebCore::contentExtensionsEnabled):
1005         (WebCore::UserContentController::processContentExtensionRulesForLoad):
1006         (WebCore::UserContentController::actionsForResourceLoad):
1007         Check the DocumentLoader of the main frame when checking if content extensions are disabled,
1008         because that is the DocumentLoader that has the flag from reloading without content blockers.
1009
1010 2015-10-16  Simon Fraser  <simon.fraser@apple.com>
1011
1012         Make TextStream the canonical way to log classes in WebCore
1013         https://bugs.webkit.org/show_bug.cgi?id=150256
1014
1015         Reviewed by Sam Weinig.
1016
1017         We vacillated between PrintStream and TextStream as being the canonical way
1018         to stringify WebCore data structures. This patch solidifies TextStream
1019         as the solution, since it has convenient stream syntax, and is what we
1020         use for render tree dumps.
1021
1022         Remove TextStream member functions that output non-simple structs
1023         (sizes, points and rects), replacing them with free operator<< functions
1024         in the .cpp file for the relevant class. Formatting is currently consistent
1025         with RenderTreeAsText output, to avoid breaking tests.
1026
1027         Remove custom FloatRect outputting in SVG and RemoteLayerTreeTransaction.
1028
1029         * CMakeLists.txt:
1030         * WebCore.xcodeproj/project.pbxproj:
1031         * platform/graphics/FloatPoint.cpp:
1032         (WebCore::operator<<):
1033         (WebCore::FloatPoint::dump): Deleted.
1034         * platform/graphics/FloatPoint.h:
1035         * platform/graphics/FloatRect.cpp:
1036         (WebCore::operator<<):
1037         (WebCore::FloatRect::dump): Deleted.
1038         * platform/graphics/FloatRect.h:
1039         * platform/graphics/FloatSize.cpp:
1040         (WebCore::FloatSize::FloatSize):
1041         (WebCore::operator<<):
1042         (WebCore::FloatSize::dump): Deleted.
1043         * platform/graphics/FloatSize.h:
1044         * platform/graphics/IntPoint.cpp:
1045         (WebCore::operator<<):
1046         (WebCore::IntPoint::dump): Deleted.
1047         * platform/graphics/IntPoint.h:
1048         * platform/graphics/IntRect.cpp:
1049         (WebCore::operator<<):
1050         (WebCore::IntRect::dump): Deleted.
1051         * platform/graphics/IntRect.h:
1052         * platform/graphics/IntSize.cpp:
1053         (WebCore::operator<<):
1054         (WebCore::IntSize::dump): Deleted.
1055         * platform/graphics/IntSize.h:
1056         * platform/graphics/LayoutPoint.cpp: Copied from Source/WebCore/platform/graphics/IntPoint.cpp.
1057         (WebCore::operator<<):
1058         * platform/graphics/LayoutPoint.h:
1059         * platform/graphics/LayoutRect.cpp:
1060         (WebCore::operator<<):
1061         * platform/graphics/LayoutRect.h:
1062         * platform/graphics/LayoutSize.cpp: Copied from Source/WebCore/platform/graphics/IntPoint.cpp.
1063         (WebCore::operator<<):
1064         * platform/graphics/LayoutSize.h:
1065         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1066         (WebCore::MediaSampleAVFObjC::dump):
1067         * platform/text/TextStream.cpp:
1068         (WebCore::TextStream::operator<<):
1069         * platform/text/TextStream.h:
1070         * rendering/svg/SVGRenderTreeAsText.cpp:
1071         (WebCore::operator<<): Deleted.
1072
1073 2015-10-16  Brent Fulgham  <bfulgham@apple.com>
1074
1075         Hide all plugin names except Flash, Java, and QuickTime
1076         https://bugs.webkit.org/show_bug.cgi?id=149014
1077
1078         Reviewed by Darin Adler.
1079
1080         Revise plugin interface so that sites cannot iterate over all plugins to obtain
1081         a list of installed plugins for fingerprinting purposes. Sites need to ask for
1082         specific plugins by name, rather than iterating and comparing to avoid making
1083         this information accessible for fingerprinting purposes.
1084
1085         * plugins/DOMPluginArray.cpp:
1086         (WebCore::DOMPluginArray::length): Only return length of the plugins we are
1087         allowing to be seen.
1088         (WebCore::DOMPluginArray::item): Only iterate through the plugins we are
1089         allowing to be seen.
1090         * plugins/PluginData.cpp:
1091         (WebCore::PluginData::publiclyVisiblePlugins): Added.
1092         * plugins/PluginData.h:
1093
1094 2015-10-16  Brady Eidson  <beidson@apple.com>
1095
1096         "enum class" some IDB enums.
1097         https://bugs.webkit.org/show_bug.cgi?id=150246
1098
1099         Reviewed by Alex Christensen.
1100
1101         No new tests (No change in behavior).
1102
1103         * Modules/indexeddb/IDBKeyPath.cpp:
1104         (WebCore::IDBIsValidKeyPath):
1105         (WebCore::IDBParseKeyPath):
1106         (WebCore::IDBKeyPath::IDBKeyPath):
1107         (WebCore::IDBKeyPath::isValid):
1108         (WebCore::IDBKeyPath::operator==):
1109         (WebCore::IDBKeyPath::encode):
1110         (WebCore::IDBKeyPath::decode):
1111         * Modules/indexeddb/IDBKeyPath.h:
1112         (WebCore::IDBKeyPath::IDBKeyPath):
1113         (WebCore::IDBKeyPath::type):
1114         (WebCore::IDBKeyPath::array):
1115         (WebCore::IDBKeyPath::string):
1116         (WebCore::IDBKeyPath::isNull):
1117         (WebCore::IDBKeyPath::encode):
1118         (WebCore::IDBKeyPath::decode):
1119         * Modules/indexeddb/IndexedDB.h:
1120         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
1121         (WebCore::LegacyDatabase::createObjectStore):
1122         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
1123         (WebCore::LegacyObjectStore::createIndex):
1124         * bindings/js/IDBBindingUtilities.cpp:
1125         (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
1126         (WebCore::injectIDBKeyIntoScriptValue):
1127         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
1128         (WebCore::canInjectIDBKeyIntoScriptValue):
1129         * bindings/js/JSIDBAnyCustom.cpp:
1130         (WebCore::toJS):
1131         * inspector/InspectorIndexedDBAgent.cpp:
1132
1133 2015-10-16  Anders Carlsson  <andersca@apple.com>
1134
1135         Add indexeddb/shared to the include paths.
1136
1137         * WebCore.vcxproj/WebCoreIncludeCommon.props:
1138
1139 2015-10-16  Antti Koivisto  <antti@apple.com>
1140
1141         Computed style should work correctly with slotted elements that have display:none
1142         https://bugs.webkit.org/show_bug.cgi?id=150237
1143
1144         Reviewed by Andreas Kling.
1145
1146         If an element has display:none we don't normally retain or even compute its style (as it is not rendered).
1147         If getComputedStyle is invoked for such element we resolve the style (along with any ancestors) and cache
1148         it separately to rare data. This path needs to work with slotted elements in shadow trees.
1149
1150         This patch also make computedStyle() iterative rather than recursive.
1151
1152         Test: fast/shadow-dom/computed-style-display-none.html
1153
1154         * dom/Document.cpp:
1155         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1156
1157             Pass in the parent style instead of invoking computedStyle() recursively.
1158
1159         * dom/Document.h:
1160         * dom/Element.cpp:
1161         (WebCore::beforeOrAfterPseudoElement):
1162         (WebCore::Element::existingComputedStyle):
1163         (WebCore::Element::resolveComputedStyle):
1164
1165             Iterative resolve function that uses composed tree iterator.
1166
1167         (WebCore::Element::computedStyle):
1168
1169             Factor into helpers.
1170
1171         * dom/Element.h:
1172         * dom/Node.cpp:
1173         (WebCore::Node::computedStyle):
1174
1175             Use the composed tree iterator.
1176
1177 2015-10-16  David Hyatt  <hyatt@apple.com>
1178
1179         ASSERT in imported/blink/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html
1180         https://bugs.webkit.org/show_bug.cgi?id=150249
1181
1182         Reviewed by Myles Maxfield.
1183
1184         Covered by existing tests.
1185
1186         * css/CSSValue.cpp:
1187         (WebCore::CSSValue::equals):
1188         Make sure the "unset" value has an equals implementation.
1189
1190 2015-10-16  Brady Eidson  <beidson@apple.com>
1191
1192         Modern IDB: Handle versionchange events.
1193         https://bugs.webkit.org/show_bug.cgi?id=150149
1194
1195         Reviewed by Alex Christensen.
1196
1197         Test: storage/indexeddb/modern/versionchange-event.html
1198         
1199         - IDBVersionChangeEvents are now dispatched to open connections when a
1200           version upgrade request comes in.
1201         - Once all of those open connections have closed, the version upgrade 
1202           request is handled.
1203
1204         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1205         (WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
1206         (WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection):
1207         (WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection):
1208         * Modules/indexeddb/client/IDBConnectionToServer.h:
1209
1210         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1211         (WebCore::IDBClient::IDBDatabase::fireVersionChangeEvent):
1212         * Modules/indexeddb/client/IDBDatabaseImpl.h:
1213
1214         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1215         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1216         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1217         (WebCore::IDBServer::UniqueIDBDatabase::invokeTransactionScheduler):
1218         (WebCore::IDBServer::UniqueIDBDatabase::transactionSchedulingTimerFired):
1219         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1220
1221 2015-10-16  Zalan Bujtas  <zalan@apple.com>
1222
1223         First line box in paragraph using initial-letter overflows.
1224         https://bugs.webkit.org/show_bug.cgi?id=147977
1225         <rdar://problem/22901553>
1226
1227         Reviewed by David Hyatt.
1228
1229         When initial-letter float is present, we should shrink the first
1230         line even if it's not intersected with the block's current height.
1231         This is because of the sunken behaviour of initial-letter. 
1232
1233         Test: fast/css-generated-content/initial-letter-first-line-wrapping.html
1234
1235         * rendering/RenderBlockFlow.h:
1236         * rendering/RenderBlockLineLayout.cpp:
1237         (WebCore::RenderBlockFlow::positionNewFloatOnLine):
1238         * rendering/line/BreakingContext.h:
1239         (WebCore::BreakingContext::handleFloat):
1240         * rendering/line/LineBreaker.cpp:
1241         (WebCore::LineBreaker::skipLeadingWhitespace):
1242         * rendering/line/LineBreaker.h:
1243         (WebCore::LineBreaker::positionNewFloatOnLine):
1244         * rendering/line/LineWidth.cpp:
1245         (WebCore::newFloatShrinksLine):
1246         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1247         * rendering/line/LineWidth.h:
1248
1249 2015-10-16  Keith Rollin  <krollin@apple.com>
1250
1251         The value sanitization algorithm for input[type=url] should strip whitespaces
1252         https://bugs.webkit.org/show_bug.cgi?id=148864
1253         rdar://problem/22589358
1254
1255         Reviewed by Chris Dumez.
1256
1257         Follow the sanitization algorithm specified in:
1258         https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url)
1259
1260         Chrome also has the same issue with url.html. Firefox passes.  All
1261         three browsers have multiple issues with type-change-state.html, with
1262         each browser having a different set of failures. Addressing this in
1263         WebKit is another issue outside the scope of bz=148864. For now, I'm
1264         updating that test to capture current WebKit behavior.
1265
1266         No new tests (covered by existing tests):
1267         - web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html
1268         - web-platform-tests/html/semantics/forms/the-input-element/url.html
1269
1270         * html/TextFieldInputType.h:
1271         * html/URLInputType.cpp:
1272         (WebCore::URLInputType::sanitizeValue):
1273         * html/URLInputType.h:
1274
1275 2015-10-16  Antti Koivisto  <antti@apple.com>
1276
1277         Remove NodeRenderingTraversal
1278         https://bugs.webkit.org/show_bug.cgi?id=150226
1279
1280         Reviewed by Chris Dumez.
1281
1282         It has been reduced to an implementation detail of FocusController. Move the remaining
1283         functions there as they have no general utility (and are wrong for focus navigation too).
1284
1285         * CMakeLists.txt:
1286         * WebCore.xcodeproj/project.pbxproj:
1287         * dom/DOMAllInOne.cpp:
1288         * dom/NodeRenderingTraversal.cpp: Removed.
1289         * dom/NodeRenderingTraversal.h: Removed.
1290         * page/FocusController.cpp:
1291         (WebCore::firstChildInScope):
1292         (WebCore::lastChildInScope):
1293         (WebCore::parentInScope):
1294         (WebCore::nextInScope):
1295         (WebCore::previousInScope):
1296         (WebCore::FocusNavigationScope::FocusNavigationScope):
1297         (WebCore::FocusNavigationScope::focusNavigationScopeOf):
1298         (WebCore::FocusController::findElementWithExactTabIndex):
1299         (WebCore::nextElementWithGreaterTabIndex):
1300         (WebCore::previousElementWithLowerTabIndex):
1301         (WebCore::FocusController::nextFocusableElement):
1302         (WebCore::FocusController::previousFocusableElement):
1303
1304 2015-10-16  David Hyatt  <hyatt@apple.com>
1305
1306         Build fix. "all" keyword introduction exposed a typo bug in the grid-area property definition.
1307
1308         * css/CSSPropertyNames.in:
1309
1310 2015-10-16  Tim Horton  <timothy_horton@apple.com>
1311
1312         Hook up autolayout intrinsic sizing for WKWebView
1313         https://bugs.webkit.org/show_bug.cgi?id=150219
1314         <rdar://problem/20016905>
1315
1316         Reviewed by Simon Fraser.
1317
1318         New API test: WebKit2.AutoLayoutIntegration.
1319
1320         * page/FrameView.cpp:
1321         (WebCore::FrameView::autoSizeIfEnabled):
1322         When autosizing a document in which the body expands to the size of 
1323         the view (a feature of quirks mode), the first (width-determining)
1324         autosizing will resize the view to the document height (which is at 
1325         least the body height), and the second time around, the height will
1326         not decrease (because it was expanded to the size of the view).
1327
1328         Instead, the first time around, we should use the computed width,
1329         but shrink the height back down to the minimum, and then expand
1330         only as much as needed to fit the content.
1331
1332 2015-10-16  Brady Eidson  <beidson@apple.com>
1333
1334         Modern IDB: Support IDBDatabase.close().
1335         https://bugs.webkit.org/show_bug.cgi?id=150150
1336
1337         Reviewed by Alex Christensen.
1338
1339         No new tests (Covered by changes to storage/indexeddb/modern/opendatabase-versions.html).
1340
1341         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1342         (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
1343         * Modules/indexeddb/client/IDBConnectionToServer.h:
1344         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1345
1346         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1347         (WebCore::IDBClient::IDBDatabase::IDBDatabase):
1348         (WebCore::IDBClient::IDBDatabase::~IDBDatabase):
1349         (WebCore::IDBClient::IDBDatabase::close):
1350         (WebCore::IDBClient::IDBDatabase::maybeCloseInServer):
1351         (WebCore::IDBClient::IDBDatabase::commitTransaction):
1352         * Modules/indexeddb/client/IDBDatabaseImpl.h:
1353         (WebCore::IDBClient::IDBDatabase::databaseConnectionIdentifier):
1354
1355         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1356         (WebCore::IDBClient::IDBRequest::result):
1357
1358         * Modules/indexeddb/server/IDBServer.cpp:
1359         (WebCore::IDBServer::IDBServer::databaseConnectionClosed):
1360         * Modules/indexeddb/server/IDBServer.h:
1361
1362         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1363         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1364         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): Deleted.
1365         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1366
1367         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1368         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1369         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
1370         (WebCore::IDBServer::UniqueIDBDatabaseConnection::hasNonFinishedTransactions):
1371         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
1372         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1373
1374         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1375         (WebCore::InProcessIDBServer::databaseConnectionClosed):
1376         * Modules/indexeddb/shared/InProcessIDBServer.h:
1377
1378 2015-10-16  Chris Dumez  <cdumez@apple.com>
1379
1380         HTMLPreloadScanner should preload iframes
1381         https://bugs.webkit.org/show_bug.cgi?id=150097
1382         <rdar://problem/23094475>
1383
1384         Reviewed by Antti Koivisto.
1385
1386         HTMLPreloadScanner should preload iframes to decrease page load time.
1387
1388         Tests:
1389         - fast/preloader/frame-src.html
1390         - http/tests/loading/preload-no-store-frame-src.html
1391
1392         * html/parser/HTMLPreloadScanner.cpp:
1393         (WebCore::TokenPreloadScanner::tagIdFor):
1394         (WebCore::TokenPreloadScanner::initiatorFor):
1395         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
1396         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1397         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
1398         (WebCore::TokenPreloadScanner::StartTagScanner::setUrlToLoad): Deleted.
1399         (WebCore::TokenPreloadScanner::StartTagScanner::charset): Deleted.
1400         * html/parser/HTMLPreloadScanner.h:
1401
1402 2015-10-16  David Hyatt  <hyatt@apple.com>
1403
1404         Implement the "all" CSS property.
1405         https://bugs.webkit.org/show_bug.cgi?id=116966
1406
1407         Reviewed by Zalan Bujtas.
1408
1409         Added new tests in fast/css.
1410
1411         * css/CSSComputedStyleDeclaration.cpp:
1412         (WebCore::ComputedStyleExtractor::propertyValue):
1413         Don't support "all" from computed style for now.
1414
1415         * css/CSSParser.cpp:
1416         (WebCore::CSSParser::parseValue):
1417         Make sure to bail after checking inherit/unset/initial for all, since you can't actually
1418         accept longhand values in the shorthand declarations.
1419
1420         (WebCore::CSSParser::parseAnimationProperty):
1421         "all" for animations is a special value and should not be confused with the property. It
1422         animates everything and does not omit unicode-bidi/direction the way the "all" property does.
1423
1424         * css/CSSPropertyNames.in:
1425         Add the "all" property to the list and use a special keyword in the Longhands value, "all",
1426         that makeprop.pl will look for. This way we don't have to dump every single CSS property
1427         into the Longhands expression, since that would be nuts.
1428
1429         * css/StyleProperties.cpp:
1430         (WebCore::StyleProperties::getPropertyValue):
1431         Look for a common value across all properties supported by "all". That way you can get
1432         back inherit/initial/unset from it.
1433
1434         * css/makeprop.pl:
1435         Make the perl script look for "all" in the longhand list, and if it sees it, put every
1436         single CSS property into the list for the all shorthand.
1437
1438 2015-10-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1439
1440         Binding generator should use templated JSXXConstructor
1441         https://bugs.webkit.org/show_bug.cgi?id=149952
1442
1443         Reviewed by Darin Adler.
1444
1445         Adding constructor templates:
1446         - JSDOMConstructor: usual JS constructors
1447         - JSDOMNamedConstructor: for named constructors
1448         - JSDOMConstructorNotConstructable: for objects that cannot be constructed directly from JS.
1449
1450         Binding generator is using these 3 templates and is generating specializations for construct, initializeProperties and s_info.
1451         These templates may also be used for private or custom constructors as examplified by JSImageConstructor
1452         and JSReadableStream reader and controller private constructors.
1453
1454         Updated binding generator to use those templates.
1455         Updated JSImageConstructor.cpp to use JSDOMNamedConstructor.
1456         Updated default template implementation of JSBuiltinConstructor::createObject.
1457         Updated generated helper routines of binding generator to fit with the templates.
1458
1459         A further patch should remove DOMConstructorWithDocument and DOMConstructorJSBuiltinObject. 
1460
1461         Covered by binding tests.
1462
1463         * bindings/js/JSDOMConstructor.h:
1464         (WebCore::JSDOMConstructorNotConstructable::create):
1465         (WebCore::JSDOMConstructorNotConstructable::createStructure):
1466         (WebCore::JSDOMConstructorNotConstructable::JSDOMConstructorNotConstructable):
1467         (WebCore::JSDOMConstructorNotConstructable::initializeProperties):
1468         (WebCore::JSDOMConstructorNotConstructable<JSClass>::finishCreation):
1469         (WebCore::JSDOMConstructor::create):
1470         (WebCore::JSDOMConstructor::createStructure):
1471         (WebCore::JSDOMConstructor::JSDOMConstructor):
1472         (WebCore::JSDOMConstructor::initializeProperties):
1473         (WebCore::JSDOMConstructor<JSClass>::finishCreation):
1474         (WebCore::JSDOMConstructor<JSClass>::getConstructData):
1475         (WebCore::JSDOMNamedConstructor::create):
1476         (WebCore::JSDOMNamedConstructor::createStructure):
1477         (WebCore::JSDOMNamedConstructor::JSDOMNamedConstructor):
1478         (WebCore::JSDOMNamedConstructor::initializeProperties):
1479         (WebCore::JSDOMNamedConstructor<JSClass>::finishCreation):
1480         (WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
1481         * bindings/js/JSDOMWindowCustom.cpp:
1482         (WebCore::JSDOMWindow::image):
1483         * bindings/js/JSImageConstructor.cpp:
1484         (WebCore::JSImageConstructor::initializeProperties):
1485         (WebCore::JSImageConstructor::construct):
1486         (WebCore::createImageConstructor):
1487         * bindings/js/JSImageConstructor.h:
1488         * bindings/scripts/CodeGeneratorJS.pm:
1489         (GetConstructorTemplateClassName):
1490         (GenerateConstructorDeclaration):
1491         (GenerateOverloadedConstructorDefinition):
1492         (GenerateConstructorDefinition):
1493         (GenerateConstructorHelperMethods):
1494         (GenerateImplementation): Deleted.
1495         (GenerateConstructorDefinitions): Deleted.
1496         (HasCustomSetter): Deleted.
1497         (HasCustomMethod): Deleted.
1498         (NeedsConstructorProperty): Deleted.
1499         (ComputeFunctionSpecial): Deleted.
1500         (AddJSBuiltinIncludesIfNeeded): Deleted.
1501         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1502         (WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
1503         (WebCore::JSTestActiveDOMObjectPrototype::finishCreation): Deleted.
1504         (WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject): Deleted.
1505         * bindings/scripts/test/JS/JSTestCallback.cpp:
1506         (WebCore::JSTestCallbackConstructor::initializeProperties):
1507         (WebCore::JSTestCallback::callbackWithNoParam): Deleted.
1508         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1509         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
1510         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::initializeProperties):
1511         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation): Deleted.
1512         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject): Deleted.
1513         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype): Deleted.
1514         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype): Deleted.
1515         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy): Deleted.
1516         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1517         (WebCore::JSTestCustomNamedGetterConstructor::initializeProperties):
1518         (WebCore::JSTestCustomNamedGetterPrototype::finishCreation): Deleted.
1519         (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter): Deleted.
1520         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1521         (WebCore::JSTestEventConstructorConstructor::construct):
1522         (WebCore::JSTestEventConstructorConstructor::initializeProperties):
1523         (WebCore::JSTestEventConstructorPrototype::finishCreation): Deleted.
1524         (WebCore::JSTestEventConstructor::JSTestEventConstructor): Deleted.
1525         (WebCore::JSTestEventConstructor::getPrototype): Deleted.
1526         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1527         (WebCore::JSTestEventTargetConstructor::initializeProperties):
1528         (WebCore::JSTestEventTargetPrototype::finishCreation): Deleted.
1529         * bindings/scripts/test/JS/JSTestException.cpp:
1530         (WebCore::JSTestExceptionConstructor::initializeProperties):
1531         (WebCore::JSTestExceptionPrototype::finishCreation): Deleted.
1532         (WebCore::JSTestException::JSTestException): Deleted.
1533         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1534         (WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
1535         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): Deleted.
1536         (WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable): Deleted.
1537         * bindings/scripts/test/JS/JSTestInterface.cpp:
1538         (WebCore::JSTestInterfaceConstructor::construct):
1539         (WebCore::JSTestInterfaceConstructor::initializeProperties):
1540         (WebCore::JSTestInterfaceConstructor::getConstructData):
1541         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1542         (WebCore::JSTestJSBuiltinConstructorConstructor::createJSObject):
1543         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
1544         (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation): Deleted.
1545         (WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor): Deleted.
1546         (WebCore::JSTestJSBuiltinConstructor::createPrototype): Deleted.
1547         (WebCore::JSTestJSBuiltinConstructor::getPrototype): Deleted.
1548         (WebCore::JSTestJSBuiltinConstructor::destroy): Deleted.
1549         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1550         (WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
1551         (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation): Deleted.
1552         (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): Deleted.
1553         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1554         (WebCore::JSTestNamedConstructorConstructor::initializeProperties):
1555         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
1556         (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
1557         (WebCore::JSTestNamedConstructorPrototype::finishCreation): Deleted.
1558         (WebCore::JSTestNamedConstructor::JSTestNamedConstructor): Deleted.
1559         (WebCore::jsTestNamedConstructorConstructor): Deleted.
1560         (WebCore::JSTestNamedConstructor::getConstructor): Deleted.
1561         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots): Deleted.
1562         * bindings/scripts/test/JS/JSTestNode.cpp:
1563         (WebCore::JSTestNodeConstructor::construct):
1564         (WebCore::JSTestNodeConstructor::initializeProperties):
1565         (WebCore::JSTestNodePrototype::finishCreation): Deleted.
1566         (WebCore::JSTestNode::JSTestNode): Deleted.
1567         (WebCore::JSTestNode::getPrototype): Deleted.
1568         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1569         (WebCore::JSTestNondeterministicConstructor::initializeProperties):
1570         (WebCore::JSTestNondeterministicPrototype::finishCreation): Deleted.
1571         * bindings/scripts/test/JS/JSTestObj.cpp:
1572         (WebCore::JSTestObjConstructor::construct):
1573         (WebCore::JSTestObjConstructor::initializeProperties):
1574         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1575         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1576         (WebCore::JSTestOverloadedConstructorsConstructor::initializeProperties):
1577         (WebCore::constructJSTestOverloadedConstructors1): Deleted.
1578         (WebCore::constructJSTestOverloadedConstructors2): Deleted.
1579         (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation): Deleted.
1580         (WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors): Deleted.
1581         (WebCore::JSTestOverloadedConstructors::createPrototype): Deleted.
1582         (WebCore::JSTestOverloadedConstructors::getPrototype): Deleted.
1583         (WebCore::JSTestOverloadedConstructors::destroy): Deleted.
1584         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1585         (WebCore::JSTestOverrideBuiltinsConstructor::initializeProperties):
1586         (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation): Deleted.
1587         (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins): Deleted.
1588         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1589         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::initializeProperties):
1590         (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation): Deleted.
1591         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1592         (WebCore::JSTestTypedefsConstructor::construct):
1593         (WebCore::JSTestTypedefsConstructor::initializeProperties):
1594         (WebCore::JSTestTypedefsPrototype::finishCreation): Deleted.
1595         * bindings/scripts/test/JS/JSattribute.cpp:
1596         (WebCore::JSattributeConstructor::initializeProperties):
1597         (WebCore::JSattributePrototype::finishCreation): Deleted.
1598         (WebCore::JSattribute::JSattribute): Deleted.
1599         * bindings/scripts/test/JS/JSreadonly.cpp:
1600         (WebCore::JSreadonlyConstructor::initializeProperties):
1601         (WebCore::JSreadonlyPrototype::finishCreation): Deleted.
1602         (WebCore::JSreadonly::JSreadonly): Deleted.
1603
1604 2015-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1605
1606         [GStreamer] ASSERTION FAILED: !m_adoptionIsRequired in MediaSourceGStreamer::addSourceBuffer
1607         https://bugs.webkit.org/show_bug.cgi?id=150229
1608
1609         Reviewed by Philippe Normand.
1610
1611         This happens in the debug bot in all media source tests that run
1612         that code. The problem is that we are creating a RefPtr without
1613         adopting the reference.
1614
1615         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
1616         (WebCore::MediaSourceGStreamer::addSourceBuffer): Use
1617         SourceBufferPrivateGStreamer::create().
1618         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp:
1619         (WebCore::SourceBufferPrivateGStreamer::create): Added to make
1620         sure you can't create a SourceBufferPrivateGStreamer without
1621         adopting the reference.
1622         (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
1623         Takes a reference to the client instead of a PassRefPtr.
1624         * platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h:
1625
1626 2015-10-15  Roopesh Chander  <roop@roopc.net>
1627
1628         [Content Extensions] Content blocking rules are not consulted for pings
1629         https://bugs.webkit.org/show_bug.cgi?id=149873
1630
1631         Reviewed by Alex Christensen.
1632
1633         This patch makes requests sent through the PingLoader
1634         respect content blocking rules. Specifically, the following
1635         are now subject to content blocking rules:
1636  
1637          1. <a ping> pings
1638          2. Images loaded in unload / beforeunload / pagehide handlers
1639          3. X-XSS-Protection / CSP violation reports
1640
1641         Tests: http/tests/contentextensions/block-cookies-in-csp-report.html
1642                http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html
1643                http/tests/contentextensions/block-cookies-in-ping.html
1644                http/tests/contentextensions/block-csp-report.html
1645                http/tests/contentextensions/block-image-load-in-onunload.html
1646                http/tests/contentextensions/block-ping.html
1647                http/tests/contentextensions/hide-on-csp-report.html
1648
1649         * loader/PingLoader.cpp:
1650         (WebCore::processContentExtensionRulesForLoad):
1651         (WebCore::PingLoader::loadImage):
1652         (WebCore::PingLoader::sendPing):
1653         (WebCore::PingLoader::sendViolationReport):
1654
1655 2015-10-14  Joseph Pecoraro  <pecoraro@apple.com>
1656
1657         Web Inspector: Include Garbage Collection Event in Timeline
1658         https://bugs.webkit.org/show_bug.cgi?id=142510
1659
1660         Reviewed by Geoffrey Garen and Brian Burg.
1661
1662         Tests: inspector/heap/garbageCollected.html
1663                inspector/heap/gc.html
1664
1665         * ForwardingHeaders/heap/HeapObserver.h: Added.
1666         * ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Added.
1667         * WebCore.vcxproj/WebCore.vcxproj:
1668         * WebCore.vcxproj/WebCore.vcxproj.filters:
1669         Forwarding headers.
1670
1671         * inspector/InspectorController.cpp:
1672         (WebCore::InspectorController::InspectorController):
1673         (WebCore::InspectorController::vm):
1674         * inspector/InspectorController.h:
1675         * inspector/WorkerInspectorController.cpp:
1676         (WebCore::WorkerInspectorController::vm):
1677         * inspector/WorkerInspectorController.h:
1678         Implement InspectorEnvironment::vm and create a Heap agent for the
1679         Page inspector controller.
1680
1681 2015-10-15  Commit Queue  <commit-queue@webkit.org>
1682
1683         Unreviewed, rolling out r191156.
1684         https://bugs.webkit.org/show_bug.cgi?id=150215
1685
1686         Introduced crashing test (Requested by bradee-oh on #webkit).
1687
1688         Reverted changeset:
1689
1690         "Modern IDB: Support IDBDatabase.close()."
1691         https://bugs.webkit.org/show_bug.cgi?id=150150
1692         http://trac.webkit.org/changeset/191156
1693
1694 2015-10-15  Brady Eidson  <beidson@apple.com>
1695
1696         Modern IDB: Support IDBDatabase.close().
1697         https://bugs.webkit.org/show_bug.cgi?id=150150
1698
1699         Reviewed by Alex Christensen.
1700
1701         No new tests (Covered by changes to storage/indexeddb/modern/opendatabase-versions.html).
1702
1703         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1704         (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
1705         * Modules/indexeddb/client/IDBConnectionToServer.h:
1706         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1707
1708         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1709         (WebCore::IDBClient::IDBDatabase::IDBDatabase):
1710         (WebCore::IDBClient::IDBDatabase::~IDBDatabase):
1711         (WebCore::IDBClient::IDBDatabase::close):
1712         (WebCore::IDBClient::IDBDatabase::maybeCloseInServer):
1713         (WebCore::IDBClient::IDBDatabase::commitTransaction):
1714         * Modules/indexeddb/client/IDBDatabaseImpl.h:
1715         (WebCore::IDBClient::IDBDatabase::databaseConnectionIdentifier):
1716
1717         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1718         (WebCore::IDBClient::IDBRequest::result):
1719
1720         * Modules/indexeddb/server/IDBServer.cpp:
1721         (WebCore::IDBServer::IDBServer::databaseConnectionClosed):
1722         * Modules/indexeddb/server/IDBServer.h:
1723
1724         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1725         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1726         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): Deleted.
1727         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1728
1729         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1730         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1731         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
1732         (WebCore::IDBServer::UniqueIDBDatabaseConnection::hasNonFinishedTransactions):
1733         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
1734         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1735
1736         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1737         (WebCore::InProcessIDBServer::databaseConnectionClosed):
1738         * Modules/indexeddb/shared/InProcessIDBServer.h:
1739
1740 2015-10-15  David Hyatt  <hyatt@apple.com>
1741
1742         Patch parseKeywordValue to accept "unset" so that it goes down the faster parsing path.
1743         https://bugs.webkit.org/show_bug.cgi?id=150213
1744
1745         Reviewed by Dean Jackson.
1746
1747         No new tests as correctness doesn't change (just speed).
1748
1749         * css/CSSParser.cpp:
1750         (WebCore::parseKeywordValue):
1751
1752 2015-10-15  David Hyatt  <hyatt@apple.com>
1753
1754         Add support for the CSS 'unset' keyword.
1755         https://bugs.webkit.org/show_bug.cgi?id=148614
1756
1757         Reviewed by Dean Jackson.
1758
1759         Added new test in fast/css, and existing variables tests also use unset in several tests.
1760
1761         * WebCore.xcodeproj/project.pbxproj:
1762         Add CSSUnsetValue.cpp to the project.
1763
1764         * bindings/objc/DOMCSS.mm:
1765         (kitClass):
1766         Make sure UNSET is handled in the switch.
1767
1768         * css/CSSParser.cpp:
1769         (WebCore::parseKeywordValue):
1770         (WebCore::CSSParser::parseValue):
1771         (WebCore::CSSParser::parseCustomPropertyDeclaration):
1772         Add cases to create a CSSUnsetValue properly.
1773
1774         * css/CSSToStyleMap.cpp:
1775         (WebCore::CSSToStyleMap::styleImage):
1776         (WebCore::CSSToStyleMap::mapFillAttachment):
1777         (WebCore::CSSToStyleMap::mapFillClip):
1778         (WebCore::CSSToStyleMap::mapFillComposite):
1779         (WebCore::CSSToStyleMap::mapFillBlendMode):
1780         (WebCore::CSSToStyleMap::mapFillOrigin):
1781         (WebCore::CSSToStyleMap::mapFillImage):
1782         (WebCore::CSSToStyleMap::mapFillRepeatX):
1783         (WebCore::CSSToStyleMap::mapFillRepeatY):
1784         (WebCore::convertToLengthSize):
1785         (WebCore::CSSToStyleMap::mapFillSize):
1786         (WebCore::CSSToStyleMap::mapFillXPosition):
1787         (WebCore::CSSToStyleMap::mapFillYPosition):
1788         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
1789         (WebCore::CSSToStyleMap::mapAnimationDelay):
1790         (WebCore::CSSToStyleMap::mapAnimationDirection):
1791         (WebCore::CSSToStyleMap::mapAnimationDuration):
1792         (WebCore::CSSToStyleMap::mapAnimationFillMode):
1793         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
1794         (WebCore::CSSToStyleMap::mapAnimationName):
1795         (WebCore::CSSToStyleMap::mapAnimationPlayState):
1796         (WebCore::CSSToStyleMap::mapAnimationProperty):
1797         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1798         (WebCore::CSSToStyleMap::mapAnimationTrigger):
1799         The background and animation functions need to check for unset and be able to map it properly to initial. This is done
1800         with a new treatAsInitial method on CSSValue that can take the property ID and check for both initial
1801         or unset on a non-inherited property.
1802
1803         * css/CSSUnsetValue.cpp: Added.
1804         (WebCore::CSSUnsetValue::customCSSText):
1805         * css/CSSUnsetValue.h: Added.
1806         (WebCore::CSSUnsetValue::create):
1807         (WebCore::CSSUnsetValue::equals):
1808         (WebCore::CSSUnsetValue::CSSUnsetValue):
1809         This new value looks exactly like CSSInheritedValue and CSSInitialValue.
1810
1811         * css/CSSValue.cpp:
1812         (WebCore::CSSValue::cssValueType):
1813         (WebCore::CSSValue::cssText):
1814         (WebCore::CSSValue::destroy):
1815         (WebCore::CSSValue::isInvalidCustomPropertyValue):
1816         (WebCore::CSSValue::treatAsInheritedValue):
1817         (WebCore::CSSValue::treatAsInitialValue):
1818         * css/CSSValue.h:
1819         (WebCore::CSSValue::isUnsetValue):
1820         Add isUnsetValue and the UnsetClass. Add support for treatAsInheritedValue and treatAsInitialValue to have
1821         a way to query for initial/inherit or the matching unset type.
1822
1823         * css/CSSValueKeywords.in:
1824         Add the unset keyword.
1825
1826         * css/CSSValuePool.cpp:
1827         (WebCore::CSSValuePool::CSSValuePool):
1828         * css/CSSValuePool.h:
1829         (WebCore::CSSValuePool::createUnsetValue):
1830         Have a singleton model for unset just like we do for inherit/initial.
1831
1832         * css/StyleResolver.cpp:
1833         (WebCore::StyleResolver::applyProperty):
1834         Handle unset correctly. It maps to inherit for inherited properties and initial for non-inherited ones.
1835
1836 2015-10-15  Myles C. Maxfield  <mmaxfield@apple.com>
1837
1838         Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
1839         https://bugs.webkit.org/show_bug.cgi?id=150155
1840
1841         Reviewed by Tim Horton.
1842
1843         No new tests because there is no behavior change.
1844
1845         * platform/graphics/cg/GraphicsContextCG.cpp:
1846         (WebCore::GraphicsContext::drawPattern):
1847         (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
1848         * platform/graphics/cg/ImageBufferCG.cpp:
1849         (WebCore::ImageBuffer::putByteArray):
1850         * platform/ios/WebCoreSystemInterfaceIOS.mm:
1851         * platform/mac/WebCoreSystemInterface.h:
1852         * platform/mac/WebCoreSystemInterface.mm:
1853
1854 2015-10-15  Dan Bernstein  <mitz@apple.com>
1855
1856         Fixed the build.
1857
1858         * platform/network/mac/ResourceHandleMac.mm:
1859
1860 2015-10-15  Dan Bernstein  <mitz@apple.com>
1861
1862         [Cocoa] Stop using WKSetNSURLConnectionDefersCallbacks
1863         https://bugs.webkit.org/show_bug.cgi?id=150189
1864
1865         Reviewed by Anders Carlsson.
1866
1867         * platform/ios/WebCoreSystemInterfaceIOS.mm: Removed definition.
1868         * platform/mac/WebCoreSystemInterface.h: Removed declaration.
1869         * platform/mac/WebCoreSystemInterface.mm: Removed definition.
1870
1871         * platform/network/mac/ResourceHandleMac.mm:
1872         (WebCore::ResourceHandle::start): Changed to use -[NSURLConnection setDefersLoading:].
1873         (WebCore::ResourceHandle::platformSetDefersLoading): Ditto.
1874
1875         * platform/spi/cocoa/NSURLConnectionSPI.h: Added declaration of
1876           -[NSURLConnection setDefersLoading:].
1877
1878 2015-10-15  Dean Jackson  <dino@apple.com>
1879
1880         CSSKeyframesRule::appendRule is deprecated, but is actually the spec
1881         https://bugs.webkit.org/show_bug.cgi?id=150113
1882
1883         Reviewed by Simon Fraser.
1884
1885         I stupidly deprecated the wrong function in
1886         http://trac.webkit.org/changeset/174469
1887
1888         * css/CSSKeyframesRule.cpp:
1889         (WebCore::CSSKeyframesRule::insertRule): Swap the code between these two.
1890         (WebCore::CSSKeyframesRule::appendRule):
1891
1892 2015-10-14  David Hyatt  <hyatt@apple.com>
1893
1894         Implement CSS Variables.
1895         https://bugs.webkit.org/show_bug.cgi?id=19660
1896
1897         Reviewed by Dean Jackson.
1898
1899         Added new tests in fast/css/custom-properties and fast/css/variables.
1900
1901         * CMakeLists.txt:
1902         * WebCore.xcodeproj/project.pbxproj:
1903         Add CSSVariableValue.cpp and CSSVariableDependentValue.cpp to builds.
1904
1905         * css/CSSCalculationValue.cpp:
1906         (WebCore::hasDoubleValue):
1907         Handle the new CSS_PARSER_WHITESPACE value.
1908
1909         * css/CSSComputedStyleDeclaration.cpp:
1910         (WebCore::ComputedStyleExtractor::customPropertyValue):
1911         Patched to make sure style is updated so that dynamic changes to custom properties are reflected
1912         immediately when querying values.
1913
1914         (WebCore::CSSComputedStyleDeclaration::length):
1915         (WebCore::CSSComputedStyleDeclaration::item):
1916         The custom properties table is a reference and not a pointer now.
1917
1918         * css/CSSCustomPropertyValue.h:
1919         (WebCore::CSSCustomPropertyValue::create):
1920         (WebCore::CSSCustomPropertyValue::createInvalid):
1921         (WebCore::CSSCustomPropertyValue::customCSSText):
1922         (WebCore::CSSCustomPropertyValue::equals):
1923         (WebCore::CSSCustomPropertyValue::isInvalid):
1924         (WebCore::CSSCustomPropertyValue::containsVariables):
1925         (WebCore::CSSCustomPropertyValue::value):
1926         (WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
1927         The CSSCustomPropertyValue represents a custom property/value pair in the back end. It holds on
1928         to both the property name and a CSSValueList that has the original parser terms. This class also
1929         doubles as the invalid-at-compute-time value for custom properties when they contain cycles, etc.
1930
1931         * css/CSSFunctionValue.cpp:
1932         (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
1933          * css/CSSFunctionValue.h:
1934         (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
1935         Hands back a CSSParserValue for a function with variables replaced with their real values (or fallback).
1936
1937         * css/CSSGrammar.y.in:
1938         Many changes to support the var() syntax and to handle error conditions and cases.
1939
1940         * css/CSSParser.cpp:
1941         (WebCore::filterProperties):
1942         Null check the value here. Shouldn't happen, but being paranoid.
1943
1944         (WebCore::CSSParser::parseVariableDependentValue):
1945         This function converts a CSSValueList back into a CSSParserValueList and then passes
1946         it off to the parser. If the result parses, successfully, then the parsed CSSValue is handed back.
1947
1948         (WebCore::CSSParser::parseValue):
1949         Detect when a property value contains variables and simply make a CSSVariableDependentValue to hold
1950         a copy of the parser value list (as a CSSValueList). We defer parsing the list until compute-time
1951         when we know the values of the variables to use.
1952
1953         (WebCore::CSSParser::parseCustomPropertyDeclaration):
1954         Add support for inherit, initial and variable references in custom properties.
1955
1956         (WebCore::CSSParser::detectFunctionTypeToken):
1957         Add support for detection of the "var" token.
1958
1959         (WebCore::CSSParser::realLex):
1960         Fix the parsing of custom properties to allow "--" and to allow them to start with digits, e.g., "--0".
1961
1962         * css/CSSParser.h:
1963         Add parseVariableDependentValue function for handling variable substitution and subsequent parsing
1964         of the resolved parser value list.
1965
1966         * css/CSSParserValues.cpp:
1967         (WebCore::CSSParserValueList::containsVariables):
1968         Get rid of the toString() function (no longer needed) and replace it with containsVariables(). This
1969         check is used to figure out if a parser value list has variables and thus needs to defer parsing
1970         until later.
1971
1972         (WebCore::CSSParserValue::createCSSValue):
1973         Add support for the creation of values for variables, CSSVariableValues.
1974
1975         (WebCore::CSSParserValueList::toString): Deleted.
1976         No longer needed.
1977
1978         * css/CSSParserValues.h:
1979         Add CSSParserVariable as a new kind of parser value. This represents a var() that is encountered
1980         during parsing. It is similar to a function except it has to hold both the reference (custom property name)
1981         and fallback arguments.
1982
1983         * css/CSSPrimitiveValue.cpp:
1984         (WebCore::isValidCSSUnitTypeForDoubleConversion):
1985         (WebCore::CSSPrimitiveValue::cleanup):
1986         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
1987         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
1988         (WebCore::CSSPrimitiveValue::equals):
1989         Add support for CSS_PARSER_WHITESPACE as a way of preserving whitespace as a parsed item (variables can
1990         be only whitespace, and this has to be retained).
1991
1992         (WebCore::CSSPrimitiveValue::buildParserValue):
1993         Conversion from a CSSPrimitiveValue back into a parser value is handled by this function.
1994
1995         * css/CSSPrimitiveValue.h:
1996         (WebCore::CSSPrimitiveValue::isParserOperator):
1997         (WebCore::CSSPrimitiveValue::parserOperator):
1998         Add ability to get parser operator info. Add the buildParserValue declaration.
1999
2000         * css/CSSValue.cpp:
2001         (WebCore::CSSValue::equals):
2002         (WebCore::CSSValue::cssText):
2003         (WebCore::CSSValue::destroy):
2004         (WebCore::CSSValue::cloneForCSSOM):
2005         (WebCore::CSSValue::isInvalidCustomPropertyValue):
2006         * css/CSSValue.h:
2007         Add support for variable values and variable dependent values.
2008
2009         * css/CSSValueList.cpp:
2010         (WebCore::CSSValueList::customCSSText):
2011         Improve serialization to not output extra spaces when a comma operator is a value.
2012
2013         (WebCore::CSSValueList::containsVariables):
2014         Whether or not a CSSVariableValue can be found somewhere within the list (or its descendants).
2015
2016         (WebCore::CSSValueList::checkVariablesForCycles):
2017         Called to check variables for cycles.
2018
2019         (WebCore::CSSValueList::buildParserValueSubstitutingVariables):
2020         (WebCore::CSSValueList::buildParserValueListSubstitutingVariables):
2021         Functions that handle converting the value list to a parser value list while making
2022         variable substitutions along the way.
2023
2024         * css/CSSValueList.h:
2025         Add the new buildParserXXX functions.
2026
2027         * css/CSSVariableDependentValue.cpp: Added.
2028         (WebCore::CSSVariableDependentValue::checkVariablesForCycles):
2029         * css/CSSVariableDependentValue.h: Added.
2030         (WebCore::CSSVariableDependentValue::create):
2031         (WebCore::CSSVariableDependentValue::customCSSText):
2032         (WebCore::CSSVariableDependentValue::equals):
2033         (WebCore::CSSVariableDependentValue::propertyID):
2034         (WebCore::CSSVariableDependentValue::valueList):
2035         (WebCore::CSSVariableDependentValue::CSSVariableDependentValue):
2036         This value represents a list of terms that have not had variables substituted yet. The list
2037         is held by the value so that it can be converted back into a parser value list once the
2038         variable values are known.
2039
2040         * css/CSSVariableValue.cpp: Added.
2041         (WebCore::CSSVariableValue::CSSVariableValue):
2042         (WebCore::CSSVariableValue::customCSSText):
2043         (WebCore::CSSVariableValue::equals):
2044         (WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
2045         * css/CSSVariableValue.h: Added.
2046         (WebCore::CSSVariableValue::create):
2047         (WebCore::CSSVariableValue::name):
2048         (WebCore::CSSVariableValue::fallbackArguments):
2049         This value represents a var() itself. It knows how to do the substitution of the variable
2050         value and to apply fallback if that value is not present.
2051
2052         * css/StyleProperties.cpp:
2053         (WebCore::StyleProperties::getPropertyValue):
2054         (WebCore::StyleProperties::borderSpacingValue):
2055         (WebCore::StyleProperties::getLayeredShorthandValue):
2056         (WebCore::StyleProperties::getShorthandValue):
2057         (WebCore::StyleProperties::getCommonValue):
2058         (WebCore::StyleProperties::getPropertyCSSValue):
2059         (WebCore::StyleProperties::getPropertyCSSValueInternal):
2060         (WebCore::StyleProperties::asText):
2061         (WebCore::StyleProperties::copyPropertiesInSet):
2062         * css/StyleProperties.h:
2063         Patched to factor property fetching into an internal method so that variables can work with shorthands
2064         in the CSS OM.
2065
2066         * css/StyleResolver.cpp:
2067         (WebCore::StyleResolver::applyProperty):
2068         Resolve variable values at compute time. If they fail to resolve, use inherit or initial as the
2069         value (depending on whether the property inherits by default).
2070
2071         (WebCore::StyleResolver::resolvedVariableValue):
2072         Helper function that calls parseVariableDependentValue and gets the resolved result.
2073
2074         (WebCore::StyleResolver::applyCascadedProperties):
2075         After custom properties have been collected, we check for cycles and perform variable substitutions.
2076         This way we get all the variables replaced before we inherit down the style tree.
2077
2078         * css/StyleResolver.h:
2079         Add resolvedVariableValue declaration.
2080
2081         * css/makeprop.pl:
2082         Make sure custom properties are inherited by default.
2083
2084         * rendering/style/RenderStyle.cpp:
2085         (WebCore::RenderStyle::checkVariablesInCustomProperties):
2086         This function handles updating variables with cycles to be invalid in the RenderStyle. It then also
2087         handles the replacement of variables found in custom properties with resolved values. All custom
2088         properties are either invalid or are real non-variable-dependent value lists after this function
2089         completes.
2090
2091         * rendering/style/RenderStyle.h:
2092         Add checkVariablesInCustomProperties declaration.
2093
2094         * rendering/style/StyleCustomPropertyData.h:
2095         (WebCore::StyleCustomPropertyData::create):
2096         (WebCore::StyleCustomPropertyData::copy):
2097         (WebCore::StyleCustomPropertyData::operator==):
2098         (WebCore::StyleCustomPropertyData::operator!=):
2099         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
2100         (WebCore::StyleCustomPropertyData::getCustomPropertyValue):
2101         (WebCore::StyleCustomPropertyData::values):
2102         (WebCore::StyleCustomPropertyData::hasCustomProperty):
2103         (WebCore::StyleCustomPropertyData::containsVariables):
2104         (WebCore::StyleCustomPropertyData::setContainsVariables):
2105         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2106         Miscellaneous cleanup, and the addition of whether or not the properties still contain variable
2107         dependent values that need to be resolved.
2108
2109 2015-10-15  Csaba Osztrogonác  <ossy@webkit.org>
2110
2111         Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) build after r191112
2112         https://bugs.webkit.org/show_bug.cgi?id=150175
2113
2114         Reviewed by Antti Koivisto.
2115
2116         * dom/ComposedTreeAncestorIterator.h:
2117         (WebCore::ComposedTreeAncestorIterator::traverseParent):
2118         * dom/ComposedTreeIterator.cpp:
2119         (WebCore::ComposedTreeIterator::initializeShadowStack):
2120         * dom/Element.cpp:
2121         (WebCore::Element::childrenChanged):
2122
2123 2015-10-15  Csaba Osztrogonác  <ossy@webkit.org>
2124
2125         Get rid of the only once used isIntegerArray function
2126         https://bugs.webkit.org/show_bug.cgi?id=150170
2127
2128         Reviewed by Geoffrey Garen.
2129
2130         * page/Crypto.cpp:
2131         (WebCore::Crypto::getRandomValues):
2132
2133 2015-10-15  Tim Horton  <timothy_horton@apple.com>
2134
2135         Try to fix the iOS build.
2136
2137         * page/EventHandler.h:
2138
2139 2015-10-15  Zalan Bujtas  <zalan@apple.com>
2140
2141         Anonymous table objects: Collapse anonymous table rows.
2142         https://bugs.webkit.org/show_bug.cgi?id=150154
2143
2144         Reviewed by David Hyatt.
2145
2146         Merge anonymous table rows when they are not needed anymore.
2147         Generated table rows can be collapsed into one when there's no
2148         non-generated sibling table row left in the tree.
2149
2150         Import W3C CSS2.1 anonymous table tests.
2151
2152         * rendering/RenderObject.cpp:
2153         (WebCore::collapseAnonymousTableRowsIfNeeded):
2154         (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
2155
2156 2015-10-15  Simon Fraser  <simon.fraser@apple.com>
2157
2158         Un-indent contents of the WebCore namespace
2159         in GraphicsContext.h. No code changes.
2160
2161         * platform/graphics/GraphicsContext.h:
2162
2163 2015-10-14  Simon Fraser  <simon.fraser@apple.com>
2164
2165         Move ImageBuffer:clip() into GraphicsContextCG
2166         https://bugs.webkit.org/show_bug.cgi?id=150140
2167
2168         Reviewed by Zalan Bujtas.
2169
2170         Move the guts of CG's ImageBuffer:clip() into GraphicsContextCG.
2171
2172         * platform/graphics/GraphicsContext.h:
2173         * platform/graphics/cg/GraphicsContextCG.cpp:
2174         (WebCore::GraphicsContext::clipToNativeImage):
2175         * platform/graphics/cg/ImageBufferCG.cpp:
2176         (WebCore::ImageBuffer::clip):
2177
2178 2015-10-14  Brady Eidson  <beidson@apple.com>
2179
2180         Modern IDB: Add basic transaction committing.
2181         https://bugs.webkit.org/show_bug.cgi?id=150147
2182
2183         Reviewed by Alex Christensen.
2184
2185         Test: storage/indexeddb/modern/opendatabase-versions.html
2186
2187         * Modules/indexeddb/IDBTransaction.h:
2188
2189         * Modules/indexeddb/IndexedDB.h:
2190
2191         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2192         (WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
2193         (WebCore::IDBClient::IDBConnectionToServer::didCommitTransaction):
2194         * Modules/indexeddb/client/IDBConnectionToServer.h:
2195         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2196
2197         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2198         (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
2199         (WebCore::IDBClient::IDBDatabase::commitTransaction):
2200         (WebCore::IDBClient::IDBDatabase::didCommitTransaction):
2201         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
2202         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
2203         * Modules/indexeddb/client/IDBDatabaseImpl.h:
2204
2205         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2206         (WebCore::IDBClient::IDBFactory::open):
2207
2208         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2209         (WebCore::IDBClient::IDBOpenDBRequest::onSuccess):
2210         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2211
2212         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2213         (WebCore::IDBClient::IDBTransaction::IDBTransaction):
2214         (WebCore::IDBClient::IDBTransaction::db):
2215         (WebCore::IDBClient::IDBTransaction::hasPendingActivity):
2216         (WebCore::IDBClient::IDBTransaction::isActive):
2217         (WebCore::IDBClient::IDBTransaction::scheduleOperationTimer):
2218         (WebCore::IDBClient::IDBTransaction::operationTimerFired):
2219         (WebCore::IDBClient::IDBTransaction::commit):
2220         (WebCore::IDBClient::IDBTransaction::didCommit):
2221         (WebCore::IDBClient::IDBTransaction::fireOnComplete):
2222         (WebCore::IDBClient::IDBTransaction::fireOnAbort):
2223         (WebCore::IDBClient::IDBTransaction::enqueueEvent):
2224         (WebCore::IDBClient::IDBTransaction::dispatchEvent):
2225         * Modules/indexeddb/client/IDBTransactionImpl.h:
2226         (WebCore::IDBClient::IDBTransaction::database):
2227         
2228         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
2229         (WebCore::LegacyTransaction::db):
2230         * Modules/indexeddb/legacy/LegacyTransaction.h:
2231         
2232         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2233         (WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction):
2234         * Modules/indexeddb/server/IDBConnectionToClient.h:
2235         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2236         
2237         * Modules/indexeddb/server/IDBServer.cpp:
2238         (WebCore::IDBServer::IDBServer::registerTransaction):
2239         (WebCore::IDBServer::IDBServer::unregisterTransaction):
2240         (WebCore::IDBServer::IDBServer::commitTransaction):
2241         * Modules/indexeddb/server/IDBServer.h:
2242         
2243         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2244         (WebCore::IDBServer::generateUniqueCallbackIdentifier):
2245         (WebCore::IDBServer::UniqueIDBDatabase::storeCallback):
2246         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2247         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
2248         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
2249         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
2250         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction): Deleted.
2251         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2252         (WebCore::IDBServer::UniqueIDBDatabase::server):
2253         
2254         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2255         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
2256         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
2257         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2258         
2259         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2260         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
2261         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
2262         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
2263         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2264         
2265         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2266         (WebCore::IDBDatabaseInfo::setVersion):
2267         
2268         * Modules/indexeddb/shared/IDBError.cpp:
2269         (WebCore::IDBError::isolatedCopy):
2270         * Modules/indexeddb/shared/IDBError.h:
2271
2272         * Modules/indexeddb/shared/IDBRequestData.h:
2273
2274         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2275         (WebCore::IDBResourceIdentifier::isolatedCopy):
2276         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2277
2278         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2279         (WebCore::InProcessIDBServer::didCommitTransaction):
2280         (WebCore::InProcessIDBServer::commitTransaction):
2281         * Modules/indexeddb/shared/InProcessIDBServer.h:
2282
2283         * WebCore.xcodeproj/project.pbxproj:
2284
2285         * platform/CrossThreadCopier.cpp:
2286         (WebCore::IDBResourceIdentifier>::copy):
2287         (WebCore::IDBError>::copy):
2288         * platform/CrossThreadCopier.h:
2289
2290 2015-10-15  Daniel Bates  <dabates@apple.com>
2291
2292         [iOS] DOM click event may not be dispatched when page has :active style and <input type="search">
2293         https://bugs.webkit.org/show_bug.cgi?id=144451
2294         <rdar://problem/23099482>
2295
2296         Reviewed by Simon Fraser.
2297
2298         Fixes an issue where a DOM click event is not dispatched to an element in a subframe on a page
2299         that has a <input type="search"> and defines a CSS :active pseudo-class for the HTML body element.
2300
2301         On iOS we only dispatch a DOM click event if the content does not change as part
2302         of dispatching a DOM mousemove event at the tapped element. In particular, we do not
2303         dispatch a DOM click event if there is a visibility change to some element on the page
2304         as part of dispatching a mousemove event at the tapped element. For a web page
2305         that specifies CSS :active pseudo-class and contains a search field, applying/unapplying
2306         this pseudo-class as part of dispatching a DOM mousemove event may cause the
2307         visibility of the search field cancel button to change; => a DOM click event will not
2308         be dispatched to the tapped element.
2309
2310         Tests: fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html
2311                fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html
2312                fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html
2313                fast/forms/search/search-cancel-in-formerly-invisible-element.html
2314                fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html
2315                fast/forms/search/search-cancel-toggle-visibility-initially-visible.html
2316
2317         * rendering/RenderSearchField.cpp:
2318         (WebCore::RenderSearchField::updateCancelButtonVisibility): Write logic for determining
2319         whether the visibility of the cancel button changed in terms of m_isCancelButtonVisible
2320         instead of querying for the current style data as the latter is overwritten on a full
2321         style recalculation.
2322         (WebCore::RenderSearchField::RenderSearchField): Deleted.
2323         (WebCore::RenderSearchField::visibilityForCancelButton): Deleted.
2324         * rendering/RenderSearchField.h: Define instance variable m_isCancelButtonVisible to
2325         store the visibility state of the cancel button.
2326
2327 2015-10-15  Antti Koivisto  <antti@apple.com>
2328
2329         Implement iterator for traversing composed ancestors
2330         https://bugs.webkit.org/show_bug.cgi?id=150162
2331
2332         Reviewed by Andreas Kling.
2333
2334         The existing general purpose ComposedTreeIterator can traverse parent chain but not efficiently
2335         (since it builds stack). Add a separate stackless iterator for ancestor chain traversal.
2336
2337         * WebCore.xcodeproj/project.pbxproj:
2338         * dom/ComposedTreeAncestorIterator.h: Added.
2339         (WebCore::ComposedTreeAncestorIterator::operator*):
2340         (WebCore::ComposedTreeAncestorIterator::operator->):
2341         (WebCore::ComposedTreeAncestorIterator::operator==):
2342         (WebCore::ComposedTreeAncestorIterator::operator!=):
2343         (WebCore::ComposedTreeAncestorIterator::operator++):
2344         (WebCore::ComposedTreeAncestorIterator::get):
2345         (WebCore::ComposedTreeAncestorIterator::ComposedTreeAncestorIterator):
2346         (WebCore::ComposedTreeAncestorIterator::traverseParent):
2347         (WebCore::ComposedTreeAncestorAdapter::ComposedTreeAncestorAdapter):
2348         (WebCore::ComposedTreeAncestorAdapter::begin):
2349         (WebCore::ComposedTreeAncestorAdapter::end):
2350         (WebCore::ComposedTreeAncestorAdapter::first):
2351         (WebCore::composedTreeAncestors):
2352         * dom/ComposedTreeIterator.h:
2353         * dom/ContainerNode.h:
2354         (WebCore::Node::highestAncestor):
2355         (WebCore::Node::isTreeScope):
2356         (WebCore::Node::needsNodeRenderingTraversalSlowPath): Deleted.
2357
2358             With NodeRenderingTraversal::parent removed this bit is no longer used.
2359
2360         * dom/Element.cpp:
2361         (WebCore::Element::shadowRoot):
2362         (WebCore::Element::addShadowRoot):
2363         (WebCore::shouldUseNodeRenderingTraversalSlowPath): Deleted.
2364         (WebCore::Element::resetNeedsNodeRenderingTraversalSlowPath): Deleted.
2365         * dom/Element.h:
2366         (WebCore::Element::didAddUserAgentShadowRoot):
2367         (WebCore::Element::alwaysCreateUserAgentShadowRoot):
2368         * dom/Node.cpp:
2369         (WebCore::Node::derefEventTarget):
2370         (WebCore::Node::updateAncestorsForStyleRecalc):
2371         (WebCore::traverseStyleParent): Deleted.
2372         (WebCore::traverseFirstStyleParent): Deleted.
2373
2374             Switch to iterator interface.
2375
2376         * dom/Node.h:
2377         (WebCore::Node::isDocumentFragment):
2378         (WebCore::Node::isShadowRoot):
2379         (WebCore::Node::isNamedFlowContentNode):
2380         (WebCore::Node::hasCustomStyleResolveCallbacks):
2381         (WebCore::Node::setHasCustomStyleResolveCallbacks):
2382         (WebCore::Node::setTreeScope):
2383         (WebCore::Node::setStyleChange):
2384         (WebCore::Node::setNeedsNodeRenderingTraversalSlowPath): Deleted.
2385         * dom/NodeRenderingTraversal.cpp:
2386         (WebCore::NodeRenderingTraversal::traverseParent):
2387         (WebCore::NodeRenderingTraversal::traverseFirstChild):
2388         (WebCore::NodeRenderingTraversal::traverseLastChild):
2389         (WebCore::NodeRenderingTraversal::traversePreviousSibling):
2390         (WebCore::NodeRenderingTraversal::nextInScope):
2391         (WebCore::NodeRenderingTraversal::previousInScope):
2392         (WebCore::NodeRenderingTraversal::parentInScope):
2393         (WebCore::NodeRenderingTraversal::lastChildInScope):
2394         (WebCore::NodeRenderingTraversal::parentSlow): Deleted.
2395         * dom/NodeRenderingTraversal.h:
2396         (WebCore::NodeRenderingTraversal::parent): Deleted.
2397
2398             No longer used.
2399
2400         * html/HTMLSummaryElement.cpp:
2401         * rendering/RenderNamedFlowThread.cpp:
2402         (WebCore::RenderNamedFlowThread::isChildAllowed):
2403
2404             Switch to iterator interface.
2405
2406         * style/RenderTreePosition.cpp:
2407         * style/StyleResolveTree.cpp:
2408         (WebCore::Style::updateTextRendererAfterContentChange):
2409
2410             Switch to iterator interface.
2411
2412 2015-10-14  Zhuo Li  <zachli@apple.com>
2413
2414         Augment <input type=search>’s recent search history with the time each entry was added,
2415         in order to allow time-based clearing of search history.
2416         https://bugs.webkit.org/show_bug.cgi?id=148388.
2417
2418         Reviewed by Darin Adler.
2419
2420         Replace Vector<String> with Vector<RecentSearch>, where RecentSearch is a struct
2421         that consists search string and time, for recent searches in order to store additional time
2422         information.
2423
2424         * WebCore.xcodeproj/project.pbxproj: Added SearchPopupMenuCocoa.h and SearchPopupMenuCocoa.mm
2425         and sort the project file.
2426         * loader/EmptyClients.cpp:
2427         (WebCore::EmptySearchPopupMenu::saveRecentSearches):
2428         (WebCore::EmptySearchPopupMenu::loadRecentSearches):
2429         * platform/SearchPopupMenu.h:
2430         * platform/cocoa/SearchPopupMenuCocoa.h: Added methods for SeachPopupMenuMac in WebKit
2431         and WebPageProxyCocoa in WebKit2 to call.
2432         * platform/cocoa/SearchPopupMenuCocoa.mm: Added.
2433         (WebCore::searchFieldRecentSearchesStorageDirectory): Recent searches with the new structure
2434         are stored in a new location.
2435         (WebCore::searchFieldRecentSearchesPlistPath): Get the path for the plist of the recent
2436         searches entries.
2437         (WebCore::RetainPtr<NSMutableDictionary> readSearchFieldRecentSearchesPlist): Return the
2438         recent searches plist as NSMutableDictionary.
2439         (WebCore::fromNSDatetoSystemClockTime): Convert from NSDate to system_clock::time_point.
2440         (WebCore::fromSystemClockTimetoNSDate): Convert from system_clock::time_point to NSDate.
2441         (WebCore::SearchPopupMenuCocoa::saveRecentSearches): Add a dictionary where it has two pairs
2442         that the first one is the search string and the second one is the time.
2443         (WebCore::SearchPopupMenuCocoa::loadRecentSearches): We expect the recent search item in the
2444         plist to be a two-pair dictionary, and convert the dictionary to the struct RecentSearch.
2445         * platform/win/SearchPopupMenuWin.cpp:
2446         (WebCore::SearchPopupMenuWin::saveRecentSearches): Only save the RecentSearch's search
2447         string on Windows platform, which is what we used to do.
2448         (WebCore::SearchPopupMenuWin::loadRecentSearches): Since we need to construct a
2449         RecentSearch, we get the string from the app's preferences, and set the time to be
2450         std::chrono::system_clock::time_point::min().
2451         * platform/win/SearchPopupMenuWin.h:
2452         * rendering/RenderSearchField.cpp: Now that m_recentSearches are Vector<RecentSearch>,
2453         we cannot use -removeAll with a search string. Use -removeAllMatching instead to remove the
2454         item that has its member search string equal to the search string user inputs.
2455         (WebCore::RenderSearchField::addSearchResult):
2456         (WebCore::RenderSearchField::itemText):
2457
2458 2015-10-14  Simon Fraser  <simon.fraser@apple.com>
2459
2460         Use RefPtr<Image> return type for StyleImage::image()
2461         https://bugs.webkit.org/show_bug.cgi?id=150112
2462
2463         Reviewed by Andreas Kling.
2464         
2465         Change StyleImage::image() and subclasses to return RefPtr<Image>
2466         instead of a PassRefPtr<Image>.
2467
2468         * WebCore.xcodeproj/project.pbxproj:
2469         * rendering/RenderImageResource.cpp:
2470         (WebCore::RenderImageResource::image):
2471         * rendering/RenderImageResource.h:
2472         * rendering/RenderImageResourceStyleImage.cpp:
2473         (WebCore::RenderImageResourceStyleImage::image):
2474         * rendering/RenderImageResourceStyleImage.h:
2475         * rendering/style/StyleCachedImage.cpp:
2476         (WebCore::StyleCachedImage::image):
2477         * rendering/style/StyleCachedImage.h:
2478         * rendering/style/StyleCachedImageSet.cpp:
2479         (WebCore::StyleCachedImageSet::image):
2480         * rendering/style/StyleCachedImageSet.h:
2481         * rendering/style/StyleGeneratedImage.cpp:
2482         (WebCore::StyleGeneratedImage::image):
2483         * rendering/style/StyleGeneratedImage.h:
2484         * rendering/style/StyleImage.h:
2485         * rendering/style/StylePendingImage.h:
2486
2487 2015-10-14  Simon Fraser  <simon.fraser@apple.com>
2488
2489         Give subclasses of CSSImageGeneratorValue a consistent image() return type
2490         https://bugs.webkit.org/show_bug.cgi?id=150111
2491
2492         Reviewed by Andreas Kling.
2493         
2494         CSSImageGeneratorValue and subclasses had signatures of the non-virtual image() function
2495         with mistmatched return types; some returned RefPtr<Image>, and others PassRefPtr<Image>. Make
2496         them all the same.
2497
2498         * css/CSSImageGeneratorValue.cpp:
2499         (WebCore::CSSImageGeneratorValue::image):
2500         * css/CSSImageGeneratorValue.h:
2501         * css/CSSNamedImageValue.cpp:
2502         (WebCore::CSSNamedImageValue::image):
2503         * css/CSSNamedImageValue.h:
2504
2505 2015-10-14  Tim Horton  <timothy_horton@apple.com>
2506
2507         Move some EventHandler initialization to the header
2508         https://bugs.webkit.org/show_bug.cgi?id=150139
2509
2510         Reviewed by Andreas Kling.
2511
2512         No new tests, just cleanup.
2513
2514         * page/EventHandler.cpp:
2515         (WebCore::EventHandler::EventHandler): Deleted.
2516         * page/EventHandler.h:
2517         Also found one member which was unused, and a few that were uninitialized.
2518         It's likely the uninitialized ones didn't actually cause any trouble because
2519         they are reset in lots of places, but this seems better.
2520
2521 2015-10-14  Alex Christensen  <achristensen@webkit.org>
2522
2523         [Content Extensions] Make blocked async XHR call onerror
2524         https://bugs.webkit.org/show_bug.cgi?id=146706
2525
2526         Reviewed by Brady Eidson.
2527
2528         Test: http/tests/contentextensions/async-xhr-onerror.html
2529
2530         * xml/XMLHttpRequest.cpp:
2531         (WebCore::XMLHttpRequest::XMLHttpRequest):
2532         (WebCore::XMLHttpRequest::createRequest):
2533         (WebCore::XMLHttpRequest::networkError):
2534         (WebCore::XMLHttpRequest::networkErrorTimerFired):
2535         (WebCore::XMLHttpRequest::abortError):
2536         * xml/XMLHttpRequest.h:
2537         Make a timer that calls networkError in 0 time if a content blocker blocks the asynchronous load.
2538         It is necessary to call setPendingActivity and dropProtection (which calls unsetPendingActivity)
2539         to keep a reference to the XMLHttpRequest alive.
2540
2541 2015-10-14  Andy Estes  <aestes@apple.com>
2542
2543         [iOS] QuickLook documents loaded over https do not load their subresources
2544         https://bugs.webkit.org/show_bug.cgi?id=150145
2545         <rdar://problem/22884521>
2546
2547         Reviewed by Alexey Proskuryakov.
2548
2549         When QuickLook generates an HTML preview of a document, subresources are referenced using the x-apple-ql-id scheme,
2550         for which QuickLook installs an NSURLProtocol. If a document is loaded over https, then this scheme needs to be
2551         considered secure in order to avoid mixed content errors.
2552
2553         Test: http/tests/quicklook/secure-document-with-subresources.html
2554
2555         * platform/SchemeRegistry.cpp:
2556         (WebCore::secureSchemes): Registered QLPreviewProtocol() as a secure scheme.
2557
2558 2015-10-14  Jiewen Tan  <jiewen_tan@apple.com>
2559
2560         Postpone mutation events before invoke Editor::Command command(Document*, const String&, bool).
2561         https://bugs.webkit.org/show_bug.cgi?id=149299
2562         <rdar://problem/22746995>
2563
2564         Reviewed by Andreas Kling.
2565
2566         Test: editing/inserting/insert-with-mutation-event.html
2567
2568         This is a merge of a part of Blink r166294:
2569         https://codereview.chromium.org/141103006
2570
2571         * dom/Document.cpp:
2572         (WebCore::Document::execCommand):
2573
2574 2015-10-14  Dean Jackson  <dino@apple.com>
2575
2576         Implement CanvasRenderingContext2D::commit
2577         https://bugs.webkit.org/show_bug.cgi?id=150110
2578         <rdar://problem/23057398>
2579
2580         Reviewed by Anders Carlsson.
2581
2582         As part of getting as close as possible to the HTML5 specification,
2583         implement the commit() method on 2d canvas, even though it doesn't
2584         do anything.
2585
2586         Test: fast/canvas/commit.html
2587
2588         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2589         (WebCore::JSCanvasRenderingContext2D::commit): Intercept it here to
2590         avoid adding a method to the actual implementation.
2591         * html/canvas/CanvasRenderingContext2D.idl: Add commit.
2592
2593 2015-10-14  Alex Christensen  <achristensen@webkit.org>
2594
2595         Add SPI for reloading without content blockers
2596         https://bugs.webkit.org/show_bug.cgi?id=150058
2597         rdar://problem/22742222
2598
2599         Reviewed by Sam Weinig.
2600
2601         * loader/FrameLoader.cpp:
2602         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2603         (WebCore::FrameLoader::reload):
2604         * loader/FrameLoader.h:
2605         * page/Page.h:
2606         (WebCore::Page::userContentController):
2607         (WebCore::Page::userContentExtensionsEnabled): Deleted.
2608         (WebCore::Page::setUserContentExtensionsEnabled): Deleted.
2609         * replay/UserInputBridge.cpp:
2610         (WebCore::UserInputBridge::loadRequest):
2611         (WebCore::UserInputBridge::reloadFrame):
2612         (WebCore::UserInputBridge::stopLoadingFrame):
2613         * replay/UserInputBridge.h:
2614         Pass a bool from the reloadWithoutContentBlockers call to the DocumentLoader, 
2615         which stores the state of whether the content blockers are enabled or not.
2616         Remove the state from the Page and copying the state from the Page to the DocumentLoader
2617         because that caused issues with the content blockers being re-enabled at the wrong time.
2618
2619 2015-10-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2620
2621         Rename JSDOMWrapper to JSDOMObject and JSDOMWrapperWithImplementation to JSDOMWrapper
2622         https://bugs.webkit.org/show_bug.cgi?id=150120
2623
2624         Reviewed by Sam Weinig.
2625
2626         No change in behavior.
2627
2628         * bindings/js/DOMWrapperWorld.h:
2629         * bindings/js/JSDOMBinding.h:
2630         (WebCore::DOMConstructorObject::DOMConstructorObject):
2631         (WebCore::getInlineCachedWrapper):
2632         (WebCore::setInlineCachedWrapper):
2633         (WebCore::clearInlineCachedWrapper):
2634         (WebCore::createWrapper):
2635         (WebCore::getStaticValueSlotEntryWithoutCaching<JSDOMObject>):
2636         * bindings/js/JSDOMWrapper.cpp:
2637         * bindings/js/JSDOMWrapper.h:
2638         (WebCore::JSDOMObject::JSDOMObject):
2639         (WebCore::JSDOMWrapper::~JSDOMWrapper):
2640         (WebCore::JSDOMWrapper::JSDOMWrapper):
2641         * bindings/js/JSElementCustom.cpp:
2642         (WebCore::toJSNewlyCreated):
2643         * bindings/js/JSNodeCustom.cpp:
2644         (WebCore::createWrapperInline):
2645         * bindings/js/ScriptWrappable.h:
2646         * bindings/js/ScriptWrappableInlines.h:
2647         (WebCore::ScriptWrappable::wrapper):
2648         (WebCore::ScriptWrappable::setWrapper):
2649         (WebCore::ScriptWrappable::clearWrapper):
2650         * bindings/scripts/CodeGeneratorJS.pm:
2651         (GetParentClassName):
2652         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2653         (WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject):
2654         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2655         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2656         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
2657         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2658         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2659         (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
2660         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2661         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2662         (WebCore::JSTestEventConstructor::JSTestEventConstructor):
2663         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2664         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2665         (WebCore::JSTestEventTarget::JSTestEventTarget):
2666         * bindings/scripts/test/JS/JSTestEventTarget.h:
2667         * bindings/scripts/test/JS/JSTestException.cpp:
2668         (WebCore::JSTestException::JSTestException):
2669         * bindings/scripts/test/JS/JSTestException.h:
2670         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2671         (WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable):
2672         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2673         * bindings/scripts/test/JS/JSTestInterface.cpp:
2674         (WebCore::JSTestInterface::JSTestInterface):
2675         * bindings/scripts/test/JS/JSTestInterface.h:
2676         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2677         (WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor):
2678         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
2679         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2680         (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
2681         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2682         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2683         (WebCore::JSTestNamedConstructor::JSTestNamedConstructor):
2684         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2685         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2686         (WebCore::JSTestNondeterministic::JSTestNondeterministic):
2687         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2688         * bindings/scripts/test/JS/JSTestObj.cpp:
2689         (WebCore::JSTestObj::JSTestObj):
2690         * bindings/scripts/test/JS/JSTestObj.h:
2691         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2692         (WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors):
2693         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2694         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2695         (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins):
2696         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2697         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2698         (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
2699         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2700         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2701         (WebCore::JSTestTypedefs::JSTestTypedefs):
2702         * bindings/scripts/test/JS/JSTestTypedefs.h:
2703         * bindings/scripts/test/JS/JSattribute.cpp:
2704         (WebCore::JSattribute::JSattribute):
2705         * bindings/scripts/test/JS/JSattribute.h:
2706         * bindings/scripts/test/JS/JSreadonly.cpp:
2707         (WebCore::JSreadonly::JSreadonly):
2708         * bindings/scripts/test/JS/JSreadonly.h:
2709         * dom/make_names.pl:
2710         (printWrapperFunctions):
2711         (printWrapperFactoryCppFile):
2712         (printWrapperFactoryHeaderFile):
2713
2714 2015-10-14  Simon Fraser  <simon.fraser@apple.com>
2715
2716         Change GraphicsContext image-drawing functions to take references
2717         https://bugs.webkit.org/show_bug.cgi?id=150108
2718
2719         Reviewed by Tim Horton and Sam Weinig.
2720
2721         Change GraphicsContext::drawImage(), drawTiledImage(), drawImageBuffer(), clipToImageBuffer()
2722         and isCompatibleWithBuffer() to take references, and adjust calling code, adding
2723         null-checks where necessary.
2724
2725         * css/CSSCrossfadeValue.cpp:
2726         (WebCore::CSSCrossfadeValue::image):
2727         * css/CSSFilterImageValue.cpp:
2728         (WebCore::CSSFilterImageValue::image):
2729         * html/HTMLCanvasElement.cpp:
2730         (WebCore::HTMLCanvasElement::paint):
2731         * html/canvas/CanvasRenderingContext2D.cpp:
2732         (WebCore::CanvasRenderingContext2D::drawImage):
2733         (WebCore::CanvasRenderingContext2D::compositeBuffer):
2734         (WebCore::drawImageToContext):
2735         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
2736         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2737         * html/canvas/CanvasRenderingContext2D.h:
2738         * html/canvas/WebGL2RenderingContext.cpp:
2739         (WebCore::WebGL2RenderingContext::texSubImage2D):
2740         * html/canvas/WebGLRenderingContext.cpp:
2741         (WebCore::WebGLRenderingContext::texSubImage2D):
2742         * html/canvas/WebGLRenderingContextBase.cpp:
2743         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
2744         (WebCore::WebGLRenderingContextBase::texImage2D):
2745         * html/canvas/WebGLRenderingContextBase.h:
2746         * platform/ScrollView.cpp:
2747         (WebCore::ScrollView::paintPanScrollIcon):
2748         * platform/graphics/CrossfadeGeneratedImage.cpp:
2749         (WebCore::CrossfadeGeneratedImage::CrossfadeGeneratedImage):
2750         (WebCore::drawCrossfadeSubimage):
2751         (WebCore::CrossfadeGeneratedImage::drawCrossfade):
2752         * platform/graphics/CrossfadeGeneratedImage.h:
2753         * platform/graphics/GradientImage.cpp:
2754         (WebCore::GradientImage::drawPattern):
2755         * platform/graphics/GraphicsContext.cpp:
2756         (WebCore::GraphicsContext::drawImage):
2757         (WebCore::GraphicsContext::drawTiledImage):
2758         (WebCore::GraphicsContext::drawImageBuffer):
2759         (WebCore::GraphicsContext::clipToImageBuffer):
2760         (WebCore::GraphicsContext::isCompatibleWithBuffer):
2761         * platform/graphics/GraphicsContext.h:
2762         * platform/graphics/ShadowBlur.cpp:
2763         (WebCore::ShadowBlur::drawShadowBuffer):
2764         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
2765         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
2766         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
2767         (WebCore::ShadowBlur::drawRectShadowWithTiling):
2768         (WebCore::ShadowBlur::drawLayerPieces):
2769         (WebCore::ShadowBlur::endShadowLayer):
2770         * platform/graphics/cairo/ImageBufferCairo.cpp:
2771         (WebCore::ImageBuffer::draw):
2772         * platform/graphics/cg/PDFDocumentImage.cpp:
2773         (WebCore::PDFDocumentImage::draw):
2774         * platform/graphics/filters/FEBlend.cpp:
2775         (WebCore::FEBlend::platformApplySoftware):
2776         * platform/graphics/filters/FEColorMatrix.cpp:
2777         (WebCore::FEColorMatrix::platformApplySoftware):
2778         * platform/graphics/filters/FEComposite.cpp:
2779         (WebCore::FEComposite::platformApplySoftware):
2780         * platform/graphics/filters/FEDropShadow.cpp:
2781         (WebCore::FEDropShadow::platformApplySoftware):
2782         * platform/graphics/filters/FEMerge.cpp:
2783         (WebCore::FEMerge::platformApplySoftware):
2784         * platform/graphics/filters/FEOffset.cpp:
2785         (WebCore::FEOffset::platformApplySoftware):
2786         * platform/graphics/filters/FETile.cpp:
2787         (WebCore::FETile::platformApplySoftware):
2788         * platform/graphics/filters/SourceAlpha.cpp:
2789         (WebCore::SourceAlpha::platformApplySoftware):
2790         * platform/graphics/filters/SourceGraphic.cpp:
2791         (WebCore::SourceGraphic::platformApplySoftware):
2792         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2793         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2794         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
2795         (WebCore::ImageBackingSurfaceClient::ImageBackingSurfaceClient):
2796         (WebCore::CoordinatedImageBacking::update):
2797         * platform/mac/ThemeMac.mm:
2798         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2799         * rendering/FilterEffectRenderer.cpp:
2800         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
2801         * rendering/ImageQualityController.cpp:
2802         (WebCore::ImageQualityController::shouldPaintAtLowQuality):
2803         * rendering/ImageQualityController.h:
2804         * rendering/RenderBoxModelObject.cpp:
2805         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality):
2806         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2807         * rendering/RenderBoxModelObject.h:
2808         * rendering/RenderEmbeddedObject.cpp:
2809         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
2810         (WebCore::RenderEmbeddedObject::paintContents):
2811         * rendering/RenderEmbeddedObject.h:
2812         * rendering/RenderImage.cpp:
2813         (WebCore::RenderImage::paintReplaced):
2814         (WebCore::RenderImage::paintIntoRect):
2815         * rendering/RenderImageResourceStyleImage.cpp:
2816         (WebCore::RenderImageResourceStyleImage::shutdown):
2817         (WebCore::RenderImageResourceStyleImage::image):
2818         * rendering/RenderLayer.cpp:
2819         (WebCore::RenderLayer::drawPlatformResizerImage):
2820         * rendering/RenderListMarker.cpp:
2821         (WebCore::RenderListMarker::paint):
2822         * rendering/RenderSnapshottedPlugIn.cpp:
2823         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
2824         * rendering/RenderThemeMac.mm:
2825         (WebCore::RenderThemeMac::paintProgressBar):
2826         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2827         * rendering/RenderThemeWin.cpp:
2828         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
2829         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
2830         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
2831         * rendering/shapes/Shape.cpp:
2832         (WebCore::Shape::createRasterShape):
2833         * rendering/shapes/ShapeOutsideInfo.cpp:
2834         (WebCore::ShapeOutsideInfo::createShapeForImage): Deleted.
2835         * rendering/style/NinePieceImage.cpp:
2836         (WebCore::NinePieceImage::paint):
2837         * rendering/svg/RenderSVGImage.cpp:
2838         (WebCore::RenderSVGImage::paintForeground):
2839         * rendering/svg/RenderSVGResourceFilter.cpp:
2840         (WebCore::RenderSVGResourceFilter::postApplyResource):
2841         * rendering/svg/SVGRenderingContext.cpp:
2842         (WebCore::SVGRenderingContext::clipToImageBuffer):
2843         (WebCore::SVGRenderingContext::bufferForeground):
2844         * svg/graphics/filters/SVGFEImage.cpp:
2845         (WebCore::FEImage::platformApplySoftware):
2846
2847 2015-10-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2848
2849         REGRESSION(r53318): background-repeat: space with gradients doesn't render correctly
2850         https://bugs.webkit.org/show_bug.cgi?id=150068
2851
2852         Reviewed by Simon Fraser.
2853
2854         This is a regression of r53318 in which we were trying to make the pattern
2855         of the gradient image as small as possible: 1-pixel wide or tall. But this
2856         broke the rendering of the background image when container element has the
2857         style background-repeat: space. The reason for this is tiling the gradient
2858         image is done completely by CG. To do the tiling, we start by creating a
2859         CGPattern by calling CGPatternCreate() which takes the rect of the pattern
2860         and the step. If the width or the height of the pattern image is adjusted
2861         to be 1-pixel wide or tall, that will force CG to leave a space after every
2862         it draws the pattern image which is 1-pixel wide or tall which is wrong.
2863         
2864         The fix is to disable this optimization altogether if the container element
2865         has the style background-repeat: space.
2866
2867         Test: fast/gradients/background-image-repeat-space.html
2868
2869         * platform/graphics/Gradient.cpp:
2870         (WebCore::Gradient::adjustParametersForTiledDrawing):
2871         * platform/graphics/Gradient.h:
2872         * platform/graphics/GradientImage.cpp:
2873         (WebCore::GradientImage::drawPattern):
2874
2875 2015-10-13  Simon Fraser  <simon.fraser@apple.com>
2876
2877         Add helper funtion for checking pointer equivalency and use it
2878         https://bugs.webkit.org/show_bug.cgi?id=150022
2879
2880         Reviewed by Darin Adler.
2881
2882         A common pattern in WebCore code is to check for equivalency of two pointers,
2883         either both null, or both non-null and with equal values. This was written in
2884         several different ways in different places.
2885         
2886         Add arePointingToEqualData() to standardize this pattern.
2887
2888         This obviates the need for StyleImage::imagesEquivalent(), counterDataEquivalent()
2889         etc.
2890         
2891         Also change some comparisons of DataRef<> which checked the pointer and then the
2892         values to use DataRef<>::operator== which does the same thing. Comparisons of
2893         m_grid and m_gridItem only checked pointer equality, so this is probably a bug fix there.
2894
2895         * page/animation/CSSPropertyAnimation.cpp: if ((!a && !b) || a == b) is redundant so fix,
2896         and add checks for a and b RenderStyle* first.
2897         (WebCore::PropertyWrapperGetter::equals):
2898         (WebCore::StyleImagePropertyWrapper::equals):
2899         (WebCore::PropertyWrapperShadow::equals):
2900         (WebCore::PropertyWrapperMaybeInvalidColor::equals):
2901         (WebCore::FillLayerPropertyWrapperGetter::equals):
2902         (WebCore::FillLayerStyleImagePropertyWrapper::equals):
2903         (WebCore::FillLayersPropertyWrapper::equals):
2904         (WebCore::ShorthandPropertyWrapper::equals):
2905         (WebCore::PropertyWrapperFlex::equals):
2906         (WebCore::PropertyWrapperSVGPaint::equals):
2907         * platform/network/ResourceRequestBase.cpp:
2908         (WebCore::equalIgnoringHeaderFields):
2909         * rendering/style/FillLayer.cpp:
2910         (WebCore::FillLayer::operator==):
2911         * rendering/style/NinePieceImage.cpp:
2912         (WebCore::NinePieceImageData::operator==):
2913         * rendering/style/RenderStyle.cpp: Some nullptr cleanup.
2914         (WebCore::RenderStyle::getCachedPseudoStyle):
2915         (WebCore::RenderStyle::addCachedPseudoStyle):
2916         (WebCore::RenderStyle::changeAffectsVisualOverflow):
2917         (WebCore::RenderStyle::changeRequiresLayout):
2918         (WebCore::RenderStyle::changeRequiresLayerRepaint):
2919         (WebCore::RenderStyle::setWillChange):
2920         * rendering/style/SVGRenderStyleDefs.cpp:
2921         (WebCore::StyleShadowSVGData::operator==):
2922         * rendering/style/ShadowData.cpp:
2923         (WebCore::ShadowData::operator==):
2924         * rendering/style/StyleImage.h:
2925         (WebCore::StyleImage::imagesEquivalent): Deleted.
2926         * rendering/style/StyleRareInheritedData.cpp:
2927         (WebCore::StyleRareInheritedData::operator==):
2928         (WebCore::cursorDataEquivalent): Deleted.
2929         (WebCore::quotesDataEquivalent): Deleted.
2930         (WebCore::StyleRareInheritedData::shadowDataEquivalent): Deleted.
2931         * rendering/style/StyleRareInheritedData.h:
2932         * rendering/style/StyleRareNonInheritedData.cpp:
2933         (WebCore::StyleRareNonInheritedData::operator==):
2934         (WebCore::StyleRareNonInheritedData::counterDataEquivalent): Deleted.
2935         (WebCore::StyleRareNonInheritedData::shadowDataEquivalent): Deleted.
2936         (WebCore::StyleRareNonInheritedData::willChangeDataEquivalent): Deleted.
2937         (WebCore::StyleRareNonInheritedData::reflectionDataEquivalent): Deleted.
2938         (WebCore::StyleRareNonInheritedData::animationDataEquivalent): Deleted.
2939         (WebCore::StyleRareNonInheritedData::transitionDataEquivalent): Deleted.
2940         * rendering/style/StyleRareNonInheritedData.h:
2941
2942 2015-10-13  Myles C. Maxfield  <mmaxfield@apple.com>
2943
2944         Split TypesettingFeatures into kerning and ligatures bools
2945         https://bugs.webkit.org/show_bug.cgi?id=150074
2946
2947         Reviewed by Simon Fraser.
2948
2949         Our TypesettingFeatures type represents whether kerning or ligatures are enabled
2950         when laying out text. However, now that I have implemented font-feature-settings
2951         and font-variant-*, this type is wildly inadequate. There are now multiple kinds
2952         of ligatures, and many other features which are neither kerning nor ligatures.
2953         Adding tons of information to this type doesn't make sense because 1) We already
2954         have a FontVariantSettings struct which contains this information, and 2) None
2955         of the users of TypesettingFeatures care about most of these new features.
2956
2957         In this new world of font features, the font-kerning property isn't changing.
2958         Therefore, all the code which relies only on the Kerning value in
2959         TypesettingFeatures doesn't need to change. The places which rely on Ligatures,
2960         however, need to be updated to understand that there are many different kinds
2961         of ligatures.
2962
2963         Indeed, after inspection, all of the places which inspect ligatures are more
2964         interested in a high-level concept of whether or not we can trust some simple
2965         computation. Therefore, we really have two things we care about: Kerning, and
2966         this high-level concept.
2967
2968         This patch is the second step to update our view of the world to include
2969         font-feature-settings and font-variant-*. In particular, this patch simply
2970         splits TypesettingFeatures into two Booleans, one for Kerning, and one for
2971         Ligatures (which has no behavior change). Then, once they are separated, I can
2972         migrate the Ligatures Boolean to take on its new meaning.
2973
2974         This change is purely mechanical.
2975
2976         No new tests because there is no behavior change.
2977
2978         * WebCore.xcodeproj/project.pbxproj:
2979         * css/CSSPrimitiveValueMappings.h:
2980         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2981         (WebCore::CSSPrimitiveValue::operator FontCascadeDescription::Kerning):
2982         * platform/graphics/Font.cpp:
2983         (WebCore::Font::applyTransforms):
2984         * platform/graphics/Font.h:
2985         * platform/graphics/FontCascade.cpp:
2986         (WebCore::FontCascade::FontCascade):
2987         (WebCore::FontCascade::operator=):
2988         (WebCore::FontCascade::update):
2989         (WebCore::FontCascade::drawText):
2990         (WebCore::FontCascade::drawEmphasisMarks):
2991         (WebCore::FontCascade::width):
2992         (WebCore::FontCascade::adjustSelectionRectForText):
2993         (WebCore::FontCascade::offsetForPosition):
2994         (WebCore::FontCascade::setDefaultKerning):
2995         (WebCore::FontCascade::setDefaultLigatures):
2996         (WebCore::FontCascade::codePath):
2997         (WebCore::FontCascade::floatWidthForSimpleText):
2998         (WebCore::FontCascade::setDefaultTypesettingFeatures): Deleted.
2999         (WebCore::FontCascade::defaultTypesettingFeatures): Deleted.
3000         * platform/graphics/FontCascade.h:
3001         (WebCore::FontCascade::enableKerning):
3002         (WebCore::FontCascade::enableLigatures):
3003         (WebCore::FontCascade::computeEnableKerning):
3004         (WebCore::FontCascade::computeEnableLigatures):
3005         (WebCore::FontCascade::typesettingFeatures): Deleted.
3006         (WebCore::FontCascade::computeTypesettingFeatures): Deleted.
3007         * platform/graphics/FontDescription.cpp:
3008         (WebCore::FontCascadeDescription::FontCascadeDescription):
3009         * platform/graphics/FontDescription.h:
3010         (WebCore::FontCascadeDescription::setKerning):
3011         (WebCore::FontCascadeDescription::initialKerning):
3012         * platform/graphics/TypesettingFeatures.h: Removed.
3013         * platform/graphics/WidthIterator.cpp:
3014         (WebCore::WidthIterator::WidthIterator):
3015         (WebCore::WidthIterator::applyFontTransforms):
3016         (WebCore::WidthIterator::advanceInternal):
3017         * platform/graphics/WidthIterator.h:
3018         * platform/graphics/cocoa/FontCocoa.mm:
3019         (WebCore::Font::canRenderCombiningCharacterSequence):
3020         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3021         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
3022         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
3023         (WebCore::Font::getCFStringAttributes):
3024         * rendering/RenderBlockLineLayout.cpp:
3025         (WebCore::setLogicalWidthForTextRun):
3026         * rendering/line/BreakingContext.h:
3027         (WebCore::WordTrailingSpace::width):
3028         * svg/SVGFontData.h:
3029
3030 2015-10-13  Zalan Bujtas  <zalan@apple.com>
3031
3032         Anonymous table objects: inline parent box requires inline-table child.
3033         https://bugs.webkit.org/show_bug.cgi?id=150090
3034
3035         Reviewed by David Hyatt.
3036
3037         According to the CSS2.1 specification, if a child needs anonymous table wrapper
3038         and the child's parent is an inline box, the generated table needs to be inline-table.
3039         (inline-block and block parents generate non-inline table) 
3040
3041         Import W3C CSS2.1 anonymous table tests.
3042
3043         * rendering/RenderElement.cpp:
3044         (WebCore::RenderElement::childRequiresTable):
3045         (WebCore::RenderElement::addChild):
3046         * rendering/RenderElement.h:
3047         * rendering/RenderInline.cpp:
3048         (WebCore::RenderInline::newChildIsInline):
3049         (WebCore::RenderInline::addChildIgnoringContinuation):
3050         (WebCore::RenderInline::addChildToContinuation):
3051         * rendering/RenderInline.h:
3052         * rendering/RenderTable.cpp:
3053         (WebCore::RenderTable::createAnonymousWithParentRenderer):
3054
3055 2015-10-13  Dean Jackson  <dino@apple.com>
3056
3057         Device motion and orientation should only be visible from the main frame's security origin
3058         https://bugs.webkit.org/show_bug.cgi?id=150072
3059         <rdar://problem/23082036>
3060
3061         Reviewed by Brent Fulgham.
3062
3063         There are reports that gyroscope and accelerometer information can
3064         be used to detect keyboard entry. One initial step to reduce the
3065         risk is to forbid device motion and orientation events from
3066         being fired in frames that are a different security origin from the main page.
3067
3068         Manual test: deviceorientation-main-frame-only.html
3069
3070         * page/DOMWindow.cpp:
3071         (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame): New helper function.
3072         (WebCore::DOMWindow::addEventListener): Check if we are the main frame, or the
3073         same security origin as the main frame. If not, don't add the event
3074         listeners.
3075
3076 2015-10-12  Dean Jackson  <dino@apple.com>
3077
3078         ASSERT(m_motionManager) on emgn.com page
3079         https://bugs.webkit.org/show_bug.cgi?id=150070
3080         <rdar://problem/18383732>
3081
3082         Reviewed by Simon Fraser.
3083
3084         In the WebCoreMotionManager init method, we call
3085         into another setup method on the main thread.
3086         However, if a listener was attached before that
3087         ran, we'd ASSERT. This wasn't actually causing a bug
3088         because the main thread initialization would
3089         check the listeners once it got a chance to run.
3090
3091         The fix is to only check status when we've
3092         actually initialized.
3093
3094         * platform/ios/WebCoreMotionManager.h: New m_initialized boolean.
3095         * platform/ios/WebCoreMotionManager.mm: Check m_initialized before doing real work.
3096         (-[WebCoreMotionManager init]):
3097         (-[WebCoreMotionManager addMotionClient:]):
3098         (-[WebCoreMotionManager removeMotionClient:]):
3099         (-[WebCoreMotionManager addOrientationClient:]):
3100         (-[WebCoreMotionManager removeOrientationClient:]):
3101         (-[WebCoreMotionManager initializeOnMainThread]):
3102
3103 2015-10-13  Chris Dumez  <cdumez@apple.com>
3104
3105         Avoid useless copies in range-loops that are using 'auto'
3106         https://bugs.webkit.org/show_bug.cgi?id=150091
3107
3108         Reviewed by Sam Weinig.
3109
3110         Avoid useless copies in range-loops that are using 'auto'. Also use
3111         'auto*' instead of 'auto' when range values are pointers for clarity.
3112
3113 2015-10-13  Simon Fraser  <simon.fraser@apple.com>
3114
3115         Move Image::drawPattern for CG into GraphicsContext
3116         https://bugs.webkit.org/show_bug.cgi?id=150077
3117
3118         Reviewed by Myles C. Maxfield.
3119
3120         In order to consolidate code that calls into Core Graphics inside
3121         GraphicsContext, move the body of Image::drawPattern() into
3122         GraphicsContextCG.cpp, and do the same for Cairo.
3123
3124         * platform/graphics/GraphicsContext.h:
3125         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3126         (WebCore::GraphicsContext::drawPattern):
3127         * platform/graphics/cairo/ImageCairo.cpp:
3128         (WebCore::Image::drawPattern):
3129         * platform/graphics/cg/GraphicsContextCG.cpp:
3130         (WebCore::drawPatternCallback):
3131         (WebCore::patternReleaseCallback):
3132         (WebCore::GraphicsContext::drawPattern):
3133         * platform/graphics/cg/ImageCG.cpp:
3134         (WebCore::Image::drawPattern):
3135         (WebCore::drawPatternCallback): Deleted.
3136         (WebCore::patternReleaseCallback): Deleted.
3137
3138 2015-10-13  Myles C. Maxfield  <mmaxfield@apple.com>
3139
3140         Unprefix font-kerning
3141         https://bugs.webkit.org/show_bug.cgi?id=150080
3142
3143         Reviewed by Sam Weinig.
3144
3145         This is the last property in CSS3 Fonts which is prefixed.
3146
3147         Test: fast/text/font-kerning.html
3148
3149         * css/CSSPropertyNames.in:
3150
3151 2015-10-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3152
3153         Add debug settings for using giant tiles (4096x4096)
3154         https://bugs.webkit.org/show_bug.cgi?id=149977
3155         <rdar://problem/23017093>
3156
3157         Reviewed by Tim Horton.
3158
3159         Instead of creating the GraphicsLayer with a fixed size 512x512, we need
3160         to read the useGiantTiles setting. If its value is true, we set the layer
3161         tileSize to 4096x4096.
3162
3163         * page/Settings.in:
3164         Define the name of the setting and its default value.
3165         
3166         * platform/graphics/GraphicsLayerClient.h:
3167         (WebCore::GraphicsLayerClient::tileSize):
3168         Define tileSize() in the base class GraphicsLayerClient. This is going to
3169         be overridden RenderLayerBacking.
3170         
3171         * platform/graphics/TiledBacking.h:
3172         (WebCore::defaultTileSize):
3173         Define the default tileSize which will depend on the useGiantTiles
3174         setting.
3175
3176         * platform/graphics/ca/GraphicsLayerCA.cpp:
3177         (WebCore::GraphicsLayerCA::platformCALayerTileSize):
3178         Implement the virtual function GraphicsLayerCA::platformCALayerTileSize().
3179         It passes the call to client GraphicsLayerClient which can be RenderLayerBacking
3180         in our case.
3181
3182         * platform/graphics/ca/GraphicsLayerCA.h:
3183         Override base class function PlatformCALayerClient::PlatformCALayerClient().
3184
3185         * platform/graphics/ca/PlatformCALayerClient.h:
3186         (WebCore::PlatformCALayerClient::platformCALayerTileSize):
3187         Define platformCALayerTileSize() in the base class PlatformCALayerClient.
3188         This is going to be overridden GraphicsLayerCA.
3189
3190         * platform/graphics/ca/TileController.cpp:
3191         (WebCore::TileController::TileController):
3192         No need for the member m_tileSize.
3193         
3194         (WebCore::TileController::computeTileCoverageRect):
3195         Use the function tileSize() instead of using the static values.
3196         
3197         (WebCore::TileController::tileSize):
3198         The tileSize will be retrieved from the owning graphics layer.
3199         
3200         * platform/graphics/ca/TileController.h:
3201         No need for the member m_tileSize. The tileSize will be retrieved from the owning graphics layer.
3202
3203         * rendering/RenderLayerBacking.cpp:
3204         (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
3205         Use the function tileSize() instead of using the static values.
3206         
3207         (WebCore::RenderLayerBacking::tileSize):
3208         Override base class function GraphicsLayerClient::tileSize().
3209         
3210         * rendering/RenderLayerBacking.h:
3211         Define the concrete method RenderLayerBacking::tilSize().
3212
3213 2015-10-13  Antti Koivisto  <antti@apple.com>
3214
3215         Try to fix ENABLE(DETAILS_ELEMENT) with SHADOW_DOM disabled.
3216
3217         * dom/Element.cpp:
3218         (WebCore::Element::attributeChanged):
3219         * dom/Node.cpp:
3220         (WebCore::traverseStyleParent):
3221
3222 2015-10-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3223
3224         Fix license and copyrights of WebCore js binding builtin files
3225         https://bugs.webkit.org/show_bug.cgi?id=150027
3226
3227         Reviewed by Darin Adler.
3228
3229         Fixing copyright on all three files.
3230         Moving to BSD-like license as they should have been in the first place.
3231         Ordering lexicographically the builtin names in WebCoreBuiltinNames.h.
3232
3233         No change in behaviour.
3234
3235         * bindings/js/WebCoreBuiltinNames.h:
3236         * bindings/js/WebCoreJSBuiltins.cpp:
3237         * bindings/js/WebCoreJSBuiltins.h:
3238         * bindings/js/WebCoreJSBuiltinInternals.h:
3239
3240 2015-10-12  Antti Koivisto  <antti@apple.com>
3241
3242         Implement iterator for traversing composed DOM
3243         https://bugs.webkit.org/show_bug.cgi?id=149997
3244
3245         Reviewed by Ryosuke Niwa.
3246
3247         ComposedTreeIterator traverses the DOM in composed tree order. This means it enters
3248         shadow trees and follows slots created by Shadow DOM API correctly.
3249
3250         auto children = composedTreeChildren(containerNode);
3251         for (auto& composedChild : children)
3252             ...
3253
3254         auto descendants = composedTreeDescendants(containerNode);
3255         for (auto& composedDescendant : descendants)
3256             ...
3257
3258         * WebCore.xcodeproj/project.pbxproj:
3259         * dom/ComposedTreeIterator.cpp: Added.
3260         (WebCore::ComposedTreeIterator::initializeShadowStack):
3261         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
3262         (WebCore::ComposedTreeIterator::traverseNextSiblingSlot):
3263         (WebCore::ComposedTreeIterator::traversePreviousSiblingSlot):
3264         (WebCore::ComposedTreeIterator::traverseParentInShadowTree):
3265         * dom/ComposedTreeIterator.h: Added.
3266         (WebCore::ComposedTreeIterator::operator*):
3267         (WebCore::ComposedTreeIterator::operator->):
3268         (WebCore::ComposedTreeIterator::operator==):
3269         (WebCore::ComposedTreeIterator::operator!=):
3270         (WebCore::ComposedTreeIterator::ShadowContext::ShadowContext):
3271         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
3272         (WebCore::ComposedTreeIterator::traverseNext):
3273         (WebCore::ComposedTreeIterator::traverseNextSibling):
3274         (WebCore::ComposedTreeIterator::traversePreviousSibling):
3275         (WebCore::ComposedTreeIterator::traverseParent):
3276         (WebCore::ComposedTreeChildAdapter::Iterator::Iterator):
3277         (WebCore::ComposedTreeChildAdapter::Iterator::operator++):
3278         (WebCore::ComposedTreeChildAdapter::Iterator::operator--):
3279         (WebCore::ComposedTreeChildAdapter::ComposedTreeChildAdapter):
3280         (WebCore::ComposedTreeChildAdapter::begin):
3281         (WebCore::ComposedTreeChildAdapter::end):
3282         (WebCore::ComposedTreeChildAdapter::at):
3283         (WebCore::composedTreeChildren):
3284         * dom/NodeRenderingTraversal.cpp:
3285         (WebCore::NodeRenderingTraversal::parentSlow):
3286         (WebCore::NodeRenderingTraversal::nextInScope):
3287         (WebCore::NodeRenderingTraversal::firstChildSlow): Deleted.
3288         (WebCore::NodeRenderingTraversal::nextSiblingSlow): Deleted.
3289         (WebCore::NodeRenderingTraversal::previousSiblingSlow): Deleted.
3290         * dom/NodeRenderingTraversal.h:
3291         (WebCore::NodeRenderingTraversal::parent):
3292         (WebCore::NodeRenderingTraversal::firstChild): Deleted.
3293         (WebCore::NodeRenderingTraversal::nextSibling): Deleted.
3294         (WebCore::NodeRenderingTraversal::previousSibling): Deleted.
3295         * style/RenderTreePosition.cpp:
3296         (WebCore::RenderTreePosition::computeNextSibling):
3297
3298             Restore the full assert.
3299
3300         (WebCore::RenderTreePosition::invalidateNextSibling):
3301         (WebCore::RenderTreePosition::previousSiblingRenderer):
3302         (WebCore::RenderTreePosition::nextSiblingRenderer):
3303
3304             Make these member functions.
3305             Use the iterator. This is fixes some bugs and allows enabling a test case.
3306
3307         * style/RenderTreePosition.h:
3308         * style/StyleResolveTree.cpp:
3309         (WebCore::Style::textRendererIsNeeded):
3310
3311 2015-10-13  ChangSeok Oh  <changseok.oh@collabora.com>
3312
3313         [GTK] Use GUniquePtr for GtkIconInfo
3314         https://bugs.webkit.org/show_bug.cgi?id=150082
3315
3316         Reviewed by Carlos Garcia Campos.
3317
3318         GtkIconInfo cab be wrapped by a smart pointer, GUniqueptr.
3319
3320         No new test required since no functionality changed.
3321
3322         * rendering/RenderThemeGtk.cpp:
3323         (WebCore::getStockSymbolicIconForWidgetType):
3324
3325 2015-10-12  Jaehun Lim  <ljaehun.lim@samsung.com>
3326
3327         Unreviewed, fix debug build warning.
3328
3329         %llu needs 'long long unsigned int'.
3330
3331         Type casting unit64_t to long long unsigned int.
3332
3333         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3334         (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
3335         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3336         (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChange):
3337
3338 2015-10-12  Simon Fraser  <simon.fraser@apple.com>
3339
3340         Speculative Cairo build fixes after r190910.
3341
3342         * platform/graphics/cairo/ImageBufferCairo.cpp:
3343         (WebCore::ImageBuffer::drawPattern):
3344         * platform/graphics/cairo/ImageCairo.cpp:
3345         (WebCore::Image::drawPattern):
3346
3347 2015-10-12  Simon Fraser  <simon.fraser@apple.com>
3348
3349         Fix iOS and Efl builds.
3350
3351         * platform/graphics/NamedImageGeneratedImage.cpp:
3352         (WebCore::NamedImageGeneratedImage::drawPattern):
3353
3354 2015-10-12  Simon Fraser  <simon.fraser@apple.com>
3355
3356         Remove Image::spaceSize() and ImageBuffer::spaceSize()
3357         https://bugs.webkit.org/show_bug.cgi?id=150064
3358
3359         Reviewed by Tim Horton.
3360
3361         Image spacing when tiled should not be a property of the image; but a description
3362         of how it's drawn, like tile size. So remove spacing from Image and ImageBuffer,
3363         and pass it in as an argument.
3364
3365         * platform/graphics/BitmapImage.cpp:
3366         (WebCore::BitmapImage::drawPattern):
3367         * platform/graphics/BitmapImage.h:
3368         * platform/graphics/CrossfadeGeneratedImage.cpp:
3369         (WebCore::CrossfadeGeneratedImage::drawPattern):
3370         * platform/graphics/CrossfadeGeneratedImage.h:
3371         * platform/graphics/GeneratedImage.h:
3372         * platform/graphics/GradientImage.cpp:
3373         (WebCore::GradientImage::drawPattern):
3374         * platform/graphics/GradientImage.h:
3375         * platform/graphics/GraphicsContext.cpp:
3376         (WebCore::GraphicsContext::drawTiledImage):
3377         * platform/graphics/GraphicsContext.h:
3378         * platform/graphics/Image.cpp:
3379         (WebCore::Image::drawTiled):
3380         * platform/graphics/Image.h:
3381         (WebCore::Image::spaceSize): Deleted.
3382         (WebCore::Image::setSpaceSize): Deleted.
3383         * platform/graphics/ImageBuffer.h:
3384         (WebCore::ImageBuffer::spaceSize): Deleted.
3385         (WebCore::ImageBuffer::setSpaceSize): Deleted.
3386         * platform/graphics/NamedImageGeneratedImage.cpp:
3387         (WebCore::NamedImageGeneratedImage::drawPattern):
3388         * platform/graphics/NamedImageGeneratedImage.h:
3389         * platform/graphics/cg/ImageBufferCG.cpp:
3390         (WebCore::ImageBuffer::copyImage):
3391         (WebCore::ImageBuffer::drawPattern):
3392         * platform/graphics/cg/ImageCG.cpp:
3393         (WebCore::Image::drawPattern):
3394         * rendering/RenderBoxModelObject.cpp:
3395         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3396         * svg/graphics/SVGImage.cpp:
3397         (WebCore::SVGImage::drawPatternForContainer):
3398         * svg/graphics/SVGImage.h:
3399         * svg/graphics/SVGImageForContainer.cpp:
3400         (WebCore::SVGImageForContainer::drawPattern):
3401         * svg/graphics/SVGImageForContainer.h:
3402
3403 2015-10-12  Andreas Kling  <akling@apple.com>
3404
3405         Have TransformState::mappedSecondaryQuad() return an Optional<FloatQuad>.
3406         <https://webkit.org/b/150057>
3407
3408         Reviewed by Simon Fraser.
3409
3410         Using Optional instead of std::unique_ptr allows us to signal the absence of a
3411         secondary quad without incurring a heap allocation in cases where one is present.
3412
3413         This dodges ~132000 malloc/free pairs on loading thelocal.se
3414
3415         * platform/graphics/ca/GraphicsLayerCA.cpp:
3416         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
3417         * platform/graphics/transforms/TransformState.cpp:
3418         (WebCore::TransformState::mappedSecondaryQuad):
3419         * platform/graphics/transforms/TransformState.h:
3420
3421 2015-10-12  Brady Eidson  <beidson@apple.com>
3422
3423         Followup to:
3424         Modern IDB: Start version change transaction for connections to new database.
3425         https://bugs.webkit.org/show_bug.cgi?id=150033
3426
3427         Reviewed by NOBODY (Fixing existing test flakiness)
3428
3429         No new tests (Covered by existing tests)
3430
3431         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3432         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): Early return if a version change transaction
3433           is already in progress.
3434
3435 2015-10-12  Myles C. Maxfield  <mmaxfield@apple.com>
3436
3437         [Font Features] Tiny cleanup regarding FontCascade::typesettingFeatures()
3438         https://bugs.webkit.org/show_bug.cgi?id=150051
3439
3440         Reviewed by Simon Fraser.
3441
3442         There are no typesetting features which aren't kerning nor ligatures.
3443
3444         No new tests because there is no behavior difference.