Scrollbars and ScrollAnimators must always have a ScrollableArea
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
2
3         Scrollbars and ScrollAnimators must always have a ScrollableArea
4         https://bugs.webkit.org/show_bug.cgi?id=141855
5
6         Reviewed by Simon Fraser.
7
8         No change in functionality.
9         
10         Change users of the scrollAnimator() method to expect a reference instead of a pointer. Also get rid of
11         a number of unnecessary nullptr checks.
12
13         * accessibility/AccessibilityScrollbar.cpp:
14         (WebCore::AccessibilityScrollbar::setValue):
15         * css/SelectorCheckerTestFunctions.h:
16         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
17         * page/FrameView.cpp:
18         (WebCore::FrameView::createScrollbar):
19         (WebCore::FrameView::setFixedVisibleContentRect):
20         * page/scrolling/ScrollingCoordinator.cpp:
21         (WebCore::ScrollingCoordinator::handleWheelEventPhase):
22         * platform/PopupMenuClient.h:
23         * platform/ScrollAnimator.cpp:
24         (WebCore::ScrollAnimator::ScrollAnimator):
25         (WebCore::ScrollAnimator::scroll):
26         (WebCore::ScrollAnimator::handleWheelEvent):
27         (WebCore::ScrollAnimator::notifyPositionChanged):
28         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers):
29         * platform/ScrollAnimator.h:
30         (WebCore::ScrollAnimator::ScrollAnimator::scrollableArea):
31         * platform/ScrollAnimatorNone.cpp:
32         * platform/ScrollAnimatorNone.h:
33         * platform/ScrollView.cpp:
34         (WebCore::ScrollView::createScrollbar):
35         * platform/ScrollableArea.cpp:
36         (WebCore::ScrollableArea::scrollAnimator):
37         (WebCore::ScrollableArea::scroll):
38         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
39         (WebCore::ScrollableArea::notifyScrollPositionChanged):
40         (WebCore::ScrollableArea::scrollPositionChanged):
41         (WebCore::ScrollableArea::handleWheelEvent):
42         (WebCore::ScrollableArea::handleTouchEvent):
43         (WebCore::ScrollableArea::mouseEnteredScrollbar):
44         (WebCore::ScrollableArea::mouseExitedScrollbar):
45         (WebCore::ScrollableArea::didAddScrollbar):
46         (WebCore::ScrollableArea::willRemoveScrollbar):
47         (WebCore::ScrollableArea::verticalScrollbarLayerDidChange):
48         (WebCore::ScrollableArea::horizontalScrollbarLayerDidChange):
49         * platform/ScrollableArea.h:
50         * platform/Scrollbar.cpp:
51         (WebCore::Scrollbar::createNativeScrollbar):
52         (WebCore::Scrollbar::Scrollbar):
53         (WebCore::Scrollbar::scrollbarOverlayStyle):
54         (WebCore::Scrollbar::isScrollableAreaActive):
55         (WebCore::Scrollbar::offsetDidChange):
56         (WebCore::Scrollbar::autoscrollPressedPart):
57         (WebCore::Scrollbar::moveThumb):
58         (WebCore::Scrollbar::mouseMoved):
59         (WebCore::Scrollbar::mouseEntered):
60         (WebCore::Scrollbar::mouseExited):
61         (WebCore::Scrollbar::mouseUp):
62         (WebCore::Scrollbar::shouldParticipateInHitTesting):
63         (WebCore::Scrollbar::isWindowActive):
64         (WebCore::Scrollbar::invalidateRect):
65         (WebCore::Scrollbar::convertToContainingView):
66         (WebCore::Scrollbar::convertFromContainingView):
67         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
68         * platform/Scrollbar.h:
69         (WebCore::Scrollbar::scrollableArea):
70         (WebCore::Scrollbar::disconnectFromScrollableArea): Deleted.
71         * platform/ios/ScrollAnimatorIOS.mm:
72         (WebCore::ScrollAnimatorIOS::handleTouchEvent):
73         (WebCore::ScrollAnimatorIOS::determineScrollableAreaForTouchSequence):
74         * platform/mac/ScrollAnimatorMac.h:
75         * platform/mac/ScrollAnimatorMac.mm:
76         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
77         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
78         (-[WebScrollbarPainterDelegate scrollAnimator]):
79         (-[WebScrollbarPainterDelegate layer]):
80         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
81         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
82         (WebCore::ScrollAnimator::create):
83         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
84         (WebCore::ScrollAnimatorMac::scroll):
85         (WebCore::ScrollAnimatorMac::adjustScrollPositionIfNecessary):
86         (WebCore::ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary):
87         (WebCore::ScrollAnimatorMac::immediateScrollTo):
88         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
89         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
90         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
91         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
92         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
93         (WebCore::ScrollAnimatorMac::pinnedInDirection):
94         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture):
95         (WebCore::ScrollAnimatorMac::allowsVerticalStretching):
96         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching):
97         (WebCore::ScrollAnimatorMac::stretchAmount):
98         (WebCore::ScrollAnimatorMac::canScrollHorizontally):
99         (WebCore::ScrollAnimatorMac::canScrollVertically):
100         (WebCore::ScrollAnimatorMac::absoluteScrollPosition):
101         (WebCore::ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints):
102         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
103         (WebCore::ScrollAnimatorMac::setVisibleScrollerThumbRect):
104         * rendering/RenderLayer.cpp:
105         (WebCore::RenderLayer::RenderLayer):
106         (WebCore::RenderLayer::createScrollbar):
107         (WebCore::RenderLayer::destroyScrollbar):
108         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
109         * rendering/RenderListBox.cpp:
110         (WebCore::RenderListBox::createScrollbar):
111         (WebCore::RenderListBox::destroyScrollbar):
112         * rendering/RenderMenuList.cpp:
113         (RenderMenuList::createScrollbar):
114         * rendering/RenderMenuList.h:
115         * rendering/RenderScrollbar.cpp:
116         (WebCore::RenderScrollbar::createCustomScrollbar):
117         (WebCore::RenderScrollbar::RenderScrollbar):
118         * rendering/RenderScrollbar.h:
119         * rendering/RenderSearchField.cpp:
120         (WebCore::RenderSearchField::createScrollbar):
121         * rendering/RenderSearchField.h:
122
123 2015-02-20  Enrica Casucci  <enrica@apple.com>
124
125         [WK2] Add support for font panel on OS X.
126         https://bugs.webkit.org/show_bug.cgi?id=141777
127
128         Reviewed by Tim Horton.
129
130         This patch adds the necessary hooks to the Editor class to support
131         the font panel.
132
133         * editing/Editor.h:
134         * editing/mac/EditorMac.mm:
135         (WebCore::Editor::applyFontStyles):
136
137 2015-02-20  Zalan Bujtas  <zalan@apple.com>
138
139         Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
140         https://bugs.webkit.org/show_bug.cgi?id=141854
141
142         Reviewed by Ryosuke Niwa.
143
144         Inserting content before/after the body as the result of editing is a valid operation.
145         This assert was originally introduced to cover cases where edited content would get moved
146         out of body. However, asserting such operation properly is not possible atm.
147
148         Test: editing/inserting/insert-as-body-sibling.html
149
150         * editing/CompositeEditCommand.cpp:
151         (WebCore::CompositeEditCommand::insertNodeBefore):
152         (WebCore::CompositeEditCommand::insertNodeAfter):
153
154 2015-02-20  Chris Dumez  <cdumez@apple.com>
155
156         [WK2] Add more detailed diagnostic logging for measuring network cache efficacy
157         https://bugs.webkit.org/show_bug.cgi?id=141803
158         <rdar://problem/19632080>
159
160         Reviewed by Antti Koivisto.
161
162         Add more diagnostic logging keys for the network cache.
163
164         * page/DiagnosticLoggingKeys.cpp:
165         (WebCore::DiagnosticLoggingKeys::missingValidatorFieldsKey):
166         (WebCore::DiagnosticLoggingKeys::noLongerInCacheKey):
167         (WebCore::DiagnosticLoggingKeys::isReloadIgnoringCacheDataKey):
168         (WebCore::DiagnosticLoggingKeys::isAttachmentKey):
169         (WebCore::DiagnosticLoggingKeys::isConditionalRequestKey):
170         (WebCore::DiagnosticLoggingKeys::cacheControlNoStoreKey):
171         (WebCore::DiagnosticLoggingKeys::uncacheableStatusCodeKey):
172         (WebCore::DiagnosticLoggingKeys::unsupportedHTTPMethodKey):
173         (WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey):
174         (WebCore::DiagnosticLoggingKeys::varyingHeaderMismatchKey):
175         (WebCore::WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey):
176         (WebCore::DiagnosticLoggingKeys::notInCacheKey):
177         (WebCore::DiagnosticLoggingKeys::noLongerInCacheFailureKey): Deleted.
178         (WebCore::DiagnosticLoggingKeys::unhandledRequestFailureKey): Deleted.
179         (WebCore::DiagnosticLoggingKeys::unusableCachedEntryFailureKey): Deleted.
180         * page/DiagnosticLoggingKeys.h:
181
182 2015-02-20  Tim Horton  <timothy_horton@apple.com>
183
184         <attachment> turns the wrong blue when you highlight it
185         https://bugs.webkit.org/show_bug.cgi?id=141853
186
187         Reviewed by Simon Fraser.
188
189         * rendering/RenderAttachment.h:
190         * rendering/RenderReplaced.cpp:
191         (WebCore::RenderReplaced::shouldDrawSelectionTint):
192         (WebCore::RenderReplaced::paint):
193         * rendering/RenderReplaced.h:
194         Don't draw the selection tint for RenderAttachment.
195
196 2015-02-20  Tim Horton  <timothy_horton@apple.com>
197
198         Allow <attachment> elements to be focused
199         https://bugs.webkit.org/show_bug.cgi?id=141847
200
201         Reviewed by Enrica Casucci.
202
203         * css/html.css:
204         (attachment:focus):
205         Disable focus rings for <attachment>.
206
207         * html/HTMLAttachmentElement.cpp:
208         (WebCore::HTMLAttachmentElement::setFocus):
209         * html/HTMLAttachmentElement.h:
210         Allow HTMLAttachmentElement to get editing focus.
211         Let RenderAttachment know when focus changes.
212
213         * rendering/RenderAttachment.cpp:
214         (WebCore::RenderAttachment::paintReplaced):
215         Paint the background in cyan when we are inside the selection or have focus.
216         Otherwise, it will be gray.
217
218         (WebCore::RenderAttachment::focusChanged):
219         When focus changes, repaint.
220
221         * rendering/RenderAttachment.h:
222
223 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
224
225         Rename ScrollElasticityController to ScrollController
226         https://bugs.webkit.org/show_bug.cgi?id=141842
227
228         Reviewed by Simon Fraser.
229
230         No change in functionality.
231
232         * PlatformMac.cmake:
233         * WebCore.order:
234         * WebCore.xcodeproj/project.pbxproj:
235         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
236         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
237         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
238         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
239         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer):
240         * platform/mac/ScrollAnimatorMac.h:
241         * platform/mac/ScrollAnimatorMac.mm:
242         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
243         (WebCore::ScrollAnimatorMac::isRubberBandInProgress):
244         (WebCore::ScrollAnimatorMac::handleWheelEvent):
245         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
246         * platform/mac/ScrollController.h: Copied from WebCore/platform/mac/ScrollElasticityController.h.
247         (WebCore::ScrollControllerClient::~ScrollControllerClient):
248         (WebCore::ScrollElasticityControllerClient::~ScrollElasticityControllerClient): Deleted.
249         * platform/mac/ScrollController.mm: Copied from WebCore/platform/mac/ScrollElasticityController.mm.
250         (WebCore::ScrollController::ScrollController):
251         (WebCore::ScrollController::handleWheelEvent):
252         (WebCore::ScrollController::snapRubberBandTimerFired):
253         (WebCore::ScrollController::isRubberBandInProgress):
254         (WebCore::ScrollController::stopSnapRubberbandTimer):
255         (WebCore::ScrollController::snapRubberBand):
256         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection):
257         (WebCore::ScrollElasticityController::ScrollElasticityController): Deleted.
258         (WebCore::ScrollElasticityController::handleWheelEvent): Deleted.
259         (WebCore::ScrollElasticityController::snapRubberBandTimerFired): Deleted.
260         (WebCore::ScrollElasticityController::isRubberBandInProgress): Deleted.
261         (WebCore::ScrollElasticityController::stopSnapRubberbandTimer): Deleted.
262         (WebCore::ScrollElasticityController::snapRubberBand): Deleted.
263         (WebCore::ScrollElasticityController::shouldRubberBandInHorizontalDirection): Deleted.
264         * platform/mac/ScrollElasticityController.h: Removed.
265         * platform/mac/ScrollElasticityController.mm: Removed.
266
267 2015-02-20  Alexey Proskuryakov  <ap@apple.com>
268
269         Remove svn:keywords property.
270
271         As far as I can tell, the property had no effect on any of these files, but also,
272         when it has effect it's likely harmful.
273
274         * Modules/mediacontrols/assets-apple-iOS.svg: Removed property svn:keywords.
275         * Modules/mediacontrols/mediaControlsBase.css: Removed property svn:keywords.
276         * Modules/mediacontrols/mediaControlsBase.js: Removed property svn:keywords.
277         * bindings/js/JSDeviceMotionEventCustom.cpp: Removed property svn:keywords.
278         * css/CSSKeyframeRule.cpp: Removed property svn:keywords.
279         * css/CSSKeyframeRule.h: Removed property svn:keywords.
280         * css/CSSKeyframesRule.cpp: Removed property svn:keywords.
281         * css/CSSKeyframesRule.h: Removed property svn:keywords.
282         * css/WebKitCSSFilterValue.cpp: Removed property svn:keywords.
283         * css/WebKitCSSFilterValue.h: Removed property svn:keywords.
284         * css/plugIns.css: Removed property svn:keywords.
285         * dom/AnimationEvent.cpp: Removed property svn:keywords.
286         * dom/AnimationEvent.h: Removed property svn:keywords.
287         * dom/DeviceMotionClient.h: Removed property svn:keywords.
288         * dom/DeviceMotionController.cpp: Removed property svn:keywords.
289         * dom/DeviceMotionController.h: Removed property svn:keywords.
290         * dom/DeviceMotionData.cpp: Removed property svn:keywords.
291         * dom/DeviceMotionData.h: Removed property svn:keywords.
292         * dom/DeviceMotionEvent.cpp: Removed property svn:keywords.
293         * dom/DeviceMotionEvent.h: Removed property svn:keywords.
294         * html/canvas/ANGLEInstancedArrays.cpp: Removed property svn:keywords.
295         * html/canvas/ANGLEInstancedArrays.h: Removed property svn:keywords.
296         * html/canvas/OESTextureFloatLinear.cpp: Removed property svn:keywords.
297         * html/canvas/OESTextureFloatLinear.h: Removed property svn:keywords.
298         * html/canvas/OESTextureHalfFloatLinear.cpp: Removed property svn:keywords.
299         * html/canvas/OESTextureHalfFloatLinear.h: Removed property svn:keywords.
300         * html/shadow/MediaControlsApple.cpp: Removed property svn:keywords.
301         * html/shadow/MediaControlsApple.h: Removed property svn:keywords.
302         * page/Frame.h: Removed property svn:keywords.
303         * page/scrolling/ScrollingConstraints.cpp: Removed property svn:keywords.
304         * page/scrolling/ScrollingConstraints.h: Removed property svn:keywords.
305         * page/scrolling/ScrollingStateStickyNode.cpp: Removed property svn:keywords.
306         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed property svn:keywords.
307         * page/scrolling/mac/ScrollingTreeStickyNode.h: Removed property svn:keywords.
308         * platform/ControlStates.h: Removed property svn:keywords.
309         * platform/ScrollbarTheme.cpp: Removed property svn:keywords.
310         * platform/graphics/GraphicsLayerUpdater.cpp: Removed property svn:keywords.
311         * platform/graphics/GraphicsLayerUpdater.h: Removed property svn:keywords.
312         * platform/graphics/ca/TileController.h: Removed property svn:keywords.
313         * platform/graphics/ca/mac/WebTiledBackingLayer.h: Removed property svn:keywords.
314         * platform/graphics/filters/FilterOperation.cpp: Removed property svn:keywords.
315         * platform/graphics/filters/FilterOperation.h: Removed property svn:keywords.
316         * platform/graphics/filters/FilterOperations.h: Removed property svn:keywords.
317         * platform/ios/SystemMemory.h: Removed property svn:keywords.
318         * platform/mock/ScrollbarThemeMock.cpp: Removed property svn:keywords.
319         * platform/mock/ScrollbarThemeMock.h: Removed property svn:keywords.
320         * platform/spi/cocoa/ServersSPI.h: Removed property svn:keywords.
321         * platform/text/mac/ios-encodings.txt: Removed property svn:keywords.
322         * rendering/FilterEffectRenderer.cpp: Removed property svn:keywords.
323         * rendering/FilterEffectRenderer.h: Removed property svn:keywords.
324         * rendering/RenderGeometryMap.cpp: Removed property svn:keywords.
325         * rendering/RenderGeometryMap.h: Removed property svn:keywords.
326         * rendering/RenderMediaControlElements.h: Removed property svn:keywords.
327         * rendering/TextAutoSizing.cpp: Removed property svn:keywords.
328         * rendering/TextAutoSizing.h: Removed property svn:keywords.
329         * rendering/style/StylePendingImage.h: Removed property svn:keywords.
330
331 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
332
333         [Mac] REGRESSION: Scroll snap points broken after r180018
334         https://bugs.webkit.org/show_bug.cgi?id=141821
335         <rdar://problem/19898333>
336
337         Reviewed by Simon Fraser.
338
339         * page/EventHandler.cpp:
340         (WebCore::EventHandler::platformNotifySnapIfNecessary): Added stub.
341         (WebCore::EventHandler::handleWheelEvent): Call new 'platformNotifySnapIfNecessary' method
342         to catch the 'ended wheel' gesture.
343         * page/EventHandler.h:
344         * page/mac/EventHandlerMac.mm:
345         (WebCore::EventHandler::platformNotifySnapIfNecessary): Added. If the wheel event signifies
346         the end of a wheel/swipe gesture, let the snap logic decide if it should do anything
347         (i.e., trigger an animation)
348         * platform/ScrollAnimator.cpp:
349         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Added.
350         * platform/ScrollAnimator.h:
351
352 2015-02-20  Eric Carlson  <eric.carlson@apple.com>
353
354         [iOS] cleanup AirPlay code
355         https://bugs.webkit.org/show_bug.cgi?id=141811
356
357         Reviewed by Jer Noble.
358
359         * Configurations/FeatureDefines.xcconfig: IOS_AIRPLAY -> WIRELESS_PLAYBACK_TARGET.
360
361         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: Ditto.
362         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
363         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl:
364
365         * Modules/mediacontrols/MediaControlsHost.cpp:
366         (WebCore::MediaControlsHost::externalDeviceDisplayName): Ditto.
367         (WebCore::MediaControlsHost::externalDeviceType):
368
369         * dom/EventNames.h: Ditto.
370         * dom/EventNames.in:
371
372         * html/HTMLMediaElement.cpp:
373         (WebCore::HTMLMediaElement::HTMLMediaElement): Ditto.
374         (WebCore::HTMLMediaElement::~HTMLMediaElement): Ditto.
375         (WebCore::HTMLMediaElement::parseAttribute):
376         * html/HTMLMediaElement.h:
377         * html/HTMLMediaElement.idl:
378
379         * html/HTMLMediaSession.cpp:
380         (WebCore::restrictionName): Ditto.
381         (WebCore::HTMLMediaSession::applyMediaPlayerRestrictions): Ditto.
382         * html/HTMLMediaSession.h:
383
384         * html/HTMLVideoElement.cpp:
385         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
386         * html/HTMLVideoElement.h:
387         * html/HTMLVideoElement.idl:
388
389         * page/Settings.in: Ditto.
390
391         * platform/audio/MediaSessionManager.h:
392         * platform/audio/ios/MediaSessionManagerIOS.h:
393         * platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
394
395         * platform/graphics/MediaPlayer.cpp:
396         (WebCore::MediaPlayer::showPlaybackTargetPicker): Deleted.
397         (WebCore::MediaPlayer::hasWirelessPlaybackTargets): Deleted.
398         * platform/graphics/MediaPlayer.h:
399         * platform/graphics/MediaPlayerPrivate.h:
400         (WebCore::MediaPlayerPrivateInterface::showPlaybackTargetPicker): Deleted.
401         (WebCore::MediaPlayerPrivateInterface::hasWirelessPlaybackTargets): Deleted.
402         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
403         (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
404         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
405
406         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
407         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
409         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): IOS_AIRPLAY -> WIRELESS_PLAYBACK_TARGET.
410         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Ditto.
411         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Ditto.
412         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): Ditto.
413         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Ditto.
414
415 2015-02-20  Dhi Aurrahman  <diorahman@rockybars.com>
416
417         Language ranges containing asterisks must be quoted as strings
418         https://bugs.webkit.org/show_bug.cgi?id=141659
419
420         Reviewed by Benjamin Poulain.
421
422         As specified in [1], the language ranges containing asterisks must be quoted as strings.
423
424         [1] http://dev.w3.org/csswg/selectors-4/#the-lang-pseudo.
425
426         * css/CSSGrammar.y.in:
427         * css/CSSParser.cpp:
428         (WebCore::CSSParser::realLex):
429
430 2015-02-20  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
431
432         Use std::unique_ptr instead of PassOwnPtr|OwnPtr in MediaPlayerFoo classes
433         https://bugs.webkit.org/show_bug.cgi?id=137765
434
435         Reviewed by Ryosuke Niwa.
436
437         As a step to use std::unique_ptr|std::make_unique<>, this patch changes use of OwnPtr|PassOwnPtr
438         with std::unique_ptr<>|std::make_unique<>. To remove all create() factory function, lambdas is
439         used in registerMediaEngine().
440
441         No new tests, no behavior changes.
442
443         * WebCore.exp.in:
444         * html/HTMLMediaElement.cpp:
445         (WebCore::HTMLMediaElement::parseAttribute):
446         * html/HTMLMediaElement.h:
447         * platform/graphics/MediaPlayer.cpp:
448         (WebCore::NullMediaPlayerPrivate::NullMediaPlayerPrivate):
449         (WebCore::MediaPlayer::MediaPlayer):
450         (WebCore::MediaPlayer::loadWithNextMediaEngine):
451         (WebCore::createNullMediaPlayer): Deleted.
452         * platform/graphics/MediaPlayer.h:
453         (WebCore::MediaPlayer::create): Deleted.
454         * platform/graphics/MediaPlayerPrivate.h:
455         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
456         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
457         (WebCore::MediaPlayerPrivateAVFoundationCF::registerMediaEngine):
458         (WebCore::MediaPlayerPrivateAVFoundationCF::create): Deleted.
459         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
460         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
461         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
462         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
463         (WebCore::MediaPlayerPrivateAVFoundationObjC::create): Deleted.
464         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
465         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
466         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
467         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::create): Deleted.
468         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
469         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
470         (WebCore::MediaPlayerPrivateGStreamer::create): Deleted.
471         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
472         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
473         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
474         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine):
475         (WebCore::MediaPlayerPrivateQTKit::create): Deleted.
476         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
477         (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine):
478         (WebCore::MediaPlayerPrivateMediaFoundation::create): Deleted.
479         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
480         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
481         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
482         (WebCore::MockMediaPlayerMediaSource::create): Deleted.
483         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
484
485 2015-02-19  David Kilzer  <ddkilzer@apple.com>
486
487         Rename SOFT_LINK_FUNCTION_{DECL,IMPL}() to SOFT_LINK_FUNCTION_{HEADER,SOURCE}()
488
489         Rubber-stamped by Brent Fulgham.
490
491         "HEADER" and "SOURCE" seem clearer than "DECL" and "IMPL", and
492         Brent agreed when I talked to him in person.
493
494         * platform/cf/CoreMediaSoftLink.cpp:
495         * platform/cf/CoreMediaSoftLink.h:
496         * platform/mac/SoftLinking.h:
497         * platform/win/SoftLinking.h:
498         - Do the rename.
499
500 2015-02-19  David Kilzer  <ddkilzer@apple.com>
501
502         Move more CoreMedia soft-linked functions to CoreMediaSoftLink.{cpp,h}
503         <http://webkit.org/b/141791>
504
505         Reviewed by Alexey Proskuryakov.
506
507         * Configurations/WebCore.unexp:
508         - Remove five more symbols.
509
510         * Modules/plugins/QuickTimePluginReplacement.mm:
511         - Remove all local soft-links and include CoreMediaSoftLink.h.
512           Note that SOFT_LINK_FRAMEWORK_OPTIONAL() should not have been
513           used here since we didn't use the optional function soft-link
514           method.
515
516         * WebCore.vcxproj/WebCore.vcxproj.filters:
517         * WebCore.vcxproj/WebCoreCFNetwork.props:
518         * WebCore.xcodeproj/project.pbxproj:
519         - Add CoreMediaSPI.h to the project.
520
521         * platform/cf/CoreMediaSoftLink.cpp:
522         * platform/cf/CoreMediaSoftLink.h:
523         - Add three cross-platform symbols, five Cocoa-only symbols, and
524           two Windows-only symbols (based on current usage, not
525           availability on each platform).
526         - Include CoreMediaSPI.h header.
527         - Include <CoreMedia/CoreMedia.h> instead of just CMTime.h.
528
529         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
530         - Remove all CoreMedia soft-linked functions.  Constants remain.
531
532         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
533         - Remove one CoreMedia soft-linked method.
534
535         * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
536         - Remove all CoreMedia soft-linked funtions.  With this change,
537           we are already realizing space savings for duplicate
538           SOFT_LINK_FRAMEWORK() calls.  (On Windows, there was code
539           generated for many unused functions included by
540           CoreMediaSoftLinking.h.)
541
542         * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h:
543         - Remove all CoreMedia soft-linked funtions.  Constants remain.
544
545         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
546         - Remove duplicate header included by CoreMediaSoftLink.h.
547
548         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
549         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
550         - Remove all CoreMedia soft-linked funtions.  Constants remain.
551
552         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
553         - Remove three CoreMedia soft-linked methods.
554
555         * platform/mac/PlatformClockCM.mm:
556         - Remove two CoreMedia soft-linked methods.
557
558         * platform/mac/SerializedPlatformRepresentationMac.mm:
559         - Remove only CoreMedia soft-linked funtion.  It wasn't even
560           used.
561
562         * platform/mediastream/mac/AVVideoCaptureSource.mm:
563         - Remove two CoreMedia soft-linked method.
564
565         * platform/spi/cf/CoreMediaSPI.h:
566         - Add for SPI from CMNotificationCenter.h.
567
568 2015-02-19  David Hyatt  <hyatt@apple.com>
569
570         Columns are splitting unsplittable content.
571         https://bugs.webkit.org/show_bug.cgi?id=141807
572         <rdar://problem/18387659>
573
574         Reviewed by Dean Jackson.
575
576         Added inline-table-dynamic-movement.html
577
578         * rendering/RenderBlockFlow.cpp:
579         (WebCore::RenderBlockFlow::pageLogicalTopForOffset):
580         (WebCore::RenderBlockFlow::pageLogicalHeightForOffset):
581         Patch these functions to always check the layout state for a zero
582         pageLogicalHeight, since that is actually our indicator that we're
583         doing column balancing and don't have a height set yet.
584
585         * rendering/RenderMultiColumnFlowThread.cpp:
586         (WebCore::RenderMultiColumnFlowThread::isPageLogicalHeightKnown):
587         * rendering/RenderMultiColumnSet.cpp:
588         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
589         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
590         (WebCore::RenderMultiColumnSet::prepareForLayout):
591         * rendering/RenderMultiColumnSet.h:
592         The function for deciding whether the logical height of the columns was
593         known was checking for a zero computedColumnHeight. However, a column set
594         can legitimately compute a zero column height, and with the fix to examine
595         the layout state, this bug was exposed.
596
597         The fix is to add a new variable that caches whether or not the column height
598         has been computed, so that even if it computes to zero, we aren't fooled.
599
600 2015-02-19  Chris Dumez  <cdumez@apple.com>
601
602         [iOS] Fix inefficiencies in ResourceResponse::platformLazyInit()
603         https://bugs.webkit.org/show_bug.cgi?id=141744
604
605         Reviewed by Alexey Proskuryakov.
606
607         Fix inefficiencies in iOS's ResourceResponse::platformLazyInit()
608         implementation, similarly to what was already done for Mac in:
609         <http://trac.webkit.org/changeset/174717>
610
611         The following changes were made:
612         - Add missing "initLevel == AllFields" check before initializing
613           uncommon fields. This bug was causing us to initialize uncommon
614           fields even if called with 'CommonFieldsOnly' initLevel.
615         - Bypass the first pass populating common HTTP headers in
616           m_httpHeaderFields if the initLevel is AllFields. If called
617           with AllFields initLevel, we will end up populating all HTTP
618           headers later on so this first pass is redundant.
619         - Use C++11 range loop to iterator over commonHeaderFields array
620           for readability.
621         - Use CFDictionaryApplyFunction() to populate m_httpHeaderFields
622           for the CFDictionaryRef containing the headers instead of creating
623           copies of keys and values using CFDictionaryGetKeysAndValues() and
624           then iterating over those. This avoids allocating Vectors for keys /
625           values and avoids unnecessary copying.
626
627
628 2015-02-18  Dean Jackson  <dino@apple.com>
629
630         Sufficiently small media controls should remove toolbar elements
631         https://bugs.webkit.org/show_bug.cgi?id=141780
632         <rdar://problem/16548548>
633         <rdar://problem/17598778>
634         <rdar://problem/18351963>
635
636         Reviewed by Eric Carlson.
637
638         Implement some logic where elements on the media controls are
639         hidden when there isn't enough room. We start by dropping
640         the scrubber, then the various buttons on the right hand
641         side.
642
643         This solution isn't perfect. If we had perfection, it would
644         be because we get resize events and respond accordingly. Instead
645         we check the size when the user has pinch-zoomed, or when
646         we start/stop playing.
647
648         This is going to cause some extra layout, because we need
649         to know the size of things before we can work out which
650         bits to hide.
651
652         * Modules/mediacontrols/mediaControlsiOS.css:
653         (::-webkit-media-controls): Remove the minimum width. This can
654         cause the controls to get clipped.
655         (audio::-webkit-media-controls-spacer): Add this empty element to
656         replace the scrubber when it is hidden.
657         (audio::-webkit-media-controls-timeline-container):
658         * Modules/mediacontrols/mediaControlsiOS.js:
659         (ControllerIOS): Remember our size so we don't churn.
660         (ControllerIOS.prototype.createControls): Create a new spacer element.
661         (ControllerIOS.prototype.configureInlineControls):
662         (ControllerIOS.prototype.showControls): Check if we need to hide stuff.
663         (ControllerIOS.prototype.updateControls):
664         (ControllerIOS.prototype.setPlaying): Ditto.
665         (ControllerIOS.prototype.set pageScaleFactor): Ditto.
666         (ControllerIOS.prototype.scheduleUpdateLayoutForDisplayedWidth): Trigger an update
667         asap. In this case it's probably ok to be in a bad state for a frame, or
668         we are inside setup and we know that we'll layout soon.
669         (ControllerIOS.prototype.updateLayoutForDisplayedWidth): The actual code
670         that hides elements.
671
672 2015-02-19  Tim Horton  <timothy_horton@apple.com>
673
674         Move the software-only ImageBuffer::m_context to ImageBufferData
675         https://bugs.webkit.org/show_bug.cgi?id=141784
676
677         Reviewed by Simon Fraser.
678
679         * platform/graphics/ImageBuffer.h:
680         * platform/graphics/cairo/ImageBufferCairo.cpp:
681         (WebCore::ImageBuffer::ImageBuffer):
682         (WebCore::ImageBuffer::context):
683         * platform/graphics/cairo/ImageBufferDataCairo.h:
684         * platform/graphics/cg/ImageBufferCG.cpp:
685         (WebCore::ImageBuffer::ImageBuffer):
686         (WebCore::ImageBuffer::context):
687         * platform/graphics/cg/ImageBufferDataCG.h:
688         Move m_context to ImageBufferData in the software-only section;
689         for accelerated contexts, the GraphicsContext is owned by the IOSurface wrapper.
690         This will make it harder for ImageBuffer to make the mistake of using
691         m_context blindly without thinking when it will often be null.
692
693 2015-02-18  Andreas Kling  <akling@apple.com>
694
695         REGRESSION(r179347): Clearing the PageCache no longer clears the PageCache.
696         <https://webkit.org/b/141788>
697
698         Reviewed by Anders Carlsson.
699
700         Once again we've fallen into the TemporaryChange trap:
701
702             TemporaryChange<unsigned>(m_member, temporaryValue);
703
704         The code above doesn't actually do anything. Since the TemporaryChange local is not named,
705         it immediately goes out of scope and restores the original value of m_member.
706
707         Unless someone knows a C++ trick to prevent these, we'll need to add a style checker pass
708         to catch bugs like this. Whatever we do will be done separately from this bug.
709
710         Test: fast/history/page-cache-clearing.html
711
712         * history/PageCache.cpp:
713         (WebCore::PageCache::pruneToSizeNow): Name the local so it lives longer.
714
715         * testing/Internals.cpp:
716         (WebCore::Internals::clearPageCache):
717         (WebCore::Internals::pageCacheSize):
718         * testing/Internals.h:
719         * testing/Internals.idl: Add a way to clear the page cache and query its size from
720         window.internals to facilitate writing a simple test for this bug.
721
722 2015-02-18  Alexey Proskuryakov  <ap@apple.com>
723
724         Roll out r180280.
725
726         Crashes under IDBDatabase::closeConnection.
727         https://bugs.webkit.org/show_bug.cgi?id=141745
728         rdar://problem/19816412
729
730         * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::closeConnection):
731
732 2015-02-18  Tim Horton  <timothy_horton@apple.com>
733
734         Fix the iOS Simulator build after r180308.
735
736         * platform/graphics/cg/ImageBufferDataCG.h:
737
738 2015-02-18  Zalan Bujtas  <zalan@apple.com>
739
740         REGRESSION(r174761) Dangling spanner pointer in RenderMultiColumnSpannerPlaceholder.
741         https://bugs.webkit.org/show_bug.cgi?id=138224
742
743         Reviewed by Dave Hyatt.
744
745         It's wrong to call flowThreadRelativeWillBeRemoved(child).
746         RenderMultiColumnFlowThread::removeFlowChildInfo() does not mean that the child is actually about to be removed.
747         Should this introduce any regressions, we need to deal with those separately.
748
749         Test: fast/multicol/crash-when-spanner-gets-moved-around.html
750
751         * rendering/RenderMultiColumnFlowThread.cpp:
752         (WebCore::RenderMultiColumnFlowThread::removeFlowChildInfo): Deleted.
753         * rendering/RenderMultiColumnFlowThread.h:
754
755 2015-02-18  Brent Fulgham  <bfulgham@apple.com>
756
757         [Win] CFData leak in CDMSessionAVFoundationCF
758         https://bugs.webkit.org/show_bug.cgi?id=141765
759         <rdar://problem/141765>
760
761         Reviewed by Joseph Pecoraro.
762
763         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
764         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest): use 'adoptCF'
765         so we don't double-increment the retain count.
766
767 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
768
769         Adopt WebCore::IOSurface in ImageBuffer
770         https://bugs.webkit.org/show_bug.cgi?id=141751
771
772         Reviewed by Simon Fraser.
773
774         * platform/graphics/cg/ImageBufferCG.cpp:
775         (WebCore::createIOSurface): Deleted.
776         (WebCore::ImageBuffer::ImageBuffer):
777         Make use of cachedCGColorSpace.
778         Make use of WebCore::IOSurface.
779         Remove the unused size argument from ImageBufferDataCG.
780         Clear the IOSurface once we've allocated it; WebCore::IOSurface doesn't
781         do this for us, unlike wkIOSurfaceContextCreate.
782         Apply the flipping and scale factor to whichever context we made.
783         We don't need to setIsAcceleratedContext anymore because it's always
784         false for software contexts, and WebCore::IOSurface will set it for
785         any accelerated contexts.
786
787         (WebCore::ImageBuffer::context):
788         If we are IOSurface-backed, return WebCore::IOSurface's GraphicsContext.
789
790         (WebCore::ImageBuffer::flushContext):
791         Make use of context(); m_context is now null for accelerated ImageBuffers.
792
793         (WebCore::ImageBuffer::copyNativeImage):
794         Adopt in-line with the Create functions for clarity. Make use of
795         IOSurface::createImage instead of wkIOSurfaceContextCreateImage.
796
797         (WebCore::ImageBuffer::draw):
798         (WebCore::ImageBuffer::drawPattern):
799         (WebCore::ImageBuffer::getUnmultipliedImageData):
800         (WebCore::ImageBuffer::getPremultipliedImageData):
801         (WebCore::ImageBuffer::putByteArray):
802         (WebCore::ImageBuffer::toDataURL):
803         Make use of context(); m_context is now null for accelerated ImageBuffers.
804
805         * platform/graphics/cg/ImageBufferDataCG.cpp:
806         (WebCore::ImageBufferData::ImageBufferData):
807         Indentation fix, and use nullptr.
808
809         (WebCore::convertScanline):
810         Grammar fix (is -> are).
811
812         (WebCore::ImageBufferData::getData):
813         (WebCore::ImageBufferData::putData):
814         Grab the IOSurfaceRef from the IOSurface wrapper. Eventually these things
815         should be made more convenient by the wrapper.
816
817         * platform/graphics/cg/ImageBufferDataCG.h:
818         Drop the unused size argument from the constructor.
819         Reorganize and label the various members which are only used
820         for a particular type of ImageBufferDataCG.
821
822         * platform/graphics/cocoa/IOSurface.mm:
823         (IOSurface::ensureGraphicsContext):
824         IOSurface-backed GraphicsContexts are always considered accelerated.
825
826         (IOSurface::create):
827         (IOSurface::IOSurface):
828         Add a constructor that take an extra size to use when making the CGContext;
829         it can only be less than the actual backing IOSurface size.
830         This is needed for r160121.
831
832         * platform/ios/WebCoreSystemInterfaceIOS.mm:
833         * platform/mac/WebCoreSystemInterface.h:
834         * platform/mac/WebCoreSystemInterface.mm:
835         Remove old WKSI IOSurface-related functions.
836
837 2015-02-18  Alex Christensen  <achristensen@webkit.org>
838
839         Prepare to use WEBCORE_EXPORT on Windows.
840         https://bugs.webkit.org/show_bug.cgi?id=141735
841
842         Reviewed by Brent Fulgham.
843
844         * bindings/js/GCController.h:
845         * bindings/js/JSDOMGlobalObject.h:
846         * bindings/scripts/CodeGeneratorJS.pm:
847         (GenerateHeader):
848         (GenerateImplementation):
849         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
850         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
851         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
852         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
853         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
854         * bindings/scripts/test/JS/JSTestEventConstructor.h:
855         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
856         * bindings/scripts/test/JS/JSTestEventTarget.h:
857         * bindings/scripts/test/JS/JSTestException.cpp:
858         * bindings/scripts/test/JS/JSTestException.h:
859         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
860         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
861         * bindings/scripts/test/JS/JSTestInterface.cpp:
862         * bindings/scripts/test/JS/JSTestInterface.h:
863         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
864         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
865         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
866         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
867         * bindings/scripts/test/JS/JSTestNode.cpp:
868         * bindings/scripts/test/JS/JSTestNode.h:
869         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
870         * bindings/scripts/test/JS/JSTestNondeterministic.h:
871         * bindings/scripts/test/JS/JSTestObj.cpp:
872         * bindings/scripts/test/JS/JSTestObj.h:
873         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
874         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
875         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
876         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
877         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
878         * bindings/scripts/test/JS/JSTestTypedefs.h:
879         * bindings/scripts/test/JS/JSattribute.cpp:
880         * bindings/scripts/test/JS/JSattribute.h:
881         * bindings/scripts/test/JS/JSreadonly.cpp:
882         * bindings/scripts/test/JS/JSreadonly.h:
883         * bridge/runtime_method.h:
884         * bridge/runtime_object.h:
885         * dom/make_names.pl:
886         (printNamesHeaderFile):
887         * history/HistoryItem.h:
888         * loader/FrameLoader.h:
889         * loader/LoaderStrategy.h:
890         * loader/ResourceLoadScheduler.h:
891         * loader/icon/IconDatabase.h:
892         * loader/icon/IconDatabaseBase.h:
893         * page/DatabaseProvider.h:
894         * page/Page.h:
895         * page/PageConsoleClient.h:
896         * page/PageOverlay.h:
897         * platform/FileSystem.h:
898         * platform/MemoryPressureHandler.h:
899         * platform/ThreadGlobalData.h:
900         * platform/URL.h:
901         * platform/graphics/ca/PlatformCALayer.h:
902         * platform/network/BlobDataFileReference.h:
903         * platform/network/BlobRegistry.h:
904         * platform/network/BlobRegistryImpl.h:
905         * platform/sql/SQLiteDatabase.h:
906         * rendering/ScrollBehavior.h:
907         * rendering/break_lines.h:
908         Add and move some WEBCORE_EXPORT macros.
909
910 2015-02-18  Anders Carlsson  <andersca@apple.com>
911
912         Rename LocalizedStringsMac.cpp to LocalizedStringsCocoa.mm
913         https://bugs.webkit.org/show_bug.cgi?id=141767
914
915         Reviewed by Tim Horton.
916
917         Also, move it to platform/cocoa instead of platform/mac.
918
919         * WebCore.xcodeproj/project.pbxproj:
920         * platform/cocoa/LocalizedStringsCocoa.mm: Renamed from Source/WebCore/platform/mac/LocalizedStringsMac.cpp.
921
922 2015-02-18  Antti Koivisto  <antti@apple.com>
923
924         Rename FontGlyphs to FontCascadeFonts
925         https://bugs.webkit.org/show_bug.cgi?id=141754
926
927         Reviewed by Andreas Kling.
928
929         "It is better than Impl."
930
931         The purpose of the class to own to create and own the realized Font instances and the associated caches
932         for FontCascade instances.
933
934 2015-02-18  Commit Queue  <commit-queue@webkit.org>
935
936         Unreviewed, rolling out r180286.
937         https://bugs.webkit.org/show_bug.cgi?id=141766
938
939         Caused >50 crashed LayoutTests (Requested by jernoble on
940         #webkit).
941
942         Reverted changeset:
943
944         "Page::userContentController() should return a reference, not
945         a pointer"
946         https://bugs.webkit.org/show_bug.cgi?id=141764
947         http://trac.webkit.org/changeset/180286
948
949 2015-02-18  David Kilzer  <ddkilzer@apple.com>
950
951         Consolidate soft-linked CMTimeMakeWithSeconds() function
952         <http://webkit.org/b/141655>
953
954         Reviewed by Brent Fulgham.
955
956         * Configurations/WebCore.unexp: Remove workaround for
957         CMTimeMakeWithSeconds() weak external.
958
959         * WebCore.vcxproj/WebCore.vcxproj:
960         * WebCore.vcxproj/WebCore.vcxproj.filters:
961         * WebCore.xcodeproj/project.pbxproj:
962         - Add CoreMediaSoftLink.{cpp,h} to the project.
963
964         * platform/cf/CoreMediaSoftLink.cpp: Add.
965         * platform/cf/CoreMediaSoftLink.h: Add.
966         - Implement new strategy where code for soft-linking is only
967           in one place, and the header can simply be included wherever a
968           soft-linked method is needed.
969
970         * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
971         * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h:
972         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
973         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
974         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
975         * platform/mac/PlatformClockCM.mm:
976         - Remove old soft-linking strategy and include
977           CoreMediaSoftLink.h.
978
979         * platform/mac/SoftLinking.h:
980         (SOFT_LINK_FUNCTION_DECL): Add.  New macro function used for
981         header declaration.  Split out from SOFT_LINK() macro.  Also
982         stop violating C++ standards by redeclaring an inline function
983         with the exact same signature as an extern "C" function.  This
984         now matches what we do on Windows (where Visual C++ already
985         prevented these shenanigans).
986         (SOFT_LINK_FUNCTION_IMPL): Add.  New macro function used for
987         source implementation.  Split out the from SOFT_LINK() macro.
988
989         * platform/win/SoftLinking.h:
990         (SOFT_LINK_FRAMEWORK): Map mac/SoftLinking.h macro name to
991         Windows macros so we can simplify CoreMediaSoftLink.{cpp,h}.
992         (SOFT_LINK_FUNCTION_DECL): Add.
993         (SOFT_LINK_FUNCTION_IMPL): Add.
994         - New macro functions split out from SOFT_LINK_DLL_IMPORT()
995           macro for header declaration and source implementation.
996         - We assume the __cdecl calling convention because that's what
997           all Apple libraries use, and so we are able to use the exact
998           same macro function on both Mac and Windows to simplify
999           CoreMediaSoftLink.{cpp,h}.
1000
1001 2015-02-18  Brady Eidson  <beidson@apple.com>
1002
1003         Page::userContentController() should return a reference, not a pointer
1004         https://bugs.webkit.org/show_bug.cgi?id=141764
1005
1006         Reviewed by Jer Noble.
1007
1008         No new tests (No behavior change)
1009
1010         * dom/DocumentStyleSheetCollection.cpp:
1011         (WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache):
1012         * loader/cache/CachedResourceLoader.cpp:
1013         (WebCore::CachedResourceLoader::requestResource):
1014         * page/CaptionUserPreferences.cpp:
1015         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride):
1016         * page/DOMWindow.cpp:
1017         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
1018         * page/Frame.cpp:
1019         (WebCore::Frame::injectUserScripts):
1020         * page/Page.cpp:
1021         (WebCore::Page::Page):
1022         (WebCore::Page::~Page):
1023         (WebCore::Page::setUserContentController):
1024         * page/Page.h:
1025         (WebCore::Page::userContentController):
1026         * page/UserMessageHandlersNamespace.cpp:
1027         (WebCore::UserMessageHandlersNamespace::handler):
1028
1029 2015-02-18  Roger Fong  <roger_fong@apple.com>
1030
1031         WebGL2: Promote various WebGL1 extensions to core for WebGL2.
1032         https://bugs.webkit.org/show_bug.cgi?id=141446
1033         <rdar://problem/19633715>
1034
1035         Reviewed by Brent Fulham.
1036
1037         Tests covered by WebGL2 conformance tests.
1038
1039         This patch promotes the following WebGL1 extensions to core in WebGL2:
1040         OES_element_index_uint 
1041         EXT_sRGB 
1042         EXT_blend_minmax 
1043         EXT_frag_depth 
1044         EXT_shader_texture_lod
1045         OES_standard_derivatives 
1046         
1047         The latter 3 are enabled by default now for GLSL1, though we will get these extensions 
1048         for free when GLSL3 becomes available.
1049
1050         WebGL2 binding code should actually fall back to base implementation for getFramebufferAttachmentParameter.
1051         * bindings/js/JSWebGL2RenderingContextCustom.cpp: 
1052         (WebCore::JSWebGL2RenderingContext::getFramebufferAttachmentParameter): Deleted.
1053         * html/canvas/WebGL2RenderingContext.idl: Ditto.
1054
1055         * html/canvas/WebGL2RenderingContext.cpp:
1056         (WebCore::WebGL2RenderingContext::getExtension): Enable WEBGL_lose_context as an extension again.
1057         It was not promoted to core as I originally thought it had been.
1058         (WebCore::WebGL2RenderingContext::getSupportedExtensions): Ditto.
1059         (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): Promote the 3 shader extensions for GLSL1 to core.
1060         (WebCore::WebGL2RenderingContext::initializeShaderExtensions): Ditto.
1061         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): Promote SRGB extension to core.
1062         (WebCore::WebGL2RenderingContext::renderbufferStorage): Ditto.
1063         (WebCore::WebGL2RenderingContext::hint): Ditto.
1064         (WebCore::WebGL2RenderingContext::validateTexFuncFormatAndType): Ditto.
1065         (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Promote OES_element_index_uint extension to core.
1066         (WebCore::WebGL2RenderingContext::validateDrawElements): Ditto.
1067         (WebCore::WebGL2RenderingContext::validateBlendEquation): Promote EXT_blend_minmax extension to core.
1068         * html/canvas/WebGL2RenderingContext.h:
1069
1070         * html/canvas/WebGLRenderingContext.cpp:
1071         (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Copied form WebGLRenderingContextBase.
1072         (WebCore::WebGLRenderingContext::renderbufferStorage): Ditto.
1073         (WebCore::WebGLRenderingContext::hint): Ditto.
1074         (WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
1075         (WebCore::WebGLRenderingContext::validateDrawElements): Ditto.
1076         (WebCore::WebGLRenderingContext::validateBlendEquation): Ditto.
1077         * html/canvas/WebGLRenderingContext.h:
1078
1079         * html/canvas/WebGLRenderingContextBase.cpp:
1080         (WebCore::WebGLRenderingContextBase::validateIndexArrayConservative): Deleted.
1081         (WebCore::WebGLRenderingContextBase::validateDrawElements): Deleted.
1082         (WebCore::WebGLRenderingContextBase::getExtension): Deleted.
1083         (WebCore::WebGLRenderingContextBase::getFramebufferAttachmentParameter): Deleted.
1084         (WebCore::WebGLRenderingContextBase::hint): Deleted.
1085         (WebCore::WebGLRenderingContextBase::renderbufferStorage): Deleted.
1086         (WebCore::WebGLRenderingContextBase::validateBlendEquation): Deleted.
1087         * html/canvas/WebGLRenderingContextBase.h:
1088
1089 2015-02-18  Alexey Proskuryakov  <ap@apple.com>
1090
1091         Streamline unexported function build fixes
1092         https://bugs.webkit.org/show_bug.cgi?id=141761
1093
1094         Reviewed by Alex Christensen.
1095
1096         * Configurations/WebCore.unexp: Added some functions for symbols only used on newer
1097         OS versions. Removed a special case for NodeList, to handle it uniformly with Node.
1098
1099         * Configurations/WebCore.xcconfig: Made the unexported list unconditional, because
1100         it's not only Xcode 5 that is affected.
1101
1102         * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): We already had a hack for
1103         Node, NodeList needs an exactly the same one. Also updated the comments.
1104
1105 2015-02-18  Chris Dumez  <cdumez@apple.com>
1106
1107         Access FontCache global instance via singleton() static member function
1108         https://bugs.webkit.org/show_bug.cgi?id=141726
1109
1110         Reviewed by Daniel Bates.
1111
1112         Access FontCache global instance via singleton() static member function,
1113         as per coding style.
1114
1115 2015-02-18  Alexey Proskuryakov  <ap@apple.com>
1116
1117         Crashes under IDBDatabase::closeConnection.
1118         https://bugs.webkit.org/show_bug.cgi?id=141745
1119         rdar://problem/19816412
1120
1121         Reviewed by David Kilzer.
1122
1123         * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::closeConnection):
1124         Add a missing protector.
1125
1126 2015-02-18  Myles C. Maxfield  <mmaxfield@apple.com>
1127
1128         Justified ruby can cause lines to grow beyond their container
1129         https://bugs.webkit.org/show_bug.cgi?id=141732
1130
1131         Reviewed by David Hyatt.
1132
1133         After we re-layout RenderRubyRuns, this can change the environment upon which
1134         ruby's overhang calculation is sensitive to. Before this patch, we would recalculate
1135         the overhang after the RenderRubyRun gets relaid out. However, doing such causes the
1136         effective width of the RenderRubyRun to change, which causes out subsequent
1137         justification calculations to be off.
1138
1139         Therefore, we have a cycle; the amount of ruby overhang can change the justification
1140         in a line, and the layout of the line affects the ruby overhang calculation. Instead
1141         of performing a layout in a loop until it converges, this patch simply observes that
1142         having a flush right edge is more valuable than having a perfectly correct overhang.
1143         It therefore simply removes the secondary overhang calculation.
1144
1145         Test: fast/text/ruby-justification-flush.html
1146
1147         * rendering/RenderBlockFlow.h:
1148         * rendering/RenderBlockLineLayout.cpp:
1149         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
1150         (WebCore::RenderBlockFlow::computeExpansionForJustifiedText):
1151         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1152
1153 2015-02-18  Chris Dumez  <cdumez@apple.com>
1154
1155         Evict dead resources in MemoryCache in MemoryPressureHandler::releaseNoncriticalMemory()
1156         https://bugs.webkit.org/show_bug.cgi?id=141723
1157
1158         Reviewed by Andreas Kling.
1159
1160         Evict dead resources from the MemoryCache on non-critical memory
1161         pressure. On critical memory pressure, we already evict ALL resources
1162         from the MemoryCache. It is a good idea to start by evicting resources
1163         we care less about on non-critical warning to decrease the chances of
1164         getting a critical warning and thus having to clear the whole
1165         MemoryCache.
1166
1167         * loader/cache/MemoryCache.h:
1168         * platform/MemoryPressureHandler.cpp:
1169         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
1170         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1171         (WebCore::MemoryPressureHandler::releaseMemory):
1172         Call releaseCriticalMemory() before releaseNoncriticalMemory()
1173         as releaseCriticalMemory() is more aggressive. Doing it the
1174         other way around would mean that on critical warning, we would
1175         first evict dead resources, then evict all resources. It is
1176         more efficient to evict all resources first, as it makes the
1177         non-critical operation (evict dead resources) a no-op.
1178
1179 2015-02-18  Eric Carlson  <eric.carlson@apple.com>
1180
1181         [iOS] pause video when a tab moves to the background on some devices
1182         https://bugs.webkit.org/show_bug.cgi?id=141753
1183         <rdar://problem/19814562>
1184
1185         Reviewed by Jer Noble.
1186
1187         Test: media/video-background-tab-playback.html
1188
1189         * platform/audio/MediaSession.cpp:
1190         (WebCore::MediaSession::clientDataBufferingTimerFired): Pause video when the element becomes
1191             hidden if the BackgroundTabPlaybackRestricted is set.
1192
1193         * platform/audio/MediaSessionManager.cpp:
1194         (WebCore::MediaSessionManager::applicationWillEnterBackground): Rename BackgroundPlaybackNotPermitted
1195              to BackgroundProcessPlaybackRestricted.
1196         (WebCore::MediaSessionManager::applicationWillEnterForeground): Ditto.
1197         * platform/audio/MediaSessionManager.h:
1198
1199         * platform/audio/ios/MediaSessionManagerIOS.mm:
1200         (WebCore::MediaSessionManageriOS::resetRestrictions): Set BackgroundTabPlaybackRestricted on
1201             devices with restricted memory. BackgroundPlaybackNotPermitted -> BackgroundProcessPlaybackRestricted.
1202
1203         * testing/Internals.cpp:
1204         (WebCore::Internals::setMediaSessionRestrictions): Add support for BackgroundTabPlaybackRestricted.
1205             BackgroundPlaybackNotPermitted -> BackgroundProcessPlaybackRestricted.
1206
1207 2015-02-16  David Hyatt  <hyatt@apple.com>
1208
1209         Wrong element's style is used for text-decoration-style.
1210         https://bugs.webkit.org/show_bug.cgi?id=141673
1211         <rdar://problem/19876774>
1212
1213         Reviewed by Dean Jackson.
1214
1215         Added fast/text/text-underline-style.html
1216
1217         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1218         (AXAttributeStringSetStyle):
1219         Add arguments for fetching styles.
1220
1221         * rendering/InlineTextBox.cpp:
1222         (WebCore::InlineTextBox::paint):
1223         (WebCore::InlineTextBox::paintDecoration):
1224         * rendering/InlineTextBox.h:
1225         Remove the passed in TextDecorationStyle and instead patch the code to fetch the styles in the same
1226         way it fetches the colors.
1227
1228         * rendering/RenderObject.cpp:
1229         (WebCore::RenderObject::getTextDecorationColorsAndStyles):
1230         (WebCore::RenderObject::getTextDecorationColors): Deleted.
1231         * rendering/RenderObject.h:
1232         Add style fetching to the same function that fetches colors and rename it.
1233
1234 2015-02-18  David Kilzer  <ddkilzer@apple.com>
1235
1236         REGRESSION (r180260): Try to fix incremental builds by changing UserContentController.cpp
1237
1238         Attempt to fix this linker error by making a non-coding change:
1239
1240             Undefined symbols for architecture i386:
1241               "__ZN7WebCore17ContentExtensions24ContentExtensionsBackendC1Ev", referenced from:
1242                   __ZN7WebCore21UserContentController20addUserContentFilterERKN3WTF6StringES4_ in UserContentController.o
1243             ld: symbol(s) not found for architecture i386
1244
1245         This should have been fixed by r180266, but perhaps Xcode didn't
1246         recognize that it needed to rebuild this source file.
1247
1248         * page/UserContentController.cpp: Update copyright.
1249
1250 2015-02-18  Andreas Kling  <akling@apple.com>
1251
1252         Purge PassRefPtr from CanvasRenderingContext2D.
1253         <https://webkit.org/b/141749>
1254
1255         Reviewed by Gyuyoung Kim.
1256
1257         Switch from using PassRefPtr to RefPtr/Ref in CanvasRenderingContext2D.
1258
1259         * html/TextMetrics.h:
1260         (WebCore::TextMetrics::create): Changed create() helper to return Ref.
1261
1262         * html/canvas/CanvasRenderingContext2D.h:
1263         * html/canvas/CanvasRenderingContext2D.cpp:
1264         (WebCore::CanvasRenderingContext2D::prepareGradientForDashboard): Changed to take a reference.
1265
1266         (WebCore::CanvasRenderingContext2D::createLinearGradient):
1267         (WebCore::CanvasRenderingContext2D::createRadialGradient):
1268         (WebCore::CanvasRenderingContext2D::createPattern):
1269         (WebCore::createEmptyImageData):
1270         (WebCore::CanvasRenderingContext2D::createImageData):
1271         (WebCore::CanvasRenderingContext2D::getImageData):
1272         (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Made these return RefPtr. Also did
1273         a bunch of 0 -> nullptr conversion, removed a bunch of unnecessary RefPtr::release() calls,
1274         and changed a PassRefPtr argument to RefPtr&&.
1275
1276         (WebCore::CanvasRenderingContext2D::measureText): Made this return Ref.
1277
1278 2015-02-18  Commit Queue  <commit-queue@webkit.org>
1279
1280         Unreviewed, rolling out r180260.
1281         https://bugs.webkit.org/show_bug.cgi?id=141757
1282
1283         Broke the 32-bit builders (Requested by jessieberlin on
1284         #webkit).
1285
1286         Reverted changeset:
1287
1288         "Add a trivial code generator for the DFA"
1289         https://bugs.webkit.org/show_bug.cgi?id=141017
1290         http://trac.webkit.org/changeset/180260
1291
1292 2015-02-17  Anders Carlsson  <andersca@apple.com>
1293
1294         Add API for clearing in-memory caches to WKWebsiteDataStore
1295         https://bugs.webkit.org/show_bug.cgi?id=141724
1296
1297         Reviewed by Tim Horton.
1298
1299         Add a version of evictResources that takes a session id.
1300
1301         * loader/cache/MemoryCache.cpp:
1302         (WebCore::MemoryCache::evictResources):
1303
1304 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
1305
1306         Remove more references to WebCore.exp.in
1307         https://bugs.webkit.org/show_bug.cgi?id=141747
1308
1309         Reviewed by Alexey Proskuryakov.
1310
1311         * WebCore.xcodeproj/project.pbxproj:
1312
1313 2015-02-17  Benjamin Poulain  <benjamin@webkit.org>
1314
1315         Add a trivial code generator for the DFA
1316         https://bugs.webkit.org/show_bug.cgi?id=141017
1317
1318         Reviewed by Andreas Kling.
1319
1320         Nothing fancy yet, this is just doing a literal translation from the DFA
1321         to machine code. It is extremely inefficient at the moment.
1322
1323         * WebCore.xcodeproj/project.pbxproj:
1324         * contentextensions/ContentExtensionsBackend.cpp:
1325         (WebCore::ContentExtensions::ContentExtensionsBackend::ContentExtensionsBackend):
1326         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1327         (WebCore::ContentExtensions::addActionToHashSet):
1328         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL):
1329         * contentextensions/ContentExtensionsBackend.h:
1330         * contentextensions/DFA.cpp:
1331         (WebCore::ContentExtensions::DFA::nextState): Deleted.
1332         (WebCore::ContentExtensions::DFA::actions): Deleted.
1333         * contentextensions/DFA.h:
1334         (WebCore::ContentExtensions::DFA::size):
1335         (WebCore::ContentExtensions::DFA::nodeAt):
1336         * contentextensions/DFACompiler.cpp: Added.
1337         (WebCore::ContentExtensions::compileDFA):
1338         (WebCore::ContentExtensions::DFACodeGenerator::DFACodeGenerator):
1339         (WebCore::ContentExtensions::DFACodeGenerator::compile):
1340         (WebCore::ContentExtensions::DFACodeGenerator::lowerStateMachine):
1341         (WebCore::ContentExtensions::DFACodeGenerator::lowerNode):
1342         (WebCore::ContentExtensions::DFACodeGenerator::getNextCharacter):
1343         (WebCore::ContentExtensions::DFACodeGenerator::callAddActionFunction):
1344         * contentextensions/DFACompiler.h: Copied from Source/WebCore/contentextensions/DFA.h.
1345
1346 2015-02-17  Chris Dumez  <cdumez@apple.com>
1347
1348         Rename ScopedEventQueue::instance() to singleton()
1349         https://bugs.webkit.org/show_bug.cgi?id=141738
1350
1351         Reviewed by Daniel Bates.
1352
1353         Rename ScopedEventQueue::instance() to singleton(), as per coding
1354         style. Also modernize the code a little bit.
1355
1356         * dom/EventDispatcher.cpp:
1357         (WebCore::EventDispatcher::dispatchScopedEvent):
1358         * dom/ScopedEventQueue.cpp:
1359         (WebCore::ScopedEventQueue::singleton):
1360         (WebCore::ScopedEventQueue::dispatchAllEvents):
1361         (WebCore::ScopedEventQueue::incrementScopingLevel):
1362         (WebCore::ScopedEventQueue::decrementScopingLevel):
1363         (WebCore::ScopedEventQueue::ScopedEventQueue): Deleted.
1364         (WebCore::ScopedEventQueue::~ScopedEventQueue): Deleted.
1365         (WebCore::ScopedEventQueue::instance): Deleted.
1366         * dom/ScopedEventQueue.h:
1367         (WebCore::EventQueueScope::EventQueueScope):
1368         (WebCore::EventQueueScope::~EventQueueScope):
1369
1370 2015-02-17  Chris Dumez  <cdumez@apple.com>
1371
1372         Remove dead code from FontCache
1373         https://bugs.webkit.org/show_bug.cgi?id=141741
1374
1375         Reviewed by Daniel Bates.
1376
1377         Remove dead code from FontCache:
1378         - getFontFamilyForCharacters() has no implementation.
1379         - SimpleFontFamily is unused.
1380
1381         * platform/graphics/FontCache.h:
1382
1383 2015-02-17  Chris Dumez  <cdumez@apple.com>
1384
1385         Rename CSSPropertyAnimationWrapperMap::instance() to singleton()
1386         https://bugs.webkit.org/show_bug.cgi?id=141739
1387
1388         Reviewed by Simon Fraser.
1389
1390         Rename CSSPropertyAnimationWrapperMap::instance() to singleton(), as
1391         per coding style.
1392
1393         * page/animation/CSSPropertyAnimation.cpp:
1394         (WebCore::CSSPropertyAnimationWrapperMap::singleton):
1395         (WebCore::CSSPropertyAnimation::blendProperties):
1396         (WebCore::CSSPropertyAnimation::animationOfPropertyIsAccelerated):
1397         (WebCore::CSSPropertyAnimation::animatableShorthandsAffectingProperty):
1398         (WebCore::CSSPropertyAnimation::propertiesEqual):
1399         (WebCore::CSSPropertyAnimation::getPropertyAtIndex):
1400         (WebCore::CSSPropertyAnimation::getNumProperties):
1401         (WebCore::CSSPropertyAnimationWrapperMap::instance): Deleted.
1402
1403 2015-02-17  David Kilzer  <ddkilzer@apple.com>
1404
1405         REGRESSION (r180224): Remove unused generate-export-file script
1406         <http://webkit.org/b/141491>
1407
1408         * generate-export-file: Removed.  This was the script used to
1409         create WebCore.exp files for iOS since we couldn't compile a
1410         host-side tool to run like we did on Mac OS X.  Dont't tell
1411         anyone, but this was an epic hack I created while merging open
1412         source changes to the internal iOS WebKit repository around the
1413         time that the WebCore.exp.in file was created.  End of an era.
1414
1415 2015-02-17  David Kilzer  <ddkilzer@apple.com>
1416
1417         SoftLinking.h: Update copyright and license; clean up whitespace
1418
1419         * platform/win/SoftLinking.h:
1420
1421 2015-02-17  Chris Dumez  <cdumez@apple.com>
1422
1423         Slight CachedPage class clean up
1424         https://bugs.webkit.org/show_bug.cgi?id=141693
1425
1426         Reviewed by Andreas Kling.
1427
1428         Slight CachedPage class clean up:
1429         - Drop unnecessary m_timeStamp data member
1430         - Protect m_needsCaptionPreferencesChanged data member with
1431           #if ENABLE(VIDEO_TRACK)
1432         - Merge destroy() method into the destructor as this is the
1433           only caller
1434         - Update clear() to reset 2 data members that were missing
1435
1436 2015-02-17  Anders Carlsson  <andersca@apple.com>
1437
1438         Silence two -Wcast-qual warnings.
1439         rdar://problem/19758266
1440
1441         * platform/ios/wak/WKUtilities.c:
1442         (WKRetain):
1443         (WKRelease):
1444
1445 2015-02-17  Zalan Bujtas  <zalan@apple.com>
1446
1447         Minor RenderTable* class cleanups.
1448         https://bugs.webkit.org/show_bug.cgi?id=141707
1449
1450         Reviewed by Andreas Kling.
1451
1452         Use in-class initializer where possible.
1453         Remove redundant code.
1454         Move multiline implementations out of class declaration.
1455
1456         No change in functionality.
1457
1458         * rendering/RenderTableCaption.cpp:
1459         (WebCore::RenderTableCaption::insertedIntoTree):
1460         (WebCore::RenderTableCaption::willBeRemovedFromTree):
1461         (WebCore::RenderTableCaption::containingBlockLogicalWidthForContent): Deleted.
1462         * rendering/RenderTableCaption.h:
1463         * rendering/RenderTableCell.cpp:
1464         (WebCore::RenderTableCell::RenderTableCell):
1465         * rendering/RenderTableCell.h:
1466         (WebCore::RenderTableCell::colSpan):
1467         (WebCore::RenderTableCell::rowSpan):
1468         (WebCore::RenderTableCell::setCol):
1469         (WebCore::RenderTableCell::col):
1470         (WebCore::RenderTableCell::section):
1471         (WebCore::RenderTableCell::table):
1472         (WebCore::RenderTableCell::rowIndex):
1473         (WebCore::RenderTableCell::styleOrColLogicalWidth):
1474         (WebCore::RenderTableCell::logicalHeightForRowSizing):
1475         (WebCore::RenderTableCell::isBaselineAligned):
1476         (WebCore::RenderTableCell::borderAdjoiningTableStart):
1477         (WebCore::RenderTableCell::borderAdjoiningTableEnd):
1478         (WebCore::RenderTableCell::borderAdjoiningCellBefore):
1479         (WebCore::RenderTableCell::borderAdjoiningCellAfter):
1480         * rendering/RenderTableCol.cpp:
1481         (WebCore::RenderTableCol::RenderTableCol):
1482         * rendering/RenderTableCol.h:
1483         (WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentBefore):
1484         (WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentAfter):
1485         * rendering/RenderTableRow.h:
1486         (WebCore::RenderTableRow::setRowIndex):
1487         (WebCore::RenderTableRow::rowIndex):
1488         (WebCore::RenderTableRow::borderAdjoiningTableStart):
1489         (WebCore::RenderTableRow::borderAdjoiningTableEnd):
1490         (WebCore::RenderTableRow::table):
1491         (WebCore::RenderTableSection::firstRow):
1492         (WebCore::RenderTableSection::lastRow):
1493         * rendering/RenderTableSection.cpp:
1494         (WebCore::RenderTableSection::RenderTableSection):
1495         (WebCore::RenderTableSection::dirtiedRows):
1496         (WebCore::RenderTableSection::dirtiedColumns):
1497         (WebCore::RenderTableSection::paintObject):
1498         (WebCore::RenderTableSection::nodeAtPoint):
1499         * rendering/RenderTableSection.h:
1500         (WebCore::CellSpan::CellSpan):
1501         (WebCore::RenderTableSection::borderAdjoiningTableStart):
1502         (WebCore::RenderTableSection::borderAdjoiningTableEnd):
1503         (WebCore::RenderTableSection::cellAt):
1504         (WebCore::RenderTableSection::primaryCellAt):
1505         (WebCore::RenderTableSection::rowRendererAt):
1506         (WebCore::RenderTableSection::outerBorderLeft):
1507         (WebCore::RenderTableSection::outerBorderRight):
1508         (WebCore::RenderTableSection::outerBorderTop):
1509         (WebCore::RenderTableSection::outerBorderBottom):
1510         (WebCore::RenderTableSection::numRows):
1511         (WebCore::RenderTableSection::recalcCellsIfNeeded):
1512         (WebCore::RenderTableSection::rowBaseline):
1513         (WebCore::RenderTableSection::fullTableRowSpan):
1514         (WebCore::CellSpan::start): Deleted.
1515         (WebCore::CellSpan::end): Deleted.
1516
1517 2015-02-16  Dean Jackson  <dino@apple.com>
1518
1519         REGRESSION: Video control fails to hide after playback begins in reflowable EPUB files
1520         https://bugs.webkit.org/show_bug.cgi?id=141689
1521         <rdar://problem/19689286>
1522
1523         Reviewed by Eric Carlson.
1524
1525         The iBooks app turns off the requirement for a user gesture
1526         before triggering playback. When we moved to script-based
1527         media controls there were a few regressions in this setup.
1528         This makes them behave a lot more like iOS 7.
1529
1530         * Modules/mediacontrols/mediaControlsApple.js:
1531         (Controller.prototype.setPlaying): We don't want to hide the controls
1532         yet, just start a hiding timer.
1533         * Modules/mediacontrols/mediaControlsiOS.js:
1534         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): If we've ever
1535         played before, we don't want to show the big start button. If we
1536         are in the middle of construction, we do want to show it. We no
1537         longer care about the case where you're not in setup and have
1538         the relaxed restrictions (we still want to show the start button
1539         in that case).
1540         (ControllerIOS.prototype.showControls): When we show the controls,
1541         make sure our timeline is up to date. This is necessary for the
1542         cases where we automatically show the controls, such as when we hit
1543         the end of a video.
1544         (ControllerIOS.prototype.updateTime): Make sure to pass the forceUpdate
1545         parameter on to the super-method.
1546         (ControllerIOS.prototype.setPlaying):
1547         (ControllerIOS.prototype.progressFillStyle): Deleted.
1548
1549 2015-02-17  Chris Dumez  <cdumez@apple.com>
1550
1551         Access MemoryPressureHandler global instance via a singleton() static member function
1552         https://bugs.webkit.org/show_bug.cgi?id=141691
1553
1554         Reviewed by Andreas Kling.
1555
1556         Access MemoryPressureHandler global instance via a singleton() static
1557         member function as per coding style. Also make all other member
1558         functions non-static as callers can just use singleton() to get the
1559         instance and access methods. This avoid having to call
1560         MemoryPressureHandler::singleton() from member functions.
1561
1562         * bindings/js/ScriptController.cpp:
1563         (WebCore::collectGarbageAfterWindowShellDestruction):
1564         * history/PageCache.cpp:
1565         (WebCore::PageCache::canCache):
1566         * loader/FrameLoader.cpp:
1567         (WebCore::FrameLoader::commitProvisionalLoad):
1568         * page/FrameView.cpp:
1569         (WebCore::FrameView::willPaintContents):
1570         (WebCore::FrameView::didPaintContents):
1571         (WebCore::FrameView::computeCoverageRect):
1572         * platform/MemoryPressureHandler.cpp:
1573         (WebCore::MemoryPressureHandler::singleton):
1574         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
1575         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1576         (WebCore::memoryPressureHandler): Deleted.
1577         * platform/MemoryPressureHandler.h:
1578         (WebCore::MemoryPressureHandler::setLowMemoryHandler):
1579         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1580         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1581         (WebCore::MemoryPressureHandler::install):
1582         (WebCore::MemoryPressureHandler::holdOff):
1583         (WebCore::respondToMemoryPressureCallback):
1584         * platform/graphics/FontCache.cpp:
1585         (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
1586         * platform/ios/LegacyTileCache.mm:
1587         (WebCore::LegacyTileCache::createTilesInActiveGrid):
1588         * platform/ios/LegacyTileGrid.mm:
1589         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage):
1590         * platform/ios/LegacyTileLayerPool.mm:
1591         (WebCore::LegacyTileLayerPool::addLayer):
1592         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
1593         (WebCore::TileControllerMemoryHandler::tileControllerGainedUnparentedTiles):
1594         * platform/linux/MemoryPressureHandlerLinux.cpp:
1595         (WebCore::MemoryPressureHandler::waitForMemoryPressureEvent):
1596
1597 2015-02-17  Alex Christensen  <achristensen@webkit.org>
1598
1599         Remove WebCore.exp.in and clean up.
1600         https://bugs.webkit.org/show_bug.cgi?id=141491
1601
1602         Reviewed by Andreas Kling.
1603
1604         * Configurations/WebCore.xcconfig:
1605         Don't use exported symbols files.
1606         * DerivedSources.make:
1607         Don't generate export files.
1608         * WebCore.exp.in: Removed.
1609         * WebCore.xcodeproj/project.pbxproj:
1610         Removed WebCoreExportFileGenerator targets.
1611         * make-export-file-generator: Removed.
1612
1613 2015-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1614
1615         Use HashMap::add instead of get/contains + set in DOMObjectCache
1616         https://bugs.webkit.org/show_bug.cgi?id=141558
1617
1618         Rubber-stamped by Žan Doberšek.
1619
1620         * bindings/gobject/DOMObjectCache.cpp:
1621         (WebKit::getOrCreateDOMObjectCacheFrameObserver):
1622         (WebKit::DOMObjectCache::put):
1623
1624 2015-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1625
1626         [GTK] GObject DOM bindings object are cached forever
1627         https://bugs.webkit.org/show_bug.cgi?id=141558
1628
1629         Reviewed by Sergio Villar Senin.
1630
1631         Rework the DOMObjectCache to avoid having to manually clear the
1632         objects when the frame is destroyed, using a FrameDestructionObserver
1633         instead. When a new object associated to a Frame is added to the
1634         cache, a FrameDestructionObserver is created for the frame if
1635         needed, and the DOM object is tracked by the observer too. When
1636         the frame is detached from the page all its objects are cleared,
1637         and if the aren't additional references, the object is finalized
1638         and removed from the cache normally.
1639         This patch also simplifies and modernizes the code to make it
1640         easier to read an maintain.
1641
1642         * bindings/gobject/DOMObjectCache.cpp:
1643         (WebKit::DOMObjectCacheData::DOMObjectCacheData): Add constructor
1644         to initialize its members and simplify the callers.
1645         (WebKit::DOMObjectCacheData::clearObject): Remove the references
1646         added by the cache, ensuring the GObject is not finalized until
1647         the method returns.
1648         (WebKit::DOMObjectCacheData::refObject): Adds a reference owned by
1649         the cache.
1650         (WebKit::domObjectCacheFrameObservers): Map a frame to a FrameDestructionObserver.
1651         (WebKit::getOrCreateDOMObjectCacheFrameObserver): Create a new
1652         FrameDestructionObserver for the given Frame or return the
1653         existing one.
1654         (WebKit::domObjects): Map wrapped object to wrapper object.
1655         (WebKit::DOMObjectCache::forget): Remove the wrapped object from
1656         the cache.
1657         (WebKit::DOMObjectCache::get): Return the wrapped object if it is
1658         in the cache, increasing the cache references.
1659         (WebKit::DOMObjectCache::put): Add the wrapper object to the cache
1660         for the given wrapped object. If it's a Node and has a frame add
1661         the node to the FrameDestructionObserver corresponding to the frame.
1662         (WebKit::getFrameFromHandle): Deleted.
1663         (WebKit::weakRefNotify): Deleted.
1664         (WebKit::DOMObjectCache::clearByFrame): Deleted.
1665         (WebKit::DOMObjectCache::~DOMObjectCache): Deleted.
1666         * bindings/gobject/DOMObjectCache.h:
1667
1668 2015-02-17  ChangSeok Oh  <changseok.oh@collabora.com>
1669
1670         REGRESSION(r180050): It broke the !ENABLE(CSS_GRID_LAYOUT) build
1671         https://bugs.webkit.org/show_bug.cgi?id=141647
1672
1673         Reviewed by Csaba Osztrogonác.
1674
1675         No new tests since this just fixes a build break.
1676
1677         * dom/Position.cpp: Add a build guard ENABLE(CSS_GRID_LAYOUT) for RenderGrid.
1678         (WebCore::Position::isCandidate):
1679
1680 2015-02-16  Chris Dumez  <cdumez@apple.com>
1681
1682         Keep all memory cache resources in ListHashSets
1683         https://bugs.webkit.org/show_bug.cgi?id=141667
1684
1685         Reviewed by Andreas Kling.
1686
1687         Keep all memory cache resources in ListHashSets instead of manual linked
1688         lists. This simplifies the code a lot and is also more efficient for
1689         retrieving / removing particular CachedResources.
1690
1691         * loader/cache/CachedResource.cpp:
1692         (WebCore::CachedResource::CachedResource):
1693         * loader/cache/CachedResource.h:
1694         * loader/cache/MemoryCache.cpp:
1695         (WebCore::MemoryCache::pruneDeadResourcesToSize):
1696         (WebCore::MemoryCache::removeFromLRUList):
1697         (WebCore::MemoryCache::insertInLRUList):
1698         (WebCore::MemoryCache::dumpLRULists):
1699         (WebCore::MemoryCache::lruListFor): Deleted.
1700         * loader/cache/MemoryCache.h:
1701
1702 2015-02-16  Benjamin Poulain  <benjamin@webkit.org>
1703
1704         CSS JIT: finish :nth-last-child()
1705         https://bugs.webkit.org/show_bug.cgi?id=141629
1706
1707         Reviewed by Andreas Kling.
1708
1709         This patch adds the matcher for :nth-child(An+B of selector list) and
1710         fix a small bug I discovered while working on it.
1711
1712         The matcher is straightforward: count the next siblings matching the selector,
1713         nothing fancy.
1714
1715         While working on it I noticed I forgot the test for IsParsingChildrenFinished
1716         on the simple version of :nth-last-child(). I add it in both matcher, write
1717         a couple of tests, the first part of the tests now succeed, but the second part
1718         fails...
1719
1720         What happened is:
1721         1) We interupt the parsing to execute the JavaScript.
1722            From there, we force the style resolution to get the computed style.
1723         2) When resolving the style, the early check for isFinishedParsingChildren()
1724            quits the function early. This is done *before* we marked the parent
1725            for :nth-last-child() style resolution.
1726         3) After the script, parsing resume and the following elements are added.
1727         4) When resolving the style, only the new elements are marked dirty,
1728            the elements pending their :nth-last-child() style never get udpated.
1729
1730         To fix the problem, I moved the test for FinishedParsingChildren after
1731         the parent marking.
1732
1733         Honestly, those early return for FinishedParsingChildren need to be refined
1734         and they should be tested properly. We should not do this kind of things
1735         for Query for example.
1736
1737         Tests: fast/selectors/nth-last-child-cannot-match-during-parsing-1.html
1738                fast/selectors/nth-last-child-cannot-match-during-parsing-2.html
1739                fast/selectors/nth-last-child-of-cannot-match-during-parsing-1.html
1740                fast/selectors/nth-last-child-of-cannot-match-during-parsing-2.html
1741                fast/selectors/nth-last-child-of-register-requirement.html
1742
1743         * css/SelectorChecker.cpp:
1744         (WebCore::SelectorChecker::checkOne):
1745         Fix the tree marking.
1746
1747         * cssjit/SelectorCompiler.cpp:
1748         (WebCore::SelectorCompiler::addPseudoClassType):
1749         The fragment creation was already done, all I had to do was
1750         accept the compile.
1751
1752         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1753         :nth-child() and :nth-last-child() with a selector list are heavier than :not()
1754         and :matches(), move them accordingly.
1755
1756         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
1757         More the early return after the tree marking.
1758
1759         (WebCore::SelectorCompiler::setParentAffectedByLastChildOf):
1760         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
1761         New matcher, nothing optimized yet.
1762
1763 2015-02-16  Tim Horton  <timothy_horton@apple.com>
1764
1765         Adopt CAMachPort-as-layer-contents
1766         https://bugs.webkit.org/show_bug.cgi?id=141687
1767         <rdar://problem/19393233>
1768
1769         Reviewed by Simon Fraser.
1770
1771         No new tests, just a performance bump.
1772
1773         * platform/cocoa/MachSendRight.h:
1774         (WebCore::MachSendRight::operator bool):
1775         Add an operator bool() that checks if the underlying port is nonnull.
1776
1777         * platform/spi/cocoa/QuartzCoreSPI.h:
1778         Add some SPI.
1779
1780 2015-02-15  Sam Weinig  <sam@webkit.org>
1781
1782         Add experimental <attachment> element support
1783         https://bugs.webkit.org/show_bug.cgi?id=141626
1784
1785         Reviewed by Tim Horton.
1786
1787         Adds scaffolding for an experimental implementation of an <attachment> element
1788         which can represent a file attachment (e.g. NSTextAttachment in NSAttributedString
1789         parlance).
1790
1791         The implementation is guarded by both an #ifdef (ENABLE(ATTACHMENT_ELEMENT)) and 
1792         a setting (Settings::attachmentElementEnabled()).
1793
1794         Tests: fast/attachment/attachment-disabled-dom.html
1795                fast/attachment/attachment-disabled-rendering.html
1796                fast/attachment/attachment-dom.html
1797                fast/attachment/attachment-rendering.html
1798
1799         * Configurations/FeatureDefines.xcconfig:
1800         Add new ENABLE_ATTACHMENT_ELEMENT macro.
1801
1802         * CMakeLists.txt:
1803         * WebCore.vcxproj/WebCore.vcxproj:
1804         * WebCore.xcodeproj/project.pbxproj:
1805         Add new files.
1806
1807         * dom/make_names.pl:
1808         Add support for checking a setting to determine if a particular tag should be exposed.
1809
1810         * html/HTMLAttachmentElement.cpp: Added.
1811         * html/HTMLAttachmentElement.h: Added.
1812         Stub out the basics of the new element.
1813
1814         * html/HTMLElementsAllInOne.cpp:
1815         Add HTMLAttachmentElement.cpp.
1816
1817         * html/HTMLTagNames.in:
1818         Add 'attachment'.
1819
1820         * page/Settings.in:
1821         Add attachmentElementEnabled setting.
1822
1823         * rendering/RenderAttachment.cpp: Added.
1824         * rendering/RenderAttachment.h: Added.
1825         Stub out the basics of the new render. We will probably want to replace this with
1826         a non-replaced render, but this will do as a placeholder for now.
1827
1828         * rendering/RenderObject.h:
1829         (WebCore::RenderObject::isAttachment):
1830         Add predicate for type casting.
1831
1832         * rendering/RenderingAllInOne.cpp:
1833         Add RenderAttachment.cpp.
1834
1835 2015-02-16  Andreas Kling  <akling@apple.com>
1836
1837         GC (almost) immediately when navigating under memory pressure.
1838         <https://webkit.org/b/141663>
1839
1840         Reviewed by Geoffrey Garen.
1841
1842         Since the PageCache is already disabled in memory pressure situations,
1843         we know that detaching the old window shell on navigation is basically
1844         guaranteed to generate a bunch of garbage, we can soften the memory
1845         peak a bit by doing a GC right away instead of scheduling one for soon(tm).
1846
1847         * bindings/js/GCController.cpp:
1848         (WebCore::GCController::GCController):
1849         (WebCore::GCController::garbageCollectSoon):
1850         (WebCore::GCController::garbageCollectOnNextRunLoop):
1851         (WebCore::GCController::gcTimerFired):
1852         * bindings/js/GCController.h:
1853
1854             Add a GCController::garbageCollectOnNextRunLoop() complement to the
1855             "soon" and "now" options. There was already a zero timer in here for
1856             non-CF builds, so I just used that same timer to implement this
1857             and have the non-CF code path call garbageCollectOnNextRunLoop().
1858
1859         * bindings/js/ScriptController.cpp:
1860         (WebCore::collectGarbageAfterWindowShellDestruction):
1861         (WebCore::ScriptController::~ScriptController):
1862         (WebCore::ScriptController::clearWindowShell):
1863
1864             Under system memory pressure conditions, schedule a full GC on next
1865             runloop iteration instead of just asking for it to happen soon.
1866             We do it on next runloop to ensure that there's no pointer to the
1867             window object on the stack.
1868
1869 2015-02-16  Enrica Casucci  <enrica@apple.com>
1870
1871         Emoji sequences do not render properly.
1872         https://bugs.webkit.org/show_bug.cgi?id=141661
1873         rdar://problem/19820463
1874
1875         Reviewed by Sam Weinig.
1876
1877         Emoji sequences and emoji with variations should be rendered
1878         using the Complex code path and should be treated as graphemes.
1879         This change modifies advanceByCombiningCharacterSequence to add
1880         this logic.
1881
1882         Test: fast/text/emoji.html
1883
1884         * WebCore.xcodeproj/project.pbxproj:
1885         * platform/graphics/FontCascade.cpp:
1886         (WebCore::FontCascade::characterRangeCodePath):
1887         * platform/graphics/mac/ComplexTextController.cpp:
1888         (WebCore::advanceByCombiningCharacterSequence): Implements a simple
1889         logic to treat emoji sequences and emoji with variations as graphemes.
1890         * platform/text/CharacterProperties.h: Added.
1891         (WebCore::isEmojiGroupCandidate):
1892         (WebCore::isEmojiModifier):
1893         (WebCore::isVariationSelector):
1894         * rendering/RenderText.cpp:
1895         (WebCore::isEmojiGroupCandidate): Deleted.
1896         (WebCore::isEmojiModifier): Deleted.
1897
1898 2015-02-16  Zalan Bujtas  <zalan@apple.com>
1899
1900         RenderTableRow should check if it has access to its ancestor chain.
1901         https://bugs.webkit.org/show_bug.cgi?id=141668
1902
1903         Reviewed by Andreas Kling.
1904
1905         Preventive fix.
1906
1907         * rendering/RenderTableRow.cpp:
1908         (WebCore::RenderTableRow::styleDidChange):
1909         (WebCore::RenderTableRow::addChild):
1910         * rendering/RenderTableRow.h:
1911
1912 2015-02-16  Jer Noble  <jer.noble@apple.com>
1913
1914         [iOS] Build fix: declare undeclared identifier 'credential'.
1915
1916         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1917         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential):
1918
1919 2015-02-16  Jer Noble  <jer.noble@apple.com>
1920
1921         [iOS] Unable to play .mp4 file over http with basic http authentication
1922         https://bugs.webkit.org/show_bug.cgi?id=141503
1923         rdar://problem/15799844
1924
1925         Reviewed by Alexey Proskuryakov.
1926
1927         On iOS, CFNetwork is used for authentication, so the NSURLAuthenticationChallenge
1928         provided by AVAssetResourceLoader needs to be shoehorned into a AuthenticationChallenge
1929         object by way of CFURLAuthChallengeRef.
1930
1931         Create a new class, WebCoreNSURLAuthenticationChallengeClient, whose sole purpose
1932         is to take AuthenticationChallengeClient callbacks and pass them along to a
1933         NSURLAuthenticationChallenge sender.
1934
1935         Create a NSURLAuthenticationChallenge out of the CF version through an SPI, and add
1936         that SPI to a new header. Drive-by fix: take two of our existing SPI calls and move
1937         them into that same header.
1938
1939         * WebCore.xcodeproj/project.pbxproj: Add CFNSURLConnectionSPI.h to project.
1940         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1941         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Factory.
1942         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Simple constructor.
1943         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Pass to m_challenge.
1944         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Ditto.
1945         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Ditto.
1946         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Ditto.
1947         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Ditto.
1948         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
1949             Create an AuthenticationChallenge out of the nsChallenge and client and pass it up
1950             to the HTMLMediaElement.
1951         * platform/network/mac/AuthenticationMac.mm:
1952         * platform/spi/cocoa/CFNSURLConnectionSPI.h: Added.
1953
1954 2015-02-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1955
1956         Revert a change in SVGRenderSupport::mapLocalToContainer committed for fixing <https://bugs.webkit.org/show_bug.cgi?id=119626>.
1957         https://bugs.webkit.org/show_bug.cgi?id=138439
1958
1959         Reviewed by Darin Adler.
1960
1961         The change http://trac.webkit.org/changeset/164861 was ported from Blink
1962         but it was was revert later because it broke Chrome SVG rendering. It also
1963         broke the WebKit SVG text search highlighting.
1964         
1965         Tests: svg/transforms/svg-geometry-crash.html: This test was added by the
1966         blamed change. A new but correct solution is required to fix the assertion.
1967
1968         * rendering/svg/SVGRenderSupport.h:
1969         * rendering/svg/SVGRenderSupport.cpp:
1970         Notice that TransformState.applyTransform() does matrix-left-multiplication,
1971         i.e. state = transform * state. But operator*() of AffineTransform and
1972         MatrixTransform  does right multiply, i.e. this = this * transform.
1973         
1974         (WebCore::SVGRenderSupport::localToParentTransform): Have the calculation
1975         of the SVG localToParentTransform in one shared function.
1976         
1977         (WebCore::SVGRenderSupport::mapLocalToContainer): Revert the Blink change.
1978         If the parent is the SVG root, the transform state should be equal to
1979         transform = svg_to_css_mapping * local_to_parent_mapping * transform.
1980         
1981         (WebCore::SVGRenderSupport::pushMappingToContainer): Get the localToParent
1982         transform to be pushed in the geometryMap. If the parent is the SVG root,
1983         localToParent = svg_to_css_mapping * local_to_parent_mapping. The original
1984         code was doing the opposite and this is the cause of the assertion which 
1985         was fixed wrongly by reversing the correct multiplication order in 
1986         SVGRenderSupport::mapLocalToContainer().
1987
1988 2015-02-16  Zalan Bujtas  <zalan@apple.com>
1989
1990         RenderTableCell can't access its parent while in detached state.
1991         https://bugs.webkit.org/show_bug.cgi?id=141639
1992         rdar://problem/19850760
1993
1994         Reviewed by Simon Fraser.
1995
1996         Null check against ancestor chain so that certain methods in RenderTableCell can
1997         be called even if the renderer is not yet attached.
1998
1999         Test: fast/table/table-cell-crash-when-detached-state.html
2000
2001         * rendering/RenderTableCell.cpp:
2002         (WebCore::RenderTableCell::borderLeft):
2003         (WebCore::RenderTableCell::borderRight):
2004         (WebCore::RenderTableCell::borderTop):
2005         (WebCore::RenderTableCell::borderBottom):
2006         (WebCore::RenderTableCell::borderStart):
2007         (WebCore::RenderTableCell::borderEnd):
2008         (WebCore::RenderTableCell::borderBefore):
2009         (WebCore::RenderTableCell::borderAfter):
2010         * rendering/RenderTableCell.h:
2011
2012 2015-02-16  David Hyatt  <hyatt@apple.com>
2013
2014         Add ifdefs to avoid adjusting Ruby selection rects to avoid overlap on iOS.
2015         https://bugs.webkit.org/show_bug.cgi?id=141651
2016         <rdar://problem/19182526>
2017         
2018         Reviewed by Simon Fraser.
2019
2020         * rendering/RootInlineBox.cpp:
2021         (WebCore::RootInlineBox::selectionTop):
2022         (WebCore::RootInlineBox::selectionBottom):
2023
2024 2015-02-16  David Kilzer  <ddkilzer@apple.com>
2025
2026         SoftLinking.h: Update copyright and license; clean up whitespace
2027
2028         * platform/mac/SoftLinking.h:
2029
2030 2015-02-12  David Hyatt  <hyatt@apple.com>
2031
2032         text-underline-position:under has multiple correctness issues
2033         https://bugs.webkit.org/show_bug.cgi?id=141528
2034
2035         Reviewed by Dean Jackson.
2036
2037         Added a bunch of new tests in fast/text
2038
2039         * rendering/InlineFlowBox.cpp:
2040         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine):
2041         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine):
2042         (WebCore::InlineFlowBox::computeMaxLogicalBottom): Deleted.
2043         * rendering/InlineFlowBox.h:
2044         These functions have been re-written to take an enclosing renderer that specified the
2045         decoration. This way they can properly limit the bottom/top computation to only line boxes
2046         that are contained inside the renderer.
2047
2048         * rendering/InlineTextBox.cpp:
2049         (WebCore::InlineTextBox::paintDecoration):
2050         Tweak the call to get the decoration colors now that quirks mode has been removed.
2051
2052         * rendering/RenderElement.cpp:
2053         (WebCore::RenderElement::enclosingRendererWithTextDecoration):
2054         * rendering/RenderElement.h:
2055         New function that finds the enclosing renderer that specified a text decoration. For now
2056         this is only used in the "under" position computation, but soon we'll be using it
2057         everywhere.
2058
2059         * rendering/RenderObject.cpp:
2060         (WebCore::RenderObject::getTextDecorationColors):
2061         * rendering/RenderObject.h:
2062         Remove the quirks mode argument, since we were always passing true anyway (making the argument dead).
2063
2064         * rendering/RootInlineBox.cpp:
2065         (WebCore::RootInlineBox::maxLogicalBottom): Deleted.
2066         * rendering/RootInlineBox.h:
2067         Get rid of these functions and just have InlineTextBoxStyle's computeUnderLineOffset function call
2068         the InlineFlowBox functions directly.
2069
2070         * style/InlineTextBoxStyle.cpp:
2071         (WebCore::computeUnderlineOffset):
2072         Re-written to fetch the enclosingRendererWithTextDecoration so that it can be passed to the logical top/bottom
2073         computation to limit which line boxes get included.
2074
2075 2015-02-16  Brent Fulgham  <bfulgham@apple.com>
2076
2077         FEGaussianBlur::calculateUnscaledKernelSize does unspeakable things with signed and unsigned values
2078         https://bugs.webkit.org/show_bug.cgi?id=141596
2079         <rdar://problem/19837103>
2080
2081         Reviewed by Zalan Bujtas.
2082
2083         No new tests. Covered by css3/filters/huge-blur-value.html
2084
2085         Avoid overflowing the signed integer values by not converting from unsigned
2086         until the maximum size has been clamped to the expected max.
2087
2088         * platform/graphics/filters/FEGaussianBlur.cpp:
2089         (WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
2090
2091 2015-02-13  Sergio Villar Senin  <svillar@igalia.com>
2092
2093         [CSS Grid Layout] Invalid initialization of track sizes with non spanning grid items
2094         https://bugs.webkit.org/show_bug.cgi?id=140763
2095
2096         Reviewed by Antti Koivisto.
2097
2098         Content sized tracks with non-spanning grid items were not
2099         properly sized because the growth limit was sometimes infinity
2100         (-1) after calling resolveContentBasedTrackSizingFunctions() when
2101         it should not. This patch adds an special initialization phase for
2102         non-spanning grid items as the new track sizing algorithm
2103         describes.
2104
2105         Granted, that was handled in the old algorithm in
2106         distributeSpaceToTracks() as a special case. The problem is that
2107         it regressed after the optimization added in r173868 because that
2108         method is no longer called when the space to distribute is 0.
2109
2110         That's why we could fix this by allowing calls to
2111         distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing
2112         it with an explicit initialization our implementation becomes
2113         closer to the new algorithm and the initialization is now explicit
2114         in the code instead of a side effect of calling
2115         distributeSpaceToTracks() with no space to be distributed. It also
2116         brings a slight performance improvement as we save sorts and hash
2117         lookups.
2118
2119         I also took the change to add caching to several GridTrackSize
2120         methods that were hot on the profiler (each one accounted for ~1%
2121         of the total time, now they account for ~0.3% each).
2122
2123         Test: fast/css-grid-layout/grid-initialize-span-one-items.html
2124
2125         * rendering/RenderGrid.cpp:
2126         (WebCore::GridItemWithSpan::span): New helper method for ASSERTs.
2127         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2128         Exclude non spanning grid items from the calls to
2129         resolveContentBasedTrackSizingFunctionsForItems().
2130         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2131         New method to resolve track sizes only using non-spanning grid
2132         items.
2133         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2134         Ensure that it isn't called for non-spanning grid items.
2135         * rendering/RenderGrid.h:
2136         * rendering/style/GridTrackSize.h:
2137         (WebCore::GridTrackSize::GridTrackSize): Cache return values.
2138         (WebCore::GridTrackSize::setLength): Ditto.
2139         (WebCore::GridTrackSize::setMinMax): Ditto.
2140         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes): New method
2141         that caches the return values for hasXXXTrackBreadth() methods.
2142         (WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth): Use
2143         the cached return value.
2144         (WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth): Ditto.
2145         (WebCore::GridTrackSize::hasMinContentMaxTrackBreadth): Ditto.
2146         (WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth): Ditto.
2147         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadth): Ditto.
2148         (WebCore::GridTrackSize::hasMinContentMinTrackBreadth): Ditto.
2149         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
2150         Ditto.
2151         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
2152         Ditto.
2153
2154 2015-02-16  Milan Crha  <mcrha@redhat.com>
2155
2156         [GTK] Loading page into WebView shows g_closure_unref warning
2157         https://bugs.webkit.org/show_bug.cgi?id=127474
2158
2159         Reviewed by Carlos Garcia Campos.
2160
2161         * bindings/gobject/GObjectEventListener.cpp:
2162         (WebCore::GObjectEventListener::gobjectDestroyed):
2163
2164 2015-02-13  Sergio Villar Senin  <svillar@igalia.com>
2165
2166         [CSS Grid Layout] Remove the usage of Length(Undefined) in GridLength
2167         https://bugs.webkit.org/show_bug.cgi?id=141562
2168
2169         Reviewed by Chris Dumez.
2170
2171         From Blink r164154 by <timloh@chromium.org>
2172
2173         The patch simplifies some of the logic in creating and applying
2174         GridLength and GridTrackSize values to RenderStyles by using the
2175         constructors for initialisation instead of deferring to setters.
2176
2177         The rationale behind this change is that neither of
2178         createGridTrackSize() nor createGridTrackBreadth() should be able
2179         to fail, so these are changed to return objects directly instead
2180         of taking an out reference (note that in general failing in
2181         applying properties is incorrect and we should catch these in the
2182         parser).
2183
2184         The quirk value across to the Lengths was also removed because it
2185         doesn't apply to Grid.
2186
2187         * css/CSSPropertyNames.in:
2188         * css/StyleBuilderConverter.h:
2189         (WebCore::StyleBuilderConverter::createGridTrackBreadth): Return a
2190         GridLength instead of a bool.
2191         (WebCore::StyleBuilderConverter::createGridTrackSize): Return a
2192         GridTrackSize instead of a bool.
2193         (WebCore::StyleBuilderConverter::createGridTrackList): Do not
2194         create temporary GridTrackSizes with undefined Lengths.
2195         (WebCore::StyleBuilderConverter::convertGridTrackSize): Ditto.
2196         * rendering/style/GridLength.h:
2197         (WebCore::GridLength::GridLength): It now requires a mandatory
2198         Length argument.
2199         (WebCore::GridLength::length): Deleted.
2200         (WebCore::GridLength::setFlex): Deleted.
2201         * rendering/style/GridTrackSize.h:
2202         (WebCore::GridTrackSize::GridTrackSize): It now requires a
2203         mandatory GridLength argument.
2204         (WebCore::GridTrackSize::length): Removed no longer valid ASSERTs.
2205         (WebCore::GridTrackSize::minTrackBreadth): Ditto.
2206         (WebCore::GridTrackSize::maxTrackBreadth): Ditto.
2207         (WebCore::GridTrackSize::setLength): Deleted.
2208         (WebCore::GridTrackSize::setMinMax): Deleted.
2209         * rendering/style/RenderStyle.h:
2210
2211 2015-02-13  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
2212
2213         Removing text node does not remove its associated markers
2214         https://bugs.webkit.org/show_bug.cgi?id=140999
2215
2216         Reviewed by Ryosuke Niwa.
2217
2218         Removing text node via script does not remove its markers.
2219         For example, running the following script:
2220
2221         <script>
2222             var div = document.getElementById("testElement");
2223             div.focus();
2224             document.execCommand("InsertText", false, "welllcome ");
2225
2226             // Give a time async spellchecker to show its markers and
2227             // remove the node.
2228             setTimeout(function() { div.removeChild(div.firstChild); }, 100);
2229         </script>
2230
2231         will cause that DocumentMarkerController still stores the markers for
2232         detached node.
2233
2234         The same issue occurs when the text gets cleared, for example,
2235         <script>
2236             input.value = ""; // for HTMLTextAreaElement, HTMLInputElement
2237             // or
2238             div.innerHTML = ""; // for content editable
2239         </script>
2240
2241         No new tests. Internals marker APIs operate on text node attached
2242         to the element. To test it we could expose document().markers().hasMarkers()
2243         but there is no more useful cases where it could be used.
2244         Another obstacle is that we are in isInShadowTree() so that there is
2245         no possible to register on "DOMSubtreeModified" event.
2246         Test cases attached to the bug:
2247         1. input.value = ""  https://bug-140999-attachments.webkit.org/attachment.cgi?id=245704
2248         2. elem.removeChild(textNode) https://bug-140999-attachments.webkit.org/attachment.cgi?id=246515
2249
2250         Remove markers when text nodes are about to remove.
2251         * dom/Document.cpp:
2252         (WebCore::Document::nodeChildrenWillBeRemoved):
2253         Fixes input.value = ""
2254         (WebCore::Document::nodeWillBeRemoved):
2255         Fixes elem.removeChild(textNode)
2256
2257 2015-02-15  David Kilzer  <ddkilzer@apple.com>
2258
2259         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
2260         <http://webkit.org/b/141607>
2261
2262         This should fix the build, but leaves a FIXME list in
2263         WebCore.unexp.
2264
2265         * Configurations/WebCore.unexp: Add weak externals with a FIXME
2266         statement so they can be removed later.  It's more important to
2267         fix the build first.
2268
2269         * Configurations/WebCore.xcconfig: Change XCODE_VERSION_MINOR to
2270         XCODE_VERSION_MAJOR since the internal bots use version 5.1.1
2271         which still has the error.
2272
2273 2015-02-15  Brian J. Burg  <burg@cs.washington.edu>
2274
2275         Web Inspector: remove unused XHR replay code
2276         https://bugs.webkit.org/show_bug.cgi?id=141622
2277
2278         Reviewed by Timothy Hatcher.
2279
2280         XHR Replay functionality became unused with the last frontend rewrite.
2281         Remove instrumentation and data storage classes only used by this feature.
2282
2283         * inspector/InspectorInstrumentation.cpp:
2284         (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClientImpl): Deleted.
2285         (WebCore::InspectorInstrumentation::willLoadXHRImpl): Deleted.
2286         (WebCore::InspectorInstrumentation::didFailXHRLoadingImpl): Deleted.
2287         * inspector/InspectorInstrumentation.h:
2288         (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient): Deleted.
2289         (WebCore::InspectorInstrumentation::willLoadXHR): Deleted.
2290         (WebCore::InspectorInstrumentation::didFailXHRLoading): Deleted.
2291         * inspector/InspectorResourceAgent.cpp:
2292         (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
2293         (WebCore::InspectorResourceAgent::didFinishXHRLoading):
2294         (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): Deleted.
2295         (WebCore::InspectorResourceAgent::willLoadXHR): Deleted.
2296         (WebCore::InspectorResourceAgent::didFailXHRLoading): Deleted.
2297         (WebCore::InspectorResourceAgent::replayXHR): Deleted.
2298         * inspector/InspectorResourceAgent.h:
2299         * inspector/NetworkResourcesData.cpp:
2300         (WebCore::NetworkResourcesData::clear):
2301         (WebCore::XHRReplayData::create): Deleted.
2302         (WebCore::XHRReplayData::XHRReplayData): Deleted.
2303         (WebCore::NetworkResourcesData::xhrReplayData): Deleted.
2304         (WebCore::NetworkResourcesData::setXHRReplayData): Deleted.
2305         (WebCore::NetworkResourcesData::reuseXHRReplayData): Deleted.
2306         * inspector/NetworkResourcesData.h:
2307         (WebCore::XHRReplayData::method): Deleted.
2308         (WebCore::XHRReplayData::url): Deleted.
2309         (WebCore::XHRReplayData::async): Deleted.
2310         (WebCore::XHRReplayData::formData): Deleted.
2311         (WebCore::XHRReplayData::headers): Deleted.
2312         (WebCore::XHRReplayData::includeCredentials): Deleted.
2313         (WebCore::NetworkResourcesData::ResourceData::xhrReplayData): Deleted.
2314         (WebCore::NetworkResourcesData::ResourceData::setXHRReplayData): Deleted.
2315         * loader/DocumentThreadableLoader.cpp:
2316         (WebCore::DocumentThreadableLoader::loadRequest):
2317         * xml/XMLHttpRequest.cpp:
2318         (WebCore::XMLHttpRequest::createRequest):
2319         (WebCore::XMLHttpRequest::internalAbort):
2320         (WebCore::XMLHttpRequest::sendForInspectorXHRReplay): Deleted.
2321         * xml/XMLHttpRequest.h:
2322
2323 2015-02-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
2324
2325         Crash when accessing an item in SVGTransformList and then removing a previous item from this list.
2326         https://bugs.webkit.org/show_bug.cgi?id=141550.
2327
2328         Reviewed by David Kilzer.
2329
2330         * svg/properties/SVGMatrixTearOff.h:
2331         (WebCore::SVGMatrixTearOff::create): Fix a compilation error on the release build.
2332         The ASSERT() here references a parameter which is not used anywhere else. We need 
2333         to change it to ASSERT_UNUSED(). 
2334
2335 2015-02-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
2336
2337         Crash when accessing an item in SVGTransformList and then removing a previous item from this list.
2338         https://bugs.webkit.org/show_bug.cgi?id=141550.
2339
2340         Reviewed by Darin Adler.
2341
2342         Tests: LayoutTests/svg/dom/SVGTransformList-basics.xhtml: This test is modified to
2343         include a new test case.
2344
2345         * svg/properties/SVGMatrixTearOff.h: m_value of SVGMatrixTearOff will be a null
2346         pointer. There is no point in having SVGMatrixTearOff points to the parent and
2347         the property of the parent at the same time.
2348         
2349         (WebCore::SVGMatrixTearOff::create): SVGMatrixTearOff will hold a pointer to
2350         the parent SVGPropertyTearOff<SVGTransform>. But it should overrides setValue()
2351         and propertyReference() so it can set and get the SVGMatrix from the SVGTransform
2352         parent.
2353         
2354         (WebCore::SVGMatrixTearOff::SVGMatrixTearOff): Pass a nullptr to the base class.
2355         SVGMatrixTearOff will act as a proxy of the parent. It does not hold any data by
2356         itself but it knows what property to set and get from the parent.
2357         
2358         * svg/properties/SVGPropertyTearOff.h:
2359         (WebCore::SVGPropertyTearOff::create): Add a create method which can take a pointer value.
2360         
2361         (WebCore::SVGPropertyTearOff::propertyReference):
2362         (WebCore::SVGPropertyTearOff::setValue): Make these functions virtual so concrete classes
2363         like SVGMatrixTearOff can override them.
2364         
2365         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff): Add a new constructor.
2366
2367 2015-02-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
2368
2369         Crash when accessing an item in SVGLengthList and then replacing it with a previous item in the list.
2370         https://bugs.webkit.org/show_bug.cgi?id=141552.
2371
2372         Reviewed by Darin Adler.
2373
2374         Tests: LayoutTests/svg/dom/SVGLengthList-basics.xhtml: This test is modified to
2375         include a new test case.
2376
2377         * svg/properties/SVGListPropertyTearOff.h: Commit the removal of the replacing item
2378         before trying to detach the wrapper of the item which going to be replaced.
2379
2380 2015-02-15  David Kilzer  <ddkilzer@apple.com>
2381
2382         CoreText only needs to be soft-linked on Windows
2383
2384         More work towards the Maverick Debug build fix:
2385
2386         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
2387         <http://webkit.org/b/141607>
2388
2389         * page/CaptionUserPreferencesMediaAF.cpp:
2390
2391 2015-02-15  Alexey Proskuryakov  <ap@apple.com>
2392
2393         More build fixing.
2394
2395         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
2396
2397 2015-02-14  Alexey Proskuryakov  <ap@apple.com>
2398
2399         More internal build fixing.
2400
2401         DDDFACache.h is not an actual private header, so we were using open source
2402         redeclaration of DDDFACacheRef with an internal function prototype from DDDFAScanner.h.
2403
2404         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
2405         (WebCore::TelephoneNumberDetector::phoneNumbersScanner):
2406
2407 2015-02-14  Benjamin Poulain  <benjamin@webkit.org>
2408
2409         Add the initial matching implementation for attribute selectors with case-insensitive value
2410         https://bugs.webkit.org/show_bug.cgi?id=141615
2411
2412         Reviewed by Andreas Kling.
2413
2414         Tests: fast/css/case-insensitive-attribute-selector-specificity.html
2415                fast/css/case-insensitive-attribute-selector-styling-html-1.html
2416                fast/css/case-insensitive-attribute-selector-styling-html-2.html
2417                fast/css/case-insensitive-attribute-selector-styling-html-3.html
2418                fast/css/case-insensitive-attribute-selector-styling-xhtml-1.xhtml
2419                fast/css/case-insensitive-attribute-selector-styling-xhtml-2.xhtml
2420                fast/css/case-insensitive-attribute-selector-styling-xhtml-3.xhtml
2421                fast/selectors/case-insensitive-attribute-bascis.html
2422                fast/selectors/case-insensitive-attribute-matching-style-attribute.html
2423                fast/selectors/case-insensitive-attribute-style-update.html
2424                fast/selectors/case-insensitive-attribute-with-case-sensitive-name.html
2425
2426         * css/SelectorChecker.cpp:
2427         (WebCore::SelectorChecker::checkOne):
2428         We already had case-insensitive value matching due to some legacy HTML
2429         behaviors where some attribute values would be matched case-insensitively
2430         depending on the attribute name.
2431
2432         For this patch, I just re-use the same mechanism. I used branches to try
2433         to convey the idea that matching is case sensitive by default unless
2434         the selector has a flag or we are in the weird HTML exception.
2435
2436         * cssjit/SelectorCompiler.cpp:
2437         (WebCore::SelectorCompiler::constructFragmentsInternal):
2438         Disable that case in the CSS JIT for now, I'll implement it later.
2439
2440 2015-02-14  David Kilzer  <ddkilzer@apple.com>
2441
2442         Declare soft-linked functions with extern "C" linkage
2443
2444         More work towards the Maverick Debug build fix:
2445
2446         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
2447         <http://webkit.org/b/141607>
2448
2449         * platform/mac/SoftLinking.h: Try declaring soft-linked
2450         functions with extern "C" linkage to see if they stop appearing
2451         as weak externals.  This has the added benefit that if the
2452         function signature changes, we'll get a build failure.
2453
2454 2015-02-14  Joseph Pecoraro  <pecoraro@apple.com>
2455
2456         [Mac] RetainPtr member cleanup, possible leaks
2457         https://bugs.webkit.org/show_bug.cgi?id=141616
2458
2459         Reviewed by Andreas Kling.
2460
2461         * platform/mac/PlatformSpeechSynthesizerMac.mm:
2462         (-[WebSpeechSynthesisWrapper speakUtterance:]):
2463         Adopt the allocated object to avoid a possible leak.
2464
2465         * platform/mac/ScrollAnimatorMac.mm:
2466         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
2467         Adopt to avoid unnecessary retain/autorelease.
2468
2469 2015-02-14  Joseph Pecoraro  <pecoraro@apple.com>
2470
2471         IncompleteMetaDataCue leak seen on leaks bot
2472         https://bugs.webkit.org/show_bug.cgi?id=141611
2473
2474         Reviewed by Eric Carlson.        
2475
2476         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
2477         (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): Deleted.
2478         (WebCore::IncompleteMetaDataCue::~IncompleteMetaDataCue): Deleted.
2479         (WebCore::IncompleteMetaDataCue::cueData): Deleted.
2480         (WebCore::IncompleteMetaDataCue::startTime): Deleted.
2481         Convert to a struct and hold a list of structs instead of pointers.
2482
2483         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
2484         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
2485         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
2486         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
2487         Update use of IncompleteMetaDataCue and modernize related code.
2488
2489 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
2490
2491         Web Inspector: remove some unnecessary Inspector prefixes from class names in Inspector namespace
2492         https://bugs.webkit.org/show_bug.cgi?id=141372
2493
2494         Reviewed by Joseph Pecoraro.
2495
2496         * WebCore.exp.in:
2497         * inspector/InspectorApplicationCacheAgent.cpp:
2498         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
2499         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
2500         * inspector/InspectorApplicationCacheAgent.h:
2501         * inspector/InspectorCSSAgent.cpp:
2502         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
2503         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
2504         * inspector/InspectorCSSAgent.h:
2505         * inspector/InspectorController.cpp:
2506         (WebCore::InspectorController::InspectorController):
2507         (WebCore::InspectorController::inspectedPageDestroyed):
2508         (WebCore::InspectorController::connectFrontend):
2509         (WebCore::InspectorController::disconnectFrontend):
2510         (WebCore::InspectorController::show):
2511         (WebCore::InspectorController::close):
2512         (WebCore::InspectorController::dispatchMessageFromFrontend):
2513         * inspector/InspectorController.h:
2514         * inspector/InspectorDOMAgent.cpp:
2515         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
2516         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
2517         * inspector/InspectorDOMAgent.h:
2518         * inspector/InspectorDOMDebuggerAgent.cpp:
2519         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
2520         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
2521         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
2522         (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
2523         (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
2524         (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
2525         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
2526         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
2527         * inspector/InspectorDOMDebuggerAgent.h:
2528         * inspector/InspectorDOMStorageAgent.cpp:
2529         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
2530         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
2531         * inspector/InspectorDOMStorageAgent.h:
2532         * inspector/InspectorDatabaseAgent.cpp:
2533         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
2534         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
2535         * inspector/InspectorDatabaseAgent.h:
2536         * inspector/InspectorDatabaseResource.cpp:
2537         (WebCore::InspectorDatabaseResource::bind):
2538         * inspector/InspectorDatabaseResource.h:
2539         * inspector/InspectorForwarding.h:
2540         * inspector/InspectorIndexedDBAgent.cpp:
2541         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
2542         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
2543         * inspector/InspectorIndexedDBAgent.h:
2544         * inspector/InspectorLayerTreeAgent.cpp:
2545         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
2546         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
2547         * inspector/InspectorLayerTreeAgent.h:
2548         * inspector/InspectorPageAgent.cpp:
2549         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
2550         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
2551         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
2552         * inspector/InspectorPageAgent.h:
2553         * inspector/InspectorReplayAgent.cpp:
2554         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
2555         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
2556         * inspector/InspectorReplayAgent.h:
2557         * inspector/InspectorResourceAgent.cpp:
2558         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
2559         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
2560         * inspector/InspectorResourceAgent.h:
2561         * inspector/InspectorStyleSheet.cpp:
2562         (WebCore::InspectorStyle::styleWithProperties):
2563         * inspector/InspectorTimelineAgent.cpp:
2564         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
2565         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2566         * inspector/InspectorTimelineAgent.h:
2567         * inspector/InspectorWorkerAgent.cpp:
2568         (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::WorkerFrontendChannel):
2569         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
2570         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
2571         * inspector/InspectorWorkerAgent.h:
2572         * inspector/PageRuntimeAgent.cpp:
2573         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
2574         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
2575         * inspector/PageRuntimeAgent.h:
2576         * inspector/WorkerInspectorController.cpp:
2577         (WebCore::WorkerInspectorController::~WorkerInspectorController):
2578         (WebCore::WorkerInspectorController::connectFrontend):
2579         (WebCore::WorkerInspectorController::disconnectFrontend):
2580         * inspector/WorkerInspectorController.h:
2581         * inspector/WorkerRuntimeAgent.cpp:
2582         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
2583         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
2584         * inspector/WorkerRuntimeAgent.h:
2585         * loader/EmptyClients.h:
2586         * page/PageDebuggable.cpp:
2587         (WebCore::PageDebuggable::connect):
2588         (WebCore::PageDebuggable::disconnect):
2589         * page/PageDebuggable.h:
2590         * testing/Internals.cpp:
2591         (WebCore::Internals::closeDummyInspectorFrontend):
2592         * workers/WorkerMessagingProxy.cpp:
2593         (WebCore::WorkerMessagingProxy::disconnectFromInspector):
2594
2595 2015-02-14  David Kilzer  <ddkilzer@apple.com>
2596
2597         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
2598         <http://webkit.org/b/141607>
2599
2600         Work towards fixing the Mavericks Debug build.
2601
2602         * dom/Document.h:
2603         (WebCore::Document::setAnnotatedRegionsDirty):
2604         * dom/Event.h:
2605         (WebCore::Event::create):
2606         * dom/Node.h:
2607         (WebCore::Node::hasEditableStyle):
2608         * dom/Position.h:
2609         (WebCore::Position::Position):
2610         * editing/FrameSelection.h:
2611         (WebCore::DragCaretController::clear):
2612         * loader/ResourceLoader.h:
2613         (WebCore::ResourceLoader::originalRequest):
2614         - Do not mark inline methods for export.
2615
2616 2015-02-14  Alexey Proskuryakov  <ap@apple.com>
2617
2618         rel="noreferrer" should make window.opener null
2619         https://bugs.webkit.org/show_bug.cgi?id=141579
2620
2621         Reviewed by Darin Adler.
2622
2623         Tests: http/tests/navigation/target-blank-opener-post.html
2624                http/tests/navigation/target-blank-opener.html
2625
2626         We used to avoid passing window.opener policy by temporarily storing it in a FrameLoader
2627         member variable. This works for some clients - ones that invoke delegate callbacks
2628         synchronously - but not in the general case.
2629
2630         So, changed to passing the policy explicitly.
2631
2632         * WebCore.exp.in:
2633         * loader/FrameLoader.cpp:
2634         (WebCore::FrameLoader::FrameLoader):
2635         (WebCore::FrameLoader::urlSelected):
2636         (WebCore::FrameLoader::loadURLIntoChildFrame):
2637         (WebCore::FrameLoader::loadFrameRequest):
2638         (WebCore::FrameLoader::loadURL):
2639         (WebCore::FrameLoader::load):
2640         (WebCore::FrameLoader::loadPostRequest):
2641         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2642         * loader/FrameLoader.h:
2643         (WebCore::FrameLoader::suppressOpenerInNewFrame): Deleted.
2644         * loader/FrameLoaderTypes.h:
2645         * loader/NavigationScheduler.cpp:
2646         * page/ContextMenuController.cpp:
2647         (WebCore::openNewWindow):
2648         (WebCore::ContextMenuController::contextMenuItemSelected):
2649
2650 2015-02-14  David Kilzer  <ddkilzer@apple.com>
2651
2652         REGRESSION (r180082): WebCore build on Mountain Lion fails due to weak export for i386
2653         <rdar://problem/19838127>
2654
2655         * Configurations/WebCore.unexp: Add missing symbol.
2656
2657 2015-02-13  Chris Dumez  <cdumez@apple.com>
2658
2659         RenderListItem resets its marker's style on style change even if the diff is StyleDifferenceEqual
2660         https://bugs.webkit.org/show_bug.cgi?id=141572
2661         <rdar://problem/19759818>
2662
2663         Reviewed by Simon Fraser.
2664
2665         Do not unnecessarily update the marker's style in RenderListItem::styleDidChange()
2666         if the RenderStyle diff is StyleDifferenceEqual. Doing so can cause unnecessary
2667         layouts.
2668
2669         This was causing high cpu usage on
2670         http://www.nokogiri.org/tutorials/searching_a_xml_html_document.html because there
2671         is an animation that changes the style every second (but the diff is equal) and the
2672         RenderListItem keeps resetting its marker's margin, which triggers a layout and the
2673         RenderListMarker re-computes its margin during layout and updates its style again.
2674
2675         With this change, CPU usage on the page goes from 150% to 20%. There is only a style
2676         recalc happening every second, no more relayouts and repaints.
2677
2678         Test: fast/repaint/list-item-equal-style-change-no-repaint.html
2679
2680         * rendering/RenderListItem.cpp:
2681         (WebCore::RenderListItem::styleDidChange):
2682
2683 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
2684
2685         Make WebCore::IOSurface have single ownership instead of refcounting
2686         https://bugs.webkit.org/show_bug.cgi?id=141578
2687
2688         Reviewed by Anders Carlsson.
2689
2690         In the interests of making it harder to misuse and to make it more like
2691         ImageBuffer, our IOSurface wrapper should have single ownership.
2692
2693         This will also allow future changes which depend on temporarily
2694         consuming an IOSurface to more easily enforce correct usage.
2695
2696         * WebCore.exp.in:
2697         * platform/graphics/cg/IOSurfacePool.cpp:
2698         (WebCore::IOSurfacePool::takeSurface):
2699         (WebCore::IOSurfacePool::addSurface):
2700         (WebCore::IOSurfacePool::insertSurfaceIntoPool):
2701         (WebCore::IOSurfacePool::tryEvictInUseSurface):
2702         (WebCore::IOSurfacePool::tryEvictOldestCachedSurface):
2703         (WebCore::IOSurfacePool::collectInUseSurfaces):
2704         * platform/graphics/cg/IOSurfacePool.h:
2705         * platform/graphics/cocoa/IOSurface.h:
2706         * platform/graphics/cocoa/IOSurface.mm:
2707         (IOSurface::create):
2708         (IOSurface::createFromSendRight):
2709         (IOSurface::createFromSurface):
2710         (IOSurface::createFromImage):
2711         Make IOSurface::create()s return a unique_ptr, and adjust everywhere.
2712
2713 2015-02-12  Enrica Casucci  <enrica@apple.com>
2714
2715         Additional emoji group support.
2716         https://bugs.webkit.org/show_bug.cgi?id=141539
2717         rdar://problem/19727527
2718
2719         Reviewed by Sam Weinig.
2720
2721         Adding some new emoji ligatures.
2722         Updated existing test to include the new sequences.
2723
2724         * platform/text/TextBreakIterator.cpp:
2725         (WebCore::cursorMovementIterator):
2726         * rendering/RenderText.cpp:
2727         (WebCore::isEmojiGroupCandidate):
2728
2729 2015-02-13  Alex Christensen  <achristensen@webkit.org>
2730
2731         Really stop using export files.
2732         https://bugs.webkit.org/show_bug.cgi?id=141521
2733
2734         Reviewed by Mark Rowe.
2735
2736         * Configurations/WebCore.xcconfig:
2737         Don't use exported symbols files.
2738         * Configurations/WebCore.unexp:
2739         Added list of symbols not to export (needed by Xcode 5.0.2).
2740
2741 2015-02-13  Zalan Bujtas  <zalan@apple.com>
2742
2743         Simplify ASSERT in lastRubyRun().
2744         https://bugs.webkit.org/show_bug.cgi?id=141574
2745
2746         Reviewed by Daniel Bates.
2747
2748         r180064 made some of the conditions in the ASSERT redundant.
2749
2750         Covered by existing tests.
2751
2752         * rendering/RenderRuby.cpp:
2753         (WebCore::lastRubyRun):
2754
2755 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
2756
2757         [Mac, iOS] Adjust pagination behavior for Mail.app printing use
2758         https://bugs.webkit.org/show_bug.cgi?id=141569
2759         <rdar://problem/14912763>
2760
2761         Reviewed by Anders Carlsson.
2762
2763         * page/Settings.in: Add new pagination setting flag.
2764         * rendering/RenderBlockFlow.cpp:
2765         (WebCore::messageContainerName): Added.
2766         (WebCore::needsPaginationQuirk): Added.
2767         (WebCore::RenderBlockFlow::adjustLinePositionForPagination): Don't move the message content
2768         div to a new page when using this special printing mode.
2769
2770 2015-02-13  Daniel Bates  <dabates@apple.com>
2771
2772         [iOS] DumpRenderTree.app fails to link due to undefined classes
2773         <rdar://problem/19831228>
2774
2775         Following r179945, DumpRenderTree.app fails to link due to undefined symbols:
2776
2777         Undefined symbols for architecture x86_64:
2778           "_OBJC_CLASS_$_WebEvent", referenced from:
2779               objc-class-ref in libDumpRenderTree.a(EventSendingController.o)
2780           "_OBJC_CLASS_$_WebUndefined", referenced from:
2781               objc-class-ref in libDumpRenderTree.a(ObjCController.o)
2782
2783         We need to export the classes WebScriptObject and WebEvent.
2784
2785         * bindings/objc/WebScriptObject.h:
2786         * platform/ios/WebEvent.h:
2787
2788 2015-02-13  Andreas Kling  <akling@apple.com>
2789
2790         CachedResource::clearLoader() should self-destruct if nothing else retains the CachedResource.
2791         <https://webkit.org/b/141568>
2792         <rdar://problem/19800310>
2793
2794         Reviewed by Antti Koivisto.
2795
2796         Anything that may cause CachedResource::canDelete() to return true must also make sure
2797         to call CachedResource::deleteIfPossible(), or we risk leaking the CachedResource.
2798         This is because CachedResource employs an extremely convoluted lifetime mechanism that
2799         depends on its presence in a number of collections, as well as internal counters and
2800         state.
2801
2802         This is a speculative fix for a potential CachedResource leak that I'm not sure exists
2803         in practice, but let's be good citizens here.
2804
2805         * loader/cache/CachedResource.cpp:
2806         (WebCore::CachedResource::clearLoader):
2807
2808 2015-02-13  Jer Noble  <jer.noble@apple.com>
2809
2810         [MSE][Mac] Crash at WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset + 2357
2811         https://bugs.webkit.org/show_bug.cgi?id=141566
2812         rdar://problem/19826075
2813
2814         Reviewed by Andreas Kling.
2815
2816         Null check m_mediaSource before dereferencing.
2817
2818         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2819         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2820
2821 2015-02-13  Zalan Bujtas  <zalan@apple.com>
2822
2823         REGRESSION (r174761): Invalid cast in WebCore::lastRubyRun / WebCore::RenderRubyAsBlock::addChild
2824         https://bugs.webkit.org/show_bug.cgi?id=137929
2825         rdar://problem/18723492
2826
2827         Reviewed by Chris Dumez.
2828
2829         Ensure that the child renderer is a RenderRubyRun.
2830
2831         Test: fast/ruby/crash-with-before-after-on-ruby.html
2832
2833         * rendering/RenderRuby.cpp:
2834         (WebCore::lastRubyRun):
2835
2836 2015-02-13  Simon Fraser  <simon.fraser@apple.com>
2837
2838         Crashes under RenderLayer::hitTestLayer under determinePrimarySnapshottedPlugIn()
2839         https://bugs.webkit.org/show_bug.cgi?id=141551
2840
2841         Reviewed by Zalan Bujtas.
2842         
2843         It's possible for a layout to dirty the parent frame's state, via the calls to
2844         ownerElement()->scheduleSetNeedsStyleRecalc() that RenderLayerCompositor does when
2845         iframes toggle their compositing mode.
2846         
2847         That could cause FrameView::updateLayoutAndStyleIfNeededRecursive() to fail to 
2848         leave all the frames in a clean state. Later on, we could enter hit testing,
2849         which calls document().updateLayout() on each frame's document. Document::updateLayout()
2850         does layout on all ancestor documents, so in the middle of hit testing, we could
2851         layout a subframe (dirtying an ancestor frame), then layout another frame, which
2852         would forcing that ancestor to be laid out while we're hit testing it, thus
2853         corrupting the RenderLayer tree while it's being iterated over.
2854         
2855         Fix by having FrameView::updateLayoutAndStyleIfNeededRecursive() do a second
2856         layout after laying out subframes, which most of the time will be a no-op.
2857         
2858         Also add a stronger assertion, that this frame and all subframes are clean
2859         at the end of FrameView::updateLayoutAndStyleIfNeededRecursive() for the
2860         main frame.
2861
2862         Various existing frames tests hit the new assertion if the code change is removed,
2863         so this is covered by existing tests.
2864
2865         * page/FrameView.cpp:
2866         (WebCore::FrameView::needsStyleRecalcOrLayout):
2867         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2868         * page/FrameView.h:
2869         * rendering/RenderWidget.cpp:
2870         (WebCore::RenderWidget::willBeDestroyed):
2871
2872 2015-02-12  Simon Fraser  <simon.fraser@apple.com>
2873
2874         determinePrimarySnapshottedPlugIn() should only traverse visible Frames
2875         https://bugs.webkit.org/show_bug.cgi?id=141547
2876         Part of rdar://problem/18445733.
2877
2878         Reviewed by Anders Carlsson.
2879
2880         There's an expectation from clients that FrameView::updateLayoutAndStyleIfNeededRecursive()
2881         updates layout in all frames, but it uses the widget tree, so only hits frames
2882         that are parented via renderers (i.e. not display:none frames or their descendants).
2883         
2884         Moving towards a future where we remove Widgets, fix by adding a FrameTree 
2885         traversal function that only finds rendered frames (those with an ownerRenderer).
2886         
2887         Not testable.
2888
2889         * page/FrameTree.cpp:
2890         (WebCore::FrameTree::firstRenderedChild):
2891         (WebCore::FrameTree::nextRenderedSibling):
2892         (WebCore::FrameTree::traverseNextRendered):
2893         (printFrames):
2894         * page/FrameTree.h:
2895         * page/FrameView.cpp:
2896         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2897
2898 2015-02-13  Alexey Proskuryakov  <ap@apple.com>
2899
2900         TimerBase::m_heapInsertionOrder calculation is racy
2901         https://bugs.webkit.org/show_bug.cgi?id=141554
2902
2903         Reviewed by Anders Carlsson.
2904
2905         Use an atomic increment.
2906
2907         * platform/Timer.cpp: (WebCore::TimerBase::setNextFireTime):
2908
2909 2015-02-13  Andreas Kling  <akling@apple.com>
2910
2911         [iOS] Refine GC behavior in response to process suspension and memory pressure.
2912         <https://webkit.org/b/141543>
2913         <rdar://problem/19738024>
2914
2915         Reviewed by Geoffrey Garen.
2916
2917         Do an immediate full garbage collection when the web process is about to
2918         be suspended (when another tab is moving to the foreground on iOS.)
2919         This ensures that we make a best effort to reduce the process footprint
2920         before we lose the ability to execute code.
2921
2922         When receiving a memory pressure warning, tell the garbage collector to
2923         accelerate its next collection (by calling garbageCollectSoon().)
2924         This gives us some confidence that a collection will happen within a
2925         reasonable timeframe, but doesn't risk dooming us to a loop of endless
2926         garbage collections.
2927
2928         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2929         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2930
2931 2015-02-13  Antti Koivisto  <antti@apple.com>
2932
2933         Add some RELEASE_ASSERTs to try to catch crashes in StyleResolver::loadPendingImages
2934         https://bugs.webkit.org/show_bug.cgi?id=141561
2935
2936         Reviewed by Simon Fraser.
2937
2938         One possibility is that loads triggered by loadPendingImages end up synchronously destroying or re-entering
2939         style resolver. Try to catch these in release builds.
2940
2941         * css/StyleResolver.cpp:
2942         (WebCore::StyleResolver::~StyleResolver):
2943         (WebCore::StyleResolver::styleForElement):
2944         (WebCore::StyleResolver::styleForKeyframe):
2945         (WebCore::StyleResolver::styleForPage):
2946         (WebCore::StyleResolver::loadPendingImages):
2947         * css/StyleResolver.h:
2948
2949 2015-02-13  ChangSeok Oh  <changseok.oh@collabora.com>
2950
2951         Div having contentEditable and display:grid cannot be edited if it is empty.
2952         https://bugs.webkit.org/show_bug.cgi?id=141465
2953
2954         Reviewed by Ryosuke Niwa.
2955
2956         This bug is quite similar to webkit.org/b/141218. RenderGrid should be also treated as a candidate
2957         for visible position as like RenderFlexibleBox. The only different situation between them is
2958         that RenderGrid has a bug setting "0px" for logicalHeight when it is empty. RenderGrid should also have
2959         a minimum height of a single line if it is editable as well as RenderFlexibleBox does.
2960
2961         Test: fast/events/key-events-in-editable-gridbox.html
2962
2963         * dom/Position.cpp:
2964         (WebCore::Position::isCandidate):
2965         (WebCore::Position::isRenderedCharacter):
2966         * rendering/RenderGrid.cpp:
2967         (WebCore::RenderGrid::layoutGridItems):
2968
2969 2015-02-12  Zalan Bujtas  <zalan@apple.com>
2970
2971         REGRESSION (r176262): Invalid cast in WebCore`WebCore::RootInlineBox::selectionTop
2972         https://bugs.webkit.org/show_bug.cgi?id=138992
2973
2974         Reviewed by Dave Hyatt.
2975
2976         RenderRubyText requires the ancestor chain to be (RenderRubyAsInline | RenderRubyAsBlock) -> RenderRubyRun -> RenderRubyText.
2977         This patch ensures that we create RenderRubyText for an <rt> element only when
2978         the expected ancestor chain is guaranteed.
2979
2980         Test: fast/ruby/crash-when-ruby-is-set-to-inline-block.html
2981
2982         * rendering/RenderElement.cpp:
2983         (WebCore::RenderElement::createFor): treat inline-block <ruby> as block.
2984         * rendering/RenderObject.h:
2985         (WebCore::RenderObject::isRubyInline):
2986         (WebCore::RenderObject::isRubyBlock):
2987         (WebCore::RenderObject::isRuby): Deleted.
2988         * rendering/RenderRuby.cpp:
2989         (WebCore::isAnonymousRubyInlineBlock):
2990         * rendering/RenderRuby.h: add support for is<RenderRubyAsBlock>(renderer) and for is<RenderRubyAsInline>(renderer)
2991         The isRuby() method does not follow the is*() -> maps to one class pattern.
2992         (WebCore::isRuby):
2993         * rendering/RenderRubyRun.cpp:
2994         (WebCore::RenderRubyRun::addChild):
2995         (WebCore::RenderRubyRun::staticCreateRubyRun):
2996
2997 2015-02-13  Csaba Osztrogonac  <ossy@webkit.org>
2998
2999         Fix the gperf related build issue on the WinCairo bot
3000         https://bugs.webkit.org/show_bug.cgi?id=141507
3001
3002         Reviewed by Alex Christensen.
3003
3004         * platform/ColorData.gperf: Modified property svn:eol-style.
3005
3006 2015-02-13  Csaba Osztrogonác  <ossy@webkit.org>
3007
3008         Unreviewed, remove empty directories.
3009
3010         * loader/icon/wince: Removed.
3011         * platform/graphics/wince: Removed.
3012         * storage/wince: Removed.
3013
3014 2015-02-12  Timothy Horton  <timothy_horton@apple.com>
3015
3016         Crashes under detectItemAroundHitTestResult when DataDetectors is not available
3017         https://bugs.webkit.org/show_bug.cgi?id=141549
3018         <rdar://problem/19180955>
3019
3020         Reviewed by Dan Bernstein.
3021
3022         * editing/mac/DataDetection.mm:
3023         (WebCore::DataDetection::detectItemAroundHitTestResult):
3024         Bail out from data detection if either of the relevant frameworks aren't loaded.
3025
3026 2015-02-12  Dean Jackson  <dino@apple.com>
3027
3028         [iOS Media] Audio should hide timeline scrubber until playback starts
3029         https://bugs.webkit.org/show_bug.cgi?id=141542
3030         <rdar://problem/19820685>
3031
3032         Reviewed by Eric Carlson.
3033
3034         We regressed from the system behaviour in iOS 7, where the timeline
3035         scrubber for an audio element is not shown until the user starts
3036         playback.
3037
3038         * Modules/mediacontrols/mediaControlsiOS.css:
3039         (video::-webkit-media-controls-panel): Fix the alignment of the flexbox.
3040         (audio::-webkit-media-controls-status-display): Add the style for the status display.
3041         * Modules/mediacontrols/mediaControlsiOS.js:
3042         (ControllerIOS.prototype.configureInlineControls): Start hidden if we are an <audio>.
3043         (ControllerIOS.prototype.configureFullScreenControls): Drive by comment change.
3044         (ControllerIOS.prototype.setPlaying): Unhide the timeline.
3045
3046 2015-02-12  Chris Dumez  <cdumez@apple.com>
3047
3048         Drop the quirks-mode exception for CSS MIME types
3049         https://bugs.webkit.org/show_bug.cgi?id=141501
3050
3051         Reviewed by Alexey Proskuryakov.
3052
3053         Drop the quirks-mode exception for CSS MIME types.
3054         This matches Firefox's behavior.
3055
3056         This patch is based on the following Blink revision:
3057         http://src.chromium.org/viewvc/blink?view=revision&revision=189669
3058
3059         Tests:
3060         - http/tests/misc/css-accept-any-type.html
3061         - http/tests/security/cross-origin-css.html
3062
3063         * css/StyleSheetContents.cpp:
3064         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3065         * dom/ProcessingInstruction.cpp:
3066         (WebCore::ProcessingInstruction::setCSSStyleSheet):
3067         * inspector/InspectorPageAgent.cpp:
3068         (WebCore::InspectorPageAgent::cachedResourceContent):
3069         * loader/cache/CachedCSSStyleSheet.cpp:
3070         (WebCore::CachedCSSStyleSheet::sheetText):
3071         (WebCore::CachedCSSStyleSheet::canUseSheet):
3072         * loader/cache/CachedCSSStyleSheet.h:
3073
3074 2015-02-12  Beth Dakin  <bdakin@apple.com>
3075
3076         REGRESSION: Should not send wheel events with a delta of 0
3077         https://bugs.webkit.org/show_bug.cgi?id=141537
3078         -and corresponding-
3079         rdar://problem/18903118
3080
3081         Reviewed by Simon Fraser.
3082
3083         This code should not have been removed entirely to accommodate rubber-banding, it 
3084         just needs to return false instead of true in order to allow the MayBegin and 
3085         Ended phases to be handled by the ElasticityController.
3086         * dom/Element.cpp:
3087         (WebCore::Element::dispatchWheelEvent):
3088
3089 2015-02-12  Dean Jackson  <dino@apple.com>
3090
3091         [iOS Media] Implement 3-style media timeline (buffered, played, unavailable)
3092         https://bugs.webkit.org/show_bug.cgi?id=141526
3093         <rdar://problem/19603337>
3094
3095         Reviewed by Eric Carlson and Antoine Quint.
3096
3097         Implement a 3-style media scrubber for iOS. This draws white for
3098         the region that has been played (before the playhead), black
3099         for the region that is buffered, and is hollow for the rest.
3100
3101         * Modules/mediacontrols/mediaControlsApple.js:
3102         (Controller.prototype.updateProgress): Update progress is now completely
3103         shared between OS X and iOS. This calls the implementation specific
3104         drawTimelineBackground.
3105         (Controller.prototype.drawTimelineBackground): Move the OS X code to here.
3106         * Modules/mediacontrols/mediaControlsiOS.css:
3107         (audio::-webkit-media-controls-timeline): New styles for the timeline. Updated thumb image, etc.
3108         (video::-webkit-media-controls-timeline::-webkit-slider-runnable-track):
3109         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
3110         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb:active):
3111         (video::-webkit-media-controls-time-remaining-display):
3112         * Modules/mediacontrols/mediaControlsiOS.js:
3113         (ControllerIOS): Create a globally unique canvas context name in the constructor.
3114         (ControllerIOS.prototype.createControls): Set the background of the timeline to a canvas.
3115         (ControllerIOS.prototype.addRoundedRect): Helper function.
3116         (ControllerIOS.prototype.drawTimelineBackground): Draw the 3-style content.
3117         (ControllerIOS.prototype.updateProgress): Deleted.
3118
3119 2015-02-12  Daniel Bates  <dabates@apple.com>
3120
3121         Fix some Mac linker warnings
3122         https://bugs.webkit.org/show_bug.cgi?id=141522
3123
3124         Reviewed by Alex Christensen.
3125
3126         Following <https://trac.webkit.org/changeset/179945>, the linker warns about the following hidden WebCore symbols:
3127         
3128         ld: warning: cannot export hidden symbol __ZN7WebCore20LogNotYetImplementedE from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/Logging.o
3129         ld: warning: cannot export hidden symbol _wkCreateURLPasteboardFlavorTypeName from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCoreSystemInterface.o
3130         ld: warning: cannot export hidden symbol _wkCreateURLNPasteboardFlavorTypeName from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCoreSystemInterface.o
3131
3132         * WebCore.exp.in: Remove symbols for functions wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName.
3133         * platform/Logging.h: Export WTFLogChannel for LogNotYetImplemented, which is referenced from
3134         notImplementedLoggingChannel() in file NotImplemented.cpp. We make use of the associated
3135         header, NotImplemented.h, in both WebKit and WebKit2.
3136         * platform/mac/WebCoreSystemInterface.mm: Remove declarations for functions
3137         wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName that
3138         were inadvertently not removed in r25494.
3139
3140 2015-02-12  Joseph Pecoraro  <pecoraro@apple.com>
3141
3142         Web Inspector: Crash inspecting styles of element with mutated stylesheet
3143         https://bugs.webkit.org/show_bug.cgi?id=141451
3144
3145         Reviewed by Timothy Hatcher.
3146
3147         Test: inspector/css/stylesheet-with-mutations.html
3148
3149         * css/CSSStyleSheet.h:
3150         * css/CSSStyleSheet.cpp:
3151         (WebCore::CSSStyleSheet::CSSStyleSheet):
3152         (WebCore::CSSStyleSheet::didMutateRules):
3153         Keep a flag on the CSSStyleSheet to know when it has had a rule
3154         mutation from the contents.
3155
3156         * inspector/InspectorStyleSheet.h:
3157         * inspector/InspectorStyleSheet.cpp:
3158         (WebCore::InspectorStyleSheet::reparseStyleSheet):
3159         When completely replacing the stylesheet's contents, we will have
3160         destroyed any previous rules, so clear the has mutations flag.
3161
3162         (WebCore::selectorsFromSource):
3163         Previously there was a mismatch between the rules the parsed
3164         SourceData had, and the actual CSSSelectors we were iterating.
3165         We use the SourceData so we can get the exact user authored
3166         text instead of generated longhands from actualy selector objects.
3167         Add an ASSERT and bail to catch and more gracefully handle
3168         any possible mismatches in the future.
3169
3170         (WebCore::InspectorStyleSheet::styleSheetMutated):
3171         (WebCore::InspectorStyleSheet::ensureParsedDataReady):
3172         When a CSSStyleSheet has been mutated beyond the inspector's
3173         knowledge right now, fall back to readonly generated selectors.
3174         We should better handle this in the future:
3175         <https://webkit.org/b/141450> Web Inspector: Better support for CSSOM StyleSheet mutations (insertRule/deleteRule)
3176
3177 2015-02-12  Commit Queue  <commit-queue@webkit.org>
3178
3179         Unreviewed, rolling out r179987.
3180         https://bugs.webkit.org/show_bug.cgi?id=141525
3181
3182         caused debug tests to fail (Requested by alexchristensen on
3183         #webkit).
3184
3185         Reverted changeset:
3186
3187         "[CSS Grid Layout] Invalid initialization of track sizes with
3188         non spanning grid items"
3189         https://bugs.webkit.org/show_bug.cgi?id=140763
3190         http://trac.webkit.org/changeset/179987
3191
3192 2015-02-12  Brian J. Burg  <burg@cs.washington.edu>
3193
3194         REGRESSION(r178060): empty arguments are passed when logging to system console
3195         https://bugs.webkit.org/show_bug.cgi?id=141511
3196
3197         Reviewed by Timothy Hatcher.
3198
3199         * page/PageConsoleClient.cpp:
3200         (WebCore::PageConsoleClient::messageWithTypeAndLevel): Change premature move to copyRef.
3201
3202 2015-02-12  Alex Christensen  <achristensen@webkit.org>
3203
3204         [Win] Unreviewed debug build fix after r179980.
3205
3206         * svg/SVGSVGElement.cpp:
3207         (WebCore::SVGSVGElement::currentViewportSize):
3208         Explicitly call constructor.
3209
3210 2015-01-23  Sergio Villar Senin  <svillar@igalia.com>
3211
3212         [CSS Grid Layout] Invalid initialization of track sizes with non spanning grid items
3213         https://bugs.webkit.org/show_bug.cgi?id=140763
3214
3215         Reviewed by Antti Koivisto.
3216
3217         Content sized tracks with non-spanning grid items were not
3218         properly sized because the growth limit was sometimes infinity
3219         (-1) after calling resolveContentBasedTrackSizingFunctions() when
3220         it should not. This patch adds an special initialization phase for
3221         non-spanning grid items as the new track sizing algorithm
3222         describes.
3223
3224         Granted, that was handled in the old algorithm in
3225         distributeSpaceToTracks() as a special case. The problem is that
3226         it regressed after the optimization added in r173868 because that
3227         method is no longer called when the space to distribute is 0.
3228
3229         That's why we could fix this by allowing calls to
3230         distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing
3231         it with an explicit initialization our implementation becomes
3232         closer to the new algorithm and the initialization is now explicit
3233         in the code instead of a side effect of calling
3234         distributeSpaceToTracks() with no space to be distributed. It also
3235         brings a slight performance improvement as we save sorts and hash
3236         lookups.
3237
3238         I also took the change to add caching to several GridTrackSize
3239         methods that were hot on the profiler (each one accounted for ~1%
3240         of the total time, now they account for ~0.3% each).
3241
3242         Test: fast/css-grid-layout/grid-initialize-span-one-items.html
3243
3244         * rendering/RenderGrid.cpp:
3245         (WebCore::GridItemWithSpan::span): New helper method for ASSERTs.
3246         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3247         Exclude non spanning grid items from the calls to
3248         resolveContentBasedTrackSizingFunctionsForItems().
3249         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
3250         New method to resolve track sizes only using non-spanning grid
3251         items.
3252         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3253         Ensure that it isn't called for non-spanning grid items.
3254         * rendering/RenderGrid.h:
3255         * rendering/style/GridTrackSize.h:
3256         (WebCore::GridTrackSize::GridTrackSize): Cache return values.
3257         (WebCore::GridTrackSize::setLength): Ditto.
3258         (WebCore::GridTrackSize::setMinMax): Ditto.
3259         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes): New method
3260         that caches the return values for hasXXXTrackBreadth() methods.
3261         (WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth): Use
3262         the cached return value.
3263         (WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth): Ditto.
3264         (WebCore::GridTrackSize::hasMinContentMaxTrackBreadth): Ditto.
3265         (WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth): Ditto.
3266         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadth): Ditto.
3267         (WebCore::GridTrackSize::hasMinContentMinTrackBreadth): Ditto.
3268         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
3269         Ditto.
3270         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
3271         Ditto.
3272
3273 2015-02-12  Zan Dobersek  <zdobersek@igalia.com>
3274
3275         Remove the USE(ACCELERATED_COMPOSITING) guard from the
3276         MediaPlayerPrivateGStreamerBase destructor.
3277
3278         The guard was removed in r163079. It was still defined through CMake
3279         for the EFL and GTK ports when the guarded code was introduced in
3280         r172828. In r171741 the macro was finally removed for the GTK and EFL
3281         ports as well, but the guards for the affected code weren't updated
3282         so TextureMapperPlatformLayer::Client::platformLayerWillBeDestroyed()
3283         wasn't being called anymore.
3284
3285         Rubber-stamped by Philippe Normand.
3286
3287         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3288         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3289
3290 2015-02-11  Darin Adler  <darin@apple.com>
3291
3292         Streamline and simplify SVGSVGElement and related classes
3293         https://bugs.webkit.org/show_bug.cgi?id=141463
3294
3295         Reviewed by Antti Koivisto.
3296
3297         * dom/Document.cpp: Removed unneeded include of SVGSVGElement.h.
3298         * loader/FrameLoader.cpp: Ditto.
3299         * rendering/RenderBoxModelObject.cpp: Ditto.
3300         * rendering/svg/RenderSVGForeignObject.cpp: Ditto.
3301         * svg/SVGImageElement.cpp: Ditto.
3302         * svg/SVGMarkerElement.cpp: Ditto.
3303         * svg/SVGPathElement.cpp: Ditto.
3304         * svg/SVGPatternElement.cpp: Ditto.
3305         * svg/SVGTransform.cpp: Ditto.
3306
3307         * page/FrameView.cpp:
3308         (WebCore::FrameView::scrollToAnchor): Updated to call the SVGSVGElement function
3309         named scrollToAnchor (was setupInitialView). Also refactored to avoid repeating
3310         the expression frame().document() so often.
3311
3312         * platform/graphics/FloatSize.h: Added operator/.
3313
3314         * svg/SVGDocument.cpp:
3315         (WebCore::SVGDocument::rootElement): Rearranged to use early return.
3316         (WebCore::SVGDocument::zoomAndPanEnabled): Ditto.
3317         (WebCore::SVGDocument::startPan): Ditto. Also used FloatPoint math instead
3318         of breaking things apart into x and y.
3319         (WebCore::SVGDocument::updatePan): Ditto.
3320
3321         * svg/SVGDocument.h: Removed some unneeded includes and forward declarations.
3322         Moved function bodies out of the class to make it more readable. Renamed
3323         m_translate to m_panningOffset and made it a FloatSize instead of FloatPoint.
3324
3325         * svg/SVGDocumentExtensions.cpp:
3326         (WebCore::SVGDocumentExtensions::startAnimations): Use a modern for loop
3327         and update since timeContainer() now returns a reference.
3328
3329         * svg/SVGSVGElement.cpp: Removed many unneeded includes.
3330         (WebCore::SVGSVGElement::SVGSVGElement): Moved initialization of scalars to
3331         the class definition. Updated since m_timerContainer is a Ref (later should
3332         change it to be a std::unique_ptr or just directly contained in SVGSVGElement).
3333         (WebCore::SVGSVGElement::~SVGSVGElement): Removed comment that doesn't say much,
3334         but is worded in a confusing way.
3335         (WebCore::SVGSVGElement::contentScriptType): Use NeverDestroyed instead of
3336         DEPRECATED_DEFINE_STATIC_LOCAL.
3337         (WebCore::SVGSVGElement::contentStyleType): Ditto.
3338         (WebCore::SVGSVGElement::viewport): Streamlined a bit.
3339         (WebCore::SVGSVGElement::pixelUnitToMillimeterX): Ditto.
3340         (WebCore::SVGSVGElement::pixelUnitToMillimeterY): Ditto.
3341         (WebCore::SVGSVGElement::currentView): Changed to return a reference.
3342         (WebCore::SVGSVGElement::frameForCurrentScale): Added. Helper for the two
3343         functions below.
3344         (WebCore::SVGSVGElement::currentScale): Updated to use frameForCurrentScale.
3345         (WebCore::SVGSVGElement::setCurrentScale): Ditto.
3346         (WebCore::SVGSVGElement::setCurrentTranslate): Optimized the case where there
3347         is no change to the translation. Also changed the data member's name to
3348         m_currentTranslate to more directly match the DOM API naming.
3349         (WebCore::SVGSVGElement::parseAttribute): Simplified the parsing a bit, and
3350         changed to pass a reference to SVGZoomAndPan::parseAttribute.
3351         (WebCore::SVGSVGElement::svgAttributeChanged): Tweaked formatting and removed
3352         code that converts the renderer pointer to a RenderObject* unnecessarily.
3353         (WebCore::SVGSVGElement::suspendRedraw): Removed FIXME about implementing this,
3354         since we don't really plan to do that.
3355         (WebCore::SVGSVGElement::unsuspendRedraw): Ditto.
3356         (WebCore::SVGSVGElement::unsuspendRedrawAll): Ditto.
3357         (WebCore::SVGSVGElement::forceRedraw): Ditto.
3358         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList): Changed return
3359         type to Ref, and pass in a function instead of an enumeration value.
3360         (WebCore::SVGSVGElement::getIntersectionList): Updated for above.
3361         (WebCore::SVGSVGElement::getEnclosureList): Ditto.
3362         (WebCore::SVGSVGElement::checkIntersection): Use && instead of early return
3363         for the null check.
3364         (WebCore::SVGSVGElement::checkEnclosure): Ditto.
3365         (WebCore::SVGSVGElement::createSVGLength): Use initialization list syntax
3366         for greater brevity.
3367         (WebCore::SVGSVGElement::createSVGAngle): Ditto.
3368         (WebCore::SVGSVGElement::createSVGPoint): Ditto.
3369         (WebCore::SVGSVGElement::createSVGMatrix): Ditto.
3370         (WebCore::SVGSVGElement::createSVGRect): Ditto.
3371         (WebCore::SVGSVGElement::createSVGTransform): Removed unneeded explicit
3372         constructor invocation.
3373         (WebCore::SVGSVGElement::createSVGTransformFromMatrix): Removed unneeded cast.
3374         (WebCore::SVGSVGElement::insertedInto): Updated since timeContainer() now
3375         returns a reference.
3376         (WebCore::SVGSVGElement::setCurrentTime): Use isfinite instead of isnan, so
3377         we won't store infinity as the current time.
3378         (WebCore::SVGSVGElement::currentViewBoxRect): Renamed locals and changed
3379         to use initializer lists for brevity.
3380         (WebCore::SVGSVGElement::currentViewportSize): Streamlined code by using
3381         initializer lists, using local variables only for things used more than once,
3382         and using the / operator defined above.
3383         (WebCore::SVGSVGElement::viewBoxToViewTransform): Use the concatenate function
3384         in a way that is more straightforward, rather than doing it with a temporary.
3385         (WebCore::SVGSVGElement::scrollToAnchor): Renamed this from
3386         setupInitialView.
3387         (WebCore::SVGSVGElement::inheritViewAttributes): Changed this to work with
3388         references rather than pointers.
3389         (WebCore::SVGSVGElement::getElementById): Use getAllElementsById as the
3390         FIXME comment suggested for better efficiency when there are a lot of descendants
3391         of the <svg> element at the cost of making it less efficient if there are
3392         a lot of elements all with the desired ID, but not inside the <svg> element.
3393         (WebCore::SVGSVGElement::isValid): Moved here from the header.
3394
3395         * svg/SVGSVGElement.h: Removed unneeded forward declarations. Moved the
3396         animated properties to the top of the file, then other DOM, the other
3397         public members. Changed return types to references and Ref. Moved
3398         function bodies out of the class definition. Made createSVGNumber inline.
3399
3400         * svg/SVGViewElement.cpp: Removed unneeded includes.
3401         (WebCore::SVGViewElement::isSupportedAttribute): Deleted.
3402         (WebCore::SVGViewElement::parseAttribute): Changed to not rely on
3403         isSupportedAttribute. Eventually I will do this in all the SVG classes.
3404
3405         * svg/SVGViewSpec.cpp: Removed unneeded include of SVGSVGElement.h.
3406         (WebCore::SVGViewSpec::parseViewSpec): Updated for change in the name
3407         of the parse function in the SVGZoomAndPan class.
3408
3409         * svg/SVGZoomAndPan.cpp:
3410         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
3411         (WebCore::SVGZoomAndPan::addSupportedAttributes): Deleted.
3412         (WebCore::SVGZoomAndPan::parse): Renamed from parseZoomAndPan since
3413         this is a member of the SVGZoomAndPan class and also has an argument
3414         of SVGZoomAndPanType.
3415         (WebCore::SVGZoomAndPan::parseAttributeValue): Added. Helper so the
3416         template function is not so big. Also write it in a simpler way.