[ES6] Implement Unicode code point escapes
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-29  Darin Adler  <darin@apple.com>
2
3         [ES6] Implement Unicode code point escapes
4         https://bugs.webkit.org/show_bug.cgi?id=144377
5
6         Reviewed by Antti Koivisto.
7
8         Test: js/unicode-escape-sequences.html
9
10         * css/CSSParser.cpp:
11         (WebCore::CSSParser::parseEscape): Use ICU's UCHAR_MAX_VALUE instead of writing
12         out 0x10FFFF; clearer this way. Also use our replacementCharacter instead of
13         writing out 0xFFFD.
14
15         * html/parser/HTMLEntityParser.cpp:
16         (WebCore::isAlphaNumeric): Deleted.
17         (WebCore::HTMLEntityParser::legalEntityFor): Use ICU's UCHAR_MAX_VALUE and
18         U_IS_SURROGATE instead of writing the code out. Didn't use U_IS_UNICODE_CHAR
19         because that also includes U_IS_UNICODE_NONCHAR and thus would change behavior,
20         but maye it's something we want to do in the future.
21         (WebCore::HTMLEntityParser::consumeNamedEntity): Use isASCIIAlphanumeric instead
22         of a the function in this file that does the same thing less efficiently.
23
24         * html/parser/InputStreamPreprocessor.h:
25         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Use
26         replacementCharacter from CharacterNames.h instead of writing out 0xFFFd.
27
28         * xml/parser/CharacterReferenceParserInlines.h:
29         (WebCore::consumeCharacterReference): Use ICU's UCHAR_MAX_VALUE instead of
30         defining our own local highestValidCharacter constant.
31
32 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
33
34         [CMake] [GTK] Organize and clean up unused CMake variables
35         https://bugs.webkit.org/show_bug.cgi?id=144364
36
37         Reviewed by Gyuyoung Kim.
38
39         * PlatformGTK.cmake: Add variables specific to this project.
40
41 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
42
43         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
44         https://bugs.webkit.org/show_bug.cgi?id=144388
45
46         Reviewed by Brady Eidson.
47
48         There used to be a method in ContextMenuItem to check if share
49         menu item was supported or not, but since r182573, there's a
50         method to get the share menu item. If the returned menu item is
51         null, it's not added to the menu, but we are not returning a null
52         ContextMenu item even though we don't support share menu item.
53
54         * platform/gtk/ContextMenuItemGtk.cpp:
55         (WebCore::ContextMenuItem::shareMenuItem): Return a null ContextMenuItem.
56
57 2015-04-29  Zan Dobersek  <zdobersek@igalia.com>
58
59         Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
60         https://bugs.webkit.org/show_bug.cgi?id=144232
61
62         Reviewed by Darin Adler.
63
64         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
65         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 
66         Replace uses of WTF::Function<> and WTF::bind() with the STL alternatives.
67
68 2015-04-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
69
70         Fix crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock().
71         https://bugs.webkit.org/show_bug.cgi?id=140261
72
73         Reviewed by Darin Adler.
74
75         We need to check whether RenderObject is valid in RenderView::fooSubtreeSelection functions
76         because invalid object has caused a crash. This patch adds isValidObjectForNewSelection(), and use it.
77
78         * rendering/RenderView.cpp:
79         (WebCore::isValidObjectForNewSelection):
80         (WebCore::RenderView::clearSubtreeSelection):
81         (WebCore::RenderView::applySubtreeSelection):
82
83 2015-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
84
85         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
86         https://bugs.webkit.org/show_bug.cgi?id=143711
87
88         Reviewed by Darin Adler.
89
90         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
91         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
92         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
93
94         Test: http/tests/appcache/simple-video-sync.html
95
96         * html/HTMLMediaElement.cpp:
97         (WebCore::HTMLMediaElement::parseAttribute):
98         * loader/DocumentThreadableLoader.cpp:
99         (WebCore::DocumentThreadableLoader::loadRequest):
100         * loader/FrameLoader.cpp:
101         (WebCore::FrameLoader::loadResourceSynchronously):
102         * loader/FrameLoader.h:
103         * loader/appcache/ApplicationCacheHost.cpp:
104         (WebCore::ApplicationCacheHost::maybeLoadResource):
105         (WebCore::ApplicationCacheHost::createFileURL):
106         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
107         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
108         * loader/appcache/ApplicationCacheHost.h:
109         * xml/XSLTProcessorLibxslt.cpp:
110         (WebCore::docLoaderFunc):
111         * xml/parser/XMLDocumentParserLibxml2.cpp:
112         (WebCore::openFunc):
113
114 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
115
116         Purge PassRefPtr from createSVGPathSegFoo factory functions
117         https://bugs.webkit.org/show_bug.cgi?id=144374
118
119         Reviewed by Darin Adler.
120
121         Use Ref instead of PassRefPtr in createSVGPathSegFoo functions because
122         those factory functions can't return null. Additionally let's remove unnecessary
123         #include<PassRefPtr.h> there.
124
125         No new tests, no behavior changes.
126
127         * svg/SVGColor.cpp:
128         (WebCore::SVGColor::cloneForCSSOM):
129         * svg/SVGColor.h:
130         * svg/SVGGlyphMap.h:
131         (WebCore::GlyphMapNode::create):
132         * svg/SVGPaint.cpp:
133         (WebCore::SVGPaint::cloneForCSSOM):
134         * svg/SVGPaint.h:
135         * svg/SVGPathElement.cpp:
136         (WebCore::SVGPathElement::createSVGPathSegClosePath):
137         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
138         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
139         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
140         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
141         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
142         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
143         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
144         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
145         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
146         (WebCore::SVGPathElement::createSVGPathSegArcRel):
147         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
148         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
149         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
150         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
151         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
152         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
153         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
154         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
155         * svg/SVGPathElement.h:
156         * svg/SVGPathSegArcAbs.h:
157         (WebCore::SVGPathSegArcAbs::create):
158         * svg/SVGPathSegArcRel.h:
159         (WebCore::SVGPathSegArcRel::create):
160         * svg/SVGPathSegClosePath.h:
161         (WebCore::SVGPathSegClosePath::create):
162         * svg/SVGPathSegCurvetoCubicAbs.h:
163         (WebCore::SVGPathSegCurvetoCubicAbs::create):
164         * svg/SVGPathSegCurvetoCubicRel.h:
165         (WebCore::SVGPathSegCurvetoCubicRel::create):
166         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
167         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
168         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
169         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
170         * svg/SVGPathSegCurvetoQuadraticAbs.h:
171         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
172         * svg/SVGPathSegCurvetoQuadraticRel.h:
173         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
174         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
175         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
176         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
177         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
178         * svg/SVGPathSegLinetoAbs.h:
179         (WebCore::SVGPathSegLinetoAbs::create):
180         * svg/SVGPathSegLinetoHorizontalAbs.h:
181         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
182         * svg/SVGPathSegLinetoHorizontalRel.h:
183         (WebCore::SVGPathSegLinetoHorizontalRel::create):
184         * svg/SVGPathSegLinetoRel.h:
185         (WebCore::SVGPathSegLinetoRel::create):
186         * svg/SVGPathSegLinetoVerticalAbs.h:
187         (WebCore::SVGPathSegLinetoVerticalAbs::create):
188         * svg/SVGPathSegLinetoVerticalRel.h:
189         (WebCore::SVGPathSegLinetoVerticalRel::create):
190         * svg/SVGPathSegMovetoAbs.h:
191         (WebCore::SVGPathSegMovetoAbs::create):
192         * svg/SVGPathSegMovetoRel.h:
193         (WebCore::SVGPathSegMovetoRel::create):
194         * svg/SVGViewSpec.h:
195         (WebCore::SVGViewSpec::create):
196         * svg/animation/SMILTimeContainer.h:
197         (WebCore::SMILTimeContainer::create):
198         * svg/animation/SVGSMILElement.cpp:
199         (WebCore::ConditionEventListener::create):
200         * svg/graphics/SVGImage.h:
201         * svg/graphics/SVGImageForContainer.h:
202         * svg/graphics/filters/SVGFilter.cpp:
203         (WebCore::SVGFilter::create):
204         * svg/graphics/filters/SVGFilter.h:
205
206 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
207
208         Make a non-static version of FrameView::yPositionForRootContentLayer()
209         https://bugs.webkit.org/show_bug.cgi?id=144375
210
211         Reviewed by Andy Estes.
212
213         There were two calls to the static FrameView::yPositionForRootContentLayer()
214         which passed in all the arguments for the same FrameView. Make a member
215         function for convenience.
216
217         * page/FrameView.cpp:
218         (WebCore::FrameView::yPositionForRootContentLayer):
219         * page/FrameView.h:
220         * rendering/RenderLayerCompositor.cpp:
221         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
222
223 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
224
225         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
226         https://bugs.webkit.org/show_bug.cgi?id=143001
227
228         Reviewed by Gyuyoung Kim.
229
230         TiledBackingStore has only been used by Coordinated Graphics since Qt and WebKit1/Efl were dropped.
231         So, this patch replaces USE(TILED_BACKING_STORE) with USE(COORDINATED_GRAPHICS) to merge the features.
232
233         In addition, this moves TiledBackingStore and related files from platform to platform/texmap/coordinated
234         where other coordinated graphics files are located.
235
236         * CMakeLists.txt: Move TiledBackingStore.cpp because this is not common file.
237         * PlatformEfl.cmake:
238         * PlatformGTK.cmake:
239         * WebCore.vcxproj/WebCore.vcxproj: Follow new location of TiledBackingStore* files.
240         * WebCore.vcxproj/WebCore.vcxproj.filters:
241         * loader/EmptyClients.h:
242         * page/Chrome.cpp:
243         * page/Chrome.h:
244         * page/ChromeClient.h:
245         * page/Frame.cpp:
246         (WebCore::Frame::createView):
247         * page/FrameView.cpp:
248         (WebCore::FrameView::requestScrollPositionUpdate):
249         * page/FrameView.h:
250         * page/Page.cpp:
251         (WebCore::Page::setPageScaleFactor):
252         * platform/HostWindow.h:
253         * platform/ScrollView.cpp:
254         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
255         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
256         (WebCore::ScrollView::visibleContentRectInternal):
257         (WebCore::ScrollView::scrollTo):
258         * platform/ScrollView.h:
259         * platform/graphics/cairo/TileCairo.h: Removed because it is dead code since r169328
260         * platform/graphics/texmap/coordinated/Tile.h: Renamed from Source/WebCore/platform/graphics/Tile.h.
261         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.cpp.
262         * platform/graphics/texmap/coordinated/TiledBackingStore.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.h.
263         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreBackend.h.
264         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreClient.h.
265
266 2015-04-28  Brent Fulgham  <bfulgham@apple.com>
267
268         REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
269         https://bugs.webkit.org/show_bug.cgi?id=144366
270         <rdar://problem/20533513>
271
272         Reviewed by Dean Jackson.
273
274         * rendering/RenderBlockFlow.cpp:
275         (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
276         before attempting to dereference it. 
277
278 2015-04-28  Andreas Kling  <akling@apple.com>
279
280         Simplify DOM wrapper destruction, don't deref() in finalizers.
281         <https://webkit.org/b/144183>
282
283         Reviewed by Darin Adler.
284
285         DOM JS bindings had two mechanisms to call deref() on the WebCore object,
286         once through a weak finalizer, and once through the JSCell's regular destructor.
287
288         That was once believed to be an optimization, but these days the finalizer will
289         run just moments before the destructor anyway, all in the same call stack.
290         And more importantly, the finalizer is not guaranteed to run, for instance in the
291         case where a Weak is assigned to after going dead, but before the WeakBlock
292         has been swept by the incremental sweeper.
293
294         Simplify this by just removing the deref() from the generated finalizers.
295         This makes it easier to reason about DOM wrapper destruction, and eliminates
296         the awkward time window  where a DOM wrapper could have a null impl().
297
298         We could spend more time on figuring out a way to have finalizers manage the
299         destruction of these wrappers, but that would require fundamental changes to
300         our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
301         destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
302         However the risk:reward ratio does not seem justified at this point in time.
303
304         * bindings/scripts/CodeGeneratorJS.pm:
305         (GenerateHeader):
306         (GenerateImplementation):
307         * bindings/js/JSCSSValueCustom.cpp:
308         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
309         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
310         (WebCore::JSTestActiveDOMObjectOwner::finalize):
311         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
312         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
313         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
314         (WebCore::JSTestCustomNamedGetterOwner::finalize):
315         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
316         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
317         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
318         (WebCore::JSTestEventConstructorOwner::finalize):
319         * bindings/scripts/test/JS/JSTestEventConstructor.h:
320         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
321         (WebCore::JSTestEventTarget::~JSTestEventTarget):
322         (WebCore::JSTestEventTargetOwner::finalize):
323         * bindings/scripts/test/JS/JSTestEventTarget.h:
324         * bindings/scripts/test/JS/JSTestException.cpp:
325         (WebCore::JSTestException::~JSTestException):
326         (WebCore::JSTestExceptionOwner::finalize):
327         * bindings/scripts/test/JS/JSTestException.h:
328         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
329         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
330         (WebCore::JSTestGenerateIsReachableOwner::finalize):
331         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
332         * bindings/scripts/test/JS/JSTestInterface.cpp:
333         (WebCore::JSTestInterface::~JSTestInterface):
334         (WebCore::JSTestInterfaceOwner::finalize):
335         * bindings/scripts/test/JS/JSTestInterface.h:
336         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
337         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
338         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
339         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
340         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
341         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
342         (WebCore::JSTestNamedConstructorOwner::finalize):
343         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
344         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
345         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
346         (WebCore::JSTestNondeterministicOwner::finalize):
347         * bindings/scripts/test/JS/JSTestNondeterministic.h:
348         * bindings/scripts/test/JS/JSTestObj.cpp:
349         (WebCore::JSTestObj::~JSTestObj):
350         (WebCore::JSTestObjOwner::finalize):
351         * bindings/scripts/test/JS/JSTestObj.h:
352         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
353         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
354         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
355         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
356         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
357         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
358         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
359         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
360         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
361         (WebCore::JSTestTypedefs::~JSTestTypedefs):
362         (WebCore::JSTestTypedefsOwner::finalize):
363         * bindings/scripts/test/JS/JSTestTypedefs.h:
364         * bindings/scripts/test/JS/JSattribute.cpp:
365         (WebCore::JSattribute::~JSattribute):
366         (WebCore::JSattributeOwner::finalize):
367         * bindings/scripts/test/JS/JSattribute.h:
368         * bindings/scripts/test/JS/JSreadonly.cpp:
369         (WebCore::JSreadonly::~JSreadonly):
370         (WebCore::JSreadonlyOwner::finalize):
371         * bindings/scripts/test/JS/JSreadonly.h:
372
373 2015-04-28  Alex Christensen  <achristensen@webkit.org>
374
375         Build WinCairo without cygwin.
376         https://bugs.webkit.org/show_bug.cgi?id=144365
377
378         Reviewed by Myles Maxfield.
379
380         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
381         Pass the CC executable to build-generated-files.pl like r182164.
382         * WebCore.vcxproj/build-generated-files.pl:
383         Default to 8 CPUs unless otherwise specified.
384
385 2015-04-28  Sam Weinig  <sam@webkit.org>
386
387         [Content Extensions] Process NFAs individually to avoid having all NFAs live at the same time
388         https://bugs.webkit.org/show_bug.cgi?id=144363
389
390         Reviewed by Alex Christensen.
391
392         This brings dirty memory use when compiling our test content extension down from ~300MB to ~100MB.
393
394         * contentextensions/CombinedURLFilters.cpp:
395         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
396         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs): Deleted.
397         * contentextensions/CombinedURLFilters.h:
398         Replace function that creates a Vector of all the NFAs with one that allows incremental processing
399         as they are created.
400
401         * contentextensions/ContentExtensionCompiler.cpp:
402         (WebCore::ContentExtensions::addUniversalActionsToDFA):
403         Extract code to add universal actions into a helper, since we need to call it in two places now.
404
405         (WebCore::ContentExtensions::compileRuleList):
406         Adopt CombinedURLFilters::processNFAs. Now that we don't have a Vector of NFAs, we need to keep track
407         of whether or not any NFAs were processed and if we are currently processing the first NFA so we can
408         ensure that we have some bytecode generated event for empty rule sets, and that universal actions are
409         placed on the first DFA.
410
411 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
412
413         [TextIndicator] Yellow highlight takes too long to fade out on scroll
414         https://bugs.webkit.org/show_bug.cgi?id=144358
415         <rdar://problem/19451011>
416
417         Reviewed by Beth Dakin.
418
419         * page/TextIndicator.h:
420         Add Lifetime and DismissalAnimation enums.
421
422         (WebCore::TextIndicator::contentImageWithHighlight):
423         (WebCore::TextIndicator::contentImage):
424         Fix style.
425
426         * page/mac/TextIndicatorWindow.h:
427         * page/mac/TextIndicatorWindow.mm:
428         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
429         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
430         (WebCore::TextIndicatorWindow::clearTextIndicator):
431         (WebCore::TextIndicatorWindow::setTextIndicator):
432         (WebCore::TextIndicatorWindow::closeWindow):
433         (WebCore::TextIndicatorWindow::startFadeOut):
434         Rename m_startFadeOutTimer to m_temporaryTextIndicatorTimer (and related).
435         This is just about temporary-lifetime TextIndicators, like the ones
436         you get when the find-in-page UI is hidden but you hit Cmd-G.
437
438         Add clearTextIndicator, which takes a DismissalAnimation, providing
439         clients an opportunity to avoid the normal fade-out animation, if it
440         was going to happen.
441
442 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
443
444         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
445         https://bugs.webkit.org/show_bug.cgi?id=144304
446
447         Reviewed by Geoffrey Garen.
448
449         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
450
451         * Configurations/FeatureDefines.xcconfig:
452
453 2015-04-28  Commit Queue  <commit-queue@webkit.org>
454
455         Unreviewed, rolling out r183514.
456         https://bugs.webkit.org/show_bug.cgi?id=144359
457
458         It broke cloop test bots (Requested by mcatanzaro on #webkit).
459
460         Reverted changeset:
461
462         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
463         https://bugs.webkit.org/show_bug.cgi?id=144304
464         http://trac.webkit.org/changeset/183514
465
466 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
467
468         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
469         https://bugs.webkit.org/show_bug.cgi?id=144304
470
471         Reviewed by Geoffrey Garen.
472
473         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
474
475         * Configurations/FeatureDefines.xcconfig:
476
477 2015-04-28  Zalan Bujtas  <zalan@apple.com>
478
479         Checkboxes on bugs.webkit.org are painted with stripes at some zoom levels.
480         https://bugs.webkit.org/show_bug.cgi?id=144351
481
482         Reviewed by Simon Fraser.
483
484         This patch ensures that CG context is properly restored after painting dashed/dotted lines.
485
486         Test: fast/forms/checkbox-painting-with-hr.html
487
488         * platform/graphics/cg/GraphicsContextCG.cpp:
489         (WebCore::GraphicsContext::drawLine):
490
491 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
492
493         Provide contentsToView() and viewToContents() functions on ScrollView, and use them
494         https://bugs.webkit.org/show_bug.cgi?id=144357
495
496         Reviewed by Tim Horton.
497
498         Too much code was consulting topContentInset() and headerHeight() directly. Replace
499         with calls to new contentsToView() and viewToContents() functions, which wrap the
500         exisiting documentScrollOffsetRelativeToViewOrigin().
501         
502         Use the new functions in FrameView and ScrollView coordinate mapping functions.
503         
504         No behavior change.
505
506         * page/FrameView.cpp:
507         (WebCore::FrameView::convertFromRendererToContainingView):
508         (WebCore::FrameView::convertFromContainingViewToRenderer):
509         * platform/ScrollView.cpp:
510         (WebCore::ScrollView::viewToContents):
511         (WebCore::ScrollView::contentsToView):
512         (WebCore::ScrollView::rootViewToContents):
513         (WebCore::ScrollView::contentsToRootView):
514         (WebCore::ScrollView::rootViewToTotalContents):
515         (WebCore::ScrollView::windowToContents):
516         (WebCore::ScrollView::contentsToWindow):
517         * platform/ScrollView.h:
518
519 2015-04-28  Eric Carlson  <eric.carlson@apple.com>
520
521         [Mac] Simplify code to support media engines which do not support target playback
522         https://bugs.webkit.org/show_bug.cgi?id=144332
523
524         Reviewed by Jer Noble.
525
526         * Modules/mediasession/WebMediaSessionManager.cpp:
527         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): Always make client
528         callback, let them decide if it is significant or not.
529
530         * html/HTMLMediaElement.cpp:
531         (WebCore::HTMLMediaElement::HTMLMediaElement): m_loadTimer -> m_pendingActionTimer.
532         (WebCore::HTMLMediaElement::scheduleDelayedAction): Handle CheckPlaybackTargetCompatablity.
533         (WebCore::HTMLMediaElement::scheduleNextSourceChild): m_loadTimer -> m_pendingActionTimer.
534         (WebCore::HTMLMediaElement::loadTimerFired): Renamed pendingActionTimerFired.
535         (WebCore::HTMLMediaElement::prepareForLoad): m_loadTimer -> m_pendingActionTimer.
536         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Add logging.
537         (WebCore::HTMLMediaElement::clearMediaPlayer): m_loadTimer -> m_pendingActionTimer.
538         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): Removed.
539         (WebCore::HTMLMediaElement::dispatchEvent): If a 'webkitcurrentplaybacktargetiswirelesschanged'
540         event is dispatched when the current target is wireless but the media engine does not support
541         wireless playback, tell the media engine not to play to the target.
542         * html/HTMLMediaElement.h:
543         * html/HTMLMediaElement.idl:
544
545         * html/HTMLMediaSession.cpp:
546         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Drive-by fix to disallow audio-only files.
547         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): Deleted.
548         * html/HTMLMediaSession.h:
549
550         * platform/graphics/MediaPlayer.cpp:
551         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): Deleted.
552         * platform/graphics/MediaPlayer.h:
553         * platform/graphics/MediaPlayerPrivate.h:
554
555         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
556         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Use a RetainPtr
557         to explicitly manage the lifetime of the temporary object.
558         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Ditto.
559         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
560
561         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
562         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
563         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless):
564         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): Deleted.
565
566         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
567         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
568         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
569         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetWireless):
570         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Deleted.
571
572 2015-04-28  Alex Christensen  <achristensen@webkit.org>
573
574         [Content Extensions] Use less memory for CombinedURLFilters.
575         https://bugs.webkit.org/show_bug.cgi?id=144290
576
577         Reviewed by Andreas Kling.
578
579         * contentextensions/CombinedURLFilters.cpp:
580         (WebCore::ContentExtensions::recursiveMemoryUsed):
581         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
582         (WebCore::ContentExtensions::generateNFAForSubtree):
583         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
584         * contentextensions/NFA.cpp:
585         (WebCore::ContentExtensions::NFA::memoryUsed):
586         (WebCore::ContentExtensions::NFA::setActions):
587         * contentextensions/NFA.h:
588         * contentextensions/NFANode.h:
589         * contentextensions/Term.h:
590         (WebCore::ContentExtensions::Term::Term::generateGraph):
591         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
592         Use Vectors instead of HashTables in PrefixTreeVertex because the sets stay small and need to be more memory efficient.
593
594 2015-04-28  Brady Eidson  <beidson@apple.com>
595
596         Consolidate most "frame load" arguments into FrameLoadRequest.
597         https://bugs.webkit.org/show_bug.cgi?id=144276
598
599         Reviewed by Alexey Proskuryakov.
600
601         No new tests (No change in behavior).
602         
603         This patch starts the long overdue process of wrangling the insane load methods in FrameLoader.
604         
605         Humble beginnings of this long process:
606         - Put most of the various "frame load" arguments that are passed around within FrameLoader on FrameLoadRequest.
607         - Get rid of the "easy" constructors of FrameLoadRequest, forcing users to actually think about what they're doing.
608         - Change a private FrameLoader load method (urlSelected) to take a FrameLoadRequest instead of argument gobbledygook.
609         - Change a public FrameLoader load methods (changeLocation) to take a FrameLoadRequest instead of gobbledygook.
610         
611         These cover the straightforward changes where it was easy to figure out what the values of the FrameLoadRequest
612         arguments were from these various call sites.
613         
614         Further refactoring can be done in much smaller patches, handling fewer cases at a time. Little by little we will be
615         able to reduce the number of "load" methods on FrameLoader and make sure that they mainly only take a FrameLoadRequest
616         as an argument.
617
618         * inspector/InspectorFrontendClientLocal.cpp:
619         (WebCore::InspectorFrontendClientLocal::openInNewTab):
620         
621         * inspector/InspectorPageAgent.cpp:
622         (WebCore::InspectorPageAgent::navigate):
623         
624         * loader/FrameLoadRequest.cpp:
625         (WebCore::FrameLoadRequest::FrameLoadRequest):
626         * loader/FrameLoadRequest.h:
627         (WebCore::FrameLoadRequest::FrameLoadRequest):
628         (WebCore::FrameLoadRequest::lockHistory):
629         (WebCore::FrameLoadRequest::lockBackForwardList):
630         (WebCore::FrameLoadRequest::shouldSendReferrer):
631         (WebCore::FrameLoadRequest::allowNavigationToInvalidURL):
632         (WebCore::FrameLoadRequest::newFrameOpenerPolicy):
633         (WebCore::FrameLoadRequest::shouldReplaceDocumentIfJavaScriptURL):
634         
635         * loader/FrameLoader.cpp:
636         (WebCore::FrameLoader::changeLocation):
637         (WebCore::FrameLoader::urlSelected):
638         (WebCore::FrameLoader::loadFrameRequest):
639         * loader/FrameLoader.h:
640         
641         * loader/NavigationScheduler.cpp:
642         (WebCore::NavigationScheduler::scheduleLocationChange):
643         
644         * page/ContextMenuController.cpp:
645         (WebCore::openNewWindow):
646         (WebCore::ContextMenuController::contextMenuItemSelected):
647         
648         * page/DOMWindow.cpp:
649         (WebCore::DOMWindow::createWindow):
650
651 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
652
653         [Mac] [iOS] Implement font-synthesis CSS property
654         https://bugs.webkit.org/show_bug.cgi?id=144305
655
656         Reviewed by Andreas Kling.
657
658         This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
659
660         The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
661         determine if we should synthesize bold and italics, this CSS property simply guards that decision.
662
663         Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
664         regarding font-synthesis into FontDescription (from RenderStyle).
665
666         Test: fast/css3-text/font-synthesis.html
667
668         * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
669         inside FontDescription. This also means that the property must be marked as a "high priority" property, which
670         is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
671         FontCacheIOS and FontCacheMac have access to the saved state.
672         * css/CSSComputedStyleDeclaration.cpp:
673         (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
674         * css/CSSSegmentedFontFace.cpp:
675         (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
676         FontSynthesis state inside FontDescription.
677         * css/StyleBuilderConverter.h:
678         (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
679         StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
680         CSSPropertyNames.in
681         * css/StyleBuilderCustom.h:
682         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
683         * platform/graphics/FontDescription.h:
684         (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
685         (WebCore::FontDescription::fontSynthesis): Ditto.
686         (WebCore::FontDescription::setFontSynthesis): Ditto.
687         (WebCore::FontDescription::initialFontSynthesis): Ditto.
688         (WebCore::FontDescription::operator==): Update to include new state.
689         * platform/graphics/FontCache.h:
690         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
691         state inside FontDescription.
692         * platform/graphics/ios/FontCacheIOS.mm:
693         (WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
694         new FontSynthesis state inside FontDescription.
695         * platform/graphics/mac/FontCacheMac.mm:
696         (WebCore::FontCache::createFontPlatformData): Ditto.
697         * platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
698         * rendering/style/RenderStyle.h:
699         (WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
700         (WebCore::RenderStyle::setFontSynthesis): Ditto.
701         (WebCore::RenderStyle::initialFontSynthesis): Ditto.
702         * rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
703         * rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)
704
705 2015-04-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
706
707         SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray
708         https://bugs.webkit.org/show_bug.cgi?id=144321
709
710         Reviewed by Darin Adler.
711
712         Patch correctness covered by existing tests.
713
714         * platform/SharedBuffer.cpp:
715         (WebCore::SharedBuffer::copy): Direct appending to m_dataArray and not using append method as this method updates the SharedBuffer size.
716
717 2015-04-28  Per Arne Vollan  <peavo@outlook.com>
718
719         [Curl] Memory leak.
720         https://bugs.webkit.org/show_bug.cgi?id=144327
721
722         Reviewed by Brent Fulgham.
723
724         When a data url is loaded, the ResourceHandle is not released.
725
726         * platform/network/curl/ResourceHandleManager.cpp:
727         (WebCore::ResourceHandleManager::startJob):
728
729 2015-04-28  Andy Estes  <aestes@apple.com>
730
731         Fix the Mavericks Debug build after r183467.
732
733         * platform/network/ResourceRequestBase.h:
734         (WebCore::ResourceRequestBase::requester): Removed WEBCORE_EXPORT.
735         (WebCore::ResourceRequestBase::setRequester): Ditto.
736
737 2015-04-28  Csaba Osztrogonác  <ossy@webkit.org>
738
739         Remove make-file-arrays.py
740         https://bugs.webkit.org/show_bug.cgi?id=144324
741
742         Reviewed by Gyuyoung Kim.
743
744         * make-file-arrays.py: Removed.
745
746 2015-04-28  Antti Koivisto  <antti@apple.com>
747
748         Build fix.
749
750         * platform/network/ios/ResourceRequestIOS.mm:
751         (WebCore::ResourceRequest::ResourceRequest):
752
753 2015-04-28  Antti Koivisto  <antti@apple.com>
754
755         Network Cache: Disk cache getting filled by YouTube video data
756         https://bugs.webkit.org/show_bug.cgi?id=144259
757
758         Reviewed by Darin Adler.
759
760         MSE media is loaded via XHR and tends to eventually fill the cache.
761
762         YouTube serves the media chunks cacheable, however they are rarely (if ever) reused.
763         We can reduce disk writes and keep more useful resources around by not caching them
764
765         Test: http/tests/cache/disk-cache/disk-cache-media.html
766
767         * loader/DocumentLoader.cpp:
768         (WebCore::DocumentLoader::startLoadingMainResource):
769
770             Set the requester.
771
772         * loader/cache/CachedRawResource.cpp:
773         (WebCore::CachedRawResource::CachedRawResource):
774         * page/DiagnosticLoggingKeys.cpp:
775         (WebCore::DiagnosticLoggingKeys::streamingMedia):
776         * page/DiagnosticLoggingKeys.h:
777         * platform/network/ResourceRequestBase.cpp:
778         (WebCore::ResourceRequestBase::adopt):
779         (WebCore::ResourceRequestBase::copyData):
780         (WebCore::equalIgnoringHeaderFields):
781         * platform/network/ResourceRequestBase.h:
782         (WebCore::ResourceRequestBase::requester):
783         (WebCore::ResourceRequestBase::setRequester):
784
785             Add requester type to the request object. Currently this is main resource, xhr or unspecified.
786
787         (WebCore::ResourceRequestBase::encodeWithoutPlatformData):
788         (WebCore::ResourceRequestBase::decodeWithoutPlatformData):
789         * platform/network/cf/ResourceRequest.h:
790         (WebCore::ResourceRequest::deprecatedSetMainResourceRequest): Deleted.
791         (WebCore::ResourceRequest::deprecatedIsMainResourceRequest): Deleted.
792
793             Replace this iOS only field with shared mechanism.
794
795         * platform/network/ios/QuickLook.mm:
796         (WebCore::QuickLookHandle::create):
797         * xml/XMLHttpRequest.cpp:
798         (WebCore::XMLHttpRequest::createRequest):
799
800             Set the requester.
801
802 2015-04-28  Namhoon Kim  <nakim@ea.com>
803
804         Fix windows build error in WebCore related to bulk build.
805         https://bugs.webkit.org/show_bug.cgi?id=144313
806
807         Reviewed by Csaba Osztrogonác.
808
809         No new tests because there is no behavior change.
810
811         * css/CSSAllInOne.cpp:
812         * dom/DOMAllInOne.cpp:
813
814 2015-04-27  Simon Fraser  <simon.fraser@apple.com>
815
816         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
817         https://bugs.webkit.org/show_bug.cgi?id=144198
818
819         Followup: fix assertions seen in fullscreen and pseudo-element tests. These code
820         paths set the style to the existing pointer, but with a SyntheticStyleChange.
821         We have to avoid an early return in this case.
822
823         * rendering/RenderElement.cpp:
824         (WebCore::RenderElement::setStyle):
825
826 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
827
828         Eliminate styleDidChange with StyleDifferenceEqual when updates are actually necessary
829         https://bugs.webkit.org/show_bug.cgi?id=144198
830
831         Reviewed by Darin Adler, Antti Koivisto.
832         
833         SyntheticStyleChange style recalcs are triggered for cases where behavior depends
834         on state which is outside of RenderStyle; this includes triggering compositing for
835         animations, for video and canvas, and for iframes with composited content.
836         
837         In these cases, we'd run through RenderElement::setStyle() and its fan-out, but
838         with diff == StyleDifferenceEqual, and so be unable to determine if there
839         is actual work to be done.
840         
841         This patch enforces the contract that the diff is never StyleDifferenceEqual if
842         compositing or other work has to happen from setStyle(). This is achieved by
843         passing in a 'hasSideEffects' flag, which causes the diff to become at least
844         StyleDifferenceRecompositeLayer.
845         
846         RenderLayerCompositor::layerStyleChanged() can now safely early return
847         if the diff is equal. Future patches will reduce redundant work even more.
848
849         Test: compositing/animation/no-style-recalc-during-accelerated-animation.html
850
851         * page/animation/AnimationBase.h:
852         (WebCore::AnimationBase::animate): Returns a bool now if the state changed.
853         (WebCore::AnimationBase::state):
854         * page/animation/AnimationController.cpp:
855         (WebCore::AnimationController::updateAnimations): bool out param which indicates
856         whether any animations changed state.
857         * page/animation/AnimationController.h:
858         * page/animation/CompositeAnimation.cpp:
859         (WebCore::CompositeAnimation::animate): If any transitions or animations changed
860         state, set the animationStateChanged out param to true.
861         * page/animation/CompositeAnimation.h:
862         * page/animation/ImplicitAnimation.cpp:
863         (WebCore::ImplicitAnimation::animate): Return true if the state changed.
864         * page/animation/ImplicitAnimation.h:
865         * page/animation/KeyframeAnimation.cpp:
866         (WebCore::KeyframeAnimation::animate): Return true if the state changed.
867         * page/animation/KeyframeAnimation.h:
868         * rendering/RenderElement.cpp:
869         (WebCore::RenderElement::adjustStyleDifference): We may enter here now with diff
870         != StyleDifferenceEqual, but still need to do the check to see if layers changed.
871         (WebCore::RenderElement::initializeStyle): When setting style for the first time,
872         don't use StyleDifferenceEqual.
873         (WebCore::RenderElement::setStyle): Additional flag to indicate whether this style
874         change involves side effects. If the diff is equal but the flag is set, change
875         the diff to StyleDifferenceRecompositeLayer (the "lowest" non-zero diff).
876         * rendering/RenderElement.h:
877         (WebCore::RenderElement::setAnimatableStyle): Pass true to setStyle() if hasSideEffects
878         is true, or if animation state changed.
879         * rendering/RenderLayer.cpp:
880         (WebCore::RenderLayer::styleChanged): Pass the diff down.
881         * rendering/RenderLayerCompositor.cpp:
882         (WebCore::RenderLayerCompositor::layerStyleChanged): Return if the diff is equal.
883         * rendering/RenderLayerCompositor.h:
884         * rendering/style/RenderStyleConstants.h: StyleDifferenceNewStyle is used when
885         setting style for the first time.
886         * style/StyleResolveTree.cpp:
887         (WebCore::Style::createRendererIfNeeded): Provide animationsChanged bool (which is unused).
888         (WebCore::Style::resolveLocal): If the style change is synthetic, set the flag that
889         says there are side-effects.
890
891 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
892
893         [GTK] Add one single option to control all OpenGL-related options
894         https://bugs.webkit.org/show_bug.cgi?id=144105
895
896         Reviewed by Martin Robinson.
897
898         Test WTF_USE_TEXTURE_MAPPER since USE_TEXTURE_MAPPER has been removed.
899
900         * PlatformGTK.cmake:
901
902 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
903
904         Consolidate one-line flag-related header files into TextFlags.h
905         https://bugs.webkit.org/show_bug.cgi?id=144295
906
907         Reviewed by Tim Horton.
908
909         There were a collection of single-line header files throughout platform/ which contain
910         single-line type declaractions of flags related to text layout & rendering. This patch
911         consolidates all these single-line headers into TextFlags.h
912
913         No new tests because there is no behavior change.
914
915         * WebCore.vcxproj/WebCore.vcxproj:
916         * WebCore.vcxproj/WebCore.vcxproj.filters:
917         * WebCore.xcodeproj/project.pbxproj:
918         * css/CSSFontFace.h:
919         * css/CSSPrimitiveValueMappings.h:
920         * loader/cache/CachedFont.h:
921         * loader/cache/CachedTextTrack.h:
922         * page/Settings.h:
923         * platform/DragImage.h:
924         * platform/graphics/FontDescription.h:
925         * platform/graphics/FontOrientation.h: Removed.
926         * platform/graphics/FontPlatformData.h:
927         * platform/graphics/FontRenderingMode.h: Removed.
928         * platform/graphics/FontSmoothingMode.h: Removed.
929         * platform/graphics/FontTraitsMask.h: Removed.
930         * platform/graphics/FontWidthVariant.h: Removed.
931         * platform/graphics/TextRenderingMode.h: Removed.
932         * platform/graphics/cairo/FontCustomPlatformData.h:
933         * platform/graphics/freetype/FontPlatformData.h:
934         * platform/graphics/mac/FontCustomPlatformData.h:
935         * platform/graphics/win/FontCustomPlatformData.h:
936         * platform/text/NonCJKGlyphOrientation.h: Removed.
937         * platform/text/TextFlags.h:
938         * rendering/TextPainter.h:
939         * style/StyleFontSizeFunctions.h:
940
941 2015-04-27  Daniel Bates  <dabates@apple.com>
942
943         Form control may be associated with the wrong HTML Form element after form id change
944         https://bugs.webkit.org/show_bug.cgi?id=133456
945         <rdar://problem/17095055>
946
947         Reviewed by Andy Estes.
948
949         Fixes an issue where a form control may be associated with the wrong HTML Form element
950         after the id of the HTML Form element associated with the form control is changed when
951         there is more than one HTML Form element with the same id in the document. Specifically,
952         a form control that has an HTML form attribute value X will always be associated with
953         some HTML Form element f where f.id = X regardless of whether f.id is subsequently
954         changed.
955
956         Tests: fast/forms/change-form-id-to-be-unique-then-submit-form.html
957                fast/forms/change-form-id-to-be-unique.html
958
959         * dom/Element.cpp:
960         (WebCore::Element::attributeChanged): Notify observers when the id of an element changed.
961         (WebCore::Element::updateId): Added parameter NotifyObservers (defaults to NotifyObservers::Yes),
962         as to whether we should notify observers of the id change.
963         (WebCore::Element::updateIdForTreeScope): Ditto.
964         (WebCore::Element::willModifyAttribute): Do not notify observers of the id change immediately. As
965         indicated by the name of this method, we plan to modify the DOM attribute id of the element, but
966         we have not actually modified it when this method is called. Instead we will notify observers
967         in Element::attributeChanged(), which is called after the DOM attribute id is modified.
968         (WebCore::Element::cloneAttributesFromElement): Ditto.
969         * dom/Element.h: Defined enum class NotifyObservers.
970         * dom/TreeScope.cpp:
971         (WebCore::TreeScope::addElementById): Added boolean parameter notifyObservers (defaults to true)
972         as to whether we should dispatch a notification to all observers.
973         (WebCore::TreeScope::removeElementById): Ditto.
974         * dom/TreeScope.h:
975
976 2015-04-27  Alex Christensen  <achristensen@webkit.org>
977
978         Reduce allocations and memory usage when compiling content extensions.
979         https://bugs.webkit.org/show_bug.cgi?id=144277
980
981         Reviewed by Benjamin Poulain.
982
983         Covered by existing tests.
984
985         * contentextensions/Term.h:
986         (WebCore::ContentExtensions::Term::CharacterSet::set):
987         (WebCore::ContentExtensions::Term::CharacterSet::get):
988         (WebCore::ContentExtensions::Term::CharacterSet::invert):
989         (WebCore::ContentExtensions::Term::CharacterSet::inverted):
990         (WebCore::ContentExtensions::Term::CharacterSet::bitCount):
991         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
992         (WebCore::ContentExtensions::Term::CharacterSet::hash):
993         (WebCore::ContentExtensions::Term::Term):
994         (WebCore::ContentExtensions::Term::addCharacter):
995         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
996         (WebCore::ContentExtensions::Term::isUniversalTransition):
997         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
998         Use two uint64_t's instead of a BitVector with a capacity of 128 bits.
999
1000 2015-04-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1001
1002         Rename WTF_USE_3D_GRAPHICS to ENABLE_GRAPHICS_CONTEXT_3D
1003         https://bugs.webkit.org/show_bug.cgi?id=144193
1004
1005         Reviewed by Darin Adler.
1006
1007         * CMakeLists.txt:
1008         * platform/graphics/ANGLEWebKitBridge.cpp:
1009         * platform/graphics/FormatConverter.cpp:
1010         * platform/graphics/FormatConverter.h:
1011         * platform/graphics/GLContext.h:
1012         * platform/graphics/GraphicsContext3D.cpp:
1013         * platform/graphics/GraphicsContext3DPrivate.cpp:
1014         * platform/graphics/OpenGLShims.cpp:
1015         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1016         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1017         * platform/graphics/egl/GLContextEGL.cpp:
1018         * platform/graphics/egl/GLContextEGL.h:
1019         * platform/graphics/glx/GLContextGLX.cpp:
1020         * platform/graphics/glx/GLContextGLX.h:
1021         * platform/graphics/mac/GraphicsContext3DMac.mm:
1022         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1023         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1024         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1025         * platform/graphics/opengl/GLPlatformContext.cpp:
1026         * platform/graphics/opengl/GLPlatformSurface.cpp:
1027         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1028         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1029         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1030         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1031         * platform/graphics/win/GraphicsContext3DWin.cpp:
1032
1033 2015-04-27  Jer Noble  <jer.noble@apple.com>
1034
1035         [iOS] Video not centered in element on retina devices
1036         https://bugs.webkit.org/show_bug.cgi?id=144274
1037
1038         Reviewed by Simon Fraser.
1039
1040         In r173702, a transform was added to the video layer (and a matching, inverse transform
1041         in the UIProcess), but this transform affects the position property of the video layer
1042         used to position the video content within the element bounds when their aspect ratios
1043         do not match.
1044
1045         To work around this problem, pre-apply the transform during -setPosition:.
1046
1047         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1048         (-[WebVideoContainerLayer setPosition:]):
1049
1050 2015-04-27  Jer Noble  <jer.noble@apple.com>
1051
1052         Add a setting & restriction which prevents non-interactivte playback of audible media elements.
1053         https://bugs.webkit.org/show_bug.cgi?id=143486
1054
1055         Reviewed by Eric Carlson.
1056
1057         Tests: media/audio-playback-restriction-autoplay.html
1058                media/audio-playback-restriction-play.html
1059
1060         To allow clients who want to allow non-user-interactive video-only playback, but still
1061         restrict playback of audible media elements, add a new setting and matching restriction
1062         which disallows playback of media elements containing audible characteristics.
1063
1064         * html/HTMLMediaElement.cpp:
1065         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the RequireUserGestureForAudioRateChange
1066             restriction if the audioPlaybackRequiresUserGesture() setting is set.
1067         (WebCore::HTMLMediaElement::parseAttribute): Drive-by fix. Move the opening brace
1068             out of the #if, as this confuses the heck out of diff and makes all subsequent
1069             changes appear to be within HTMLMediaElement::parseAttribute.
1070         (WebCore::HTMLMediaElement::autoplay): Remove the restriction check from within autoplay().
1071             It is checked again immediately after every autoplay() call site.
1072         (WebCore::HTMLMediaElement::pauseInternal): Remove the iOS-only #if.
1073         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Check whether playback
1074             is permitted, and if not, pause.
1075         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
1076         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Ditto.
1077         * html/HTMLMediaSession.cpp:
1078         (WebCore::restrictionName): Since BehaviorRestrictions is a bitfield, check each bit
1079             individually.
1080         (WebCore::HTMLMediaSession::removeBehaviorRestriction): Handle RequireUserGestureForAudioRateChange.
1081         (WebCore::HTMLMediaSession::playbackPermitted): Check whether the element has audio and 
1082             audio playback is restricted, and return false if so.
1083         * html/HTMLMediaSession.h:
1084         * page/Settings.cpp:
1085         * page/Settings.in:
1086         * testing/Internals.cpp:
1087         (WebCore::Internals::setMediaSessionRestrictions): Added. 
1088         (WebCore::Internals::setMediaElementRestrictions): Added.
1089         * testing/Internals.h:
1090         * testing/Internals.idl:
1091
1092 2015-04-27  Jer Noble  <jer.noble@apple.com>
1093
1094         [WebAudio] AudioContext does not remove user-gesture restriction during resume()
1095         https://bugs.webkit.org/show_bug.cgi?id=144211
1096
1097         Reviewed by Eric Carlson.
1098
1099         Tests: webaudio/audiocontext-restriction-audiobuffersourcenode-start.html
1100                webaudio/audiocontext-restriction.html
1101
1102         Before the introduction of resume(), suspend(), and stop(), AudioContexts which required
1103         a user-gesture would start normally, but would effectively mute their outputs. Now that
1104         the AudioContext's state property is exposed to JavaScript, the AudioContext should stay
1105         in the "suspended" state until the user-gesture restriction is lifted.
1106
1107         Add a new method, willBeginPlayback() which checks and potentially clears the context's
1108         behavior restrictions before checking with the MediaSession. Call this new willBeginPlayback()
1109         method when the state would transition to "running".
1110
1111         Because they may be called before any nodes are created, make sure to call lazyInitialize()
1112         from within the JS-exposed resumePlayback(), suspendPlayback(), and stopPlayback() methods.
1113
1114         Instead of clearing the behavior restrictions directly, scheduled AudioNodes should instead
1115         call a new method nodeWillBeginPlayback(). Because existing sites will call AudioNode.start()
1116         inside a user-gesture handler to clear the user-gesture restriction, call startRendering()
1117         from nodeWillBeginPlayback(). But because we don't want AudioNode.start() to resume playback
1118         unconditionally, only do so when the user-gesture restriction is set.
1119
1120         Now that an AudioContext will not transition to "running" state without a user-gesture (if
1121         that restriction is set), there's no reason to check for that restriction from inside
1122         AudioDestinationNode.
1123
1124         Add some internal methods to set and clear AudioContext BehaviorRestrictions for testing purposes.
1125
1126         * Modules/webaudio/AudioBufferSourceNode.cpp:
1127         (WebCore::AudioBufferSourceNode::startPlaying):
1128         * Modules/webaudio/AudioContext.cpp:
1129         (WebCore::AudioContext::nodeWillBeginPlayback):
1130         (WebCore::AudioContext::willBeginPlayback):
1131         (WebCore::AudioContext::willPausePlayback):
1132         (WebCore::AudioContext::startRendering):
1133         (WebCore::AudioContext::suspendContext):
1134         (WebCore::AudioContext::resumeContext):
1135         (WebCore::AudioContext::closeContext):
1136         (WebCore::AudioContext::suspendPlayback):
1137         (WebCore::AudioContext::mayResumePlayback):
1138         * Modules/webaudio/AudioContext.h:
1139         (WebCore::AudioContext::behaviorRestrictions):
1140         (WebCore::AudioContext::userGestureRequiredForAudioStart):
1141         (WebCore::AudioContext::pageConsentRequiredForAudioStart):
1142         * Modules/webaudio/AudioDestinationNode.cpp:
1143         (WebCore::AudioDestinationNode::render):
1144         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1145         (WebCore::AudioScheduledSourceNode::start):
1146         * testing/Internals.cpp:
1147         (WebCore::Internals::setAudioContextRestrictions):
1148         * testing/Internals.h:
1149         * testing/Internals.idl:
1150
1151 2015-04-27  Alexey Proskuryakov  <ap@apple.com>
1152
1153         Build fix.
1154
1155         * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1156         Use -setObject:forKey:, not array subscript.
1157
1158 2015-04-27  Eric Carlson  <eric.carlson@apple.com>
1159
1160         WirelessTargetPicker should not be visible unless a file is playable
1161         https://bugs.webkit.org/show_bug.cgi?id=144271
1162         <rdar://problem/20712003>
1163
1164         Reviewed by Jer Noble.
1165
1166         * Modules/mediacontrols/mediaControlsApple.js:
1167         (Controller.prototype.isPlayable): New.
1168         (Controller.prototype.setStatusHidden): Call updateWirelessTargetAvailable.
1169         (Controller.prototype.updateWirelessTargetAvailable): Don't show the button until the
1170             status message has been hidden.
1171
1172 2015-04-22  Martin Robinson  <mrobinson@igalia.com>
1173
1174         [CMake] Autogenerate cmakeconfig.h.cmake
1175         https://bugs.webkit.org/show_bug.cgi?id=143997
1176
1177         Reviewed by Csaba Osztrogonác.
1178
1179         * PlatformGTK.cmake: Use the WTF_USE style variables, because those are the same
1180         as the ones exposed to the build.
1181
1182 2015-04-27  Zalan Bujtas  <zalan@apple.com>
1183
1184         Simple line layout: Wrong text offsetting when range does not start from the first renderer.
1185         https://bugs.webkit.org/show_bug.cgi?id=144167
1186         rdar://problem/20639857
1187
1188         Reviewed by Simon Fraser.
1189
1190         This patch ensures that TextIterator returns the right text when the input range starts
1191         from a sibling node.
1192
1193         TextIterator::m_previousTextLengthInFlow keeps track of the current node offset from the parent.
1194         It is required to map simple line layout runs to RenderText positions.
1195         This patch sets the offset value when the iteration start with a sibling node.
1196
1197         Test: fast/text/range-text-with-simple-line-layout.html
1198
1199         * editing/TextIterator.cpp:
1200         (WebCore::TextIterator::TextIterator):
1201         (WebCore::TextIterator::handleTextNode):
1202
1203 2015-04-27  Commit Queue  <commit-queue@webkit.org>
1204
1205         Unreviewed, rolling out r183393.
1206         https://bugs.webkit.org/show_bug.cgi?id=144272
1207
1208         Caused memory corruption detected by GuardMalloc (Requested by
1209         ap on #webkit).
1210
1211         Reverted changeset:
1212
1213         "Synchronous XMLHttpRequest should get access to AppCache
1214         resources stored as flat files"
1215         https://bugs.webkit.org/show_bug.cgi?id=143711
1216         http://trac.webkit.org/changeset/183393
1217
1218 2015-04-27  Per Arne Vollan  <peavo@outlook.com>
1219
1220         [Curl] Favicons loaded from disc cache are ignored.
1221         https://bugs.webkit.org/show_bug.cgi?id=143953
1222
1223         Reviewed by Alex Christensen.
1224
1225         When a favicon is loaded from the Curl disc cache, the icon data is thrown away.
1226         This happens because we give a 304 response, which makes the icon loader ignore
1227         the response. We can solve this by responding with 200 OK.
1228
1229         * platform/network/ResourceHandleInternal.h:
1230         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1231         * platform/network/curl/CurlCacheManager.cpp:
1232         (WebCore::CurlCacheManager::didReceiveResponse):
1233         * platform/network/curl/ResourceHandleManager.cpp:
1234         (WebCore::headerCallback):
1235         (WebCore::ResourceHandleManager::initializeHandle):
1236
1237 2015-04-27  Brady Eidson  <beidson@apple.com>
1238
1239         Make 'enum NavigationType' be an enum class
1240         https://bugs.webkit.org/show_bug.cgi?id=144270
1241
1242         Reviewed by Alex Christensen.
1243
1244         No new tests (No change in behavior).
1245
1246         I’ll be adding a new NavigationType for bug 144269 so it makes sense to make this
1247         an enum class first.
1248
1249         * loader/FrameLoader.cpp:
1250         (WebCore::FrameLoader::load):
1251         (WebCore::FrameLoader::reload):
1252         (WebCore::FrameLoader::loadDifferentDocumentItem):
1253         * loader/FrameLoaderTypes.h:
1254
1255         * loader/NavigationAction.cpp:
1256         (WebCore::navigationType):
1257         (WebCore::NavigationAction::NavigationAction):
1258
1259         * loader/PolicyChecker.cpp:
1260         (WebCore::PolicyChecker::checkNavigationPolicy):
1261
1262         * page/PerformanceNavigation.cpp:
1263         (WebCore::PerformanceNavigation::type):
1264
1265 2015-04-27  Yoav Weiss  <yoav@yoav.ws>
1266
1267         Fix viewport units in Media Queries
1268         https://bugs.webkit.org/show_bug.cgi?id=144260
1269
1270         Reviewed by Darin Adler.
1271
1272         This patch makes sure that viewport units are considered "length units"
1273         in the context of Media Queries, by having MediaQueryExp use the unit logic
1274         that is in CSSPrimitiveValue.
1275         It does that by turning the relevant methods in CSSPrimitiveValue into static.
1276
1277         It also makes sure that the logic for "resolution units" is not maintained separately 
1278         in MediaQueryExp, to avoid similiar issues in the future with resolution units.
1279
1280         Test: fast/media/mq-viewport-units.html
1281
1282         * css/CSSPrimitiveValue.h:
1283         (WebCore::CSSPrimitiveValue::isViewportPercentageLength): Added a static variant.
1284         (WebCore::CSSPrimitiveValue::isLength): Added a static variant.
1285         (WebCore::CSSPrimitiveValue::isResolution): Added a static variant.
1286         * css/MediaQueryExp.cpp:
1287         (WebCore::featureWithValidPositiveLenghtOrNumber): Call CSSPrimitiveValue's length unit logic.
1288         (WebCore::featureWithValidDensity): Call CSSPrimitiveValue's resolution unit logic.
1289
1290 2015-04-27  Javier Fernandez  <jfernandez@igalia.com>
1291
1292         [CSS Grid Layout] Support for the justify-self and justify-items in grid layout
1293         https://bugs.webkit.org/show_bug.cgi?id=133280
1294
1295         Reviewed by David Hyatt.
1296
1297         Implementation of justify-self and justify-items properties for grid. It supports
1298         different writing-modes and direction. Margins, borders and paddings are also
1299         considered when computing the final position and stretched size.
1300
1301         This patch applies also a quite important refactoring of the alignment logic in
1302         order to share code between the two alignment dimensions, row-axis and column-axis.
1303
1304         Overflow handling is still missing and will be added later in a follow-up bug.
1305
1306         Tests: fast/css-grid-layout/grid-align-justify-margin-border-padding-vertical-lr.html
1307                fast/css-grid-layout/grid-align-justify-margin-border-padding-vertical-rl.html
1308                fast/css-grid-layout/grid-align-justify-margin-border-padding.html
1309                fast/css-grid-layout/justify-self-cell.html
1310
1311         * rendering/RenderGrid.cpp:
1312         (WebCore::RenderGrid::layoutGridItems):
1313         (WebCore::RenderGrid::columnAxisPositionForChild):
1314         (WebCore::RenderGrid::rowAxisPositionForChild):
1315         (WebCore::RenderGrid::rowPositionForChild):
1316         (WebCore::RenderGrid::columnPositionForChild):
1317         (WebCore::RenderGrid::findChildLogicalPosition):
1318         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild): Deleted.
1319         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
1320         (WebCore::RenderGrid::marginLogicalHeightForChild): Deleted.
1321         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching): Deleted.
1322         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): Deleted.
1323         * rendering/RenderGrid.h:
1324         * rendering/style/RenderStyle.cpp:
1325         (WebCore::RenderStyle::resolveJustification):
1326         * rendering/style/RenderStyle.h:
1327
1328 2015-04-27  Darin Adler  <darin@apple.com>
1329
1330         Crashes under IDBDatabase::closeConnection
1331         https://bugs.webkit.org/show_bug.cgi?id=141745
1332
1333         Reviewed by Alexey Proskuryakov.
1334
1335         * Modules/indexeddb/IDBDatabase.cpp:
1336         (WebCore::IDBDatabase::~IDBDatabase): Do the work of close/closeConnection without
1337         actually calling those functions.
1338         (WebCore::IDBDatabase::closeConnection): Protect the database so it's not destroyed
1339         in the middle of this function's execution.
1340
1341 2015-04-27  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1342
1343         [Streams API] ReadableStream constructor start function should be able to close the stream
1344         https://bugs.webkit.org/show_bug.cgi?id=143363
1345
1346         Reviewed by Benjamin Poulain.
1347
1348         Implements https://streams.spec.whatwg.org/#close-readable-stream.
1349         When the "close" JS function is called, the stream is getting closed.
1350         The stream state is changed to close and if it has a reader, the reader gets closed as well:
1351         The reader resolves the closed promise and releases the stream.
1352
1353         Enabled the possibility to resolve a promise with any JS value.
1354         This is used to resolve closed promise with jsUndefined and will be used for read promises in
1355         the future as well, though of course it is not restricted to Streams.
1356
1357         Covered by reference tests that are now passing.
1358
1359         * Modules/streams/ReadableStream.h:
1360         * Modules/streams/ReadableStream.cpp:
1361         (WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
1362         * Modules/streams/ReadableStreamReader.cpp:
1363         (WebCore::ReadableStreamReader::ReadableStreamReader): Initialized stream.
1364         (WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time
1365         in particular closed/errored state.
1366         (WebCore::ReadableStreamReader::releaseStream): Releases the stream.
1367         (WebCore::ReadableStreamReader::closed): Stores the promise callbacks and invokes success
1368         immediately if the stream is already closed.
1369         (WebCore::ReadableStreamReader::changeStateToClosed): Changes the internal state to closed,
1370         resolves the promise and releases the stream.
1371         * Modules/streams/ReadableStreamReader.h:
1372         (WebCore::ReadableStreamReader::State): Added.
1373         * bindings/js/JSDOMPromise.h:
1374         (WebCore::DeferredWrapper::resolve<JSC::JSValue>): Adds the ability to resolve a promise with
1375         a custom JS value.
1376         * bindings/js/JSReadableStreamControllerCustom.cpp:
1377         (WebCore::JSReadableStreamController::close): Not "notImplemented" anymore. Now it closes the
1378         stream.
1379         * bindings/js/JSReadableStreamReaderCustom.cpp:
1380         (WebCore::JSReadableStreamReader::closed): Resolves the promise with undefined.
1381
1382 2015-04-27  Csaba Osztrogonác  <ossy@webkit.org>
1383
1384         Fix the !ENABLE(CSS_GRID_LAYOUT) build after r183370
1385         https://bugs.webkit.org/show_bug.cgi?id=144255
1386
1387         Reviewed by Carlos Garcia Campos.
1388
1389         * rendering/RenderBox.cpp:
1390         (WebCore::RenderBox::computeLogicalHeight):
1391
1392 2015-04-27  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1393
1394         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
1395         https://bugs.webkit.org/show_bug.cgi?id=143711
1396
1397         Reviewed by Darin Adler.
1398
1399         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
1400         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
1401         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
1402
1403         Test: http/tests/appcache/simple-video-sync.html
1404
1405         * html/HTMLMediaElement.cpp:
1406         (WebCore::HTMLMediaElement::parseAttribute):
1407         * loader/DocumentThreadableLoader.cpp:
1408         (WebCore::DocumentThreadableLoader::loadRequest):
1409         * loader/FrameLoader.cpp:
1410         (WebCore::FrameLoader::loadResourceSynchronously):
1411         * loader/FrameLoader.h:
1412         * loader/appcache/ApplicationCacheHost.cpp:
1413         (WebCore::ApplicationCacheHost::maybeLoadResource):
1414         (WebCore::ApplicationCacheHost::createFileURL):
1415         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
1416         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
1417         * loader/appcache/ApplicationCacheHost.h:
1418         * xml/XSLTProcessorLibxslt.cpp:
1419         (WebCore::docLoaderFunc):
1420         * xml/parser/XMLDocumentParserLibxml2.cpp:
1421         (WebCore::openFunc):
1422
1423 2015-04-24  Philippe Normand  <pnormand@igalia.com>
1424
1425         [JHBuild] Move to upstream OpenWebRTC
1426         https://bugs.webkit.org/show_bug.cgi?id=144145
1427
1428         Reviewed by Carlos Garcia Campos.
1429
1430         * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp:
1431         (WebCore::initializeOpenWebRTC): Update with new owr_init API.
1432
1433 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1434
1435         [SOUP] Add initial implementation of NetworkProcess disk cache
1436         https://bugs.webkit.org/show_bug.cgi?id=143872
1437
1438         Reviewed by Martin Robinson.
1439
1440         Allow to create a GRefPtr for SoupBuffer. Even though SoupBuffer
1441         is not a GObject and has copy/free functions instead of ref/unref,
1442         it's internally refcounted, so we could use copy/free as
1443         ref/unref.
1444
1445         * PlatformGTK.cmake:
1446         * platform/network/soup/GRefPtrSoup.cpp: Added.
1447         (WTF::refGPtr):
1448         (WTF::derefGPtr):
1449         * platform/network/soup/GRefPtrSoup.h: Added.
1450
1451 2015-04-26  Manuel Rego Casasnovas  <rego@igalia.com>
1452
1453         [CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes as definite
1454         https://bugs.webkit.org/show_bug.cgi?id=144144
1455
1456         Reviewed by Darin Adler.
1457
1458         Change order in hasDefiniteLogicalHeight() ifs to consider definite
1459         absolutely positioned elements.
1460
1461         Test: fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
1462
1463         * rendering/RenderBox.cpp:
1464         (WebCore::RenderBox::hasDefiniteLogicalHeight):
1465
1466 2015-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1467
1468         SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic
1469         https://bugs.webkit.org/show_bug.cgi?id=144137
1470
1471         Reviewed by Darin Adler.
1472
1473         The SourceAlpha should be driven from the last applied FilterEffect. This
1474         will require the SourceAlpha FilterEffect to wrap a FilterEffect rather
1475         than just getting the SourceGraphic reference from FilterEffectRenderer.
1476
1477         This is based on the Blink patch:
1478         https://src.chromium.org/viewvc/blink?revision=194115&view=revision.
1479
1480         Test: svg/filters/sourceAlpha-input-filter-effect.html
1481         
1482         * platform/graphics/filters/SourceAlpha.cpp:
1483         (WebCore::SourceAlpha::create): Make SourceAlpha wraps a FilterEffect
1484         rather than a Filter.
1485         
1486         (WebCore::SourceAlpha::determineAbsolutePaintRect): Determine the paint
1487         rect from the wrapped FilterEffect.
1488         
1489         (WebCore::SourceAlpha::platformApplySoftware): Extract the alpha channel
1490         from the wrapped FilterEffect.
1491         
1492         (WebCore::SourceAlpha::SourceAlpha): 
1493         * platform/graphics/filters/SourceAlpha.h:
1494         (WebCore::SourceAlpha::SourceAlpha): Deleted.
1495         Reimplement the constructor of the SourceAlpha such that it wraps the
1496         sourceEffect in its inputEffects.
1497     
1498         * rendering/FilterEffectRenderer.cpp:
1499         (WebCore::FilterEffectRenderer::buildReferenceFilter): Delete the FIXME
1500         comment and do exactly what it said. This matches the implementation of
1501         Gecko and Blink.
1502         
1503         * rendering/svg/RenderSVGResourceFilter.cpp:
1504         (WebCore::RenderSVGResourceFilter::buildPrimitives):
1505         Delete the extra argument.
1506
1507         * svg/graphics/filters/SVGFilterBuilder.cpp:
1508         (WebCore::SVGFilterBuilder::SVGFilterBuilder):
1509         * svg/graphics/filters/SVGFilterBuilder.h: Drive the SourceAlpha from the
1510         passed source FilterEffect.
1511
1512         * platform/graphics/filters/FEBlend.cpp:
1513         * platform/graphics/filters/FEBlend.h:
1514         * platform/graphics/filters/FEColorMatrix.cpp:
1515         * platform/graphics/filters/FEColorMatrix.h:
1516         * platform/graphics/filters/FEComponentTransfer.cpp:
1517         * platform/graphics/filters/FEComponentTransfer.h:
1518         * platform/graphics/filters/FEComposite.cpp:
1519         * platform/graphics/filters/FEComposite.h:
1520         * platform/graphics/filters/FEConvolveMatrix.cpp:
1521         * platform/graphics/filters/FEConvolveMatrix.h:
1522         * platform/graphics/filters/FEDiffuseLighting.cpp:
1523         * platform/graphics/filters/FEDiffuseLighting.h:
1524         * platform/graphics/filters/FEDisplacementMap.cpp:
1525         * platform/graphics/filters/FEDisplacementMap.h:
1526         * platform/graphics/filters/FEDropShadow.cpp:
1527         * platform/graphics/filters/FEDropShadow.h:
1528         * platform/graphics/filters/FEFlood.cpp:
1529         * platform/graphics/filters/FEFlood.h:
1530         * platform/graphics/filters/FEGaussianBlur.cpp:
1531         * platform/graphics/filters/FEGaussianBlur.h:
1532         * platform/graphics/filters/FELighting.cpp:
1533         * platform/graphics/filters/FELighting.h:
1534         * platform/graphics/filters/FEMerge.cpp:
1535         * platform/graphics/filters/FEMerge.h:
1536         * platform/graphics/filters/FEMorphology.cpp:
1537         * platform/graphics/filters/FEMorphology.h:
1538         * platform/graphics/filters/FEOffset.cpp:
1539         * platform/graphics/filters/FEOffset.h:
1540         * platform/graphics/filters/FESpecularLighting.cpp:
1541         * platform/graphics/filters/FESpecularLighting.h:
1542         * platform/graphics/filters/FETile.cpp:
1543         * platform/graphics/filters/FETile.h:
1544         * platform/graphics/filters/FETurbulence.cpp:
1545         * platform/graphics/filters/FETurbulence.h:
1546         * platform/graphics/filters/Filter.h:
1547         * platform/graphics/filters/FilterEffect.cpp:
1548         * platform/graphics/filters/FilterEffect.h:
1549         * platform/graphics/filters/SourceGraphic.cpp:
1550         * platform/graphics/filters/SourceGraphic.h:
1551         * rendering/svg/RenderSVGResourceFilter.h:
1552         * rendering/svg/SVGRenderTreeAsText.cpp:
1553         Code clean up: Pointer to reference conversion. It starts by converting
1554         FilterEffect::m_filter from pointer to reference and it kept expanding.
1555         All the creations of FilterEffect were happening by passing "this" so
1556         passing "*this" did not require to check whether the pointer is nil.
1557
1558         * svg/SVGFEBlendElement.cpp:
1559         * svg/SVGFEBlendElement.h:
1560         * svg/SVGFEColorMatrixElement.cpp:
1561         * svg/SVGFEColorMatrixElement.h:
1562         * svg/SVGFEComponentTransferElement.cpp:
1563         * svg/SVGFEComponentTransferElement.h:
1564         * svg/SVGFECompositeElement.cpp:
1565         * svg/SVGFECompositeElement.h:
1566         * svg/SVGFEConvolveMatrixElement.cpp:
1567         * svg/SVGFEConvolveMatrixElement.h:
1568         * svg/SVGFEDiffuseLightingElement.cpp:
1569         * svg/SVGFEDiffuseLightingElement.h:
1570         * svg/SVGFEDisplacementMapElement.cpp:
1571         * svg/SVGFEDisplacementMapElement.h:
1572         * svg/SVGFEDropShadowElement.cpp:
1573         * svg/SVGFEDropShadowElement.h:
1574         * svg/SVGFEFloodElement.cpp:
1575         * svg/SVGFEFloodElement.h:
1576         * svg/SVGFEGaussianBlurElement.cpp:
1577         * svg/SVGFEGaussianBlurElement.h:
1578         * svg/SVGFEImageElement.cpp:
1579         * svg/SVGFEImageElement.h:
1580         * svg/SVGFEMergeElement.cpp:
1581         * svg/SVGFEMergeElement.h:
1582         * svg/SVGFEMorphologyElement.cpp:
1583         * svg/SVGFEMorphologyElement.h:
1584         * svg/SVGFEOffsetElement.cpp:
1585         * svg/SVGFEOffsetElement.h:
1586         * svg/SVGFESpecularLightingElement.cpp:
1587         * svg/SVGFESpecularLightingElement.h:
1588         * svg/SVGFETileElement.cpp:
1589         * svg/SVGFETileElement.h:
1590         * svg/SVGFETurbulenceElement.cpp:
1591         * svg/SVGFETurbulenceElement.h:
1592         * svg/SVGFilterPrimitiveStandardAttributes.h:
1593         * svg/graphics/filters/SVGFEImage.cpp:
1594         * svg/graphics/filters/SVGFEImage.h:
1595         Code clean up: Pointer to reference and PassRefPtr<> to RefPtr<> or Ref<>
1596         conversion.
1597
1598 2015-04-26  Darin Adler  <darin@apple.com>
1599
1600         REGRESSION (r174283): disabled default buttons use impossible-to-read white text on Mac
1601         https://bugs.webkit.org/show_bug.cgi?id=144237
1602
1603         Reviewed by Simon Fraser.
1604
1605         No test because DumpRenderTree and WebKitTestRunner don't have a good method
1606         for testing behaviors that are specific to active windows. That's the same reason
1607         that the change that caused this bug didn't come with a regression test.
1608
1609         * rendering/RenderTheme.cpp:
1610         (WebCore::RenderTheme::adjustStyle): Renamed "e" to "element". Added a comment to
1611         clarify the meaning of the setInsideDefaultButton function, and added an
1612         isDisabledFormControl check so it won't trigger on a disabled button.
1613         (WebCore::RenderTheme::systemColor): Moved CSSValueActivebuttontext into
1614         alphabetical order to match the rest of the switch statement ordering.
1615
1616         * rendering/RenderThemeMac.mm:
1617         (WebCore::RenderThemeMac::systemColor): Moved CSSValueActivebuttontext into
1618         alphabetical order to match the rest of the switch statement ordering. Also
1619         fixed its behavior on older versions of OS X; it should just return the same
1620         thing that CSSValueButtontext would return in that context.
1621
1622 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
1623
1624         [ES6] Implement ES6 template literals
1625         https://bugs.webkit.org/show_bug.cgi?id=142691
1626
1627         Reviewed by Darin Adler.
1628
1629         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
1630
1631         * Configurations/FeatureDefines.xcconfig:
1632
1633 2015-04-26  Javier Fernandez  <jfernandez@igalia.com>
1634
1635         [CSS Grid Layout] Support for align-self and align-items in grid layout
1636         https://bugs.webkit.org/show_bug.cgi?id=133225
1637
1638         Reviewed by Darin Adler.
1639
1640         Implementation of align-self and align-items properties for grid. It supports
1641         different writing-modes and direction. Margins, borders and paddings are also
1642         considered when computing the final position and stretched size.
1643
1644         Overflow handling is still missing and will be added when implemented row-axis
1645         alignment support.
1646
1647         Test: fast/css-grid-layout/grid-align.html
1648
1649         * rendering/RenderBox.cpp:
1650         (WebCore::RenderBox::computeLogicalHeight):
1651         * rendering/RenderGrid.cpp:
1652         (WebCore::RenderGrid::logicalContentHeightForChild):
1653         (WebCore::RenderGrid::layoutGridItems):
1654         (WebCore::computeOverflowAlignmentOffset):
1655         (WebCore::RenderGrid::endOfRowForChild):
1656         (WebCore::RenderGrid::startOfRowForChild):
1657         (WebCore::RenderGrid::centeredRowPositionForChild):
1658         (WebCore::marginWidthForChild):
1659         (WebCore::marginHeightForChild):
1660         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild):
1661         (WebCore::RenderGrid::needToStretchChildLogicalHeight):
1662         (WebCore::RenderGrid::marginLogicalHeightForChild):
1663         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
1664         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1665         (WebCore::RenderGrid::rowPositionForChild):
1666         (WebCore::RenderGrid::findChildLogicalPosition):
1667         (WebCore::RenderGrid::populateGridPositions): Deleted.
1668         * rendering/RenderGrid.h:
1669
1670 2015-04-26  Doug Russell  <d_russell@apple.com>
1671
1672         AX: richer text change notifications (142719)
1673         https://bugs.webkit.org/show_bug.cgi?id=142719
1674
1675         Reviewed by Darin Adler.
1676
1677         Richer accessibility value change notifications. Introduce AXTextEditType,
1678         postTextStateChangeNotification and postTextReplacementNotification to give assistive
1679         tech apps more reliable context for responding to changes in web content. Also implement
1680         a mechanism to post value changes in password form fields in coalesced ticks to thwart
1681         analyzing the cadence of changes.
1682
1683         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
1684         and an overload of postTextReplacementNotification to give assistive tech apps more
1685         reliable context for responding to changes in web content selection. Also block posting
1686         selection changes on password fields.
1687
1688         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
1689                platform/mac/accessibility/selection-change-userinfo.html
1690                platform/mac/accessibility/value-change-userinfo.html
1691
1692         * CMakeLists.txt:
1693         * WebCore.vcxproj/WebCore.vcxproj:
1694         * WebCore.vcxproj/WebCore.vcxproj.filters:
1695         * WebCore.xcodeproj/project.pbxproj:
1696         * accessibility/AXObjectCache.cpp:
1697         (WebCore::AXObjectCache::AXObjectCache):
1698         (WebCore::AXObjectCache::notificationPostTimerFired):
1699         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
1700         (WebCore::AXObjectCache::showIntent):
1701         (WebCore::AXObjectCache::setTextSelectionIntent):
1702         (WebCore::isPasswordFieldOrContainedByPasswordField):
1703         (WebCore::AXObjectCache::postTextStateChangeNotification):
1704         (WebCore::AXObjectCache::postTextReplacementNotification):
1705         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
1706         (WebCore::AXObjectCache::rootWebArea):
1707         (WebCore::AXObjectCache::textChangeForEditType):
1708         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
1709         (WebCore::AXObjectCache::frameLoadingEventNotification): Deleted.
1710         * accessibility/AXObjectCache.h:
1711         (WebCore::AXObjectCache::postTextStateChangeNotification):
1712         (WebCore::AXObjectCache::postTextReplacementNotification):
1713         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1714         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1715         (WebCore::AXObjectCache::textChangeForEditType):
1716         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1717         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
1718         (WebCore::AXObjectCache::getOrCreate): Deleted.
1719         (WebCore::AXObjectCache::attachWrapper): Deleted.
1720         * accessibility/AXTextStateChangeIntent.h: Added.
1721         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
1722         * accessibility/AccessibilityNodeObject.cpp:
1723         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
1724         * accessibility/AccessibilityNodeObject.h:
1725         * accessibility/AccessibilityObject.cpp:
1726         (WebCore::AccessibilityObject::isContainedByPasswordField):
1727         * accessibility/AccessibilityObject.h:
1728         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
1729         (WebCore::AccessibilityObject::isPasswordField): Deleted.
1730         * accessibility/AccessibilityRenderObject.cpp:
1731         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1732         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1733         * accessibility/AccessibilityScrollView.h:
1734         * accessibility/atk/AXObjectCacheAtk.cpp:
1735         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1736         * accessibility/ios/AXObjectCacheIOS.mm:
1737         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1738         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1739         * accessibility/mac/AXObjectCacheMac.mm:
1740         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
1741         (WebCore::AXPostNotificationWithUserInfo):
1742         (WebCore::AXObjectCache::postPlatformNotification):
1743         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1744         (WebCore::textReplacementChangeDictionary):
1745         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1746         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1747         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1748         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
1749         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
1750         (arrayRemovingNonJSONTypes):
1751         (dictionaryRemovingNonJSONTypes):
1752         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
1753         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
1754         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1755         (textMarkerRangeFromVisiblePositions):
1756         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
1757         * editing/AppendNodeCommand.cpp:
1758         (WebCore::AppendNodeCommand::AppendNodeCommand):
1759         (WebCore::sendAXTextChangedIgnoringLineBreaks):
1760         (WebCore::AppendNodeCommand::doApply):
1761         (WebCore::AppendNodeCommand::doUnapply):
1762         * editing/AppendNodeCommand.h:
1763         (WebCore::AppendNodeCommand::create):
1764         * editing/ApplyStyleCommand.cpp:
1765         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
1766         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
1767         * editing/ApplyStyleCommand.h:
1768         * editing/CompositeEditCommand.cpp:
1769         (WebCore::EditCommandComposition::unapplyEditType):
1770         (WebCore::CompositeEditCommand::CompositeEditCommand):
1771         (WebCore::CompositeEditCommand::apply):
1772         (WebCore::CompositeEditCommand::insertParagraphSeparator):
1773         (WebCore::CompositeEditCommand::insertNodeBefore):
1774         (WebCore::CompositeEditCommand::appendNode):
1775         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
1776         (WebCore::CompositeEditCommand::insertTextIntoNode):
1777         (WebCore::CompositeEditCommand::deleteTextFromNode):
1778         (WebCore::CompositeEditCommand::replaceTextInNode):
1779         (WebCore::CompositeEditCommand::moveParagraphs):
1780         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
1781         (WebCore::CompositeEditCommand::applyStyle): Deleted.
1782         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
1783         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
1784         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
1785         (WebCore::CompositeEditCommand::inputText): Deleted.
1786         * editing/CompositeEditCommand.h:
1787         * editing/DeleteFromTextNodeCommand.cpp:
1788         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
1789         (WebCore::DeleteFromTextNodeCommand::doApply):
1790         (WebCore::DeleteFromTextNodeCommand::doUnapply):
1791         * editing/DeleteFromTextNodeCommand.h:
1792         (WebCore::DeleteFromTextNodeCommand::create):
1793         (WebCore::DeleteFromTextNodeCommand::deletedText):
1794         * editing/DeleteSelectionCommand.cpp:
1795         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
1796         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
1797         * editing/DeleteSelectionCommand.h:
1798         (WebCore::DeleteSelectionCommand::create):
1799         * editing/DictationCommand.cpp:
1800         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
1801         (WebCore::DictationCommand::insertParagraphSeparator):
1802         * editing/EditAction.h:
1803         * editing/EditCommand.cpp:
1804         (WebCore::EditCommand::EditCommand):
1805         (WebCore::EditCommand::editingAction):
1806         (WebCore::EditCommand::applyEditType):
1807         (WebCore::EditCommand::unapplyEditType):
1808         (WebCore::SimpleEditCommand::SimpleEditCommand):
1809         (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
1810         (WebCore::EditCommand::setParent): Deleted.
1811         * editing/EditCommand.h:
1812         * editing/EditingAllInOne.cpp:
1813         * editing/Editor.cpp:
1814         (WebCore::Editor::handleTextEvent):
1815         (WebCore::Editor::deleteSelectionWithSmartDelete):
1816         (WebCore::Editor::replaceSelectionWithFragment):
1817         (WebCore::Editor::replaceSelectionWithText):
1818         (WebCore::Editor::appliedEditing):
1819         (WebCore::Editor::unappliedEditing):
1820         (WebCore::Editor::performCutOrCopy):
1821         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1822         (WebCore::Editor::changeBackToReplacedString):
1823         (WebCore::Editor::transpose):
1824         (WebCore::Editor::changeSelectionAfterCommand):
1825         * editing/Editor.h:
1826         * editing/EditorCommand.cpp:
1827         (WebCore::executeInsertFragment):
1828         * editing/FrameSelection.cpp:
1829         (WebCore::FrameSelection::moveTo):
1830         (WebCore::FrameSelection::moveWithoutValidationTo):
1831         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
1832         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
1833         (WebCore::FrameSelection::setSelection):
1834         (WebCore::FrameSelection::updateAndRevealSelection):
1835         (WebCore::isBoundary):
1836         (WebCore::FrameSelection::textSelectionIntent):
1837         (WebCore::FrameSelection::modify):
1838         (WebCore::FrameSelection::selectAll):
1839         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
1840         (WebCore::FrameSelection::modifyMovingBackward): Deleted.
1841         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
1842         (WebCore::FrameSelection::selectionAtWordStart): Deleted.
1843         * editing/FrameSelection.h:
1844         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1845         (WebCore::FrameSelection::selection): Deleted.
1846         * editing/InsertIntoTextNodeCommand.cpp:
1847         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
1848         (WebCore::InsertIntoTextNodeCommand::doApply):
1849         (WebCore::InsertIntoTextNodeCommand::doUnapply):
1850         * editing/InsertIntoTextNodeCommand.h:
1851         (WebCore::InsertIntoTextNodeCommand::create):
1852         (WebCore::InsertIntoTextNodeCommand::insertedText):
1853         * editing/InsertNodeBeforeCommand.cpp:
1854         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
1855         (WebCore::InsertNodeBeforeCommand::doApply):
1856         (WebCore::InsertNodeBeforeCommand::doUnapply):
1857         * editing/InsertNodeBeforeCommand.h:
1858         (WebCore::InsertNodeBeforeCommand::create):
1859         * editing/InsertParagraphSeparatorCommand.cpp:
1860         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
1861         * editing/InsertParagraphSeparatorCommand.h:
1862         (WebCore::InsertParagraphSeparatorCommand::create):
1863         * editing/InsertTextCommand.cpp:
1864         (WebCore::InsertTextCommand::InsertTextCommand):
1865         * editing/InsertTextCommand.h:
1866         (WebCore::InsertTextCommand::create):
1867         (WebCore::InsertTextCommand::createWithMarkerSupplier):
1868         * editing/MoveSelectionCommand.cpp:
1869         (WebCore::MoveSelectionCommand::doApply):
1870         * editing/RemoveNodePreservingChildrenCommand.cpp:
1871         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
1872         * editing/RemoveNodePreservingChildrenCommand.h:
1873         (WebCore::RemoveNodePreservingChildrenCommand::create):
1874         * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
1875         (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
1876         (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
1877         * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
1878         * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
1879         (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
1880         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
1881         * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
1882         * editing/ReplaceSelectionCommand.cpp:
1883         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
1884         (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
1885         (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
1886         * editing/ReplaceSelectionCommand.h:
1887         (WebCore::ReplaceSelectionCommand::create):
1888         * editing/TypingCommand.cpp:
1889         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
1890         (WebCore::TypingCommand::insertParagraphSeparator):
1891         * editing/atk/FrameSelectionAtk.cpp:
1892         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1893         * editing/ios/DictationCommandIOS.cpp:
1894         (WebCore::DictationCommandIOS::DictationCommandIOS):
1895         * editing/ios/DictationCommandIOS.h:
1896         * editing/mac/FrameSelectionMac.mm:
1897         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1898         * html/HTMLTextFormControlElement.cpp:
1899         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1900         * page/DragController.cpp:
1901         (WebCore::DragController::concludeEditDrag):
1902         * page/EventHandler.cpp:
1903         (WebCore::setInitialKeyboardSelection):
1904         * page/FocusController.cpp:
1905         (WebCore::FocusController::advanceFocusInDocumentOrder):
1906
1907 2015-04-26  Darin Adler  <darin@apple.com>
1908
1909         REGRESSION (r176751): line-height ignored in <button> elements
1910         https://bugs.webkit.org/show_bug.cgi?id=144234
1911
1912         Reviewed by Antti Koivisto.
1913
1914         Test: fast/forms/button-line-height.html
1915
1916         The theme code was overriding line heights on all themed form controls.
1917         Instead it should have only overridden line height when the theme overrides the font.
1918         For <input type=button> on Mac, the theme always overrides the font, but for
1919         other elements like <button> it does not.
1920
1921         * platform/Theme.h: Changed controlFont to return an Optional so we can tell
1922         when the theme is overriding the font. Otherwise if the font from the user-agent
1923         style sheet and the font from the theme are the same, we will think we are not
1924         overriding the font when we actually are.
1925
1926         * platform/mac/ThemeMac.h: Updated controlFont to return Optional.
1927         * platform/mac/ThemeMac.mm:
1928         (WebCore::ThemeMac::controlFont): Ditto.
1929
1930         * rendering/RenderTheme.cpp:
1931         (WebCore::RenderTheme::adjustStyle): Set line height only if the font is
1932         overriden by the theme, all the time for PushButtonPart on Mac, and not at all
1933         for other parts. Also tightened up the logic a little since RenderStyle's
1934         setFontDescription already does an "==" comparison; we don't have to do
1935         that twice.
1936
1937 2015-04-26  Darin Adler  <darin@apple.com>
1938
1939         REGRESSION (r173801): Use after free in WebCore::NotificationCenter::~NotificationCenter
1940         https://bugs.webkit.org/show_bug.cgi?id=137163
1941
1942         Reviewed by Andy Estes.
1943
1944         Test: fast/notifications/request-notification-permission-while-reloading.html
1945
1946         The test doesn't crash under WebKit2, but that's still OK for our purposes.
1947
1948         * Modules/notifications/NotificationCenter.cpp:
1949         (WebCore::NotificationCenter::NotificationCenter): Initialize m_timer.
1950         (WebCore::NotificationCenter::createNotification): Moved here from the header.
1951         (WebCore::NotificationCenter::requestPermission): Start the timer and ref the notification
1952         center when we need to defer a callback. Also use a lambda for the callback and changed
1953         the argument to match what the bindings actually pass. Before we said PassRefPtr, but the
1954         bindings were not transferring ownership of the VoidCallback. The new type is a little
1955         strange but it's consistent with how the bindings work right now.
1956         (WebCore::NotificationCenter::timerFired): Added. Calls all the callbacks, then does a deref
1957         to match the ref we did above.
1958         (WebCore::NotificationCenter::requestTimedOut): Deleted.
1959         (WebCore::NotificationCenter::NotificationRequestCallback::createAndStartTimer): Deleted.
1960         (WebCore::NotificationCenter::NotificationRequestCallback::NotificationRequestCallback): Deleted.
1961         (WebCore::NotificationCenter::NotificationRequestCallback::startTimer): Deleted.
1962         (WebCore::NotificationCenter::NotificationRequestCallback::timerFired): Deleted.
1963
1964         * Modules/notifications/NotificationCenter.h: Reorganized the header to be a bit more tidy.
1965         Changed the argument type for requestPermission to match the reality of what's passed by the
1966         bindings. Removed NotificationRequestCallback and replaced the m_callbacks HashSet with a
1967         vector of std::function.
1968
1969 2015-04-26  Simon Fraser  <simon.fraser@apple.com>
1970
1971         Modernize animations code
1972         https://bugs.webkit.org/show_bug.cgi?id=144196
1973
1974         Reviewed by Darin Adler.
1975         
1976         General cleanup in animation-related code.
1977         
1978         Use C++ references where possible. Use modern loops. Make classes fast-allocated.
1979         Use C++11 member initialization. Order member variables to optimize packing.
1980         
1981         This removes some null checks in CompositeAnimation, but the values in m_transitions
1982         and m_keyframeAnimations can never be null.
1983         
1984         No behavior change.
1985
1986         * page/animation/AnimationBase.cpp:
1987         (WebCore::AnimationBase::AnimationBase):
1988         (WebCore::AnimationBase::animationsMatch):
1989         (WebCore::AnimationBase::updateStateMachine):
1990         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
1991         (WebCore::AnimationBase::beginAnimationUpdateTime):
1992         (WebCore::AnimationBase::getElapsedTime):
1993         * page/animation/AnimationBase.h:
1994         (WebCore::AnimationBase::animation):
1995         (WebCore::AnimationBase::setAnimation):
1996         * page/animation/AnimationController.cpp:
1997         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
1998         (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
1999         * page/animation/CompositeAnimation.cpp:
2000         (WebCore::CompositeAnimation::CompositeAnimation):
2001         (WebCore::CompositeAnimation::clearRenderer):
2002         (WebCore::CompositeAnimation::updateTransitions):
2003         (WebCore::CompositeAnimation::updateKeyframeAnimations):
2004         (WebCore::CompositeAnimation::animate):
2005         (WebCore::CompositeAnimation::getAnimatedStyle):
2006         (WebCore::CompositeAnimation::timeToNextService):
2007         (WebCore::CompositeAnimation::getAnimationForProperty):
2008         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
2009         (WebCore::CompositeAnimation::suspendAnimations):
2010         (WebCore::CompositeAnimation::resumeAnimations):
2011         (WebCore::CompositeAnimation::overrideImplicitAnimations):
2012         (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations):
2013         (WebCore::CompositeAnimation::isAnimatingProperty):
2014         (WebCore::CompositeAnimation::pauseTransitionAtTime):
2015         (WebCore::CompositeAnimation::numberOfActiveAnimations):
2016         * page/animation/CompositeAnimation.h:
2017         (WebCore::CompositeAnimation::create):
2018         (WebCore::CompositeAnimation::animationController):
2019         * page/animation/ImplicitAnimation.cpp:
2020         (WebCore::ImplicitAnimation::ImplicitAnimation):
2021         (WebCore::ImplicitAnimation::sendTransitionEvent):
2022         * page/animation/ImplicitAnimation.h:
2023         (WebCore::ImplicitAnimation::create):
2024         * page/animation/KeyframeAnimation.cpp:
2025         (WebCore::KeyframeAnimation::KeyframeAnimation):
2026         (WebCore::KeyframeAnimation::animate):
2027         (WebCore::KeyframeAnimation::getAnimatedStyle):
2028         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
2029         (WebCore::KeyframeAnimation::startAnimation):
2030         (WebCore::KeyframeAnimation::sendAnimationEvent):
2031         (WebCore::KeyframeAnimation::overrideAnimations):
2032         (WebCore::KeyframeAnimation::resumeOverriddenAnimations):
2033         (WebCore::KeyframeAnimation::timeToNextService):
2034         * page/animation/KeyframeAnimation.h:
2035         * platform/animation/Animation.cpp:
2036         (WebCore::Animation::animationsMatch):
2037         * platform/animation/Animation.h:
2038         * rendering/RenderLayer.cpp:
2039         (WebCore::RenderLayer::paint):
2040         (WebCore::performOverlapTests):
2041         * rendering/style/KeyframeList.h:
2042         (WebCore::KeyframeList::properties):
2043         (WebCore::KeyframeList::keyframes):
2044         (WebCore::KeyframeList::beginProperties): Deleted.
2045         (WebCore::KeyframeList::endProperties): Deleted.
2046         (WebCore::KeyframeList::operator[]): Deleted.
2047         * rendering/style/RenderStyle.h:
2048
2049 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
2050
2051         Expand compositing coverage rect when scrolling and animating
2052         https://bugs.webkit.org/show_bug.cgi?id=144214
2053         rdar://problem/20695926
2054
2055         Reviewed by Darin Adler.
2056         
2057         r183300 added a secondary rect that gets mapped through graphics layers during
2058         layer flushing, which represents a rect, in layer coordinates, that represents
2059         the portion of this layer that's visible in the viewport.
2060         
2061         This patch extends that rect based on scrolling and animating, with the extended
2062         coverage rect being mapped into descendants (where it's used to determine whether
2063         they should detach their backing store). This required moving the responsibility for
2064         extending the coverage rect from TileController (where it was used to compute
2065         tiled extent), to GraphicsLayerCA. Thus, GraphicsLayerCA now owns the concept
2066         of coverage rect, and pushes it onto TileControllers.
2067
2068         Test: compositing/tiling/transform-origin-tiled.html
2069
2070         * platform/graphics/TiledBacking.h: Coverage rect is now pushed onto
2071         TiledBacking from outside; new functions reflect that.
2072         * platform/graphics/ca/GraphicsLayerCA.cpp:
2073         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly): No need to pass
2074         old visible rect to commitLayerChangesBeforeSublayers.
2075         (WebCore::accumulatesTransform):
2076         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush): Now calls computeVisibleAndCoverageRect(),
2077         then adjustCoverageRect() which adjusts for scrolling and animations.
2078         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect): Fetch the coverage rect from the
2079         TransformState, but we can only use this if mapping it through various transforms didn't clamp
2080         it (which can happen with severe rotations in perspective).
2081         (WebCore::GraphicsLayerCA::adjustCoverageRect): If this layer represents the page tiled backing,
2082         ask the TileController to do coverage adjustment (code which should move into here eventually).
2083         For other tiled layers, do motion-based adjustment. This should really be done for all layers
2084         (an animating non-tiled layer may contain a tiled layer).
2085         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): The VisibleRectChanged wasn't needed
2086         any more; layers only react to changed in coverage rect now.
2087         (WebCore::GraphicsLayerCA::recursiveCommitChanges): If adjustCoverageRect() changed the
2088         coverage rect, here we push the new rect back into the TransformState so it will affect
2089         descendants.
2090         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2091         (WebCore::GraphicsLayerCA::updateCoverage): Coverage and backing store attachment go
2092         hand-in-hand now.
2093         (WebCore::GraphicsLayerCA::changeLayerTypeTo):
2094         (WebCore::GraphicsLayerCA::computeVisibleRect): Deleted.
2095         (WebCore::GraphicsLayerCA::updateBackingStoreAttachment): Deleted.
2096         (WebCore::GraphicsLayerCA::updateVisibleRect): Deleted.
2097         * platform/graphics/ca/GraphicsLayerCA.h:
2098         * platform/graphics/ca/TileController.cpp:
2099         (WebCore::TileController::setVisibleRect): Visible rect is only used for scroll performance
2100         logging now.
2101         (WebCore::TileController::setCoverageRect):
2102         (WebCore::TileController::tilesWouldChangeForCoverageRect):
2103         (WebCore::TileController::revalidateTiles):
2104         (WebCore::TileController::boundsForSize): This is required because when computeTileCoverageRect()
2105         is called at the top of committing the owning layer, we haven't yet pushed a new size to the
2106         underlying platform layer (which TileController::bounds() consults).
2107         (WebCore::TileController::bounds):
2108         (WebCore::TileController::computeTileCoverageRect): Have to push the new size in, since the
2109         underlying layer hasn't been updated yet.
2110         (WebCore::TileController::didRevalidateTiles):
2111         (WebCore::TileController::tilesWouldChangeForVisibleRect): Deleted.
2112         * platform/graphics/ca/TileController.h:
2113         * platform/graphics/ca/TileCoverageMap.cpp:
2114         (WebCore::TileCoverageMap::TileCoverageMap): Add a layer to the tile map that shows 
2115         a dark blue outline for the coverage rect.
2116         (WebCore::TileCoverageMap::update): Fix some minor issues with map position when top
2117         content inset is non-zero.
2118         * platform/graphics/ca/TileCoverageMap.h:
2119         * platform/graphics/ca/TileGrid.cpp: Everything is in terms of coverage rect now.
2120         (WebCore::TileGrid::tilesWouldChangeForCoverageRect):
2121         (WebCore::TileGrid::revalidateTiles):
2122         (WebCore::TileGrid::tilesWouldChangeForVisibleRect): Deleted.
2123         * platform/graphics/ca/TileGrid.h:
2124         * platform/graphics/transforms/TransformState.cpp:
2125         (WebCore::TransformState::operator=):
2126         (WebCore::TransformState::mappedQuad): Pass direction into mapQuad().
2127         (WebCore::TransformState::mappedSecondaryQuad): Ditto.
2128         (WebCore::TransformState::setLastPlanarSecondaryQuad): This function allows a caller
2129         to pass in a secondary quad, and get it mapped into the coordinate space of the last
2130         "flattening" state (since the TransformState may have in-flight XY offset, or transform).
2131         This mapping is achieved by re-using mapQuad(), but in the inverse direction.
2132         (WebCore::TransformState::mapQuad): Make direction a parameter.
2133         (WebCore::TransformState::flattenWithTransform): This code omitted to map the secondary
2134         quad. Failure was detected by tests.
2135         * platform/graphics/transforms/TransformState.h:
2136         (WebCore::TransformState::isMappingSecondaryQuad):
2137         (WebCore::TransformState::direction):
2138         (WebCore::TransformState::inverseDirection):
2139         (WebCore::TransformState::lastPlanarSecondaryQuad): Deleted.
2140
2141 2015-04-25  Dan Bernstein  <mitz@apple.com>
2142
2143         Updated expected bindings generation test results after r183343.
2144
2145         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h:
2146         * bindings/scripts/test/ObjC/DOMTestCallback.h:
2147         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h:
2148         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
2149         * bindings/scripts/test/ObjC/DOMTestEventTarget.h:
2150         * bindings/scripts/test/ObjC/DOMTestException.h:
2151         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h:
2152         * bindings/scripts/test/ObjC/DOMTestInterface.h:
2153         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h:
2154         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h:
2155         * bindings/scripts/test/ObjC/DOMTestNode.h:
2156         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h:
2157         * bindings/scripts/test/ObjC/DOMTestObj.h:
2158         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h:
2159         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
2160         * bindings/scripts/test/ObjC/DOMTestTypedefs.h:
2161         * bindings/scripts/test/ObjC/DOMattribute.h:
2162         * bindings/scripts/test/ObjC/DOMreadonly.h:
2163
2164 2015-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
2165
2166         font-synthesis's initial value is "style weight"
2167         https://bugs.webkit.org/show_bug.cgi?id=144195
2168
2169         Reviewed by Darin Adler.
2170
2171         Updated fast/css3-text/font-synthesis-parse.html.
2172
2173         * rendering/style/RenderStyle.h:
2174
2175 2015-04-25  Commit Queue  <commit-queue@webkit.org>
2176
2177         Unreviewed, rolling out r183305.
2178         https://bugs.webkit.org/show_bug.cgi?id=144213
2179
2180         Crashes on wikipedia (Requested by litherum on #webkit).
2181
2182         Reverted changeset:
2183
2184         "[Cocoa] FontPlatformData's equality check should always use
2185         reference URLs"
2186         https://bugs.webkit.org/show_bug.cgi?id=144168
2187         http://trac.webkit.org/changeset/183305
2188
2189 2015-04-25  Dan Bernstein  <mitz@apple.com>
2190
2191         WebCore part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
2192         https://bugs.webkit.org/show_bug.cgi?id=144201
2193
2194         Reviewed by Darin Adler.
2195
2196         Instead of TBD, use the high version number to which it corresponds in CFAvailability.h,
2197         9876.5.
2198
2199         * bindings/objc/WebKitAvailability.h: Added a definition of __NSi_9876_5, so that we can
2200         use 9876_5 in availability macros. Removed the definition of
2201         __AVAILABILITY_INTERNAL__MAC_TBD, which will no longer be used.
2202
2203         * bindings/scripts/CodeGeneratorObjC.pm:
2204         (ReadPublicInterfaces): Use 9876_5 instead of TBD.
2205
2206 2015-04-25  Timothy Hatcher  <timothy@apple.com>
2207
2208         Update localized strings.
2209
2210         * English.lproj/Localizable.strings: Updated.
2211
2212 2015-04-25  Darin Adler  <darin@apple.com>
2213
2214         Crash if IDBTransaction is aborted right after it's created
2215         https://bugs.webkit.org/show_bug.cgi?id=144199
2216
2217         Reviewed by Simon Fraser.
2218
2219         Test: storage/indexeddb/transaction-abort.html
2220
2221         * Modules/indexeddb/IDBTransactionBackend.cpp:
2222         (WebCore::IDBTransactionBackend::IDBTransactionBackend): Don't start the
2223         transaction if it is already complete (has been aborted).
2224
2225 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
2226
2227         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
2228         https://bugs.webkit.org/show_bug.cgi?id=144182
2229
2230         Reviewed by Simon Fraser.
2231
2232         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2233         * WebCore.vcxproj/WebCoreCommon.props: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2234         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2235         * css/CSSComputedStyleDeclaration.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2236         * css/MediaQueryEvaluator.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2237         * platform/graphics/GraphicsContext.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2238         * platform/graphics/cairo/GraphicsContextCairo.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2239         * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2240         * rendering/RenderLayer.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2241         * rendering/RenderLayerCompositor.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2242         * rendering/RenderObject.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
2243
2244 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2245
2246         [Cocoa] FontPlatformData's equality check should always use reference URLs
2247         https://bugs.webkit.org/show_bug.cgi?id=144168
2248
2249         Reviewed by Tim Horton.
2250
2251         <rdar://problem/18985642> is not fixed, so we need to continue using the older
2252         objectForEqualityCheck().
2253
2254         No new tests because there is no behavior change.
2255
2256         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2257         (WebCore::FontPlatformData::objectForEqualityCheck):
2258
2259 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2260
2261         Implement parsing support for font-synthesis CSS property
2262         https://bugs.webkit.org/show_bug.cgi?id=144180
2263         <rdar://problem/20692791>
2264         <rdar://problem/20625024>
2265
2266         Reviewed by Tim Horton.
2267
2268         See http://www.w3.org/TR/css-fonts-3/#font-synthesis-prop
2269
2270         This property allows web authors to opt out of font synthesis. This patch only
2271         implements parsing support for the property.
2272
2273         Test: fast/css3-text/font-synthesis-parse.html
2274
2275         * css/CSSComputedStyleDeclaration.cpp:
2276         (WebCore::fontSynthesisFromStyle): Create a CSSValue for the existing style object.
2277         (WebCore::ComputedStyleExtractor::propertyValue): Call fontSynthesisFromStyle().
2278         * css/CSSParser.cpp:
2279         (WebCore::CSSParser::parseValue): Call parseFontSynthesis().
2280         (WebCore::CSSParser::parseFontSynthesis): Accept the grammar
2281         "none | [ weight || style ]"
2282         * css/CSSParser.h: Function signature.
2283         * css/CSSPropertyNames.in: New CSS property name.
2284         * css/CSSValueKeywords.in: New CSS value names.
2285         * css/StyleBuilderCustom.h:
2286         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Construct an internal
2287         representation of font-synthesis for a given CSSValue.
2288         * rendering/style/RenderStyle.h: Function signature.
2289         * rendering/style/RenderStyleConstants.h: Internal representation of
2290         font-synthesis.
2291         * rendering/style/StyleRareInheritedData.h: Where we actually store the bits
2292         related to this internal representation.
2293
2294 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2295
2296         Have the web inspector report accurate memory use for layers with detached backing store
2297         https://bugs.webkit.org/show_bug.cgi?id=144179
2298
2299         Reviewed by Dean Jackson.
2300
2301         Only report memory use for layers whose backing store is attached.
2302
2303         * platform/graphics/ca/GraphicsLayerCA.cpp:
2304         * platform/graphics/ca/PlatformCALayer.h: Add backingContributesToMemoryEstimate()
2305         which platforms can override if they allow backing store detaching.
2306
2307 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2308
2309         Track a coverage rect through GraphicsLayerCA flushes, use it to mark backing store attached
2310         https://bugs.webkit.org/show_bug.cgi?id=144165
2311
2312         Reviewed by Dean Jackson.
2313         
2314         Push in the clipRect as the secondary rect when doing a GraphicsLayerCA flush,
2315         which maps this rect through all the layers. Each layer tests intersection with
2316         this rect to determine if its backing store should be attached.
2317         
2318         This will cause us to drop backing store for layers that don't intersect the
2319         visible part of the view, which is too aggressive. A future patch will add
2320         some padding.
2321
2322         Tests: compositing/visible-rect/coverage-clipped.html
2323                compositing/visible-rect/coverage-scrolling.html
2324
2325         * platform/graphics/ca/GraphicsLayerCA.cpp:
2326         (WebCore::GraphicsLayerCA::GraphicsLayerCA): Remove initialization of things with
2327         C++11 initializers. Initialize the new m_intersectsCoverageRect bit.
2328         (WebCore::GraphicsLayerCA::flushCompositingState): Push the clipRect in as the
2329         secondary coverage rect. A future patch will inflate this on the way down the tree.
2330         (WebCore::GraphicsLayerCA::computeVisibleRect): If we're clipping, and
2331         we have a secondary coverage rect, that rect can be clipped to us too.
2332         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
2333         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2334         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2335         (WebCore::GraphicsLayerCA::updateBackingStoreAttachment):
2336         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
2337         * platform/graphics/ca/GraphicsLayerCA.h: New CoverageRectChanged bit.
2338         Use more C++11 initializers.
2339         (WebCore::GraphicsLayerCA::coverageRect):
2340
2341 2015-04-24  Dean Jackson  <dino@apple.com>
2342
2343         AnimationController::scrollWasUpdated() shows up in scrolling profiles on pages that don't use scroll triggers
2344         https://bugs.webkit.org/show_bug.cgi?id=144173
2345         <rdar://problem/20526168>
2346
2347         Reviewed by Simon Fraser.
2348
2349         Keep a list of Animations that care about scroll updates, and only
2350         run the animation update if the list is not empty.
2351
2352         Covered by existing tests.
2353
2354         * page/animation/AnimationBase.cpp:
2355         (WebCore::AnimationBase::updateStateMachine): Tell the AnimationController
2356         if this is an animation that depends on scrolling.
2357         * page/animation/AnimationController.cpp:
2358         (WebCore::AnimationControllerPrivate::animationWillBeRemoved): Call the
2359         new removeFromAnimationsDependentOnScroll as this animation is deleted.
2360         (WebCore::AnimationControllerPrivate::addToAnimationsDependentOnScroll):
2361         (WebCore::AnimationControllerPrivate::removeFromAnimationsDependentOnScroll):
2362         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Only update if
2363         there are animations that care.
2364         (WebCore::AnimationController::wantsScrollUpdates): Helper to expose this
2365         value to FrameView.
2366         * page/animation/AnimationController.h:
2367         * page/animation/AnimationControllerPrivate.h:
2368         (WebCore::AnimationControllerPrivate::wantsScrollUpdates):
2369
2370 2015-04-24  Tim Horton  <timothy_horton@apple.com>
2371
2372         WKPDFView does not support password-protected PDFs
2373         https://bugs.webkit.org/show_bug.cgi?id=144162
2374         <rdar://problem/18411512>
2375
2376         Reviewed by Andy Estes.
2377
2378         * English.lproj/Localizable.strings:
2379         Add some localizable strings.
2380
2381 2015-04-24  David Kilzer  <ddkilzer@apple.com>
2382
2383         Fix iOS EWS builds after updating to iOS 8.3 SDK
2384
2385         * platform/spi/cocoa/CoreTextSPI.h:
2386         * rendering/RenderThemeIOS.mm:
2387         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2388         - Update __IPHONE_OS_VERSION_MIN_REQUIRED for these constants.
2389
2390 2015-04-24  Jer Noble  <jer.noble@apple.com>
2391
2392         Unreviewed iOS build fix; add declarations to AVKitSPI.h
2393
2394         * platform/spi/cocoa/AVKitSPI.h:
2395
2396 2015-04-24  Enrica Casucci  <enrica@apple.com>
2397
2398         Make rangeExpandedAroundPositionByCharacters to all platforms.
2399         https://bugs.webkit.org/show_bug.cgi?id=144161
2400
2401         Reviewed by Tim Horton.
2402
2403         No change in functionality, simply making this available
2404         to all platforms.
2405
2406         * editing/VisibleUnits.cpp:
2407         (WebCore::rangeExpandedAroundPositionByCharacters):
2408         * editing/VisibleUnits.h:
2409         * editing/mac/DataDetection.mm:
2410         * editing/mac/DictionaryLookup.h:
2411         * editing/mac/DictionaryLookup.mm:
2412         (WebCore::rangeExpandedAroundPositionByCharacters): Deleted.
2413
2414 2015-04-24  Andreas Kling  <akling@apple.com>
2415
2416         Purge PassRefPtr from NamedNodeMap.
2417         <https://webkit.org/b/144091>
2418
2419         Reviewed by Antti Koivisto.
2420
2421         Use RefPtr instead of PassRefPtr in NamedNodeMap.
2422
2423         * dom/NamedNodeMap.cpp:
2424         (WebCore::NamedNodeMap::getNamedItem):
2425         (WebCore::NamedNodeMap::getNamedItemNS):
2426         (WebCore::NamedNodeMap::removeNamedItem):
2427         (WebCore::NamedNodeMap::removeNamedItemNS):
2428         (WebCore::NamedNodeMap::setNamedItem):
2429         (WebCore::NamedNodeMap::setNamedItemNS):
2430         (WebCore::NamedNodeMap::item):
2431         * dom/NamedNodeMap.h:
2432
2433 2015-04-24  Commit Queue  <commit-queue@webkit.org>
2434
2435         Unreviewed, rolling out r183266.
2436         https://bugs.webkit.org/show_bug.cgi?id=144164
2437
2438         Broke 32-bit build and a test. (Requested by ap on #webkit).
2439
2440         Reverted changeset:
2441
2442         "AX: richer text change notifications (142719)"
2443         https://bugs.webkit.org/show_bug.cgi?id=142719
2444         http://trac.webkit.org/changeset/183266
2445
2446 2015-04-24  Brady Eidson  <beidson@apple.com>
2447
2448         Origin header is preserved on cross-origin redirects.
2449         https://bugs.webkit.org/show_bug.cgi?id=144157.
2450
2451         Reviewed by Sam Weinig.
2452
2453         Tests: http/tests/security/cors-post-redirect-301.html
2454                http/tests/security/cors-post-redirect-302.html
2455                http/tests/security/cors-post-redirect-307.html
2456                http/tests/security/cors-post-redirect-308.html
2457
2458         * platform/network/cf/ResourceHandleCFNet.cpp:
2459         (WebCore::ResourceHandle::willSendRequest): Always clear any origin header for cross-origin redirects.
2460         * platform/network/mac/ResourceHandleMac.mm:
2461         (WebCore::ResourceHandle::willSendRequest): Ditto.
2462
2463 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
2464
2465         Immediate action not functional for embedded PDFs
2466         https://bugs.webkit.org/show_bug.cgi?id=143952
2467         <rdar://problem/19842365>        
2468
2469         Reviewed by Tim Horton.
2470
2471         Add a dictionary lookup method to allow us to retrieve
2472         relevant information for PDFs.
2473
2474         * editing/mac/DictionaryLookup.mm:
2475         (WebCore::dictionaryLookupForPDFSelection): Updated to properly handle cases
2476         where the Lookup engine selects a smaller range than the initial automatic
2477         selection performed on clicking.
2478
2479 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
2480
2481         Make it possible to map a secondary quad through TransformState
2482         https://bugs.webkit.org/show_bug.cgi?id=144156
2483
2484         Reviewed by Dean Jackson.
2485
2486         A future patch will need to map two quads simultaneously through TransformState,
2487         so add the ability to provide an optional secondary quad.
2488         
2489         This patch also firms up the setQuad() contract, fixing webkit.org/b/106680,
2490         requiring the state to be flattened when setting the quad (and now, the secondary quad).
2491         Previously, setQuad implicitly flattened but failed to update m_mapPoint when
2492         doing so.
2493
2494         * platform/graphics/ca/GraphicsLayerCA.cpp:
2495         (WebCore::GraphicsLayerCA::computeVisibleRect): Now we have to explicitly flatten
2496         before setting the quad.
2497         * platform/graphics/ca/GraphicsLayerCA.h: Drive-up #include removal.
2498         * platform/graphics/transforms/TransformState.cpp:
2499         (WebCore::TransformState::operator=): Copy the secondary quad if we have one.
2500         (WebCore::TransformState::translateMappedCoordinates): Move the secondary quad
2501         if we have one.
2502         (WebCore::TransformState::mappedQuad): Code factored into mapQuad().
2503         (WebCore::TransformState::mappedSecondaryQuad): Return the secondary quad mapped
2504         into the state's current coordinate space.
2505         (WebCore::TransformState::mapQuad): Factored code.
2506         * platform/graphics/transforms/TransformState.h:
2507         (WebCore::TransformState::setQuad): Make the contract more explicit with assertions.
2508         (WebCore::TransformState::setSecondaryQuad): Ditto when setting the secondary quad.
2509         (WebCore::TransformState::lastPlanarSecondaryQuad):
2510         (WebCore::TransformState::lastPlanarQuad): Deleted.
2511
2512 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2513
2514         [iOS] Reimplement r182512 and r183153 in a cleaner way
2515         https://bugs.webkit.org/show_bug.cgi?id=144151
2516
2517         Reviewed by Enrica Casucci.
2518
2519         On iOS, we create FontPlatformData's ctFont() by round tripping it through a CGFontRef.
2520         This causes the resultant ctFont() to lose system-font-ness. Patches r182512 and r183153
2521         react to this fact by making users of a FontPlatformData use the original font passed in
2522         to the FontPlatformData instead of the FontPlatformData's ctFont(), but only if we
2523         detect that the FontPlatformData represents a system font (the underlying APIs have
2524         different behavior for system fonts and non-system-fonts).
2525
2526         However, on OS X, we create a FontPlatformData's ctFont() directly from the original
2527         font passed in to the constructor. This preserves system-font-ness (because it no
2528         longer has the CGFontRef in the middle of the transformation). Therefore, OS X has the
2529         correct behavior regarding system fonts.
2530
2531         The difference between the two ctFont() creation codepaths seems to be historical
2532         rather than intentional. Rather than change all the call sites of ctFont() to use a
2533         different platform font object if a system font is detected, a cleaner solution is to
2534         simply unify the two ctFont() creation codepaths to the version which preserves system-
2535         font-ness. Doing this will make all users of FontPlatformData automatically have the
2536         correct behavior with no updates.
2537
2538         This patch reverts the relevant parts of r182512 and r183153 in favor of this new
2539         solution.
2540
2541         No new tests because there is no behavior change.
2542
2543         * platform/graphics/FontPlatformData.h:
2544         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
2545         * platform/graphics/cocoa/FontCocoa.mm:
2546         (WebCore::Font::platformWidthForGlyph):
2547         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2548         (WebCore::FontPlatformData::ctFontSize):
2549         (WebCore::FontPlatformData::ctFont):
2550         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2551         (WebCore::Font::getCFStringAttributes):
2552
2553 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2554
2555         Unreviewed build fix.
2556
2557         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2558         (WebCore::FontPlatformData::FontPlatformData):
2559
2560 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
2561
2562         [Cocoa] Start cleaning up FontPlatformData
2563         https://bugs.webkit.org/show_bug.cgi?id=144133
2564
2565         Reviewed by Enrica Casucci.
2566
2567         This is the start of a crusade to ultimately remove one of the CTFontRefs which we have inside
2568         FontPlatformData. This patch starts this effort out by removing the FontPlatformData
2569         constructor which accepts an NSFont. This constructor simply casts the NSFont to a CTFontRef,
2570         and forwards to another constructor. This patch moves this cast to callers of this constructor,
2571         thereby enumerating the places we have left that use NSFont with FontPlatformData.
2572
2573         This patch also cleans up two of the constructors in FontPlatformData.cpp to forward on to
2574         a common constructor.
2575
2576         This patch also collects places inside FontPlatformDataCocoa.mm where we check if a pointer is
2577         not 0 and not -1, and puts this common code inside a new function,
2578         FontPlatformData::isValidCTFontRef().
2579
2580         No new tests because there is no behavior change.
2581
2582         * platform/graphics/FontPlatformData.cpp:
2583         (WebCore::FontPlatformData::FontPlatformData): Coalesce constructors.
2584         * platform/graphics/FontPlatformData.h:
2585         (WebCore::FontPlatformData::isValidCTFontRef): Check if a pointer is not 0 and not -1.
2586         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
2587         * platform/graphics/cocoa/FontCocoa.mm:
2588         (WebCore::Font::platformCreateScaledFont): Receive cast which has been hoisted from the deleted
2589         FontPlatformData constructor.
2590         (WebCore::Font::compositeFontReferenceFont): Ditto.
2591         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2592         (WebCore::FontPlatformData::~FontPlatformData): Use isValidCTFontRef().
2593         (WebCore::FontPlatformData::platformDataInit): Ditto.
2594         (WebCore::FontPlatformData::platformDataAssign): Ditto.
2595         (WebCore::FontPlatformData::platformIsEqual): Simplify preprocessor macros.
2596         (WebCore::FontPlatformData::allowsLigatures): Remove unnecessary NSFont use.
2597         (WebCore::FontPlatformData::FontPlatformData): Deleted.
2598         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2599         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Remove unnecessary
2600         NSFont use.
2601         * platform/graphics/mac/FontCacheMac.mm:
2602         (WebCore::FontCache::systemFallbackForCharacters): Receive cast which has been hoisted from the
2603         deleted FontPlatformData constructor.
2604         (WebCore::FontCache::createFontPlatformData): Ditto.
2605         * platform/mac/DragImageMac.mm:
2606         (WebCore::fontFromNSFont): Ditto.
2607         (WebCore::widthWithFont): Ditto.
2608         (WebCore::drawAtPoint): Ditto.
2609
2610 2015-04-24  Doug Russell  <d_russell@apple.com>
2611
2612         AX: richer text change notifications (142719)
2613         https://bugs.webkit.org/show_bug.cgi?id=142719
2614
2615         Reviewed by Darin Adler.
2616
2617         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
2618
2619         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
2620
2621         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
2622                platform/mac/accessibility/selection-change-userinfo.html
2623                platform/mac/accessibility/value-change-userinfo.html
2624
2625         * CMakeLists.txt:
2626         * WebCore.vcxproj/WebCore.vcxproj:
2627         * WebCore.vcxproj/WebCore.vcxproj.filters:
2628         * WebCore.xcodeproj/project.pbxproj:
2629         * accessibility/AXObjectCache.cpp:
2630         (WebCore::AXObjectCache::AXObjectCache):
2631         (WebCore::AXObjectCache::notificationPostTimerFired):
2632         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
2633         (WebCore::AXObjectCache::showIntent):
2634         (WebCore::AXObjectCache::setTextSelectionIntent):
2635         (WebCore::isPasswordFieldOrContainedByPasswordField):
2636         (WebCore::AXObjectCache::postTextStateChangeNotification):
2637         (WebCore::AXObjectCache::postTextReplacementNotification):
2638         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
2639         (WebCore::AXObjectCache::rootWebArea):
2640         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
2641         * accessibility/AXObjectCache.h:
2642         (WebCore::AXObjectCache::postTextStateChangeNotification):
2643         (WebCore::AXObjectCache::postTextReplacementNotification):
2644         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2645         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2646         (WebCore::AXObjectCache::textChangeForEditType):
2647         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2648         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
2649         (WebCore::AXObjectCache::getOrCreate): Deleted.
2650         (WebCore::AXObjectCache::attachWrapper): Deleted.
2651         * accessibility/AXTextStateChangeIntent.h: Added.
2652         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
2653         * accessibility/AccessibilityNodeObject.cpp:
2654         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
2655         * accessibility/AccessibilityNodeObject.h:
2656         * accessibility/AccessibilityObject.cpp:
2657         (WebCore::AccessibilityObject::isContainedByPasswordField):
2658         * accessibility/AccessibilityObject.h:
2659         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
2660         (WebCore::AccessibilityObject::isPasswordField): Deleted.
2661         * accessibility/AccessibilityRenderObject.cpp:
2662         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
2663         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2664         * accessibility/AccessibilityScrollView.h:
2665         * accessibility/atk/AXObjectCacheAtk.cpp:
2666         (WebCore::AXObjectCache::textChangeForEditType):
2667         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2668         (WebCore::AXObjectCache::postPlatformNotification): Deleted.
2669         * accessibility/ios/AXObjectCacheIOS.mm:
2670         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2671         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2672         * accessibility/mac/AXObjectCacheMac.mm:
2673         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
2674         (WebCore::AXPostNotificationWithUserInfo):
2675         (WebCore::AXObjectCache::postPlatformNotification):
2676         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2677         (WebCore::textReplacementChangeDictionary):
2678         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
2679         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2680         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2681         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
2682         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
2683         (arrayRemovingNonJSONTypes):
2684         (dictionaryRemovingNonJSONTypes):
2685         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
2686         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
2687         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2688         (textMarkerRangeFromVisiblePositions):
2689         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
2690         * editing/AppendNodeCommand.cpp:
2691         (WebCore::AppendNodeCommand::AppendNodeCommand):
2692         (WebCore::sendAXTextChangedIgnoringLineBreaks):
2693         (WebCore::AppendNodeCommand::doApply):
2694         (WebCore::AppendNodeCommand::doUnapply):
2695         * editing/AppendNodeCommand.h:
2696         (WebCore::AppendNodeCommand::create):
2697         * editing/ApplyStyleCommand.cpp:
2698         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
2699         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
2700         * editing/ApplyStyleCommand.h:
2701         * editing/CompositeEditCommand.cpp:
2702         (WebCore::EditCommandComposition::unapplyEditType):
2703         (WebCore::CompositeEditCommand::CompositeEditCommand):
2704         (WebCore::CompositeEditCommand::apply):
2705         (WebCore::CompositeEditCommand::insertParagraphSeparator):
2706         (WebCore::CompositeEditCommand::insertNodeBefore):
2707         (WebCore::CompositeEditCommand::appendNode):
2708         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
2709         (WebCore::CompositeEditCommand::insertTextIntoNode):
2710         (WebCore::CompositeEditCommand::deleteTextFromNode):
2711         (WebCore::CompositeEditCommand::replaceTextInNode):
2712         (WebCore::CompositeEditCommand::moveParagraphs):
2713         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
2714         (WebCore::CompositeEditCommand::applyStyle): Deleted.
2715         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
2716         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
2717         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
2718         (WebCore::CompositeEditCommand::inputText): Deleted.
2719         * editing/CompositeEditCommand.h:
2720         * editing/DeleteFromTextNodeCommand.cpp:
2721         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
2722         (WebCore::DeleteFromTextNodeCommand::doApply):
2723         (WebCore::DeleteFromTextNodeCommand::doUnapply):
2724         * editing/DeleteFromTextNodeCommand.h:
2725         (WebCore::DeleteFromTextNodeCommand::create):
2726         (WebCore::DeleteFromTextNodeCommand::deletedText):
2727         * editing/DeleteSelectionCommand.cpp:
2728         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
2729         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
2730         * editing/DeleteSelectionCommand.h:
2731         (WebCore::DeleteSelectionCommand::create):
2732         * editing/DictationCommand.cpp:
2733         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
2734         (WebCore::DictationCommand::insertParagraphSeparator):
2735         * editing/EditAction.h:
2736         * editing/EditCommand.cpp:
2737         (WebCore::EditCommand::EditCommand):
2738         (WebCore::EditCommand::editingAction):
2739         (WebCore::EditCommand::applyEditType):
2740         (WebCore::EditCommand::unapplyEditType):
2741         (WebCore::SimpleEditCommand::SimpleEditCommand):
2742         (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
2743         (WebCore::EditCommand::setParent): Deleted.
2744         * editing/EditCommand.h:
2745         * editing/EditingAllInOne.cpp:
2746         * editing/Editor.cpp:
2747         (WebCore::Editor::handleTextEvent):
2748         (WebCore::Editor::deleteSelectionWithSmartDelete):
2749         (WebCore::Editor::replaceSelectionWithFragment):
2750         (WebCore::Editor::replaceSelectionWithText):
2751         (WebCore::Editor::appliedEditing):
2752         (WebCore::Editor::unappliedEditing):
2753         (WebCore::Editor::performCutOrCopy):
2754         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2755         (WebCore::Editor::changeBackToReplacedString):
2756         (WebCore::Editor::transpose):
2757         (WebCore::Editor::changeSelectionAfterCommand):
2758         * editing/Editor.h:
2759         * editing/EditorCommand.cpp:
2760         (WebCore::executeInsertFragment):
2761         * editing/FrameSelection.cpp:
2762         (WebCore::FrameSelection::moveTo):
2763         (WebCore::FrameSelection::moveWithoutValidationTo):
2764         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
2765         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
2766         (WebCore::FrameSelection::setSelection):
2767         (WebCore::FrameSelection::updateAndRevealSelection):
2768         (WebCore::isBoundary):
2769         (WebCore::FrameSelection::textSelectionIntent):
2770         (WebCore::FrameSelection::modify):
2771         (WebCore::FrameSelection::selectAll):
2772         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
2773         (WebCore::FrameSelection::modifyMovingBackward): Deleted.
2774         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
2775         (WebCore::FrameSelection::selectionAtWordStart): Deleted.
2776         * editing/FrameSelection.h:
2777         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2778         (WebCore::FrameSelection::selection): Deleted.
2779         * editing/InsertIntoTextNodeCommand.cpp:
2780         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
2781         (WebCore::InsertIntoTextNodeCommand::doApply):
2782         (WebCore::InsertIntoTextNodeCommand::doUnapply):
2783         * editing/InsertIntoTextNodeCommand.h:
2784         (WebCore::InsertIntoTextNodeCommand::create):
2785         (WebCore::InsertIntoTextNodeCommand::insertedText):
2786         * editing/InsertNodeBeforeCommand.cpp:
2787         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
2788         (WebCore::InsertNodeBeforeCommand::doApply):
2789         (WebCore::InsertNodeBeforeCommand::doUnapply):
2790         * editing/InsertNodeBeforeCommand.h:
2791         (WebCore::InsertNodeBeforeCommand::create):
2792         * editing/InsertParagraphSeparatorCommand.cpp:
2793         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
2794         * editing/InsertParagraphSeparatorCommand.h:
2795         (WebCore::InsertParagraphSeparatorCommand::create):
2796         * editing/InsertTextCommand.cpp:
2797         (WebCore::InsertTextCommand::InsertTextCommand):
2798         * editing/InsertTextCommand.h:
2799         (WebCore::InsertTextCommand::create):
2800         (WebCore::InsertTextCommand::createWithMarkerSupplier):
2801         * editing/MoveSelectionCommand.cpp:
2802         (WebCore::MoveSelectionCommand::doApply):
2803         * editing/RemoveNodePreservingChildrenCommand.cpp:
2804         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
2805         * editing/RemoveNodePreservingChildrenCommand.h:
2806         (WebCore::RemoveNodePreservingChildrenCommand::create):
2807         * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
2808         (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
2809         (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
2810         * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
2811         * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
2812         (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
2813         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
2814         * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
2815         * editing/ReplaceSelectionCommand.cpp:
2816         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
2817         (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
2818         (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
2819         * editing/ReplaceSelectionCommand.h:
2820         (WebCore::ReplaceSelectionCommand::create):
2821         * editing/TypingCommand.cpp:
2822         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
2823         (WebCore::TypingCommand::insertParagraphSeparator):
2824         * editing/atk/FrameSelectionAtk.cpp:
2825         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2826         * editing/ios/DictationCommandIOS.cpp:
2827         (WebCore::DictationCommandIOS::DictationCommandIOS):
2828         * editing/ios/DictationCommandIOS.h:
2829         * editing/mac/FrameSelectionMac.mm:
2830         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
2831         * html/HTMLTextFormControlElement.cpp:
2832         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
2833         * page/DragController.cpp:
2834         (WebCore::DragController::concludeEditDrag):
2835         * page/EventHandler.cpp:
2836         (WebCore::setInitialKeyboardSelection):
2837         * page/FocusController.cpp:
2838         (WebCore::FocusController::advanceFocusInDocumentOrder):
2839
2840 2015-04-24  Darin Adler  <darin@apple.com>
2841
2842         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
2843         https://bugs.webkit.org/show_bug.cgi?id=128007
2844
2845         Reviewed by Anders Carlsson.
2846
2847         * PlatformEfl.cmake: Removed OwnPtrCairo source files.
2848         * PlatformGTK.cmake: Ditto.
2849         * PlatformWinCairo.cmake: Ditto.
2850         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2851         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2852
2853         * platform/CrossThreadCopier.cpp: Removed OwnPtr specialization.
2854         * platform/CrossThreadCopier.h: Ditto.
2855
2856         * platform/ScrollAnimatorNone.cpp: Removed unneeded include.
2857         * platform/ThreadGlobalData.cpp: Ditto.
2858         * platform/ThreadGlobalData.h: Ditto.
2859         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Ditto.
2860
2861         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2862         (WebCore::AVFWrapper::processNotification): Use unique_ptr.
2863         (WebCore::AVFWrapper::notificationCallback): Use make_unique.
2864         (WebCore::AVFWrapper::platformLayer): Ditto.
2865
2866         * platform/graphics/cairo/CairoUtilities.cpp:
2867         (WebCore::appendPathToCairoContext): Use cairo_path_destroy directly
2868         instead of a smart pointer; the code path is simple enough that it is
2869         clear this way.
2870
2871         * platform/graphics/cairo/ImageBufferCairo.cpp:
2872         (WebCore::ImageBuffer::ImageBuffer): Use make_unique.
2873         * platform/graphics/cairo/ImageBufferDataCairo.h: Use unique_ptr.
2874
2875         * platform/graphics/cairo/OwnPtrCairo.cpp: Removed.
2876         * platform/graphics/cairo/OwnPtrCairo.h: Removed.
2877
2878         * platform/graphics/cairo/PathCairo.cpp:
2879         (WebCore::Path::Path): Use cairo_path_destroy directly instead of a
2880         smart pointer; the code path is simple enough that it is clear this way.
2881         (WebCore::Path::operator=): Ditto.
2882         (WebCore::Path::addPath): Ditto.
2883         (WebCore::Path::apply): Ditto.
2884         * platform/graphics/cairo/PlatformContextCairo.cpp:
2885         (WebCore::PlatformContextCairo::clipForPatternFilling): Ditto.
2886
2887         * platform/graphics/freetype/FontCacheFreeType.cpp: Removed unneeded include.
2888         * platform/graphics/glx/GLContextGLX.cpp: Ditto.
2889
2890         * platform/graphics/surfaces/egl/EGLSurface.cpp:
2891         (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Use make_unique.
2892
2893         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
2894         (WebCore::GLXConfigSelector::findMatchingConfig): Use unique_ptr with X11Deleter.
2895         (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
2896         * platform/graphics/surfaces/glx/GLXSurface.cpp:
2897         (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
2898         (WebCore::GLXOffScreenSurface::initialize): Ditto.
2899
2900         * platform/graphics/surfaces/glx/OwnPtrX11.h: Removed.
2901
2902         * platform/graphics/surfaces/glx/X11Helper.cpp:
2903         (WebCore::X11Helper::createOffScreenWindow): Use unique_ptr with X11Deleter.
2904         (WebCore::X11Helper::createPixmap): Ditto.
2905
2906         * platform/graphics/surfaces/glx/X11Helper.h: Added X11Deleter,
2907         which can be used with unique_ptr to make it call XFree instead of delete.
2908
2909         * platform/graphics/win/FullScreenController.cpp: Use unique_ptr.
2910         (FullScreenController::FullScreenController): Use make_unique.
2911         (FullScreenController::enterFullScreen): Ditto.
2912         * platform/graphics/win/FullScreenController.h: Use unique_ptr.
2913
2914         * platform/graphics/win/GraphicsContext3DWin.cpp: Removed unneeded includes.
2915
2916         * platform/graphics/win/WKCAImageQueue.cpp:
2917         (WebCore::WKCAImageQueue::WKCAImageQueue): Use make_unique.
2918         * platform/graphics/win/WKCAImageQueue.h: Use unique_ptr.
2919
2920         * platform/network/NetworkStorageSessionStub.cpp: Removed unneeded include.
2921
2922         * platform/network/ResourceHandleInternal.h: Use unique_ptr.
2923
2924         * platform/network/curl/MultipartHandle.cpp:
2925         (WebCore::MultipartHandle::create): Deleted.
2926         * platform/network/curl/MultipartHandle.h: Deleted the create function.
2927
2928         * platform/network/curl/ResourceHandleManager.cpp:
2929         (WebCore::headerCallback): Use make_unique.
2930
2931 2015-04-24  Per Arne Vollan  <peavo@outlook.com>
2932
2933         [Win] Popup menu is not accessible.
2934         https://bugs.webkit.org/show_bug.cgi?id=141704
2935
2936         Reviewed by Brent Fulgham.
2937
2938         Get accessibility information for items in popup menus.
2939
2940         * platform/win/PopupMenuWin.cpp:
2941         (WebCore::PopupMenuWin::onGetObject):
2942         (WebCore::PopupMenuWin::wndProc):
2943         (WebCore::AccessiblePopupMenu::AccessiblePopupMenu):
2944         (WebCore::AccessiblePopupMenu::~AccessiblePopupMenu):
2945         (WebCore::AccessiblePopupMenu::QueryInterface):
2946         (WebCore::AccessiblePopupMenu::AddRef):
2947         (WebCore::AccessiblePopupMenu::Release):
2948         (WebCore::AccessiblePopupMenu::GetTypeInfoCount):
2949         (WebCore::AccessiblePopupMenu::GetTypeInfo):
2950         (WebCore::AccessiblePopupMenu::GetIDsOfNames):
2951         (WebCore::AccessiblePopupMenu::Invoke):
2952         (WebCore::AccessiblePopupMenu::get_accParent):
2953         (WebCore::AccessiblePopupMenu::get_accChildCount):
2954         (WebCore::AccessiblePopupMenu::get_accChild):
2955         (WebCore::AccessiblePopupMenu::get_accName):
2956         (WebCore::AccessiblePopupMenu::get_accValue):
2957         (WebCore::AccessiblePopupMenu::get_accDescription):
2958         (WebCore::AccessiblePopupMenu::get_accRole):
2959         (WebCore::AccessiblePopupMenu::get_accState):
2960         (WebCore::AccessiblePopupMenu::get_accHelp):
2961         (WebCore::AccessiblePopupMenu::get_accKeyboardShortcut):
2962         (WebCore::AccessiblePopupMenu::get_accFocus):
2963         (WebCore::AccessiblePopupMenu::get_accSelection):
2964         (WebCore::AccessiblePopupMenu::get_accDefaultAction):
2965         (WebCore::AccessiblePopupMenu::accSelect):
2966         (WebCore::AccessiblePopupMenu::accLocation):
2967         (WebCore::AccessiblePopupMenu::accNavigate):
2968         (WebCore::AccessiblePopupMenu::accHitTest):
2969         (WebCore::AccessiblePopupMenu::accDoDefaultAction):
2970         (WebCore::AccessiblePopupMenu::put_accName):
2971         (WebCore::AccessiblePopupMenu::put_accValue):
2972         (WebCore::AccessiblePopupMenu::get_accHelpTopic):
2973         * platform/win/PopupMenuWin.h:
2974         * platform/win/ScrollbarThemeWin.h:
2975         (WebCore::ScrollbarThemeWin::hasButtons): Deleted.
2976
2977 2015-04-23  Antti Koivisto  <antti@apple.com>
2978
2979         Memory cache live resources repeatedly purged during painting
2980         https://bugs.webkit.org/show_bug.cgi?id=144104
2981         <rdar://problem/20667695>
2982
2983         Reviewed by Chris Dumez.
2984
2985         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
2986         This slows down page loads significantly.
2987
2988         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
2989
2990         With this path we do all regular cache pruning asynchronously. If memory is really critical
2991         the low memory handling code will still prune synchronously.
2992
2993         * loader/cache/CachedResource.cpp:
2994         (WebCore::CachedResource::removeClient):
2995         (WebCore::CachedResource::didAccessDecodedData):
2996
2997             prune() -> pruneSoon()
2998
2999         * loader/cache/MemoryCache.cpp:
3000
3001             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
3002
3003         (WebCore::MemoryCache::needsPruning):
3004
3005             Factor into a function.
3006
3007         (WebCore::MemoryCache::prune):
3008         (WebCore::MemoryCache::pruneSoon):
3009
3010             Prune asynchronously.
3011
3012         * loader/cache/MemoryCache.h:
3013
3014 2015-04-24  Antti Koivisto  <antti@apple.com>
3015
3016         Unreviewed, rolling out r183259.
3017
3018         Wrong ChangeLog.
3019
3020         Reverted changeset:
3021
3022         "Memory cache live resources repeatedly purged during
3023         painting"
3024         https://bugs.webkit.org/show_bug.cgi?id=144104
3025         http://trac.webkit.org/changeset/183259
3026
3027 2015-04-24  Antti Koivisto  <antti@apple.com>
3028
3029         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
3030         https://bugs.webkit.org/show_bug.cgi?id=144050
3031
3032         Reviewed by Chris Dumez.
3033
3034         We are seeing null Element pointer crashes with this stack:
3035
3036         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
3037         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
3038         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
3039
3040         The most likely cause seems to be that this code
3041
3042             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
3043             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
3044
3045         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with null entry in
3046         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
3047         could happen. The related code is fragile with lot of state (especially in ScriptElement class)
3048         and involves many opportunities for re-entry via scripts.
3049
3050         No repro, no test case.
3051
3052         * dom/ScriptRunner.cpp:
3053         (WebCore::ScriptRunner::timerFired):
3054
3055             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
3056             but this also covers possibility this is caused by something else.
3057
3058 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3059
3060         [SOUP] Use a webkit subdirectory for the disk cache
3061         https://bugs.webkit.org/show_bug.cgi?id=144048
3062
3063         Reviewed by Martin Robinson.
3064
3065         Add a static method to SoupNetworkSession to clear a soup cache
3066         given its directory.
3067
3068         * platform/network/soup/SoupNetworkSession.cpp:
3069         (WebCore::strIsNumeric):
3070         (WebCore::SoupNetworkSession::clearCache):
3071         * platform/network/soup/SoupNetworkSession.h:
3072
3073 2015-04-23  Andy Estes  <aestes@apple.com>
3074
3075         Fix the iOS build after r183234.
3076
3077         * platform/ios/LegacyTileCache.mm:
3078         (WebCore::LegacyTileCache::commitScaleChange):
3079
3080 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3081
3082         Fix Windows build.
3083
3084         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3085         (PlatformCALayerWin::setBackingStoreAttached):
3086         (PlatformCALayerWin::backingStoreAttached):
3087         * platform/graphics/ca/win/PlatformCALayerWin.h:
3088
3089 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3090
3091         Make it possible to detach GraphicsLayerCA backing store
3092         https://bugs.webkit.org/show_bug.cgi?id=144140
3093
3094         Reviewed by Tim Horton.
3095
3096         This changes makes it possible to denote a GraphicsLayerCA's backing store
3097         as "attached" or not. When not attached, the backing store is made volatile
3098         and can be purged. This will be used in a future patch.
3099
3100         * platform/graphics/ca/GraphicsLayerCA.h: Add updateBackingStoreAttachment().
3101         * platform/graphics/ca/PlatformCALayer.h:
3102         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3103         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Stubs. In future, we could
3104         remove backing store on Mac and iOS WK1 too.
3105         (PlatformCALayerMac::setBackingStoreAttached):
3106         (PlatformCALayerMac::backingStoreAttached):
3107
3108 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3109
3110         Remove "layer" from GraphicsLayerCA member function names
3111         https://bugs.webkit.org/show_bug.cgi?id=144139
3112
3113         Reviewed by Myles Maxfield.
3114
3115         Rename "updateLayer*" to "update*" in GraphicsLayerCA.
3116
3117         * platform/graphics/ca/GraphicsLayerCA.cpp:
3118         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3119         (WebCore::GraphicsLayerCA::updateNames):
3120         (WebCore::GraphicsLayerCA::updateDrawsContent):
3121         (WebCore::GraphicsLayerCA::updateLayerNames): Deleted.
3122         (WebCore::GraphicsLayerCA::updateLayerDrawsContent): Deleted.
3123         * platform/graphics/ca/GraphicsLayerCA.h:
3124
3125 2015-04-23  Dan Bernstein  <mitz@apple.com>
3126
3127         <rdar://problem/20663758> Fix the build after AVPlayerViewController API change
3128
3129         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3130         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Don’t pass a nil completion
3131         handler to -[AVPlayerViewController exitFullScreenAnimated:completionHandler:].
3132
3133 2015-04-23  Darin Adler  <darin@apple.com>
3134
3135         Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
3136         https://bugs.webkit.org/show_bug.cgi?id=144090
3137
3138         Reviewed by Anders Carlsson.
3139
3140         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Removed unneeded include.
3141
3142         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed include of
3143         RefCountedSupplement.h.
3144
3145         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3146         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
3147         Pass data using rvalue references, and use new/delete to pass it across
3148         threads, rather than using PassOwnPtr.
3149         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: Pass data
3150         in an rvalue reference instead of PassOwnPtr.
3151         * Modules/websockets/WebSocket.cpp:
3152         (WebCore::WebSocket::didReceiveBinaryData): Take an rvalue reference
3153         instead of a PassOwnPtr.
3154         * Modules/websockets/WebSocket.h: Ditto.
3155         * Modules/websockets/WebSocketChannel.cpp: Ditto.
3156         (WebCore::WebSocketChannel::processFrame): Ditto.
3157         * Modules/websockets/WebSocketChannelClient.h:
3158         (WebCore::WebSocketChannelClient::didReceiveBinaryData): Ditto.
3159         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3160         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
3161         Ditto.
3162         * Modules/websockets/WorkerThreadableWebSocketChannel.h: Ditto.
3163
3164         * WebCore.xcodeproj/project.pbxproj: Removed RefCountedSupplement.h.
3165
3166         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3167         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Fixed comment
3168         to not mention adoptPtr.
3169
3170         * page/make_settings.pl:
3171         (generateInternalSettingsHeaderFile): Removed include of RefCountedSupplement.h.
3172
3173         * platform/ColorChooserClient.h: Removed unneded include.
3174         * platform/ContextMenuItem.h: Ditto.
3175
3176         * platform/RefCountedSupplement.h: Removed.
3177
3178         * platform/ScrollAnimator.cpp: Removed unneeded include.
3179         * platform/ScrollAnimatorNone.h: Ditto.
3180
3181         * platform/ThreadGlobalData.cpp: Added now-needed include of PassOwnPtr.h.
3182
3183         * platform/graphics/GlyphMetricsMap.h: Ditto.
3184         * platform/graphics/MediaPlayer.h: Ditto.
3185         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Ditto.
3186         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Ditto.
3187         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto.
3188         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Ditto.
3189         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: Ditto.
3190         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Ditto.
3191         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: Ditto.
3192
3193         * platform/graphics/cg/ImageBufferCG.cpp:
3194         (WebCore::ImageBuffer::ImageBuffer): Use make_unique instead of adoptPtr.
3195         * platform/graphics/cg/ImageBufferDataCG.cpp:
3196         (WebCore::ImageBufferData::getData): Return a RefPtr instead of a PassRefPtr.
3197         * platform/graphics/cg/ImageBufferDataCG.h: Streamlined the header a bit,
3198         use unique_ptr instead of OwnPtr and RefPtr instead of PassRefPtr.
3199
3200         * platform/graphics/cocoa/IOSurface.h: Use unique_ptr instead of OwnPtr.
3201         * platform/graphics/cocoa/IOSurface.mm:
3202         (IOSurface::ensureGraphicsContext): Use make_unique instead of adoptPtr.
3203
3204         * platform/graphics/egl/GLContextEGL.cpp: Removed unneeded includes.
3205         * platform/graphics/filters/FilterOperation.h: Ditto.
3206         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Ditto.
3207         * platform/ios/DeviceMotionClientIOS.h: Ditto.
3208         * platform/ios/DeviceOrientationClientIOS.h: Ditto.
3209
3210         * platform/ios/LegacyTileCache.h: Use unique_ptr instead of OwnPtr.
3211         * platform/ios/LegacyTileCache.mm:
3212         (WebCore::LegacyTileCache::LegacyTileCache): Use make_unique instead of
3213         a create function, and also get rid of unneeded initialization to null.
3214         (WebCore::LegacyTileCache::commitScaleChange): Ditto.
3215
3216         * platform/ios/LegacyTileGrid.h: Made constructor public and got rid of create
3217         function. Made constructor take a reference to the tile cache, and make both
3218         tileCache() and m_tileCache be references too.
3219
3220         * platform/ios/LegacyTileGrid.mm:
3221         (WebCore::LegacyTileGrid::LegacyTileGrid): Updated to use reference.
3222         (WebCore::LegacyTileGrid::visibleRect): Ditto.
3223         (WebCore::LegacyTileGrid::tileByteSize) Ditto.:
3224         (WebCore::LegacyTileGrid::dropDistantTiles): Ditto.
3225         (WebCore::LegacyTileGrid::updateTileOpacity): Ditto.
3226         (WebCore::LegacyTileGrid::updateTileBorderVisibility): Ditto.
3227         (WebCore::LegacyTileGrid::updateHostLayerSize): Ditto.
3228         (WebCore::LegacyTileGrid::invalidateTiles): Ditto.
3229         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage): Ditto.
3230         (WebCore::LegacyTileGrid::tileDistance2): Ditto.
3231         (WebCore::LegacyTileGrid::createTiles): Ditto.
3232         * platform/ios/LegacyTileGridTile.mm:
3233         (WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
3234         (WebCore::LegacyTileGridTile::invalidateRect): Ditto.
3235         (WebCore::LegacyTileGridTile::showBorder): Ditto.
3236         * platform/ios/LegacyTileLayer.mm:
3237         (-[LegacyTileHostLayer renderInContext:]): Ditto.
3238         (-[LegacyTileLayer layoutSublayers]): Ditto.
3239         (-[LegacyTileLayer drawInContext:]): Ditto.
3240
3241         * platform/ios/LegacyTileLayerPool.h: Removed unneeded include.
3242         * platform/ios/ScrollAnimatorIOS.mm: Ditto.
3243         * platform/mac/ScrollAnimatorMac.mm: Ditto.
3244         * platform/mac/WebVideoFullscreenController.h: Ditto.
3245         * platform/network/BlobData.cpp: Ditto.
3246
3247         * platform/network/ResourceHandle.cpp:
3248         (WebCore::ResourceHandle::ResourceHandle): Use make_unique instead of adoptPtr.
3249         * platform/network/ResourceHandle.h: Use unique_ptr instead of OwnPtr.
3250
3251         * platform/network/ResourceHandleInternal.h: Added now-needed include.
3252
3253         * platform/network/ResourceResponseBase.h: Removed unneeded includes and
3254         tweaked formatting a bit.
3255
3256         * platform/network/SynchronousLoaderClient.h: Removed the create function and
3257         the private constructor. Used data member initialize to make the default
3258         empty constructor automatically get generated (and be public now).
3259
3260         * platform/network/cf/FormDataStreamCFNet.cpp:
3261         (WebCore::formFinishFinalizationOnMainThread): Use delete instead of adoptPtr
3262         to delete the context argument.
3263
3264         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3265         (WebCore::defaultNetworkStorageSession): Return a unique_ptr& instead of an OwnPtr&.
3266         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use make_unique
3267         instead of adoptPtr.
3268         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
3269
3270         * platform/network/cf/ResourceHandleCFNet.cpp:
3271         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Use a
3272         SynchronousLoaderClient on the stack instead of putting one on the heap with adoptPtr.
3273         * platform/network/mac/ResourceHandleMac.mm:
3274         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
3275
3276         * platform/text/TextCodec.h: Removed unneeded include.
3277         * platform/win/CursorWin.cpp: Ditto.
3278
3279         * rendering/RenderLayer.cpp:
3280         (WebCore::RenderLayer::calculateClipRects): Use move instead of release since
3281         we are using RefPtr&& instead of PassRefPtr.
3282
3283         * rendering/RenderLayerFilterInfo.cpp:
3284         (WebCore::RenderLayer::FilterInfo::setRenderer): Use RefPtr&& instead of PassRefPtr.
3285         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Streamlined to use
3286         modern for loops and auto.
3287         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): Ditto.
3288
3289         * rendering/RenderLayerFilterInfo.h: Streamlined code and removed some stuff that
3290         I think is unneeded on iOS; there is no unused private field and I suspect the problem
3291         that led to the warning is gone. Deleted friending of deleteOwnedPtr.
3292
3293         * rendering/RenderLayerMaskImageInfo.cpp: Removed unneeded includes. Moved private
3294         client classes in here from the header and made them members of MaskImageInfo.
3295         Streamlined them a bit in other ways.
3296         (WebCore::RenderLayer::MaskImageInfo::getIfExists): Use nullptr.
3297         (WebCore::RenderLayer::MaskImageInfo::MaskImageInfo): Use member initialization
3298         and also pass the layer in rather than the MaskImageInfo.
3299         (WebCore::RenderLayer::MaskImageInfo::notifyFinished): Deleted. Moved the code
3300         into the SVGDocumentClient.
3301         (WebCore::RenderLayer::MaskImageInfo::imageChanged): Deleted. Moved the code into
3302         the ImageClient.
3303         (WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients): Streamlined a bit
3304         to use a for loop.
3305         (WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients): Ditto.
3306
3307         * rendering/RenderLayerMaskImageInfo.h: Reduced unneeded includes. Got rid of
3308         definitions of private member classes here in the header; they can be in the cpp
3309         file instead. Also cut down from three classes to two, and gave the classes less
3310         redundant names since they are already members of MaskImageInfo. Removed some
3311         unneeded functions and friending of deleteOwnedPtr.
3312
3313         * testing/InternalSettings.cpp: Got rid of comment about RefCountedSupplement
3314         since no code anywhere was using it, so not using it here was not remarkable.
3315
3316 2015-04-23  Jer Noble  <jer.noble@apple.com>
3317
3318         [iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds:
3319         https://bugs.webkit.org/show_bug.cgi?id=144129
3320
3321         Reviewed by Simon Fraser.
3322
3323         When passing the hosted AVPlayerLayer to the fullscreen controller, the new superlayer will
3324         resize the hosted layer with a call to -setBounds:. But because this is a hosted layer, the
3325         bonuds change has no effect. Instead, wrap the CALayerHost in another CALayer whose job it is
3326         to intercept -setBounds: in the same way that WebAVVideoLayer did. In fact, we should just use
3327         that wrapper class inside WebAVVideoLayer as well, to avoid duplicating code.
3328
3329         Drive-by Fix: Null-check m_videoElement in setVideoLayerFrame().
3330
3331         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3332         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3333         (-[WebCALayerHostWrapper setVideoSublayer:]):
3334         (-[WebCALayerHostWrapper videoSublayer]):
3335         (-[WebCALayerHostWrapper setBounds:]): Moved from WebAVVideoLayer.
3336         (-[WebCALayerHostWrapper resolveBounds]): Ditto.
3337         (-[WebAVVideoLayer setBounds:]): Moved to WebCALayerHostWrapper.
3338         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Create the wrapper.
3339         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Clear the wrapper.
3340         (-[WebAVVideoLayer resolveBounds]): Deleted. Moved to WebCALayerHostWrapper.
3341         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3342         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Null-check m_videoElement.
3343
3344 2015-04-23  Tim Horton  <timothy_horton@apple.com>
3345
3346         Yellow highlight has gray background color when invoking Lookup on an address in a Google Maps drop down
3347         https://bugs.webkit.org/show_bug.cgi?id=138737
3348         <rdar://problem/18904429>
3349
3350         Reviewed by Simon Fraser.
3351
3352         * rendering/RenderReplaced.cpp:
3353         (WebCore::RenderReplaced::paint):
3354         Other RenderObjects don't paint box decorations in the selection painting phase,
3355         so RenderReplaced probably shouldn't either. This fixes the case where, when doing
3356         selection-only painting of a bit of text over top of a RenderReplaced, the RenderReplaced
3357         would paint its background, filling the previously transparent bitmap with an unwanted color.
3358
3359 2015-04-23  Roger Fong  <roger_fong@apple.com>
3360
3361         Update media timeline controls when video is paused..
3362         https://bugs.webkit.org/show_bug.cgi?id=144122.
3363         <rdar://problem/20422927>
3364
3365         Reviewed by Dean Jackson.
3366
3367         * Modules/mediacontrols/mediaControlsApple.js:
3368         (Controller.prototype.drawTimelineBackground): Use timelineWidth because offsetWidth is 0 when display: none.
3369         (Controller.prototype.setPlaying): Show controls when pausing.
3370         (Controller.prototype.showControls): Update time and timeline when unhiding controls.
3371
3372 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3373
3374         Changing TiledBacking velocity should schedule a tile revalidation
3375         https://bugs.webkit.org/show_bug.cgi?id=144123
3376
3377         Reviewed by Tim Horton.
3378
3379         Changing the velocity parameters on the TileController affect the computed
3380         coverage rect, so whenever we make a change to velocity data that could
3381         affect the outcome (basically any non-zero old or new velocities),
3382         schedule a layer flush.
3383
3384         * platform/graphics/TiledBacking.h:
3385         (WebCore::VelocityData::velocityOrScaleIsChanging):
3386         * platform/graphics/ca/TileController.cpp:
3387         (WebCore::TileController::setVelocity):
3388
3389 2015-04-23  Jer Noble  <jer.noble@apple.com>
3390
3391         [Mac] Disable QTKit by default on future OS X.
3392         https://bugs.webkit.org/show_bug.cgi?id=144082
3393
3394         Reviewed by Darin Adler.
3395
3396         Settings::gQTKitEnabled defaults to false.
3397
3398         * page/Settings.cpp:
3399
3400 2015-04-23  Daniel Bates  <dabates@apple.com>
3401
3402         Clean up: Use references instead of pointers in more SVG files
3403         https://bugs.webkit.org/show_bug.cgi?id=144045
3404
3405         Reviewed by Darin Adler.
3406
3407         * rendering/svg/SVGRootInlineBox.cpp:
3408         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.
3409
3410         * rendering/svg/SVGTextLayoutEngine.cpp:
3411         (WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
3412         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
3413         (WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
3414         reference and made it const since this function does not modify textBox.
3415         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
3416         Also, removed comma from comment so that it reads well.
3417         * rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.
3418
3419         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
3420         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
3421         Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
3422         Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
3423         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
3424         pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
3425         cannot point to a non-existent object).
3426         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
3427         removed runtime assertion that style is non-null.
3428         * rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.
3429
3430 2015-04-23  Commit Queue  <commit-queue@webkit.org>
3431
3432         Unreviewed, rolling out r183194.
3433         https://bugs.webkit.org/show_bug.cgi?id=144121
3434
3435         Made multiple tests flaky (Requested by ap_ on #webkit).
3436
3437         Reverted changeset:
3438
3439         "Memory cache live resources repeatedly purged during
3440         painting"
3441         https://bugs.webkit.org/show_bug.cgi?id=144104
3442         http://trac.webkit.org/changeset/183194
3443
3444 2015-04-23  Roger Fong  <roger_fong@apple.com>
3445
3446         Unreviewed. Missed a button in r182900.
3447
3448         * Modules/mediacontrols/mediaControlsApple.css:
3449         (audio::-webkit-media-controls-wireless-playback-picker-button:active):
3450
3451 2015-04-23  Roger Fong  <roger_fong@apple.com>
3452
3453         Unreviewed. Just shift some CSS around for code cleanup purposes.
3454
3455         * Modules/mediacontrols/mediaControlsApple.css:
3456         (video::-webkit-media-controls-panel):
3457         (video::-webkit-media-controls-panel:hover):
3458
3459 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
3460
3461         [iOS] WebKit services should inherit environment variables for home
3462         https://bugs.webkit.org/show_bug.cgi?id=144078
3463         rdar://problem/20571678
3464
3465         Reviewed by Dan Bernstein.
3466
3467         Added an SPI header for a drive-by fix.
3468
3469         * WebCore.xcodeproj/project.pbxproj:
3470         * platform/spi/cf/CFBundleSPI.h: Added.
3471
3472 2015-04-23  Alex Christensen  <achristensen@webkit.org>
3473
3474         Use less memory when compiling content extensions.
3475         https://bugs.webkit.org/show_bug.cgi?id=144051
3476
3477         Reviewed by Darin Adler and Benjamin Poulain.
3478
3479         No change in functionality, correctness already covered by existing tests.
3480
3481         Before this patch, a DFANode contained a HashSet of transitions.
3482         Large vectors of DFANodes made many small HashSets, which was inefficient use of memory.
3483         We now put all the actions and transitions into one big compact Vector and each node owns ranges in that vector.
3484
3485         * contentextensions/CombinedURLFilters.cpp:
3486         (WebCore::ContentExtensions::recursiveMemoryUsed):
3487         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
3488         * contentextensions/CombinedURLFilters.h:
3489         * contentextensions/ContentExtensionCompiler.cpp:
3490         (WebCore::ContentExtensions::compileRuleList):
3491         * contentextensions/ContentExtensionsDebugging.h:
3492         * contentextensions/DFA.cpp:
3493         (WebCore::ContentExtensions::DFA::memoryUsed):
3494         (WebCore::ContentExtensions::DFANode::actions):
3495         (WebCore::ContentExtensions::DFANode::transitions):
3496         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
3497         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
3498         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
3499         (WebCore::ContentExtensions::DFANode::containsTransition):
3500         (WebCore::ContentExtensions::DFANode::kill):
3501         (WebCore::ContentExtensions::DFA::minimize):
3502         (WebCore::ContentExtensions::DFA::DFA): Deleted.
3503         (WebCore::ContentExtensions::DFA::operator=): Deleted.
3504         * contentextensions/DFA.h:
3505         * contentextensions/DFABytecodeCompiler.cpp:
3506         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3507         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
3508         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
3509         * contentextensions/DFABytecodeCompiler.h:
3510         * contentextensions/DFAMinimizer.cpp:
3511         (WebCore::ContentExtensions::DFAMinimizer::minimize):
3512         * contentextensions/DFAMinimizer.h:
3513         * contentextensions/DFANode.h:
3514         (WebCore::ContentExtensions::DFANode::isKilled):
3515         (WebCore::ContentExtensions::DFANode::hasFallbackTransition):
3516         (WebCore::ContentExtensions::DFANode::hasActions):
3517         (WebCore::ContentExtensions::DFANode::transitionsLength):
3518         (WebCore::ContentExtensions::DFANode::actionsLength):
3519         (WebCore::ContentExtensions::DFANode::actionsStart):
3520         (WebCore::ContentExtensions::DFANode::setActions):
3521         (WebCore::ContentExtensions::DFANode::setTransitions):
3522         (WebCore::ContentExtensions::DFANode::resetTransitions):
3523         (WebCore::ContentExtensions::DFANode::transitionsStart):
3524         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA):
3525         * contentextensions/NFA.cpp:
3526         (WebCore::ContentExtensions::NFA::memoryUsed):
3527         * contentextensions/NFA.h:
3528         * contentextensions/NFAToDFA.cpp:
3529         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
3530         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
3531         (WebCore::ContentExtensions::getOrCreateDFANode):
3532         (WebCore::ContentExtensions::NFAToDFA::convert):
3533
3534 2015-04-23  David Hyatt  <hyatt@apple.com>
3535
3536         Don't fire a bunch of mouse moveds during scrolling.
3537         https://bugs.webkit.org/show_bug.cgi?id=99940
3538
3539         Reviewed by Simon Fraser.
3540
3541         * page/EventHandler.cpp:
3542         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
3543         Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
3544         complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.
3545
3546 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
3547
3548         Unreviewed, fix the release build.
3549
3550         * html/HTMLMediaSession.cpp:
3551         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Add an UNUSED_PARAM.
3552
3553 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3554
3555         Remove m_isPageTiledBackingLayer data member from GraphicsLayerCA, just use the layer type instead
3556         https://bugs.webkit.org/show_bug.cgi?id=144108
3557
3558         Reviewed by Dean Jackson.
3559
3560         No need for the m_isPageTiledBackingLayer data member. We can just check the layer
3561         type instead.
3562
3563         * platform/graphics/ca/GraphicsLayerCA.cpp:
3564         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3565         (WebCore::GraphicsLayerCA::initialize):
3566         (WebCore::GraphicsLayerCA::platformCALayerShowRepaintCounter):
3567         (WebCore::GraphicsLayerCA::updateContentsScale):
3568         (WebCore::GraphicsLayerCA::getDebugBorderInfo):
3569         (WebCore::GraphicsLayerCA::requiresTiledLayer):
3570         * platform/graphics/ca/GraphicsLayerCA.h:
3571         (WebCore::GraphicsLayerCA::isPageTiledBackingLayer):
3572
3573 2015-04-23  Brady Eidson  <beidson@apple.com>
3574
3575         Content extension with oft-repeated rules can cause slowdown.
3576         rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010
3577
3578         Reviewed by Alex Christensen.
3579
3580         No new tests (Behavior covered by existing tests).
3581
3582         * WebCore.xcodeproj/project.pbxproj:
3583
3584         * contentextensions/ContentExtension.cpp:
3585         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
3586
3587         Add the String identifier for the extension and the rule action ID to Actions:
3588         * contentextensions/ContentExtensionRule.cpp:
3589         (WebCore::ContentExtensions::Action::deserialize):
3590         * contentextensions/ContentExtensionRule.h:
3591         (WebCore::ContentExtensions::Action::Action):
3592         (WebCore::ContentExtensions::Action::operator==):
3593         (WebCore::ContentExtensions::Action::setExtensionIdentifier):
3594         (WebCore::ContentExtensions::Action::extensionIdentifier):
3595         (WebCore::ContentExtensions::Action::actionID):
3596         (WebCore::ContentExtensions::Action::type): Deleted.
3597
3598         Object to manage a CSSStyleSheet and selectors identified by ID:
3599         * contentextensions/ContentExtensionStyleSheet.cpp:
3600         (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
3601         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
3602         * contentextensions/ContentExtensionStyleSheet.h:
3603         (WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
3604         (WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):
3605
3606         Instead of globbing selectors together into a String and making a new stylesheet,
3607         add new unique selectors to an already existing sheet:
3608         * contentextensions/ContentExtensionsBackend.cpp:
3609         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3610         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
3611         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
3612
3613         * dom/DocumentStyleSheetCollection.cpp:
3614         (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
3615         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
3616         * dom/DocumentStyleSheetCollection.h:
3617
3618         * loader/DocumentLoader.cpp:
3619         (WebCore::DocumentLoader::commitData):
3620         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
3621         (WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
3622         * loader/DocumentLoader.h:
3623
3624 2015-04-23  Antti Koivisto  <antti@apple.com>
3625
3626         Memory cache live resources repeatedly purged during painting
3627         https://bugs.webkit.org/show_bug.cgi?id=144104
3628         <rdar://problem/20667695>
3629
3630         Reviewed by Chris Dumez.
3631
3632         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
3633         This slows down page loads significantly.
3634
3635         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
3636
3637         With this path we do all regular cache pruning asynchronously. If memory is really critical
3638         the low memory handling code will still prune synchronously.
3639
3640         * loader/cache/CachedResource.cpp:
3641         (WebCore::CachedResource::removeClient):
3642         (WebCore::CachedResource::didAccessDecodedData):
3643
3644             prune() -> pruneSoon()
3645
3646         * loader/cache/MemoryCache.cpp:
3647
3648             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
3649
3650         (WebCore::MemoryCache::needsPruning):
3651
3652             Factor into a function.
3653
3654         (WebCore::MemoryCache::prune):
3655         (WebCore::MemoryCache::pruneSoon):
3656
3657             Prune asynchronously.
3658
3659         * loader/cache/MemoryCache.h:
3660
3661 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
3662
3663         Unreviewed, make a suggested change I overlooked in Darin's review of
3664         https://bugs.webkit.org/show_bug.cgi?id=144098
3665
3666         * dom/Document.cpp:
3667         (WebCore::Document::removePlaybackTargetPickerClient): const auto& -> auto
3668         (WebCore::Document::showPlaybackTargetPicker): Ditto.
3669         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
3670         (WebCore::Document::playbackTargetAvailabilityDidChange): Ditto.
3671         (WebCore::Document::setPlaybackTarget): Ditto.
3672         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
3673
3674 2015-04-23  Joonghun Park  <jh718.park@samsung.com>
3675
3676         Use std::unique_ptr instead of OwnPtr in ThreadGlobalData
3677         https://bugs.webkit.org/show_bug.cgi?id=141950
3678
3679         Reviewed by Darin Adler.
3680
3681         No new tests, no behavior changes.
3682
3683         * dom/EventNames.h:
3684         (WebCore::EventNames::create):
3685         * loader/cache/CachedResourceRequestInitiators.h:
3686         * platform/ThreadGlobalData.cpp:
3687         (WebCore::ThreadGlobalData::ThreadGlobalData):
3688         (WebCore::ThreadGlobalData::destroy):
3689         * platform/ThreadGlobalData.h:
3690
3691 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
3692
3693         Some media tests assert after r183096
3694         https://bugs.webkit.org/show_bug.cgi?id=144098
3695
3696         Reviewed by Darin Adler.
3697
3698         * dom/Document.cpp:
3699         (WebCore::Document::removePlaybackTargetPickerClient): Don't assert if the client has already
3700             been removed from the map. This happens when a media element is removed from the document
3701             before its destructor runs and is not an error.
3702         (WebCore::Document::showPlaybackTargetPicker): It is an error to call this after the client 
3703             has been removed from the map so leave the assert in a debug build, but return early
3704             so a release build doesn't crash.
3705         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
3706         (WebCore::Document::playbackTargetAvailabilityDidChange): Use "auto" for the map iterator variable.
3707         (WebCore::Document::setPlaybackTarget): Ditto.
3708         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
3709         * dom/Document.h: Fix map typedef names.
3710
3711 2015-04-23  Andreas Kling  <akling@apple.com>
3712
3713         DOM nodes should be allocated with fastMalloc().
3714
3715         Unreviewed. This got lost in the TreeShared merge. :|
3716
3717         * dom/Node.h:
3718
3719 2015-04-23  Chris Dumez  <cdumez@apple.com>
3720
3721         [WK2] WebDiagnosticLoggingClient is leaking
3722         https://bugs.webkit.org/show_bug.cgi?id=144089
3723         <rdar://problem/19706214>
3724
3725         Reviewed by Darin Adler.
3726
3727         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
3728         constructor but there is no code destroying it.
3729
3730         This patch adds a new xxxDestroyed() virtual function to
3731         DiagnosticLoggingClient and that is overriden in
3732         WebDiagnosticLoggingClient to call "delete this". This is the same
3733         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
3734         WebProgressTrackerClient).
3735
3736         * loader/EmptyClients.h:
3737         * page/DiagnosticLoggingClient.h:
3738         * page/MainFrame.cpp:
3739         (WebCore::MainFrame::~MainFrame):
3740
3741 2015-04-22  Antti Koivisto  <antti@apple.com>
3742
3743         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
3744         https://bugs.webkit.org/show_bug.cgi?id=144050
3745         rdar://problem/15534973
3746
3747         Reviewed by Chris Dumez.
3748
3749         We are seeing null Element pointer crashes with this stack:
3750
3751         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
3752         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
3753         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
3754
3755         The most likely cause seems to be that this code
3756
3757             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
3758             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
3759
3760         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with a null entry in
3761         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
3762         could happen. The related code is fragile with lot of state (in ScriptElement class)
3763         and involves many opportunities for re-entry via scripts.
3764
3765         No repro, no test case.
3766
3767         * dom/ScriptRunner.cpp:
3768         (WebCore::ScriptRunner::timerFired):
3769
3770             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
3771             but this also covers possibility this is caused by something else.
3772
3773 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
3774
3775         Use a typedef for TileGrid tile validation policy flags
3776         https://bugs.webkit.org/show_bug.cgi?id=144085
3777
3778         Reviewed by Tim Horton.
3779
3780         Replace 'unsigned' with a typedef for the bitmask of TileValidationPolicyFlags.
3781
3782         * platform/graphics/ca/TileController.cpp:
3783         (WebCore::TileController::tileRevalidationTimerFired):
3784         * platform/graphics/ca/TileGrid.cpp:
3785         (WebCore::TileGrid::revalidateTiles):
3786         * platform/graphics/ca/TileGrid.h:
3787
3788 2015-04-23  Andreas Kling  <akling@apple.com>
3789
3790         Slap Node's reference counting functions with ALWAYS_INLINE stick.
3791
3792         Speculative fix for weird ~3% regression on Speedometer seen after TreeShared
3793         was merged into Node. Since the memory layout didn't change, failure to inline
3794         seems like a possible source of regression.
3795
3796         * dom/Node.h:
3797         (WebCore::Node::ref):
3798         (WebCore::Node::deref):
3799         (WebCore::Node::hasOneRef):
3800         (WebCore::Node::refCount):
3801
3802 2015-04-22  Simon Fraser  <simon.fraser@apple.com>
3803
3804         [iOS] Move computeCoverageRect code from FrameView into TileController
3805         https://bugs.webkit.org/show_bug.cgi?id=144087
3806
3807         Reviewed by Benjamin Poulain.
3808         
3809         There is code in four different places that adjusts tiling coverage rect:
3810         1. LegacyTileCache. This will remain unchanged.
3811         2. FrameView::computeTileCoverageRect(). This was added to do velocity-based
3812         page tiled coverage expansion for iOS WK2.
3813         3. TileController::computeTileCoverageRect(): this is used for the page tiles
3814         on Mac.
3815         4. GraphicsLayerCA::adjustTiledLayerVisibleRect(). This is used by non-page
3816         tiled layers on both iOS and Mac.
3817         
3818         This patch reduced this list to 3, coalescing FrameView::computeTileCoverageRect()
3819         and TileController::computeTileCoverageRect(). It removes the rect inflation that
3820         affects the visibleRect passed into rootLayer->flushCompositingState() for iOS,
3821         but the page tiles now do an identical coverage inflation. The visible rect
3822         change does affect visible rect computations for non-page tiled backings, but
3823         a future patch will restore that.
3824
3825         * page/FrameView.cpp:
3826         (WebCore::FrameView::setScrollVelocity):
3827         (WebCore::FrameView::computeCoverageRect): Deleted.
3828         * page/FrameView.h:
3829         * platform/graphics/TiledBacking.h:
3830         (WebCore::VelocityData::VelocityData):
3831         * platform/graphics/ca/TileController.cpp:
3832         (WebCore::TileController::setVelocity):
3833         (WebCore::TileController::computeTileCoverageRect):
3834         * platform/graphics/ca/TileController.h:
3835         * rendering/RenderLayerCompositor.cpp:
3836         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
3837
3838 2015-04-22  Darin Adler  <darin@apple.com>
3839
3840         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
3841         https://bugs.webkit.org/show_bug.cgi?id=143943
3842
3843         Reviewed by Anders Carlsson.
3844
3845         * editing/Editor.cpp:
3846         (WebCore::Editor::insertDictationPhrases): Changed this iOS-only
3847         function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
3848         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
3849         function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
3850         it take a reference rather than a pointer to the element and simplify the code
3851         a bit using modern for loops and auto.
3852         * editing/Editor.h: Ditto.
3853
3854         * editing/ios/DictationCommandIOS.cpp:
3855         (WebCore::DictationCommandIOS::DictationCommandIOS): Take
3856         a Vector<Vector<String>>&& instead of a PassOwnPtr.
3857         (WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
3858         explicitly define this.
3859         (WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
3860         work with a Vector<Vector<String>> instead of an OwnPtr.
3861         * editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
3862         Also modernized a bit by using override.
3863
3864         * platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
3865         PassOwnPtr<ResourceRequest> from this iOS-specific function.
3866         * platform/network/ios/QuickLook.mm:
3867         (WebCore::registerQLPreviewConverterIfNeeded): Ditto.
3868
3869 2015-04-22  Jinwoo Song  <jinwoo7.song@samsung.com>
3870
3871         Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
3872         https://bugs.webkit.org/show_bug.cgi?id=144033
3873
3874         Reviewed by Darin Adler.
3875
3876         Use unique_ptr for creating a copy of cairo_path_t and use lambda function
3877         for custom deleter, cairo_path_destroy().
3878
3879         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3880         (WebCore::drawPathShadow): Use std::unique_ptr instead of OwnPtr.
3881         (WebCore::GraphicsContext::clip): Call cairo_path_destroy() immediately.
3882         * platform/graphics/cairo/OwnPtrCairo.cpp:
3883         (WTF::deleteOwnedPtr<cairo_path_t>): Deleted. Remove unnecessary deleter anymore.
3884         * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
3885
3886 2015-04-22  Darin Adler  <darin@apple.com>
3887
3888         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
3889         https://bugs.webkit.org/show_bug.cgi?id=143949
3890
3891         Reviewed by Andreas Kling.
3892
3893         * dom/ContainerNode.h: Removed unneeded includes and forward declarations.
3894         * dom/Document.h: Ditto.
3895
3896         * dom/DocumentParser.h: Fixed comment to not mention PassOwnPtr.
3897
3898         * html/shadow/MediaControlElements.cpp:
3899         (WebCore::MediaControlTextTrackContainerElement::create): Return a Ref instead of a PassRefPtr.
3900         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Pass a reference
3901         rather than a pointer to TextTrackRepresentation::create.
3902         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Return a
3903         RefPtr instead of a PassRefPtr.
3904
3905         * html/shadow/MediaControlElements.h: Use unique_ptr for m_textTrackRepresentation.
3906         Also fix a couple uses of PassRefPtr.
3907
3908         * loader/DocumentLoader.cpp:
3909         (WebCore::DocumentLoader::DocumentLoader): Use make_unique.
3910         (WebCore::DocumentLoader::addAllArchiveResources): Ditto.
3911         (WebCore::DocumentLoader::addArchiveResource): Ditto.
3912         (WebCore::DocumentLoader::clearArchiveResources): Set to nullptr instead of calling clear.
3913         (WebCore::DocumentLoader::startLoadingMainResource): Use make_unique.
3914         * loader/DocumentLoader.h: Made m_archiveResourceCollection and
3915         m_applicationCacheHost use unique_ptr.
3916
3917         * loader/WorkerThreadableLoader.cpp:
3918         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Use delete here instead
3919         of using OwnPtr to do the deletion. Matches the other code nearby.
3920
3921         * loader/appcache/ApplicationCacheGroup.cpp:
3922         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Handle case where the host is
3923         null; this happens during the DocumentLoader destruction process since unique_ptr sets itself
3924         to null before it destroys the object it points to and OwnPtr does not.
3925
3926         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3927         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Use delete instead of adoptPtr
3928         to delete a raw pointer.
3929         (WebCore::DiskCacheMonitor::DiskCacheMonitor): Use unique_ptr instead of OwnPtr.
3930
3931         * page/DragController.h: Removed some unneeded forward declarations and changed the
3932         create function to return unique_ptr.
3933
3934         * platform/LayoutUnit.h: Removed wtf_ceil workaround hack here. Not sure why we ever did it
3935         this way!
3936
3937         * platform/graphics/FontCascade.cpp: