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