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