Setting up OrderIterator shouldn't require an extra Vector
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-05-27  Manuel Rego Casasnovas  <rego@igalia.com>
2
3         Setting up OrderIterator shouldn't require an extra Vector
4         https://bugs.webkit.org/show_bug.cgi?id=119061
5
6         Reviewed by Darin Adler.
7
8         From Blink r153971 by <jchaffraix@chromium.org>
9
10         This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for
11         manipulating the Vector directly. Which allows to consolidate the code into a single implementation across
12         flexbox and grid.
13
14         No new tests, already covered by current tests.
15
16         * rendering/OrderIterator.cpp:
17         (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call
18         removeDuplicatedOrderValues().
19         (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated
20         order values.
21         (WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child.
22         (WebCore::OrderIterator::setOrderValues): Deleted.
23         * rendering/OrderIterator.h:
24         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector.
25         * rendering/RenderFlexibleBox.cpp:
26         (WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector.
27         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild().
28         (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted.
29         * rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins().
30         * rendering/RenderGrid.cpp:
31         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild().
32
33 2014-05-26  Tim Horton  <timothy_horton@apple.com>
34
35         [wk2] RemoteLayerBackingStore front buffers should be purgeable when unparented
36         https://bugs.webkit.org/show_bug.cgi?id=133020
37         <rdar://problem/16521736>
38
39         Reviewed by Simon Fraser.
40
41         * WebCore.exp.in:
42         * platform/graphics/cg/IOSurfacePool.cpp:
43         (WebCore::IOSurfacePool::willAddSurface):
44         * platform/graphics/cocoa/IOSurface.h:
45         * platform/graphics/cocoa/IOSurface.mm:
46         (IOSurface::releaseGraphicsContext):
47         Rename clearGraphicsContext to releaseGraphicsContext for clarity.
48
49 2014-05-26  Philip Rogers  <pdr@google.com>
50
51         Remove special case for transparent SVG root layers
52         https://bugs.webkit.org/show_bug.cgi?id=116856
53
54         Reviewed by Dirk Schulze.
55
56         This patch removes a special case from RenderLayer for root SVG layers
57         with opacity. Instead of checking whether a composited layer exists in
58         SVGRenderingContext::prepareToRenderSVGContent we now exclude the root
59         SVG renderobject from the opacity checks in prepareToRenderSVGContent.
60
61         This is a merge of https://src.chromium.org/viewvc/blink?view=rev&revision=174102
62         by Philip Rogers <pdr@chromium.org>.
63
64         No new tests as this is covered by svg/custom/composited-svg-with-opacity.html.
65
66         * rendering/RenderLayer.cpp:
67         (WebCore::RenderLayer::isTransparent): Deleted.
68         * rendering/RenderLayer.h:
69         * rendering/svg/SVGRenderingContext.cpp:
70         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
71             The opacity case for root svg renderers is now handled by
72             RenderLayer.
73
74 2014-05-26  Yusuke Suzuki  <utatane.tea@gmail.com>
75
76         CSS JIT: Fix build error raised when CSS_SELECTOR_JIT_DEBUGGING is 1
77         https://bugs.webkit.org/show_bug.cgi?id=133266
78
79         Reviewed by Benjamin Poulain.
80
81         When CSS_SELECTOR_JIT_DEBUGGING is 1, build erros occur on x86_64.
82
83         * cssjit/SelectorCompiler.cpp:
84         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
85         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
86
87 2014-05-26  Benjamin Poulain  <benjamin@webkit.org>
88
89         Fix the quirks mode selector matching of the pseudo classes :hover and :active
90         https://bugs.webkit.org/show_bug.cgi?id=133063
91
92         Reviewed by Antti Koivisto.
93
94         Our implementation of the quirks mode of :active and :hover was very wrong. The only
95         thing it was doing is verify the pseudo class is not the first selector of a fragment
96         (which was conveniently the only thing that was tested :)).
97
98         Since those pseudo class were only checking for the order of the filters, something like
99             #target:hover
100         would succeed because :hover is not the first simple selector, while
101             :hover#target
102         would fail.
103
104         That behavior is also a problem for the CSS JIT as it is an implementation detail of SelectorChecker
105         and compiling something like that with our out-of-order matching would be nonsense.
106
107         This patch update the implementation to follow http://quirks.spec.whatwg.org/#the-:active-and-:hover-quirk
108         Basically, the only cases that do not work in quirks mode are selectors composed only of "*, :hover and :active".
109
110         To implement this behavior, I needed to be able to inspect a complete selector fragment, including
111         what is before and after :hover/:active.
112         To do that, I replaced the boolean isSubSelector by a pointer to the first selector of the fragment.
113         When we need to match :active/:hover in quirks mode, we just go over all the selectors in the fragment
114         to find one of the qualifying match type.
115
116         Tests: fast/selectors/active-hover-quirks.html
117                fast/selectors/active-quirks.html
118                fast/selectors/hover-quirks.html
119
120         * css/SelectorChecker.cpp:
121         (WebCore::SelectorChecker::matchRecursively):
122         (WebCore::canMatchHoverOrActiveInQuirksMode):
123         (WebCore::SelectorChecker::checkOne):
124         * css/SelectorChecker.h:
125         (WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext):
126
127 2014-05-26  Zalan Bujtas  <zalan@apple.com>
128
129         Split the call to adjustForLocalZoom out into a separate expression.
130         https://bugs.webkit.org/show_bug.cgi?id=133286
131
132         Reviewed by Darin Adler.
133
134         This patch ensures that adjustForLocalZoom() always gets called before we look at
135         zoomFactor's value. (and not rely on the undefined behavior of the order of function argument evaluation)
136
137         * dom/Element.cpp:
138         (WebCore::Element::offsetLeft):
139         (WebCore::Element::offsetTop):
140
141 2014-05-26  Darin Adler  <darin@apple.com>
142
143         Class name matching should use ASCII case-insensitive matching, not Unicode case folding
144         https://bugs.webkit.org/show_bug.cgi?id=133292
145
146         Reviewed by Anders Carlsson.
147
148         Tests: fast/dom/getElementsByClassName/ASCII-case-insensitive.html
149                fast/dom/getElementsByClassName/case-sensitive.html
150
151         * dom/SpaceSplitString.cpp:
152         (WebCore::hasNonASCIIOrUpper): Deleted.
153         (WebCore::tokenizeSpaceSplitString): Use a for loop instead of while.
154         (WebCore::spaceSplitStringTable): Renamed from sharedDataMap; the new name is supposed
155         to help us see the analogy with the atomic string table.
156         (WebCore::SpaceSplitString::set): Removed unneeded special case for null and preflight
157         since AtomicString::convertToASCIILowercase now handles both of those. Changed to call
158         convertToASCIILowercase instead of foldCase, since we don't want to fold non-ASCII.
159         (WebCore::SpaceSplitString::spaceSplitStringContainsValue): Ditto.
160         (WebCore::SpaceSplitStringData::create): Marked this inline since it's only called in
161         one place and that place is in this file. Also used auto a bit and used get instead of
162         find since the value type is a simple pointer.
163         (WebCore::SpaceSplitStringData::destroy): Removed unneeded check for null. We never
164         create any SpaceSplitStringData with empty strings, and a null is a kind of empty string.
165
166         * dom/SpaceSplitString.h: Removed some unneeded includes and some unneeded uses of the
167         inline keyword. Changed types from size_t to unsigned in a couple places; we had a mix
168         of the types and there was no reason to use size_t there.
169
170 2014-05-26  Javier Fernandez  <jfernandez@igalia.com>
171
172         [CSS Grid Layout] Implementation of the "grid" shorthand.
173         https://bugs.webkit.org/show_bug.cgi?id=132122
174
175         Reviewed by Darin Adler.
176
177         The grid property is a shorthand that sets all of the explicit
178         grid properties (grid-template-rows, grid-template-columns, and
179         grid-template-areas) as well as all the implicit grid properties
180         (grid-auto-rows, grid-auto-columns, and grid-auto-flow) in a
181         single declaration
182
183         Notice that either explicit or implicit grid can be specified,
184         assigning the initial values to the omitted properties.
185
186         Test: fast/css-grid-layout/grid-shorthand-get-set.html
187
188         * css/CSSComputedStyleDeclaration.cpp:
189         (WebCore::ComputedStyleExtractor::propertyValue):
190         * css/CSSParser.cpp:
191         (WebCore::CSSParser::parseValue):
192         (WebCore::CSSParser::parseGridShorthand):
193         * css/CSSParser.h:
194         * css/CSSPropertyNames.in:
195         * css/StylePropertyShorthand.cpp:
196         (WebCore::webkitGridShorthand):
197         * css/StylePropertyShorthand.h:
198
199 2014-05-26  Zalan Bujtas  <zalan@apple.com>
200
201         Subpixel layout: Legacy Element.offset* client* return values are invalid in certain cases.
202         https://bugs.webkit.org/show_bug.cgi?id=133272
203
204         Reviewed by Simon Fraser.
205
206         Element.offset* client* functions applied various rounding strategies on the return values before r168868.
207         (for example, offsetLeft/Top either floored through implicit integer arithmetics or rounded explicitly depending
208         whether the zoom scale was 1. see http://trac.webkit.org/changeset/168868/trunk/Source/WebCore/dom/Element.cpp for details)
209         This patch mimics the legacy behavior by either rounding or flooring the return value.
210
211         Not testable (legacy switch is not exposed)
212
213         * dom/Element.cpp:
214         (WebCore::adjustForLocalZoom):
215         (WebCore::convertToNonSubpixelValueIfNeeded):
216         (WebCore::Element::offsetLeft):
217         (WebCore::Element::offsetTop):
218
219 2014-05-26  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
220
221         [EFL] Input fields and text areas are not rendered correctly after r167771
222         https://bugs.webkit.org/show_bug.cgi?id=133181
223
224         Reviewed by Gyuyoung Kim.
225
226         r167771 changed arguments of RenderTheme two virtual method arguments which were not reflected
227         in changes in derived classes, which caused parent method to be called. Arguments in derived class
228         were updated, also 'override' specifiers were added to all virtual methods to prevent similar errors.
229
230         Already covered by fast/forms/textarea-placeholder-wrapping.html
231
232         * platform/efl/RenderThemeEfl.cpp:
233         (WebCore::RenderThemeEfl::paintTextField):
234         (WebCore::RenderThemeEfl::paintTextArea):
235         * platform/efl/RenderThemeEfl.h:
236         (WebCore::RenderThemeEfl::supportsHover):
237         (WebCore::RenderThemeEfl::supportsControlTints):
238
239 2014-05-20  Sergio Villar Senin  <svillar@igalia.com>
240
241         [CSS Grid Layout] Children of grid containers must be turned into grid items
242         https://bugs.webkit.org/show_bug.cgi?id=132991
243
244         Reviewed by Darin Adler.
245
246         From Blink r150472 by <jchaffraix@chromium.org>
247
248         According to specs each child of a grid container must become a
249         grid item meaning that grid items are grid level boxes and thus,
250         do not participate in the block formatting context but in the grid
251         formatting one.
252
253         This change updates the grid items' 'display' property after style
254         resolution so that we match the specification (see section 4. Grid
255         Items). The spec basically instructs us to compute the value of
256         'display' by applying the table in CSS2.1 Chapter 9.7
257         http://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo
258
259         Test: fast/css-grid-layout/grid-item-display.html
260
261         * css/StyleResolver.cpp:
262         (WebCore::isDisplayGridBox):
263         (WebCore::StyleResolver::adjustRenderStyle):
264
265 2014-05-26  Zan Dobersek  <zdobersek@igalia.com>
266
267         Remove Vector copies in ShorthandPropertyWrapper implementation and use
268         https://bugs.webkit.org/show_bug.cgi?id=133265
269
270         Reviewed by Simon Fraser.
271
272         * page/animation/CSSPropertyAnimation.cpp:
273         (WebCore::ShorthandPropertyWrapper::ShorthandPropertyWrapper): Move the passed-in Vector
274         into the member variable instead of using Vector<>::swap().
275         (WebCore::ShorthandPropertyWrapper::propertyWrappers): Return a const reference of the member
276         variable instead of a const value.
277         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Move the Vector
278         object into the ShorthandProperthyWrapper constructor.
279         (WebCore::gatherEnclosingShorthandProperties): Deploy a range-based for-loop.
280
281 2014-05-26  Tanay C  <tanay.c@samsung.com>
282
283         [EFL] Fix build error in blob.cpp after r168435
284         https://bugs.webkit.org/show_bug.cgi?id=132678
285
286         Reviewed by Alexey Proskuryakov.
287
288         * fileapi/Blob.cpp:
289         (WebCore::Blob::size): Using isInBound to check range of local var
290         actualsize to resolve build error
291
292 2014-05-25  Ryuan Choi  <ryuan.choi@samsung.com>
293
294         [EFL] Remove TileCairo and TiledBackingStoreBackendCairo
295         https://bugs.webkit.org/show_bug.cgi?id=133274
296
297         Reviewed by Gyuyoung Kim.
298
299         Now, TiledBackingStore is only used for CoordinatedGraphics and the EFL port.
300         CoordinatedGraphics does not use TileCairo and TiledBackingStoreBackendCairo.
301
302         This patch removed them and refactored related files.
303
304         * PlatformEfl.cmake:
305         * PlatformGTK.cmake:
306         * WebCore.vcxproj/WebCore.vcxproj:
307         * WebCore.vcxproj/WebCore.vcxproj.filters:
308         * platform/graphics/TiledBackingStore.cpp:
309         (WebCore::TiledBackingStore::TiledBackingStore): Deleted.
310         * platform/graphics/TiledBackingStore.h:
311         * platform/graphics/TiledBackingStoreBackend.h:
312         * platform/graphics/cairo/TileCairo.cpp: Removed.
313         * platform/graphics/cairo/TiledBackingStoreBackendCairo.cpp: Removed.
314
315 2014-05-25  Jinwoo Song  <jinwoo7.song@samsung.com>
316
317         setData() of DataTransfer has a void return type
318         https://bugs.webkit.org/show_bug.cgi?id=133108
319
320         Reviewed by Alexey Proskuryakov.
321
322         According to HTML5 spec, setData() of DataTranfer interface does not return value.
323         http://www.w3.org/TR/html/editing.html#the-datatransfer-interface
324
325         Test: editing/pasteboard/set_data_typeof_return.html
326
327         * dom/DataTransfer.cpp:
328         (WebCore::DataTransfer::setData):
329         * dom/DataTransfer.h:
330         * dom/DataTransfer.idl:
331         * platform/Pasteboard.h:
332         * platform/efl/PasteboardEfl.cpp:
333         (WebCore::Pasteboard::writeString):
334         * platform/gtk/PasteboardGtk.cpp:
335         (WebCore::Pasteboard::writeString):
336         * platform/ios/PasteboardIOS.mm:
337         (WebCore::Pasteboard::writeString):
338         * platform/mac/PasteboardMac.mm:
339         (WebCore::Pasteboard::writeString):
340         * platform/win/PasteboardWin.cpp:
341         (WebCore::Pasteboard::writeString):
342
343 2014-05-25  Benjamin Poulain  <bpoulain@apple.com>
344
345         [iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect
346         https://bugs.webkit.org/show_bug.cgi?id=133262
347
348         Reviewed by Simon Fraser.
349
350         Since VisibleContentRect was fixed, we were no longer sending scroll events when updating the scrollOffset
351         when updating the visible content rects. The reason is that the scrollOffset was defined as the top left of the
352         VisibleContentRect, and as such was already at the end position after updating the unobscured rect.
353
354         This patch split the unobscuredContentRect in unobscuredContentSize (updated live on zoom) and the position defined
355         by the ScrollView's scrollOffset (updated when scrolling).
356
357         * WebCore.exp.in:
358         * platform/ScrollView.h:
359         * platform/ios/ScrollViewIOS.mm:
360         (WebCore::ScrollView::unobscuredContentRect):
361         (WebCore::ScrollView::setUnobscuredContentSize):
362         (WebCore::ScrollView::setUnobscuredContentRect): Deleted.
363
364 2014-05-25  David Kilzer  <ddkilzer@apple.com>
365
366         Add type-checked casts for TransformOperations
367         <http://webkit.org/b/133217>
368
369         Reviewed by Simon Fraser.
370
371         * platform/graphics/GraphicsLayer.cpp:
372         (WebCore::GraphicsLayer::validateTransformOperations):
373         * platform/graphics/ca/GraphicsLayerCA.cpp:
374         (WebCore::getTransformFunctionValue):
375         - Switch to type-checked casts.
376
377         * platform/graphics/transforms/IdentityTransformOperation.h:
378         * platform/graphics/transforms/Matrix3DTransformOperation.h:
379         * platform/graphics/transforms/MatrixTransformOperation.h:
380         * platform/graphics/transforms/PerspectiveTransformOperation.h:
381         * platform/graphics/transforms/RotateTransformOperation.h:
382         * platform/graphics/transforms/ScaleTransformOperation.h:
383         * platform/graphics/transforms/SkewTransformOperation.h:
384         * platform/graphics/transforms/TranslateTransformOperation.h:
385         - Add 'final' to class declaration.
386         - Add 'override' to overridden methods.
387         - Add type-checked cast via TRANSFORMOPERATION_TYPE_CASTS macro.
388         - Move implementation of operator==(const TransformOperation&)
389           from header to source file so it is able to use a type-checked
390           cast, and switch back to using a reference instead of a
391           pointer.
392         - Add or update ASSERT in private constructor to check for
393           correct OperationType in classes that represent multiple
394           types.
395
396         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
397         (WebCore::Matrix3DTransformOperation::operator==): Added.
398
399         * platform/graphics/transforms/MatrixTransformOperation.cpp:
400         (WebCore::Matrix3DTransformOperation::operator==): Added.
401         (WebCore::MatrixTransformOperation::blend):
402         - Switch to type-checked casts and use a reference.
403
404         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
405         (WebCore::Matrix3DTransformOperation::operator==): Added.
406         (WebCore::PerspectiveTransformOperation::blend):
407         * platform/graphics/transforms/RotateTransformOperation.cpp:
408         (WebCore::Matrix3DTransformOperation::operator==): Added.
409         (WebCore::RotateTransformOperation::blend):
410         * platform/graphics/transforms/ScaleTransformOperation.cpp:
411         (WebCore::Matrix3DTransformOperation::operator==): Added.
412         (WebCore::ScaleTransformOperation::blend):
413         * platform/graphics/transforms/SkewTransformOperation.cpp:
414         (WebCore::Matrix3DTransformOperation::operator==): Added.
415         (WebCore::SkewTransformOperation::blend):
416         * platform/graphics/transforms/TranslateTransformOperation.cpp:
417         (WebCore::Matrix3DTransformOperation::operator==): Added.
418         (WebCore::TranslateTransformOperation::blend):
419         - Switch to type-checked casts.
420
421         * platform/graphics/transforms/TransformOperation.h:
422         (WebCore::TransformOperation::isRotateTransformOperationType):
423         (WebCore::TransformOperation::isScaleTransformOperationType):
424         (WebCore::TransformOperation::isSkewTransformOperationType):
425         (WebCore::TransformOperation::isTranslateTransformOperationType):
426         - Add type-checking methods used in constructors and type-checked
427           casts.
428         - Define TRANSFORMOPERATION_TYPE_CASTS macro used by subclasses.
429
430 2014-05-25  David Kilzer  <ddkilzer@apple.com>
431
432         Crash in WebCore::TextResourceDecoder::checkForCSSCharset
433         <http://webkit.org/b/133257>
434         <rdar://problem/17027109>
435
436         Reviewed by Alexey Proskuryakov.
437
438         Test: fast/encoding/css-charset-missing-semi-colon-and-newline.html
439
440         * loader/TextResourceDecoder.cpp:
441         (WebCore::TextResourceDecoder::checkForCSSCharset): Add early
442         return.
443
444 2014-05-24  Eric Carlson  <eric.carlson@apple.com>
445
446         [Mac] preload AVAssetTrack properties before asking for them
447         https://bugs.webkit.org/show_bug.cgi?id=133240
448
449         Reviewed by Jer Noble.
450
451         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
452         (WebCore::assetTrackMetadataKeyNames): Add preferredTransform and naturalSize to the list
453             of properties we preload.
454
455 2014-05-24  Zsolt Borbely  <zsborbely.u-szeged@partner.samsung.com>
456
457         Remove one of the CSSProperty constructor
458         https://bugs.webkit.org/show_bug.cgi?id=131094
459
460         Reviewed by Darin Adler.
461
462         Remove one of the CSSProperty constructor, because it is obsolete.
463
464         * css/CSSProperty.h:
465         (WebCore::CSSProperty::CSSProperty): Deleted.
466         * css/StyleProperties.h:
467         (WebCore::StyleProperties::PropertyReference::toCSSProperty):
468
469 2014-05-23  Simon Fraser  <simon.fraser@apple.com>
470
471         Rename ScrollingTreeScrollingNode's m_scrollPosition to make it clear that it's the value committed from the state tree
472         https://bugs.webkit.org/show_bug.cgi?id=133254
473
474         Reviewed by Tim Horton.
475
476         Make ScrollingTreeScrollingNode::scrollPosition() pure virtual, and rename
477         the member variable and associated getter to make it clear that they relate
478         to the last committed scroll position.
479
480         * page/scrolling/ScrollingTreeScrollingNode.cpp:
481         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
482         * page/scrolling/ScrollingTreeScrollingNode.h:
483         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition):
484         (WebCore::ScrollingTreeScrollingNode::scrollPosition): Deleted.
485
486 2014-05-23  Simon Fraser  <simon.fraser@apple.com>
487
488         Share some more ScrollingTreeScrollingNode code
489         https://bugs.webkit.org/show_bug.cgi?id=133248
490
491         Reviewed by Sam Weinig.
492
493         Push scrollBy(), scrollByWithoutContentEdgeConstraints() and setScrollPosition()
494         down to ScrollingTreeFrameScrollingNode.
495         
496         This requires that scrollPosition() return the right thing for each class, so make
497         it virtual. Future patches will reduce the confusion between the committed scroll
498         position and the one derived from layers.
499
500         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
501         (WebCore::ScrollingTreeFrameScrollingNode::scrollBy):
502         (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints):
503         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition):
504         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
505         * page/scrolling/ScrollingTreeScrollingNode.h:
506         (WebCore::ScrollingTreeScrollingNode::scrollPosition):
507         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
508         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
509         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition): Deleted.
510         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollBy): Deleted.
511         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollByWithoutContentEdgeConstraints): Deleted.
512         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
513         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
514         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
515         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy):
516         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints):
517         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition):
518         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
519         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollBy): Deleted.
520         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollByWithoutContentEdgeConstraints): Deleted.
521
522 2014-05-24  Chris Fleizach  <cfleizach@apple.com>
523
524         AX: fix coordinate mapping for iOS accessibility
525         https://bugs.webkit.org/show_bug.cgi?id=133188
526
527         Reviewed by Sam Weinig.
528
529         Make WebCore aware of the accessibility point/rect conversion methods.
530
531         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
532         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
533         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
534         * loader/EmptyClients.h:
535         * page/Chrome.cpp:
536         (WebCore::Chrome::accessibilityScreenToRootView):
537         (WebCore::Chrome::rootViewToAccessibilityScreen):
538         * page/Chrome.h:
539         * page/ChromeClient.h:
540         * platform/HostWindow.h:
541
542 2014-05-24  Zalan Bujtas  <zalan@apple.com>
543
544         Subpixel rendering: Non-compositing transforms with subpixel coordinates paint to wrong position.
545         https://bugs.webkit.org/show_bug.cgi?id=133184
546         <rdar://problem/16745606>
547
548         Reviewed by Simon Fraser.
549
550         Snapping relative negative coordinate values should produce the same position as if they were
551         positive absolute coordinates.
552         When a child box gets positioned off of its containers towards top/left, its relative coordinates
553         become negative. Pixel snapping those negative values should produce the same
554         final painting position as if the child box was fixed positioned with positive coordinates.
555         Since halfway values always round away from zero, negative and positive halfway values
556         produce opposite rounding direction.
557         This patch ensures that negative halfway values round to the direction as if they were positive.  
558
559         Test: fast/layers/hidpi-floor-negative-coordinate-values-to-maintain-rounding-direction.html
560
561         * platform/LayoutUnit.h:
562         (WebCore::roundToDevicePixel):
563         * rendering/RenderLayer.cpp:
564         (WebCore::RenderLayer::paintLayerByApplyingTransform):
565
566 2014-05-24  Frédéric Wang  <fred.wang@free.fr>
567
568         Use size variants and glyph assembly from the MATH data.
569         https://bugs.webkit.org/show_bug.cgi?id=130322
570
571         Reviewed by Chris Fleizach.
572
573         This patch modifies the RenderMathMLOperator code to use the MATH table
574         when one is provided in the current font on the <math> tag. More
575         precisely, the MathVariants table is used to draw a size variant or
576         a glyph assembly. The displaystyle attribute is not supported yet, so
577         for now large operators are always assumed to be in display style. The
578         MATH support does not work well with all platforms+fonts, so at the
579         moment the default font-family on the <math> is not changed.
580
581         Tests: mathml/opentype/large-operators-LatinModern.html
582                mathml/opentype/opentype-stretchy.html
583                mathml/opentype/vertical-LatinModern.html
584
585         * css/mathml.css: We only specify the default font-family on the math root, so that people can easily style the mathematics.
586         For now, old fonts without the MATH table are still used as the default.
587         (math):
588         (math, mfenced > *): Deleted.
589         (mo, mfenced): Deleted.
590         * platform/graphics/SimpleFontData.cpp: don't return the math data if the font is loading.
591         (WebCore::SimpleFontData::mathData):
592         * platform/graphics/opentype/OpenTypeMathData.cpp: update #ifdef so that disabling ENABLE_OPENTYPE_MATH won't lead to errors with unused parameters.
593         (WebCore::OpenTypeMathData::OpenTypeMathData):
594         (WebCore::OpenTypeMathData::getMathConstant):
595         (WebCore::OpenTypeMathData::getItalicCorrection):
596         (WebCore::OpenTypeMathData::getMathVariants):
597         * rendering/mathml/RenderMathMLOperator.cpp:
598         (WebCore::RenderMathMLOperator::boundsForGlyph):
599         (WebCore::RenderMathMLOperator::heightForGlyph):
600         (WebCore::RenderMathMLOperator::advanceForGlyph):
601         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We handle preferred width of size variants.
602         (WebCore::RenderMathMLOperator::shouldAllowStretching): This function now only returns whether the operator will stretch and no longer has side effect.
603         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): We add a function to convert from the MathVariant table data to the format supported by RenderMathMLOperator.
604         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We add a function to get the glyph that will be used for large operators in display style.
605         (WebCore::RenderMathMLOperator::findStretchyData): We make this function handle size variants.
606         (WebCore::RenderMathMLOperator::updateStyle): We handle size variants.
607         (WebCore::RenderMathMLOperator::paint): We handle size variants.
608         * rendering/mathml/RenderMathMLOperator.h:
609
610 2014-05-23  Tim Horton  <timothy_horton@apple.com>
611
612         REGRESSION (iOS WebKit2): requestAnimationFrame fires more than once between layer tree commits
613         https://bugs.webkit.org/show_bug.cgi?id=132794
614         <rdar://problem/16877909>
615
616         Reviewed by Simon Fraser.
617
618         Virtualize DisplayRefreshMonitor so that WebKit2 can implement its own DisplayRefreshMonitor for UI-side compositing views.
619         This allows the synchronization of requestAnimationFrame callbacks with UI-side compositing painting.
620
621         * WebCore.exp.in:
622         * WebCore.xcodeproj/project.pbxproj:
623         
624         * page/ChromeClient.h:
625         (WebCore::ChromeClient::graphicsLayerFactory):
626         (WebCore::ChromeClient::createDisplayRefreshMonitor):
627         * platform/graphics/DisplayRefreshMonitorFactory.h: Added.
628         * platform/graphics/GraphicsLayerUpdater.cpp:
629         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
630         * platform/graphics/GraphicsLayerUpdater.h:
631         * rendering/RenderLayerCompositor.cpp:
632         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
633         * rendering/RenderLayerCompositor.h:
634         Give the ChromeClient a chance to provide us with a custom DisplayRefreshMonitor.
635         If it does not, we'll fall back to making a DisplayRefreshMonitorMac or
636         DisplayRefreshMonitorIOS depending on the platform.
637
638         * dom/ScriptedAnimationController.cpp:
639         * dom/ScriptedAnimationController.h:
640         * platform/graphics/DisplayRefreshMonitor.cpp:
641         * platform/graphics/DisplayRefreshMonitor.h:
642         * platform/graphics/DisplayRefreshMonitorClient.cpp: Added.
643         * platform/graphics/DisplayRefreshMonitorClient.h: Added.
644         * platform/graphics/DisplayRefreshMonitorManager.cpp: Added.
645         * platform/graphics/DisplayRefreshMonitorManager.h: Added.
646         Split DisplayRefreshMonitor.cpp into one file per class.
647         Use references in a few places.
648         Remove some useless comments.
649
650         * platform/graphics/DisplayRefreshMonitor.cpp:
651         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
652         Use takeAny() and remove a FIXME about it not existing.
653
654         * platform/graphics/DisplayRefreshMonitorClient.cpp: Added.
655         (WebCore::DisplayRefreshMonitorClient::fireDisplayRefreshIfNeeded):
656         Use an early return instead of having the whole function body in an if().
657
658         * platform/graphics/ios/DisplayRefreshMonitorIOS.h: Added.
659         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
660         * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
661         * platform/graphics/mac/DisplayRefreshMonitorMac.h: Added.
662         Virtualize DisplayRefreshMonitorIOS and DisplayRefreshMonitorMac,
663         and move things specific to each of them out of DisplayRefreshMonitor itself.
664
665 2014-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
666
667         CSS JIT: Apply backtracking optimization to adjacent backtracking
668         https://bugs.webkit.org/show_bug.cgi?id=132951
669
670         Reviewed by Benjamin Poulain.
671
672         Apply the backtracking optimization to the adjacent backtracking.
673         This optimization is already done for the descendant backtracking.
674         We apply this to the adjacent backtracking similarly.
675
676         Test: fast/selectors/backtracking-adjacent-optimized.html
677
678         * cssjit/SelectorCompiler.cpp:
679         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
680         (WebCore::SelectorCompiler::solveAdjacentBacktrackingActionForDirectAdjacent):
681         (WebCore::SelectorCompiler::solveBacktrackingAction):
682         (WebCore::SelectorCompiler::computeBacktrackingStartOffsetInChain):
683         (WebCore::SelectorCompiler::computeBacktrackingHeightFromDescendant):
684         (WebCore::SelectorCompiler::computeBacktrackingWidthFromIndirectAdjacent):
685         (WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):
686         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
687         (WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
688         (WebCore::SelectorCompiler::computeBacktrackingStartHeightFromDescendant): Deleted.
689
690 2014-05-23  Alex Christensen  <achristensen@webkit.org>
691
692         Make CSS JIT run on ARM64.
693         https://bugs.webkit.org/show_bug.cgi?id=133156
694
695         Reviewed by Benjamin Poulain.
696
697         * cssjit/FunctionCall.h:
698         (WebCore::FunctionCall::saveAllocatedRegisters):
699         (WebCore::FunctionCall::restoreAllocatedRegisters):
700         Use StackAllocator's new push and pop functions to push and pop a vector instead of iterating it.
701         * cssjit/RegisterAllocator.h:
702         (WebCore::RegisterAllocator::reserveCalleeSavedRegisters):
703         (WebCore::RegisterAllocator::restoreCalleeSavedRegisters):
704         Return a vector of registers to allocate instead of doing the allocation to make the RegisterAllocator
705         not need to know about the StackAllocator and to use the new vector push and pop functions.
706         (WebCore::RegisterAllocator::~RegisterAllocator):
707         Store RegisterIDs instead of StackReferences to avoid needing to know about the stack.
708         * cssjit/SelectorCompiler.cpp:
709         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
710         Removed the requirement for assert to be disabled to print disassembly when debugging css jit.
711         (WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
712         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):
713         Added to correctly push the link register and frame pointer.
714         This is required if the jit code calls a function on arm64 and helpful for debugging tools on x86_64.
715         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
716         Generate the prologue and epilogue which respectively push and pop
717         the link register, frame pointer, and callee saved registers if needed.
718         * cssjit/StackAllocator.h:
719         (WebCore::StackAllocator::push):
720         (WebCore::StackAllocator::pop):
721         Added new vector push and pop functions to use stp and ldb instructions on arm64.
722
723 2014-05-23  Jeremy Jones  <jeremyj@apple.com>
724
725         Hide fullscreen immediately when switching tabs.
726         https://bugs.webkit.org/show_bug.cgi?id=133239
727
728         Reviewed by Eric Carlson.
729
730         This change allows fullscreen to disappear immediately while still cleaning
731         up fullscreen normally.
732
733         * WebCore.exp.in:
734         * platform/ios/WebVideoFullscreenControllerAVKit.h:
735         renamed function to requestHideAndExitFullscreen
736
737         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
738         renamed function to requestHideAndExitFullscreen
739
740         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
741         rename of requestExitFullscreen that also hides.
742
743         (-[WebVideoFullscreenController requestExitFullscreen]): Deleted.
744         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: declare requestHideAndExitFullscreen()
745         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
746         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
747         this hides the window before requesting exitfullscreen from the model.
748
749 2014-05-23  Tim Horton  <timothy_horton@apple.com>
750
751         [iOS] WKPDFView should have a page indicator
752         https://bugs.webkit.org/show_bug.cgi?id=133109
753         <rdar://problem/16383003>
754
755         Reviewed by Anders Carlsson.
756
757         * English.lproj/Localizable.strings:
758
759 2014-05-23  Enrica Casucci  <enrica@apple.com>
760
761         Remove invalid ASSERT in wordRangeForPosition.
762         https://bugs.webkit.org/show_bug.cgi?id=133232
763
764         Reviewed by Ryosuke Niwa.
765
766         In WK2 for iOS this function is called on every selection change.
767         The selection could be set by Javascript in an element that is not visible.
768         In that case we won't be able to create a VisiblePosition therefore wordRangeForPosition
769         should not ASSERT that the VisiblePosition is not null, but rather
770         perform an early return if it is null.
771
772         * editing/VisibleUnits.cpp:
773         (WebCore::wordRangeFromPosition):
774
775 2014-05-23  Manuel Rego Casasnovas  <rego@igalia.com>
776
777         [CSS Grid Layout] Use gridRowCount() and gridColumnCount() when possible
778         https://bugs.webkit.org/show_bug.cgi?id=133213
779
780         Reviewed by Sergio Villar Senin.
781
782         Use gridRowCount() and gridColumnCount() instead of m_grid.size() and
783         m_grid[0].size() to make the code more descriptive and easier to
784         understand.
785
786         No new tests (No change in behavior).
787
788         * rendering/RenderGrid.cpp:
789         (WebCore::RenderGrid::growGrid):
790         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
791
792 2014-05-23  Alexey Proskuryakov  <ap@apple.com>
793
794         REGRESSION (r153917): Chart for the Category Explorer within Quicken Essentials
795         does not draw until you force a redraw
796         https://bugs.webkit.org/show_bug.cgi?id=133228
797         <rdar://problem/15221231>
798
799         Reviewed by Simon Fraser.
800
801         * platform/RuntimeApplicationChecks.cpp: (WebCore::applicationIsQuickenEssentials):
802         * platform/RuntimeApplicationChecks.h:
803         Added a check for Quicken Essentials.
804
805         * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): Don't do an early return
806         for Quicken Essentials, it depends on drawing to update its layer.
807
808 2014-05-23  Mihnea Ovidenie  <mihnea@adobe.com>
809
810         REGRESSION(r169105): fast/regions/cssom/region-range-for-box-crash.html is more crashy than before
811         https://bugs.webkit.org/show_bug.cgi?id=133124
812
813         Reviewed by David Hyatt.
814
815         When adjusting the end points of a subtree selection in the case of a document
816         with named flows, we have to make sure that we pass the computed end
817         points to the visible selection algorithm only if the end points are
818         part of the same subtree, otherwise assume a selection clear behavior.
819
820         The test fast/regions/cssom/region-range-for-box-crash.html is used to
821         test this behavior.
822
823         * rendering/SelectionSubtreeRoot.cpp:
824         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
825         (WebCore::SelectionSubtreeRoot::selectionStartEndPositions): Moved to header file.
826         * rendering/SelectionSubtreeRoot.h:
827         (WebCore::SelectionSubtreeRoot::selectionStartEndPositions):
828
829 2014-05-23  Jeremy Jones  <jeremyj@apple.com>
830
831         reset m_havePreparedToPlay when changing media engines.
832         https://bugs.webkit.org/show_bug.cgi?id=133199
833
834         Reviewed by Eric Carlson.
835
836         If a play request comes in before the media player is created, m_havePreparedToPlay
837         is set to true. But when the player is created, this prevents the new player from
838         getting the prepare call.
839
840         * html/HTMLMediaElement.cpp:
841         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): set m_havePreparedToPlay false.
842
843 2014-05-23  Oliver Hunt  <oliver@apple.com>
844
845         Navigator object needs to have properties directly on the instance object
846         https://bugs.webkit.org/show_bug.cgi?id=133221
847
848         Reviewed by Mark Lam.
849
850         Flag the Navigator object as requiring properties to be on the instance
851         as there were a few compatibility issues when on the prototype.
852
853         * bindings/scripts/CodeGeneratorJS.pm:
854         (InterfaceRequiresAttributesOnInstance):
855
856 2014-05-23  Simon Fraser  <simon.fraser@apple.com>
857
858         Switch CSSGradientValue to use more references
859         https://bugs.webkit.org/show_bug.cgi?id=133206
860
861         Reviewed by Andreas Kling.
862
863         Switch from pointers to references in various places.
864
865         * css/CSSGradientValue.cpp:
866         (WebCore::CSSGradientValue::image):
867         (WebCore::CSSGradientValue::addStops):
868         (WebCore::positionFromValue):
869         (WebCore::CSSGradientValue::computeEndPoint):
870         (WebCore::CSSLinearGradientValue::createGradient):
871         (WebCore::CSSRadialGradientValue::resolveRadius):
872         (WebCore::CSSRadialGradientValue::createGradient):
873         * css/CSSGradientValue.h:
874
875 2014-05-23  Zalan Bujtas  <zalan@apple.com>
876
877         Subpixel rendering: Make webkit-box-shadow painting subpixel aware.
878         https://bugs.webkit.org/show_bug.cgi?id=133201
879         <rdar://problem/16072830>
880
881         Reviewed by Simon Fraser.
882
883         This patch enables webkit-box-shadow to be painted on a subpixel position. However, we
884         still truncate -webkit-box-shadow property values. Tracked here: http://webkit.org/b/133202
885
886         Test: fast/box-shadow/hidpi-webkit-box-shadow-subpixel-position.html
887
888         * platform/graphics/FloatRoundedRect.cpp:
889         (WebCore::FloatRoundedRect::inflateWithRadii): same as in from RoundedRect.
890         (WebCore::FloatRoundedRect::adjustRadii): same as in from RoundedRect.
891         * platform/graphics/FloatRoundedRect.h:
892         * rendering/RenderBoxModelObject.cpp:
893         (WebCore::RenderBoxModelObject::paintBoxShadow):
894
895 2014-05-22  peavo@outlook.com  <peavo@outlook.com>
896
897         [Curl] Crash when exceeding maximum cache limit.
898         https://bugs.webkit.org/show_bug.cgi?id=133185
899
900         Reviewed by Brent Fulgham.
901
902         When the maximum cache limit is exceeded, I get a crash.
903         This happens when deleting cache entries, because a reference to the url string object in the LRU list
904         is used as a parameter to invalidateCacheEntry(), when called from makeRoomForNewEntry().
905         When the string is removed from the LRU list in makeRoomForNewEntry(), the string is deleted.
906         Next, the string is accessed again to remove the url from the index, and we crash.
907
908         This can be fixed by removing the string from the LRU list after it is removed from the index.
909
910         Fixing the crash also revealed an infinite loop problem.
911         If the url for some reason only exist in the LRU list, and not in the index,
912         we will inifitely loop in makeRoomForNewEntry(), trying to remove this url from the cache, but never succeeding.
913         This can be fixed by removing the url from the LRU list, also when it's not in the index.
914
915         * platform/network/curl/CurlCacheManager.cpp:
916         (WebCore::CurlCacheManager::makeRoomForNewEntry): Avoid infinite loop by checking if there are more cache entries to remove.
917         (WebCore::CurlCacheManager::invalidateCacheEntry): Avoid crash and infinite loop by removing url from LRU list last.
918
919 2014-05-22  Simon Fraser  <simon.fraser@apple.com>
920
921         Make viewport units work in CSS gradients
922         https://bugs.webkit.org/show_bug.cgi?id=133204
923         <rdar://problem/17012259>
924         
925         Reviewed by Tim Horton.
926         
927         Make viewport percentage lengths work in gradients.
928
929         Test: fast/gradients/viewport-units-gradient.html
930
931         * css/CSSGradientValue.cpp:
932         (WebCore::CSSGradientValue::addStops):
933         (WebCore::CSSLinearGradientValue::createGradient):
934         (WebCore::CSSRadialGradientValue::createGradient):
935         * css/CSSGradientValue.h:
936
937 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
938
939         [iOS][WK2] Add support for minimal-ui viewports
940         https://bugs.webkit.org/show_bug.cgi?id=133162
941
942         Reviewed by Simon Fraser.
943
944         Add support for minimal-ui directly into the Viewport configuration.
945
946         ViewportConfiguration knows about two kinds of layout size in scrollview coordinates:
947         -normal size
948         -minimal ui size.
949
950         Initially, the page is initialized with resetMinimalUI() and starts with a normal layout.
951
952         At any time before the main resource is loaded, the Web page can update its viewport meta tag
953         to include minimal-ui. The viewport configuration is updated immediately to reflect the minimal-ui
954         layout size. Any layout after that takes minimal-ui into account.
955
956         * WebCore.exp.in:
957         * css/LengthFunctions.cpp:
958         (WebCore::minimumValueForLength):
959         (WebCore::floatValueForLength):
960         * css/StyleResolver.cpp:
961         (WebCore::StyleResolver::viewportPercentageValue):
962         * dom/ViewportArguments.h:
963         (WebCore::ViewportArguments::operator==):
964         * page/FrameView.cpp:
965         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
966         (WebCore::FrameView::viewportSizeForCSSViewportUnits):
967         (WebCore::FrameView::setViewportSize): Deleted.
968         (WebCore::FrameView::viewportSize): Deleted.
969         * page/FrameView.h:
970         * page/ViewportConfiguration.cpp:
971         (WebCore::ViewportConfiguration::ViewportConfiguration):
972         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
973         (WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
974         (WebCore::ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates):
975         (WebCore::ViewportConfiguration::resetMinimalUI):
976         (WebCore::ViewportConfiguration::pageWillRenderFirstFrame):
977         (WebCore::ViewportConfiguration::initialScale):
978         (WebCore::ViewportConfiguration::minimumScale):
979         (WebCore::ViewportConfiguration::updateConfiguration):
980         (WebCore::ViewportConfiguration::layoutWidth):
981         (WebCore::ViewportConfiguration::layoutHeight):
982         (WebCore::ViewportConfiguration::description):
983         * page/ViewportConfiguration.h:
984         (WebCore::ViewportConfiguration::minimumLayoutSizeForMinimalUI):
985         (WebCore::ViewportConfiguration::usesMinimalUI):
986         * rendering/RenderView.cpp:
987         (WebCore::RenderView::viewportSizeForCSSViewportUnits):
988         (WebCore::RenderView::viewportSize): Deleted.
989         * rendering/RenderView.h:
990
991 2014-05-22  Ryosuke Niwa  <rniwa@webkit.org>
992
993         Can't type in status in facebook.com on iOS Safari because keyboard disappears
994         https://bugs.webkit.org/show_bug.cgi?id=133196
995
996         Reviewed by Geoffrey Garen.
997
998         Fixed the bug by rolling out r156252.
999
1000         When the user taps on the status on facebook.com, the page focuses a textarea,
1001         which is then made momentarily invisible by setting display:none.
1002         The page then removes display:none later and expects the textarea to be still focused.
1003
1004         With r156252, the focus is removed after the page sets display:none and the keyboard disappears.
1005         Since the focus is never reset on the textarea, the user can never type in anything.
1006
1007         The specification may need to change here given that this (rather odd) behavior/expectation exists
1008         on one of the most popular websites on the Web.
1009
1010         * dom/Document.cpp:
1011         (WebCore::Document::Document):
1012         (WebCore::Document::recalcStyle):
1013         (WebCore::Document::updateLayout):
1014         (WebCore::Document::resetHiddenFocusElementSoon): Deleted.
1015         (WebCore::Document::resetHiddenFocusElementTimer): Deleted.
1016         * dom/Document.h:
1017
1018 2014-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
1019
1020         http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
1021         https://bugs.webkit.org/show_bug.cgi?id=132523
1022
1023         Reviewed by Alexey Proskuryakov.
1024
1025         We should not manufacture a response in the event of an error during a
1026         synchronous XHR. In addition, this test removes two places that are
1027         sensitive to such a manufactured response.
1028
1029         Updates test expectations.
1030
1031         * loader/DocumentThreadableLoader.cpp:
1032         (WebCore::DocumentThreadableLoader::loadRequest): Don't inspect a
1033         loader response if there is an error
1034         * platform/network/cf/ResourceHandleCFNet.cpp:
1035         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
1036         manufacture a response
1037         * platform/network/mac/ResourceHandleMac.mm:
1038         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
1039         manufacture a response
1040         * xml/XSLTProcessorLibxslt.cpp:
1041         (WebCore::docLoaderFunc): Only use the response's URL if no error
1042         occurred.
1043
1044 2014-05-22  Myles C. Maxfield  <litherum@gmail.com>
1045
1046         Unreviewed typo fix.
1047
1048         Reviewed by NOBODY.
1049
1050         No new tests.
1051
1052         * platform/graphics/mac/FontMac.mm:
1053         (WebCore::Font::dashesForIntersectionsWithRect): Accidentally said run.length() instead of glyphBuffer.size().
1054
1055 2014-05-22  Andreas Kling  <akling@apple.com>
1056
1057         [iOS WebKit2] Web process should try to shrink its memory footprint when going into background.
1058         <https://webkit.org/b/133197>
1059         <rdar://problem/17011561>
1060
1061         Make releaseMemory() public so we can call it from the process-will-suspend callback.
1062
1063         Reviewed by Gavin Barraclough.
1064
1065         * WebCore.exp.in:
1066         * platform/MemoryPressureHandler.h:
1067
1068 2014-05-22  Andreas Kling  <akling@apple.com>
1069
1070         Hook up a setting for showing detailed logging during memory pressure relief.
1071         <https://webkit.org/b/133194>
1072
1073         Make the pressure relief logger opt-in. Also make it flush memory back to the
1074         OS (for both malloc and FastMalloc) to get more accurate numbers at each step.
1075
1076         Reviewed by Gavin Barraclough.
1077
1078         * WebCore.exp.in:
1079         * platform/MemoryPressureHandler.cpp:
1080         * platform/MemoryPressureHandler.h:
1081         (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
1082         (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
1083         (WebCore::MemoryPressureHandler::ReliefLogger::setLoggingEnabled):
1084         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1085         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1086
1087 2014-05-22  Brady Eidson  <beidson@apple.com>
1088
1089         Don't scan for phone numbers in editable regions
1090         <rdar://problem/16949846> and https://bugs.webkit.org/show_bug.cgi?id=133192
1091
1092         Reviewed by Enrica Casucci.
1093
1094         No new tests (Currently untested WK2-only feature)
1095
1096         * editing/Editor.cpp:
1097         (WebCore::Editor::scanRangeForTelephoneNumbers): Skip the range if the Node is editable.
1098
1099 2014-05-22  Jeremy Jones  <jeremyj@apple.com>
1100
1101         Captions layout incorrectly in fullscreen.
1102         https://bugs.webkit.org/show_bug.cgi?id=133175
1103
1104         Reviewed by Eric Carlson.
1105
1106         When doing layout for fullscreen, geometry should be absolute so it is not influenced
1107         by the rest of the page. This change adds style for CSSPropertyPosition, CSSPropertyLeft,
1108         and CSSPropertyTop.
1109
1110         * html/shadow/MediaControlElements.cpp:
1111         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1112         Refactor style changes into updateStyleForTextTrackRepresentation().
1113         (WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
1114         Refactor style changes into updateStyleForTextTrackRepresentation().
1115         (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
1116         Refactor style changes into updateStyleForTextTrackRepresentation().
1117         (WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation):
1118         Consolidate style changes here. Include the two existing and three new style changes.
1119         * html/shadow/MediaControlElements.h:
1120         Declare updateStyleForTextTrackRepresentation().
1121
1122 2014-05-22  Simon Fraser  <simon.fraser@apple.com>
1123
1124         REGRESSION (r155977): Very stuttery 3D css animation on jtechcommunications.com
1125         https://bugs.webkit.org/show_bug.cgi?id=133179
1126         <rdar://problem/16864666>
1127
1128         Reviewed by Dean Jackson.
1129
1130         Revert code added in r155977 to try to pick a good contentsScale for layers
1131         based on a root-relative transform. This resulted in pages with too much 
1132         backing store, and too many cases where layers repainted during animations,
1133         causing stutter.
1134
1135         * platform/graphics/ca/GraphicsLayerCA.cpp:
1136         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1137         (WebCore::GraphicsLayerCA::flushCompositingState):
1138         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1139         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1140         (WebCore::GraphicsLayerCA::updateContentsOpaque):
1141         (WebCore::GraphicsLayerCA::updateAnimations):
1142         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
1143         (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
1144         (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
1145         (WebCore::GraphicsLayerCA::updateContentsScale):
1146         (WebCore::clampedContentsScaleForScale): Deleted.
1147         (WebCore::maxScaleFromTransform): Deleted.
1148         (WebCore::GraphicsLayerCA::updateRootRelativeScale): Deleted.
1149         (WebCore::GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact): Deleted.
1150         * platform/graphics/ca/GraphicsLayerCA.h:
1151
1152 2014-05-22  Martin Hock  <mhock@apple.com>
1153
1154         [iOS] Enable -apple-system- styled elements to respond to system font size changes.
1155         https://bugs.webkit.org/show_bug.cgi?id=133186
1156         <rdar://problem/16583782>
1157
1158         Reviewed by Enrica Casucci.
1159
1160         * WebCore.exp.in:
1161         * WebCore.xcodeproj/project.pbxproj:
1162         * rendering/RenderThemeIOS.h:
1163         * rendering/RenderThemeIOS.mm:
1164         (WebCore::_contentSizeCategory):
1165         (WebCore::RenderThemeIOS::contentSizeCategory):
1166         (WebCore::RenderThemeIOS::setContentSizeCategory):
1167
1168 2014-05-22  Jer Noble  <jer.noble@apple.com>
1169
1170         [MSE] Stored samples are not freed when SourceBuffer is removed from MediaSource
1171         https://bugs.webkit.org/show_bug.cgi?id=133174
1172
1173         Reviewed by Eric Carlson.
1174
1175         Clear out stored MediaSamples from SourceBuffer's TrackBuffer storage when
1176         aborting loading. Also, report the memory cost of those samples, so that the
1177         SourceBuffer will be GCd more readily.
1178
1179         Add a mechanism for reporting the size of a MediaSample:
1180         * Modules/mediasource/SourceBuffer.h:
1181         * platform/MediaSample.h:
1182         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1183         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
1184
1185         Track the memory usage of a SampleMap when adding and removing samples, as well
1186         as allowing the SampleMap to be cleared wholesale:
1187         * Modules/mediasource/SampleMap.cpp:
1188         (WebCore::SampleMap::clear): Release all stored MediaSamples.
1189         (WebCore::SampleMap::addSample): Update m_totalSize.
1190         (WebCore::SampleMap::removeSample): Ditto.
1191         * Modules/mediasource/SampleMap.h:
1192         (WebCore::SampleMap::SampleMap): Initialize m_totalSize.
1193         (WebCore::SampleMap::sizeInBytes): Simple accessor.
1194
1195         Clear the stored samples when loading is aborted, and report the extra memory
1196         cost
1197         * Modules/mediasource/SourceBuffer.cpp:
1198         (WebCore::SourceBuffer::SourceBuffer): Initialize m_reportedExtraMemoryCost.
1199         (WebCore::SourceBuffer::removedFromMediaSource): Clear all stored samples.
1200         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reportExtraMemoryCost().
1201         (WebCore::SourceBuffer::reportExtraMemoryCost): Inform the vm of the new
1202             extra memory cost incurred by the object.
1203
1204 2014-05-22  Enrica Casucci  <enrica@apple.com>
1205
1206         REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com.
1207         https://bugs.webkit.org/show_bug.cgi?id=133183
1208         <rdar://problem/17004207>
1209
1210         Reviewed by Geoff Garen.
1211
1212         Adding new export.
1213
1214         * WebCore.exp.in:
1215
1216 2014-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1217
1218         REGRESSION(r163712): [GTK] Misspelling and grammar underline marks are no longer drawn
1219         https://bugs.webkit.org/show_bug.cgi?id=133047
1220
1221         Reviewed by Darin Adler.
1222
1223         Change two conditions changed by mistake in r163712.
1224
1225         * editing/TextCheckingHelper.cpp:
1226         (WebCore::findMisspellings): Enter the loop also when wordStart is 0.
1227         (WebCore::TextCheckingHelper::findFirstMisspelling): Skip the work
1228         when the text is a single character. Also reworked it to use a for
1229         loop to improve the readability.
1230
1231 2014-05-22  Piotr Grad  <p.grad@samsung.com>
1232
1233         Video is resumed with old playback rate.
1234         https://bugs.webkit.org/show_bug.cgi?id=132905
1235
1236         Reviewed by Philippe Normand.
1237
1238         Setting '0' playback rate is causing pipeline to pause.
1239         GStreamer player impl. exposed this information to upper layers but it should not.
1240         Solution is to hidden such situation behind m_playbackRatePause flag.
1241
1242         Test: media/video-paused-0-rate.html
1243
1244         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1245         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1246         (WebCore::MediaPlayerPrivateGStreamer::play):
1247         (WebCore::MediaPlayerPrivateGStreamer::pause):
1248         (WebCore::MediaPlayerPrivateGStreamer::doSeek):
1249         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
1250         (WebCore::MediaPlayerPrivateGStreamer::paused):
1251         (WebCore::MediaPlayerPrivateGStreamer::setRate):
1252         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
1253         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1254
1255 2014-05-22  Antti Koivisto  <antti@apple.com>
1256
1257         Text markers don't paint on simple lines
1258         https://bugs.webkit.org/show_bug.cgi?id=133177
1259
1260         Reviewed by Anders Carlsson.
1261         
1262         Marker painting code does not yet support simple lines.
1263
1264         Tests: fast/text/mark-matches-rendering-simple-lines.html
1265                fast/text/mark-matches-rendering.html
1266
1267         * dom/DocumentMarkerController.cpp:
1268         (WebCore::DocumentMarkerController::addMarker):
1269         
1270             Force text blocks with markers to use line boxes.
1271
1272         * testing/Internals.cpp:
1273         (WebCore::Internals::setMarkedTextMatchesAreHighlighted):
1274         
1275             Expose this so we can make reftests for marker rendering.
1276
1277         * testing/Internals.h:
1278         * testing/Internals.idl:
1279
1280 2014-05-22  Manuel Rego Casasnovas  <rego@igalia.com>
1281
1282         [CSS Grid Layout] Guard RenderObject::isRenderGrid() method
1283         https://bugs.webkit.org/show_bug.cgi?id=132380
1284
1285         Reviewed by Benjamin Poulain.
1286
1287         Guard RenderObject::isRenderGrid() method under ENABLE_CSS_GRID_LAYOUT compilation flag.
1288
1289         * rendering/RenderBox.cpp:
1290         (WebCore::RenderBox::computeLogicalWidthInRegion):
1291         * rendering/RenderObject.h:
1292
1293 2014-05-21  Antti Koivisto  <antti@apple.com>
1294
1295         REGRESSION(r167870): Crash in simple line layout code with :after
1296         https://bugs.webkit.org/show_bug.cgi?id=133155
1297         <rdar://problem/16977696>
1298
1299         Reviewed by Darin Adler.
1300         
1301         Fix https://bugs.webkit.org/show_bug.cgi?id=132241 in a safer way.
1302         The underline behavior is tested by the existing fast/text/simple-lines-hover-underline.html
1303
1304         Test: fast/text/simple-lines-hover-after.html
1305
1306         * rendering/RenderBlock.cpp:
1307         (WebCore::RenderBlock::invalidateLineLayoutPath): Deleted.
1308
1309             Move to RenderBlockFlow.
1310
1311         * rendering/RenderBlock.h:
1312         (WebCore::RenderBlock::invalidateLineLayoutPath):
1313         * rendering/RenderBlockFlow.cpp:
1314         (WebCore::RenderBlockFlow::styleDidChange):
1315         
1316             Invalidate layout if style changes in a manner that makes us ineligible to use the simple line layout path.
1317
1318         (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
1319         
1320             Drop the simple line layout on path invalidation if it exists. It may not be valid anymore.
1321             Also invalidate the layout if this happens so we'll reconstruct the lines later.
1322
1323         (WebCore::RenderBlockFlow::simpleLineLayout): Deleted.
1324         (WebCore::RenderBlockFlow::ensureLineBoxes):
1325         (WebCore::RenderBlockFlow::createLineBoxes): Deleted.
1326                 
1327             Revert some of the changes made it r167870.
1328
1329         * rendering/RenderBlockFlow.h:
1330         (WebCore::RenderBlockFlow::simpleLineLayout):
1331         
1332             Add strong validity assert.
1333
1334 2014-05-21  Eric Carlson  <eric.carlson@apple.com>
1335
1336         [iOS] two media control button strings are not localized
1337         https://bugs.webkit.org/show_bug.cgi?id=133160
1338
1339         Reviewed by Geoffrey Garen.
1340
1341         * English.lproj/mediaControlsLocalizedStrings.js:
1342
1343 2014-05-21  Dean Jackson  <dino@apple.com>
1344
1345         [iOS] Update some of the media controls buttons to be bigger
1346         https://bugs.webkit.org/show_bug.cgi?id=133158
1347         <rdar://problem/16475828>
1348
1349         Reviewed by Simon Fraser.
1350
1351         The buttons in the media controls on iOS are too small
1352         to be comfortably pressed. Make them the size of the controls
1353         panel and the expected iOS button size (44x44px).
1354
1355         The artwork for the buttons now includes the padding. I've
1356         added a file from which you can edit the artwork, then
1357         copy it into the CSS (because editing directly in CSS is
1358         a huge pain).
1359
1360         So far just the play/pause and fullscreen button have been
1361         updated. There will be a follow-up patch to fix the remaining
1362         buttons and the scrubber.
1363
1364         * Modules/mediacontrols/assets-apple-iOS.svg: Added.
1365         * Modules/mediacontrols/mediaControlsiOS.css:
1366         (audio::-webkit-media-controls-panel):
1367         (audio::-webkit-media-controls-fullscreen-button):
1368         (audio::-webkit-media-controls-play-button):
1369         (audio::-webkit-media-controls-play-button:active):
1370         (audio::-webkit-media-controls-play-button.paused):
1371         (audio::-webkit-media-controls-fullscreen-button:active):
1372         (@media only screen and (-webkit-min-device-pixel-ratio: 2)): Deleted.
1373
1374 2014-05-21  Zalan Bujtas  <zalan@apple.com>
1375
1376         Garbage when rubber-banding at the right edge of a page zoomed to non-integral scale.
1377         https://bugs.webkit.org/show_bug.cgi?id=133139
1378         <rdar://problem/16503353>
1379
1380         Reviewed by Simon Fraser.
1381
1382         Do not pixel align the root content layer. The alignment code expands the graphics's layer size
1383         which makes the right and bottom tiles bigger than the content.
1384         Painting the body's background color produces pixel cracks, because the content can not
1385         fill the expanded tiles completely.
1386
1387         Not testable.
1388
1389         * platform/graphics/GraphicsLayerClient.h:
1390         (WebCore::GraphicsLayerClient::needsPixelAligment):
1391         * platform/graphics/ca/GraphicsLayerCA.cpp:
1392         (WebCore::GraphicsLayerCA::updateGeometry):
1393         (WebCore::GraphicsLayerCA::computePixelAlignment):
1394         * platform/graphics/ca/mac/TileGrid.mm:
1395         (WebCore::TileGrid::rectForTileIndex):
1396         * rendering/RenderLayerBacking.cpp:
1397         (WebCore::RenderLayerBacking::needsPixelAligment):
1398         * rendering/RenderLayerBacking.h:
1399
1400 2014-05-21  Radu Stavila  <stavila@adobe.com>
1401
1402         REGRESSION (r168046): Invalid layout in WebCore::RenderBox::containingBlockLogicalWidthForPositioned
1403         https://bugs.webkit.org/show_bug.cgi?id=132933
1404
1405         Reviewed by Darin Adler.
1406
1407         Invalid layout is performed when calling containingBlockLogicalWidthForPositioned for a RenderTableSection object.
1408
1409         Test: fast/multicol/newmulticol/table-section-crash.html
1410
1411         * rendering/RenderBox.cpp:
1412         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
1413
1414 2014-05-21  Simon Pena  <simon.pena@samsung.com>
1415
1416         [EFL] Ensure EGLOffScreenContext::initialize calls platformMakeCurrent on the surface
1417         https://bugs.webkit.org/show_bug.cgi?id=124832
1418
1419         Reviewed by Antonio Gomes.
1420
1421         The original code was only calling platformMakeCurrent when the
1422         GL_EXT_robustness extension is supported: the alternate code path
1423         would only create a context, but it wouldn't make that context
1424         current. This patch ensures platformMakeCurrent is also called for
1425         the alternate code path, and, if it fails to make the context
1426         current, will destroy the context. Effectively, this makes both
1427         code paths behave in the same way.
1428
1429         * platform/graphics/surfaces/egl/EGLContext.cpp:
1430         (WebCore::EGLOffScreenContext::initialize):
1431
1432 2014-05-20  Brent Fulgham  <bfulgham@apple.com>
1433
1434         [Mac] DataCues do not work properly when rewinding video
1435         https://bugs.webkit.org/show_bug.cgi?id=133138
1436         <rdar://problem/16979086>
1437
1438         Reviewed by Eric Carlson.
1439
1440         Make the TrackPrivateBase responsible for knowing if a type of track needs a non-zero
1441         startTimeVariance value.
1442
1443         Also, correct a bug in the equality test for DataCue objects.
1444
1445         * html/track/DataCue.cpp:
1446         (WebCore::DataCue::isEqual): Handle the JSValue data types consistently, so that we don't attempt
1447         to compare a JSNull against a default JSValue object.
1448         * html/track/InbandTextTrack.cpp:
1449         (WebCore::InbandTextTrack::startTimeVariance): Added.
1450         * html/track/InbandTextTrack.h:
1451         * html/track/TextTrack.cpp:
1452         (WebCore::TextTrack::hasCue): Use new startTimeVariance method location.
1453         * html/track/TextTrack.h:
1454         (WebCore::TextTrack::startTimeVariance): Added.
1455         * html/track/TextTrackCue.cpp:
1456         (WebCore::TextTrackCue::hasEquivalentStartTime): Use new startTimeVariance location.
1457         * html/track/TextTrackCue.h:
1458         (WebCore::TextTrackCue::startTimeVariance): Deleted.
1459         * html/track/TextTrackCueGeneric.h:
1460         * platform/graphics/TrackPrivateBase.h:
1461         (WebCore::TrackPrivateBase::startTimeVariance): Added.
1462         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
1463
1464 2014-05-20  Mark Hahnenberg  <mhahnenberg@apple.com>
1465
1466         Watchdog timer should be lazily allocated
1467         https://bugs.webkit.org/show_bug.cgi?id=133135
1468
1469         Reviewed by Geoffrey Garen.
1470
1471         No new tests.
1472
1473         We incur a noticeable amount of overhead on some benchmarks due to checking if the Watchdog ever fired. 
1474         There is no reason to do this checking if we never activated the Watchdog, which can only be done through 
1475         JSContextGroupSetExecutionTimeLimit or JSContextGroupClearExecutionTimeLimit. 
1476
1477         By allocating the Watchdog lazily on the VM we can avoid all of the associated overhead when we don't use 
1478         these two API functions (which is true of most clients).
1479
1480         * bindings/js/JSEventListener.cpp:
1481         (WebCore::JSEventListener::handleEvent):
1482         * bindings/js/WorkerScriptController.cpp:
1483         (WebCore::WorkerScriptController::evaluate):
1484         (WebCore::WorkerScriptController::scheduleExecutionTermination):
1485         (WebCore::WorkerScriptController::isExecutionTerminating):
1486
1487 2014-05-20  Dean Jackson  <dino@apple.com>
1488
1489         [Mac] Allow popup menus to override default appearance
1490         https://bugs.webkit.org/show_bug.cgi?id=133129
1491
1492         Reviewed by Tim Horton.
1493
1494         WebKitSystemInterface's WKPopupMenu has a flag to hide
1495         the arrows at the end of a popup-menu (e.g. <select>).
1496         Expose that via adding a hasDefaultAppearance flag to
1497         PopupMenuStyle, which then passes it on to WKSI.
1498
1499         * platform/PopupMenuStyle.h:
1500         (WebCore::PopupMenuStyle::PopupMenuStyle): New flag in constructor.
1501         (WebCore::PopupMenuStyle::hasDefaultAppearance): New flag.
1502         * platform/mac/WebCoreSystemInterface.h: wkPopupMenu signature has changed to accept
1503         the new flag.
1504         * platform/mac/WebCoreSystemInterface.mm: Ditto.
1505         * rendering/RenderMenuList.cpp:
1506         (RenderMenuList::itemStyle): Pass in true as default appearance when creating
1507         the PopupMenuStyle. We don't need it.
1508         (RenderMenuList::menuStyle): In this case we pass in the negated value of
1509         style().hasAppearance(), which indicates if we are overriding the built-in drawing.
1510         * rendering/RenderSearchField.cpp:
1511         (WebCore::RenderSearchField::menuStyle): Use true as the default value.
1512
1513 2014-05-20  Eric Carlson  <eric.carlson@apple.com>
1514
1515         [Mac] do not deactivate an audio session that has running I/O
1516         https://bugs.webkit.org/show_bug.cgi?id=133127
1517
1518         Reviewed by Jer Noble.
1519
1520         * page/Settings.h:
1521         (WebCore::Settings::setShouldManageAudioSessionCategory): Renamed from setShouldManageAudioSession.
1522         (WebCore::Settings::shouldManageAudioSessionCategory): Renamed from shouldManageAudioSession.
1523         (WebCore::Settings::setShouldManageAudioSession): Deleted.
1524         (WebCore::Settings::shouldManageAudioSession): Deleted.
1525
1526         * platform/audio/mac/MediaSessionManagerMac.cpp:
1527         (MediaSessionManager::updateSessionState): Don't deactivate the session if there are any
1528             Video or Audio sessions.
1529
1530         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1531         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus): Drive-by change to log errors 
1532             returned by -statusOfValueForKey:error: in debug builds.
1533
1534 2014-05-20  Beth Dakin  <bdakin@apple.com>
1535
1536         REGRESSION: All non-mainframe scrollbars don't paint after r169065
1537         https://bugs.webkit.org/show_bug.cgi?id=133132
1538         -and corresponding-
1539         <rdar://problem/16968850>
1540
1541         Reviewed by Geoff Garen.
1542
1543         We should not universally return true here. This feature will only work for 
1544         scrollbars with layers.
1545         * platform/ScrollableArea.h:
1546         * platform/Scrollbar.cpp:
1547         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
1548
1549 2014-05-20  Daniel Bates  <dabates@apple.com>
1550
1551         Element within flattened frame may update its scroll state during the layout phase of the wrong RenderView
1552         https://bugs.webkit.org/show_bug.cgi?id=133013
1553         <rdar://problem/16760154>
1554
1555         Reviewed by David Hyatt.
1556
1557         Fixes an issue where the scroll state of an element may be updated during the layout of the wrong
1558         RenderView. In particular, the scroll state of an element inside a CSS flex box in a flattened
1559         frame f is updated during the layout of the RenderView associated with the parent frame of f instead
1560         of during the layout of the RenderView associated with f.
1561
1562         The layout machinery assumes that the scroll state of each scrollable element is updated before the
1563         completion of layout for its associated RenderView. Currently we have logic to defer updating the scroll
1564         state of a scrollable element until completion of recursive layout. For a page with a flattened frame, we
1565         defer such updates until completion of layout for all RenderViews along the ancestor frame hierarchy of
1566         each flattened frame regardless of the RenderView associated with the element that originated the
1567         deferred scroll state request. Instead, only the RenderView associated with the element that deferred its
1568         scroll state update should dispatch the scroll state update.
1569
1570         Tests: fast/frames/flattening/scrollable-flexbox-inside-iframe-with-zero-height-and-needs-full-repaint-crash.html
1571                fast/frames/flattening/scrollable-flexbox-inside-iframe-with-zero-height-assertion-failure.html
1572
1573         * rendering/RenderBlock.cpp: Removed WTF::-prefix in typedef definition for ContinuationOutlineTableMap.
1574         (WebCore::UpdateScrollInfoAfterLayoutTransaction::UpdateScrollInfoAfterLayoutTransaction): Added; a struct
1575         that represents a RenderView v, nested transaction count, and a list of RenderBlocks in v that will need
1576         to have their scroll state updated.
1577         (WebCore::updateScrollInfoAfterLayoutTransactionStack): Added; returns the global stack of transactions.
1578         (WebCore::RenderBlock::willBeDestroyed): Call removeFromUpdateScrollInfoAfterLayoutTransaction(), which
1579         was formerly named as removeFromDelayedUpdateScrollInfoSet.
1580         (WebCore::currentUpdateScrollInfoAfterLayoutTransaction): Added; returns the top-most transaction in the
1581         global stack.
1582         (WebCore::RenderBlock::beginUpdateScrollInfoAfterLayoutTransaction): Modified as appropriate to make use
1583         of the global stack of transactions; formerly named startDelayUpdateScrollInfo.
1584         (WebCore::RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction): Modified as appropriate to
1585         make use of the global stack of transactions; formerly named finishDelayUpdateScrollInfo.
1586         (WebCore::RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction): Modified as appropriate to make
1587         use of the global stack of transactions; formerly named removeFromDelayedUpdateScrollInfoSet.
1588         (WebCore::RenderBlock::updateScrollInfoAfterLayout): Modified as appropriate to make use of the global
1589         stack of transactions.
1590         (WebCore::RenderBlock::layout): Ditto.
1591         (WebCore::RenderBlock::startDelayUpdateScrollInfo): Deleted.
1592         (WebCore::RenderBlock::finishDelayUpdateScrollInfo): Deleted.
1593         (WebCore::RenderBlock::removeFromDelayedUpdateScrollInfoSet): Deleted.
1594         * rendering/RenderBlock.h:
1595         * rendering/RenderBlockFlow.cpp:
1596         (WebCore::RenderBlockFlow::willBeDestroyed): Call removeFromUpdateScrollInfoAfterLayoutTransaction(), which
1597         was formerly named removeFromDelayedUpdateScrollInfoSet.
1598         * rendering/RenderDeprecatedFlexibleBox.cpp:
1599         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): Call {begin, end}UpdateScrollInfoAfterLayoutTransaction(),
1600         which was formerly named {start, end}DelayUpdateScrollInfo.
1601         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): Ditto.
1602         * rendering/RenderFlexibleBox.cpp:
1603         (WebCore::RenderFlexibleBox::layoutBlock): Ditto.
1604
1605 2014-05-20  Beth Dakin  <bdakin@apple.com>
1606
1607         REGRESSION (r169065): Mountain Lion run-api-tests failures: ASSERTION FAILED: 
1608         Uncaught exception - -[NSRegularLegacyScrollerImp setPresentationValue:]: 
1609         unrecognized selector sent to instance 0x7ff51aa38000
1610         https://bugs.webkit.org/show_bug.cgi?id=133121
1611
1612         Reviewed by Tim Horton.
1613
1614         * platform/mac/ScrollbarThemeMac.mm:
1615         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
1616
1617 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
1618
1619         REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
1620         https://bugs.webkit.org/show_bug.cgi?id=133106
1621         <rdar://problem/16967648>
1622
1623         Reviewed by Sam Weinig.
1624
1625         Fix regression from r169063. That commit removed scrolledContentsLayers from 
1626         frame scrolling nodes, but they do actually use them.
1627         
1628         So put them back; not in the base class, because they have a somewhat different
1629         meaning for overflow scrolling and frame scrolling.
1630
1631         * WebCore.exp.in:
1632         * page/scrolling/AsyncScrollingCoordinator.cpp:
1633         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1634         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
1635         * page/scrolling/AsyncScrollingCoordinator.h:
1636         * page/scrolling/ScrollingCoordinator.h:
1637         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
1638         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1639         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1640         (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer):
1641         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1642         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1643         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
1644         * rendering/RenderLayerCompositor.cpp:
1645         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1646
1647 2014-05-20  Radu Stavila  <stavila@adobe.com>
1648
1649         REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
1650         https://bugs.webkit.org/show_bug.cgi?id=133111
1651
1652         Reviewed by David Hyatt.
1653
1654         When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
1655         the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
1656         must no longer be taken into consideration, because its already included in the element's |topLeft|.
1657
1658         Test: fast/regions/hover-element-flowed-second-region.html
1659
1660         * rendering/RenderBox.cpp:
1661         (WebCore::RenderBox::computeRectForRepaint):
1662
1663 2014-05-20  Alex Christensen  <achristensen@webkit.org>
1664
1665         Fix web timing assertion failure.
1666         https://bugs.webkit.org/show_bug.cgi?id=133094
1667         <rdar://problem/16966032>
1668
1669         Reviewed by Alexey Proskuryakov.
1670
1671         * platform/network/mac/ResourceHandleMac.mm:
1672         (WebCore::ResourceHandle::getConnectionTimingData):
1673         Set requestStart and responseStart to 0 instead of -1 to match the 
1674         ResourceLoadTiming constructor and prevent the assertion failure in
1675         PerformanceTiming::responseStart.
1676
1677 2014-05-20  Prashant Hiremath  <hiremathprashants@gmail.com>
1678
1679         Only set title on SVG documents
1680         https://bugs.webkit.org/show_bug.cgi?id=133068
1681
1682         Reviewed by Dirk Schulze.
1683
1684         Test: svg/custom/html_document_set_title.html
1685
1686         * svg/SVGTitleElement.cpp:
1687         (WebCore::SVGTitleElement::insertedInto):
1688         (WebCore::SVGTitleElement::removedFrom):
1689         (WebCore::SVGTitleElement::childrenChanged):
1690
1691 2014-05-20  peavo@outlook.com  <peavo@outlook.com>
1692
1693         [Curl] Invalid content in cache file, causes broken rendering.
1694         https://bugs.webkit.org/show_bug.cgi?id=133069
1695
1696         Reviewed by Brent Fulgham.
1697
1698         When data for a url is received as multiple parts, the cache file for the url is truncated when opened for writing,
1699         and will only contain the last part of data received.
1700         This is fixed by only opening the file once, and close it after all data has been received.
1701
1702         * platform/network/curl/CurlCacheEntry.cpp:
1703         (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize cache file handle member.
1704         (WebCore::CurlCacheEntry::~CurlCacheEntry): Close cache file.
1705         (WebCore::CurlCacheEntry::saveCachedData): Only open cache file once to avoid truncating.
1706         (WebCore::CurlCacheEntry::didFail): Close cache file.
1707         (WebCore::CurlCacheEntry::didFinishLoading): Ditto.
1708         (WebCore::CurlCacheEntry::openContentFile): Added method to open cache file.
1709         (WebCore::CurlCacheEntry::closeContentFile): Added method to close cache file.
1710         * platform/network/curl/CurlCacheEntry.h: Added file handle member, and methods to open and close cache file.
1711
1712 2014-05-20  Radu Stavila  <stavila@adobe.com>
1713
1714         [CSS Regions] Block incorrectly sized when containing an unsplittable box
1715         https://bugs.webkit.org/show_bug.cgi?id=132601
1716
1717         Reviewed by Antti Koivisto.
1718
1719         When laying out elements in a region, when an inline element is encountered
1720         the size of its parent must not be increased beyond the bottom of the current region,
1721         unless if its the last region. This will ensure that the next sibling of the
1722         inline element is correctly laid out at the top of the next region, instead
1723         of leaving an empty space equal to the height of the overflow, as it did until now.
1724
1725         Tests: fast/regions/inline-block-inside-anonymous-overflow.html
1726                fast/regions/inline-block-overflow.html
1727
1728         * rendering/RenderBlockFlow.cpp:
1729         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
1730         (WebCore::RenderBlockFlow::hasNextPage):
1731         * rendering/RenderBlockFlow.h:
1732         * rendering/RenderBlockLineLayout.cpp:
1733         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1734         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
1735         (WebCore::RenderBlockFlow::determineStartPosition):
1736         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
1737
1738 2014-05-20  Mihnea Ovidenie  <mihnea@adobe.com>
1739
1740         [CSS Regions] Crash while painting block selection gaps in regions
1741         https://bugs.webkit.org/show_bug.cgi?id=132720
1742
1743         Reviewed by David Hyatt.
1744
1745         The fix for WebKit bug https://bugs.webkit.org/show_bug.cgi?id=131511
1746         allowed selection highlight to match the DOM selection when the start
1747         and end point of the selection were in different flow threads. In order
1748         to enable that, the selection was performed separately on view and
1749         render flow threads, considered selection subtrees.
1750
1751         However, the start and end points for each selection subtree were computed
1752         by means of Range class but it is not always possible to construct a valid
1753         Range from two pairs of RenderObjects and offsets.
1754
1755         This patch keeps the substrees approach but instead of storing the endpoints
1756         for each subtree in a Range and continuously extending the Range, it stores them
1757         using the already available SelectionSubtreeRoot class. After the end points are
1758         computed for each subtree and before processing the subtree selection, the end points
1759         are adjusted in a similar fashion as the one used in FrameSelection::updateAppearance(),
1760         to make sure we are passing the same expected information to the method implementing
1761         the visible selection processing.
1762
1763         Test: fast/regions/selection-gaps-paint-crash.html
1764
1765         * rendering/RenderView.cpp:
1766         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1767         * rendering/SelectionSubtreeRoot.cpp:
1768         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
1769         * rendering/SelectionSubtreeRoot.h:
1770         (WebCore::SelectionSubtreeRoot::selectionClear):
1771
1772 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
1773
1774         Scrolling pages with large TiledBacking content layers creates way too many tiles
1775         https://bugs.webkit.org/show_bug.cgi?id=133101
1776
1777         Reviewed by Tim Horton.
1778
1779         Fix the GraphicsLayerCA::adjustTiledLayerVisibleRect() logic to avoid making giant rects if the old
1780         and new visible rects don't overlap.
1781
1782         * platform/graphics/TiledBacking.h:
1783         * platform/graphics/ca/GraphicsLayerCA.cpp:
1784         (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):
1785         * platform/graphics/ca/mac/TileController.h:
1786
1787 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
1788
1789         Correctly maintain the "isInWindow" state for all TiledBackings
1790         https://bugs.webkit.org/show_bug.cgi?id=133095
1791
1792         Reviewed by Tim Horton.
1793         
1794         We never updated the "isInWindow" state for TiledBacking that wasn't the RenderView's
1795         backing. Fix it by having RenderLayerCompositor::setIsInWindow() recurse through all
1796         layers (if necessary), updating their state. Also set the state on newly created
1797         TiledBackings.
1798
1799         * rendering/RenderLayerCompositor.cpp:
1800         (WebCore::RenderLayerCompositor::layerTiledBackingUsageChanged):
1801         (WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
1802         (WebCore::RenderLayerCompositor::setIsInWindow):
1803         (WebCore::RenderLayerCompositor::pageTiledBacking): Deleted.
1804         * rendering/RenderLayerCompositor.h:
1805
1806 2014-05-19  Dean Jackson  <dino@apple.com>
1807
1808         [iOS] Use status display for live streams
1809         https://bugs.webkit.org/show_bug.cgi?id=133097
1810
1811         Reviewed by Sam Weinig.
1812
1813         Follow-on from https://bugs.webkit.org/show_bug.cgi?id=131390
1814         Allow the iOS controls to use the status display field.
1815
1816         * Modules/mediacontrols/mediaControlsiOS.js:
1817         (ControllerIOS.prototype.configureInlineControls): Live streams should
1818         not have a timeline or rewind button.
1819
1820 2014-05-19  Myles C. Maxfield  <litherum@gmail.com>
1821
1822         Text decorations do not contribute to visual overflow
1823         https://bugs.webkit.org/show_bug.cgi?id=132773
1824
1825         Reviewed by Antti Koivisto.
1826
1827         This patch creates a function, visualOverflowForDecorations, which computes
1828         how much visual overflow to add around a text box due to text decorations. Most of the time,
1829         text decorations are fully contained within the text box, so the result is usually 0.
1830
1831         This function exists within style/InlineTextBoxStyle.cpp, which is an added file. This is
1832         so that it can be called from setLogicalWidthForTextRun() inside RenderBlockLineLayout.cpp
1833         and from RenderStyle::changeAffectsVisualOverflow(). The former case passes in the full
1834         InlineTextBox and the latter case just passes in a RenderStyle (because the InlineTextBox
1835         is unavailable.)
1836
1837         This patch also modifies RenderTableSection::spannedColumns() to fix an off-by-one error
1838         that was causing table borders to not be drawn when they existed right on the edge of
1839         a repaint rect.
1840
1841         Tests: fast/css3-text/css3-text-decoration/repaint/underline-outside-of-layout-rect.html
1842         Tests: fast/repaint/border-collapse-table-off-by-one-expected.html
1843
1844         * WebCore.vcxproj/WebCore.vcxproj: Adding reference to new InlineTextBoxStyle.cpp file
1845         * WebCore.vcxproj/WebCore.vcxproj.filters: Adding reference to new InlineTextBoxStyle files
1846         * WebCore.xcodeproj/project.pbxproj: Adding reference to new InlineTextBoxStyle files
1847         * rendering/InlineTextBox.cpp:
1848         (WebCore::computeUnderlineOffset): Moved to InlineTextBox.cpp
1849         (WebCore::getWavyStrokeParameters): Moved to InlineTextBox.cpp
1850         (WebCore::InlineTextBox::paintDecoration): Update to use newly refactored functions
1851         * rendering/RenderBlockLineLayout.cpp:
1852         (WebCore::setLogicalWidthForTextRun): Call visualOverflowForDecorations()
1853         * rendering/RenderTableSection.cpp:
1854         * rendering/RenderTableSelection.cpp: Fix off-by-one error when the boundary of a repaint
1855         rect lies exactly on top of a table column position
1856         * rendering/style/RenderStyle.cpp:
1857         (WebCore::RenderStyle::changeAffectsVisualOverflow): Inspects shadows and text decorations
1858         (WebCore::RenderStyle::changeRequiresLayout): Calls changeAffectsVisualOverflow()
1859         (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): Moved code from here
1860         to changeAffectsVisualOverflow().
1861         * rendering/style/RenderStyle.h: Function signature
1862         * style/InlineTextBoxStyle.cpp: Added.
1863         (WebCore::computeUnderlineOffset): Moved from InlineTextBox.cpp
1864         (WebCore::getWavyStrokeParameters): Moved from InlineTextBox.cpp
1865         (WebCore::extendIntToFloat): Convenience function for dealing with the fact that
1866         underline bounding boxes use floats and GlyphOverflow uses ints
1867         (WebCore::visualOverflowForDecorations): Given
1868         vertical overflow bounds, possibly extend those to include location of
1869         decorations.
1870         * style/InlineTextBoxStyle.h: Added. Function signatures.
1871         (WebCore::textDecorationStrokeThickness): Refactored from InlineTextBox.cpp
1872         (WebCore::wavyOffsetFromDecoration): Refactored from InlineTextBox.cpp
1873         * platform/graphics/Font.h:
1874         (WebCore::GlyphOverflow::isEmpty): Convenience function
1875         (WebCore::GlyphOverflow::extendTo): Convenience function
1876
1877 2014-05-19  Alex Christensen  <achristensen@webkit.org>
1878
1879         Unreviewed build fix after r169082
1880
1881         * platform/network/ResourceHandle.h:
1882         Added NSDictionary declaration.
1883
1884 2014-05-19  Beth Dakin  <bdakin@apple.com>
1885
1886         REGRESSION: Standalone images need to take topContentInset into account
1887         https://bugs.webkit.org/show_bug.cgi?id=133092
1888         -and corresponding-
1889         <rdar://problem/16945791>
1890
1891         Reviewed by Darin Adler.
1892
1893         The FrameView’s size is accurate in terms of the NSWindow size, but that is not 
1894         really what the ImageDocument code is looking for here. The ImageDocument wants to 
1895         know the size of the unobscured viewport area. We should use visibleSize() for 
1896         that.
1897         * html/ImageDocument.cpp:
1898         (WebCore::ImageDocument::scale):
1899         (WebCore::ImageDocument::imageFitsInWindow):
1900         (WebCore::ImageDocument::imageClicked):
1901
1902 2014-05-19  Alex Christensen  <achristensen@webkit.org>
1903
1904         Collect web timing data on iOS.
1905         https://bugs.webkit.org/show_bug.cgi?id=133075
1906
1907         Reviewed by Sam Weinig.
1908
1909         * platform/network/ResourceHandle.h:
1910         Added setCollectsTimingData wrapper and getConnectionTimingData declarations.
1911         getConnectionTimingData with a dictionary parameter is a private helper function.
1912         * platform/network/cf/ResourceHandleCFNet.cpp:
1913         (WebCore::ResourceHandle::start):
1914         Call setCollectsTimingData wrapper when creating a connection to ensure that timing data is collected.
1915         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1916         (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveResponseCallback):
1917         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1918         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1919         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1920         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
1921         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1922         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1923         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
1924         Pass the CFURLConnectionRef to didReceiveResponse to get timing data from.
1925         * platform/network/mac/ResourceHandleMac.mm:
1926         (WebCore::ResourceHandle::getConnectionTimingData):
1927         Moved from getTimingData to compile regardless of using CFNetwork and added wrapper with CFDictionaryRef.
1928         (WebCore::ResourceHandle::setCollectsTimingData):
1929         Added wrapper to call objc function from c++.
1930         (WebCore::ResourceHandle::getTimingData):
1931         Renamed to getConnectionTimingData.
1932         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1933         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1934         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1935         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1936         Updated function name from getTimingData to getConnectionTimingData.
1937
1938 2014-05-19  Chris Fleizach  <cfleizach@apple.com>
1939
1940         AX: VoiceOver sees the WebArea out of order when topContentInset is used
1941         https://bugs.webkit.org/show_bug.cgi?id=133091
1942
1943         Reviewed by Simon Fraser.
1944
1945         Modify the scroll view's frame so that it recognizes the content inset.
1946         This is needed so that when VoiceOver sorts elements to create an ordering,
1947         the web area is not ordered at the top of the screen.
1948
1949         Test: platform/mac-wk2/accessibility/content-inset-scrollview-frame.html
1950
1951         * accessibility/AccessibilityScrollView.cpp:
1952         (WebCore::AccessibilityScrollView::elementRect):
1953
1954 2014-05-19  Beth Dakin  <bdakin@apple.com>
1955
1956         Scrollbars display incorrectly after switching between fast and slow scrolling 
1957         mode, affects Find and real sites
1958         https://bugs.webkit.org/show_bug.cgi?id=133077
1959         -and corresponding-
1960         <rdar://problem/16888608>
1961
1962         Reviewed by Tim Horton.
1963
1964         We should always return true here when updating on the secondary thread is 
1965         supported. It does not need to be gated on whether we are actively taking 
1966         advantage of that support at this moment.
1967         * platform/Scrollbar.cpp:
1968         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
1969
1970         Always update the presentationValue whenever we update the doubleValue just to 
1971         keep them in sync.
1972         * platform/mac/ScrollbarThemeMac.mm:
1973         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
1974
1975 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
1976
1977         Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
1978         https://bugs.webkit.org/show_bug.cgi?id=133022
1979
1980         Reviewed by Sam Weinig.
1981
1982         In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
1983         into FrameScrolling and OverflowScrolling nodes.
1984         
1985         Move what was the "viewportSize" property onto the base class for the scrolling
1986         nodes, calling it "scrollableAreaSize".
1987         
1988         Make minimum/maximumScrollPosition() virtual so we can share more code (and there
1989         is more code sharing to be done in future).
1990
1991         * Configurations/WebCore.xcconfig: Remove ScrollingStateScrollingNodeMac.mm and ScrollingTreeScrollingNodeMac.mm
1992         from the list, using #ifdefs in the file instead.
1993         * WebCore.exp.in: Lots of exports.
1994         * WebCore.xcodeproj/project.pbxproj: New files.
1995         * page/scrolling/AsyncScrollingCoordinator.cpp:
1996         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1997         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1998         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
1999         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
2000         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
2001         (WebCore::AsyncScrollingCoordinator::updateScrollingNode): Deleted.
2002         (WebCore::AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode): Deleted.
2003         This tiny function didn't need to exist.
2004         * page/scrolling/AsyncScrollingCoordinator.h:
2005         * page/scrolling/ScrollingCoordinator.h:
2006         (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
2007         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
2008         (WebCore::ScrollingCoordinator::updateScrollingNode): Deleted.
2009         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp.
2010         (WebCore::ScrollingStateFrameScrollingNode::create):
2011         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2012         (WebCore::ScrollingStateFrameScrollingNode::~ScrollingStateFrameScrollingNode):
2013         (WebCore::ScrollingStateFrameScrollingNode::clone):
2014         (WebCore::ScrollingStateFrameScrollingNode::setFrameScaleFactor):
2015         (WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion):
2016         (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount):
2017         (WebCore::ScrollingStateFrameScrollingNode::setSynchronousScrollingReasons):
2018         (WebCore::ScrollingStateFrameScrollingNode::setScrollBehaviorForFixedElements):
2019         (WebCore::ScrollingStateFrameScrollingNode::setHeaderHeight):
2020         (WebCore::ScrollingStateFrameScrollingNode::setFooterHeight):
2021         (WebCore::ScrollingStateFrameScrollingNode::setTopContentInset):
2022         (WebCore::ScrollingStateFrameScrollingNode::setCounterScrollingLayer):
2023         (WebCore::ScrollingStateFrameScrollingNode::setInsetClipLayer):
2024         (WebCore::ScrollingStateFrameScrollingNode::setContentShadowLayer):
2025         (WebCore::ScrollingStateFrameScrollingNode::setHeaderLayer):
2026         (WebCore::ScrollingStateFrameScrollingNode::setFooterLayer):
2027         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
2028         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
2029         * page/scrolling/ScrollingStateFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h.
2030         * page/scrolling/ScrollingStateNode.h:
2031         (WebCore::LayerRepresentation::layerID):
2032         (WebCore::ScrollingStateNode::isFrameScrollingNode):
2033         (WebCore::ScrollingStateNode::isOverflowScrollingNode):
2034         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Added.
2035         (WebCore::ScrollingStateOverflowScrollingNode::create):
2036         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
2037         (WebCore::ScrollingStateOverflowScrollingNode::~ScrollingStateOverflowScrollingNode):
2038         (WebCore::ScrollingStateOverflowScrollingNode::clone):
2039         (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer):
2040         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
2041         * page/scrolling/ScrollingStateOverflowScrollingNode.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
2042         (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer):
2043         * page/scrolling/ScrollingStateScrollingNode.cpp:
2044         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2045         (WebCore::ScrollingStateScrollingNode::setScrollableAreaSize):
2046         (WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
2047         (WebCore::ScrollingStateScrollingNode::dumpProperties):
2048         (WebCore::ScrollingStateScrollingNode::create): Deleted.
2049         (WebCore::ScrollingStateScrollingNode::clone): Deleted.
2050         (WebCore::ScrollingStateScrollingNode::setViewportSize): Deleted.
2051         (WebCore::ScrollingStateScrollingNode::setFrameScaleFactor): Deleted.
2052         (WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion): Deleted.
2053         (WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount): Deleted.
2054         (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons): Deleted.
2055         (WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements): Deleted.
2056         (WebCore::ScrollingStateScrollingNode::setHeaderHeight): Deleted.
2057         (WebCore::ScrollingStateScrollingNode::setFooterHeight): Deleted.
2058         (WebCore::ScrollingStateScrollingNode::setTopContentInset): Deleted.
2059         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer): Deleted.
2060         (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer): Deleted.
2061         (WebCore::ScrollingStateScrollingNode::setInsetClipLayer): Deleted.
2062         (WebCore::ScrollingStateScrollingNode::setContentShadowLayer): Deleted.
2063         (WebCore::ScrollingStateScrollingNode::setHeaderLayer): Deleted.
2064         (WebCore::ScrollingStateScrollingNode::setFooterLayer): Deleted.
2065         (WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
2066         * page/scrolling/ScrollingStateScrollingNode.h:
2067         (WebCore::ScrollingStateScrollingNode::scrollableAreaSize):
2068         (WebCore::ScrollingStateScrollingNode::totalContentsSize):
2069         * page/scrolling/ScrollingStateTree.cpp:
2070         (WebCore::ScrollingStateTree::attachNode):
2071         (WebCore::ScrollingStateTree::commit):
2072         * page/scrolling/ScrollingStateTree.h:
2073         (WebCore::ScrollingStateTree::rootStateNode):
2074         (WebCore::ScrollingStateTree::setRootStateNode):
2075         * page/scrolling/ScrollingTree.cpp:
2076         (WebCore::ScrollingTree::commitNewTreeState):
2077         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Added.
2078         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
2079         (WebCore::ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode):
2080         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
2081         * page/scrolling/ScrollingTreeFrameScrollingNode.h: Copied from Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h.
2082         (WebCore::ScrollingTreeFrameScrollingNode::updateLayersAfterDelegatedScroll):
2083         (WebCore::ScrollingTreeFrameScrollingNode::synchronousScrollingReasons):
2084         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously):
2085         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor):
2086         (WebCore::ScrollingTreeFrameScrollingNode::headerHeight):
2087         (WebCore::ScrollingTreeFrameScrollingNode::footerHeight):
2088         (WebCore::ScrollingTreeFrameScrollingNode::topContentInset):
2089         (WebCore::ScrollingTreeFrameScrollingNode::scrollBehaviorForFixedElements):
2090         * page/scrolling/ScrollingTreeNode.h:
2091         (WebCore::ScrollingTreeNode::isFrameScrollingNode):
2092         (WebCore::ScrollingTreeNode::isOverflowScrollingNode):
2093         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
2094         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
2095         (WebCore::ScrollingTreeOverflowScrollingNode::~ScrollingTreeOverflowScrollingNode):
2096         * page/scrolling/ScrollingTreeOverflowScrollingNode.h: Copied from Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
2097         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2098         (WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
2099         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
2100         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
2101         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
2102         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
2103         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition):
2104         (WebCore::ScrollingTreeScrollingNode::maximumScrollPosition):
2105         * page/scrolling/ScrollingTreeScrollingNode.h:
2106         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize):
2107         (WebCore::ScrollingTreeScrollingNode::totalContentsSize):
2108         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand):
2109         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand):
2110         (WebCore::ScrollingTreeScrollingNode::synchronousScrollingReasons): Deleted.
2111         (WebCore::ScrollingTreeScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
2112         (WebCore::ScrollingTreeScrollingNode::viewportSize): Deleted.
2113         (WebCore::ScrollingTreeScrollingNode::frameScaleFactor): Deleted.
2114         (WebCore::ScrollingTreeScrollingNode::headerHeight): Deleted.
2115         (WebCore::ScrollingTreeScrollingNode::footerHeight): Deleted.
2116         (WebCore::ScrollingTreeScrollingNode::scrollBehaviorForFixedElements): Deleted.
2117         (WebCore::ScrollingTreeScrollingNode::topContentInset): Deleted.
2118         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
2119         (WebCore::ScrollingCoordinatorIOS::createScrollingTreeNode):
2120         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.h.
2121         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer):
2122         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Renamed from Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm.
2123         (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
2124         (WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
2125         (WebCore::ScrollingTreeFrameScrollingNodeIOS::~ScrollingTreeFrameScrollingNodeIOS):
2126         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateBeforeChildren):
2127         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateAfterChildren):
2128         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition):
2129         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
2130         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
2131         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
2132         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
2133         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterDelegatedScroll):
2134         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
2135         (WebCore::ScrollingTreeFrameScrollingNodeIOS::minimumScrollPosition):
2136         (WebCore::ScrollingTreeFrameScrollingNodeIOS::maximumScrollPosition):
2137         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollBy):
2138         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollByWithoutContentEdgeConstraints):
2139         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2140         (WebCore::ScrollingCoordinatorMac::createScrollingTreeNode):
2141         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateScrollingNodeMac.mm.
2142         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars):
2143         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h.
2144         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm.
2145         (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
2146         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2147         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
2148         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2149         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateAfterChildren):
2150         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2151         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching):
2152         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching):
2153         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount):
2154         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection):
2155         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally):
2156         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically):
2157         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection):
2158         (WebCore::ScrollingTreeFrameScrollingNodeMac::absoluteScrollPosition):
2159         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy):
2160         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints):
2161         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer):
2162         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer):
2163         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
2164         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition):
2165         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2166         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2167         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2168         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange):
2169         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition):
2170         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition):
2171         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollBy):
2172         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollByWithoutContentEdgeConstraints):
2173         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
2174         (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea):
2175         (WebCore::logThreadedScrollingMode):
2176         (WebCore::logWheelEventHandlerCountChanged):
2177         * rendering/RenderLayerCompositor.cpp:
2178         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2179
2180 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
2181
2182         Images missing sometimes with composited clipping layers
2183         https://bugs.webkit.org/show_bug.cgi?id=133065
2184         <rdar://problem/15224559>
2185
2186         Reviewed by Beth Dakin.
2187         
2188         When support for solid colors on layers was added, a layer was considered a candidate
2189         for the solid color optimization without regard to whether it had descendent layers
2190         with "paintsIntoCompositedAncestor" requirements.
2191         
2192         Fix hasVisibleNonCompositingDescendantLayers(), renaming it to isPaintDestinationForDescendentLayers()
2193         and having it take into account whether descendent layers need to paint into an
2194         ancestor.
2195         
2196         Also, this test has to happen after those descendent layers have had their
2197         compositing state updated, so move the isSimpleContainerCompositingLayer() to
2198         a new updateAfterDescendents() function which is called from the various
2199         places we do compositing-udpate-tree-walks.
2200
2201         Test: compositing/backing/solid-color-with-paints-into-ancestor.html
2202
2203         * rendering/RenderLayerBacking.cpp:
2204         (WebCore::RenderLayerBacking::updateGeometry):
2205         (WebCore::RenderLayerBacking::updateAfterDescendents):
2206         (WebCore::RenderLayerBacking::paintsChildren):
2207         (WebCore::compositedWithOwnBackingStore):
2208         (WebCore::descendentLayerPaintsIntoAncestor):
2209         (WebCore::RenderLayerBacking::isPaintDestinationForDescendentLayers):
2210         (WebCore::hasVisibleNonCompositingDescendant): Deleted.
2211         (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers): Deleted.
2212         * rendering/RenderLayerBacking.h:
2213         * rendering/RenderLayerCompositor.cpp:
2214         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2215         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
2216         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
2217
2218 2014-05-19  Zalan Bujtas  <zalan@apple.com>
2219
2220         REGRESSION (r133351, sub-pixel layout): Right-to-left block with text-overflow: ellipsis truncates prematurely (breaks facebook.com Hebrew UI)
2221         https://bugs.webkit.org/show_bug.cgi?id=112227
2222
2223         Reviewed by Maciej Stachowiak.
2224
2225         This patch removes unnecessary integral snapping of inlines at layout time.
2226
2227         The general rule of thumb of using round/floor/ceil at layout time is to not use them.
2228  
2229         When some computed values (x, y, width, height) get snapped during layout, while others don't,
2230         intersecting/measuring mismatches could occur and they could end up producing visual artifacts such as truncations.
2231         This patch also enables iframe content to be positioned on odd device pixel positions on retina displays.
2232         
2233         Tests: fast/frames/hidpi-position-iframe-on-device-pixel.html
2234                fast/inline/hidpi-rtl-text-does-not-fit-line-and-gets-cut-off.html
2235
2236         * rendering/RenderBlock.h:
2237         (WebCore::RenderBlock::logicalLeftOffsetForLine):
2238         (WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine): Deleted.
2239         (WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine): Deleted.
2240         * rendering/RenderBlockLineLayout.cpp:
2241         (WebCore::updateLogicalInlinePositions):
2242         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
2243         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
2244
2245 2014-05-18  Chris Fleizach  <cfleizach@apple.com>
2246
2247         AX: iOS: using AXAttributeCacheEnabler is too slow for every accessibilityElementAtIndex:
2248         https://bugs.webkit.org/show_bug.cgi?id=133043
2249
2250         Reviewed by Mario Sanchez Prada.
2251
2252         iOS Accessibility code tries to improve performance by caching attributes when accessing
2253         elements through the platform API. However, those API calls can be used very frequently when 
2254         iterating elements. Creating the AXAttributeCacheEnabler object and tearing it down is proving
2255         to be the hottest code path in samples for accessibility access.
2256
2257         We need to move the logic for enabling/disabling the attribute cache to a level that can make
2258         a more informed decision about when to enable/disable.
2259
2260         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2261         (-[WebAccessibilityObjectWrapper enableAttributeCaching]):
2262         (-[WebAccessibilityObjectWrapper disableAttributeCaching]):
2263         (-[WebAccessibilityObjectWrapper accessibilityElementCount]):
2264         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
2265         (-[WebAccessibilityObjectWrapper indexOfAccessibilityElement:]):
2266
2267 2014-05-18  Simon Fraser  <simon.fraser@apple.com>
2268
2269         Use RenderStyle& in more places in RenderLayerBacking
2270         https://bugs.webkit.org/show_bug.cgi?id=133061
2271
2272         Reviewed by Andreas Kling.
2273
2274         Convert several member functions to use references to RenderStyle rather
2275         than pointers. Move canCreateTiledImage() higher in the file (no code
2276         changes). Other minor cleanup.
2277
2278         * rendering/RenderLayerBacking.cpp:
2279         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
2280         (WebCore::RenderLayerBacking::updateOpacity):
2281         (WebCore::RenderLayerBacking::updateTransform):
2282         (WebCore::RenderLayerBacking::updateFilters):
2283         (WebCore::RenderLayerBacking::updateBlendMode):
2284         (WebCore::RenderLayerBacking::updateGeometry):
2285         (WebCore::hasBoxDecorations):
2286         (WebCore::canCreateTiledImage):
2287         (WebCore::hasBoxDecorationsOrBackgroundImage):
2288         (WebCore::hasPerspectiveOrPreserves3D):
2289         (WebCore::supportsDirectBoxDecorationsComposition):
2290         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
2291         (WebCore::RenderLayerBacking::contentChanged):
2292         (WebCore::RenderLayerBacking::startTransition):
2293         * rendering/RenderLayerBacking.h:
2294
2295 2014-05-17  Simon Fraser  <simon.fraser@apple.com>
2296
2297         Rename some RenderLayerBacking member functions
2298         https://bugs.webkit.org/show_bug.cgi?id=133030
2299
2300         Reviewed by Sam Weinig.
2301
2302         Remove "GraphicsLayer" from some member function names on RenderLayerBacking.
2303         
2304         No behavior change.
2305
2306         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2307         (WebCore::AVFWrapper::createAVCFVideoLayer):
2308         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2309         (WebCore::MediaPlayerPrivateQTKit::createQTMovieLayer):
2310         * rendering/RenderLayer.cpp:
2311         (WebCore::RenderLayer::calculateClipRects):
2312         * rendering/RenderLayerBacking.cpp:
2313         (WebCore::RenderLayerBacking::updateAfterLayout):
2314         (WebCore::RenderLayerBacking::updateConfiguration):
2315         (WebCore::RenderLayerBacking::updateGeometry):
2316         (WebCore::RenderLayerBacking::contentChanged):
2317         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
2318         (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Deleted.
2319         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Deleted.
2320         * rendering/RenderLayerBacking.h:
2321         * rendering/RenderLayerCompositor.cpp:
2322         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2323         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2324         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
2325         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
2326         (WebCore::RenderLayerCompositor::attachRootLayer):
2327
2328 2014-05-19  Antti Koivisto  <antti@apple.com>
2329
2330         Fix assertion failure with simple line layout debug borders enabled.
2331
2332         Rubber-stamped by Andreas Kling.
2333
2334         * rendering/SimpleLineLayoutFunctions.cpp:
2335         (WebCore::SimpleLineLayout::paintDebugBorders): We shoudn't try to paint empty rects.
2336
2337 2014-05-18  Andreas Kling  <akling@apple.com>
2338
2339         Reduce constructor copypasta in RenderText and RenderElement.
2340         <https://webkit.org/b/133056>
2341
2342         Use delegating constructors to remove duplicated initializer lists
2343         from the constructors of RenderText and RenderElement.
2344
2345         Reviewed by Anders Carlsson.
2346
2347         * rendering/RenderElement.cpp:
2348         (WebCore::RenderElement::RenderElement):
2349         * rendering/RenderElement.h:
2350         * rendering/RenderText.cpp:
2351         (WebCore::RenderText::RenderText):
2352         * rendering/RenderText.h:
2353
2354 2014-05-18  Brent Fulgham  <bfulgham@apple.com>
2355
2356         Crash during scroll when latched
2357         https://bugs.webkit.org/show_bug.cgi?id=133064
2358
2359         Reviewed by Simon Fraser.
2360
2361         * page/mac/EventHandlerMac.mm:
2362         (WebCore::EventHandler::platformPrepareForWheelEvents): Prevent dereference of NULL
2363         wheelEventTarget argument.
2364
2365 2014-05-18  Svetlana Redchenko  <redchenko@yandex-team.ru>
2366
2367         Input ::selection pseudo class does not work leading to hidden selection
2368         https://bugs.webkit.org/show_bug.cgi?id=38943
2369
2370         Reviewed by Darin Adler.
2371
2372         Test: fast/selectors/input-with-selection-pseudo-element.html
2373
2374         When text is selected inside input element, it should change the
2375         color and background color according to the ::selection pseudo element.
2376
2377         * rendering/RenderObject.cpp:
2378         (WebCore::RenderObject::selectionBackgroundColor):
2379         (WebCore::RenderObject::selectionColor):
2380         (WebCore::RenderObject::selectionPseudoStyle):
2381         * rendering/RenderObject.h:
2382
2383 2014-05-18  Sam Weinig  <sam@webkit.org>
2384
2385         [WebKit2] Implement ScriptMessageHandlers
2386         https://bugs.webkit.org/show_bug.cgi?id=133053
2387
2388         Reviewed by Anders Carlsson.
2389
2390         * DerivedSources.make:
2391         * WebCore.exp.in:
2392         * WebCore.xcodeproj/project.pbxproj:
2393         * bindings/js/JSDOMWindowBase.cpp:
2394         (WebCore::JSDOMWindowBase::finishCreation):
2395         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp: Added.
2396         (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
2397         * page/DOMWindow.cpp:
2398         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
2399         (WebCore::DOMWindow::webkitNamespace):
2400         * page/DOMWindow.h:
2401         * page/UserContentController.cpp:
2402         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
2403         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
2404         * page/UserContentController.h:
2405         (WebCore::UserContentController::userMessageHandlerDescriptors):
2406         * page/UserMessageHandler.cpp: Added.
2407         (WebCore::UserMessageHandler::UserMessageHandler):
2408         (WebCore::UserMessageHandler::~UserMessageHandler):
2409         (WebCore::UserMessageHandler::postMessage):
2410         (WebCore::UserMessageHandler::name):
2411         (WebCore::UserMessageHandler::world):
2412         * page/UserMessageHandler.h: Added.
2413         (WebCore::UserMessageHandler::create):
2414         * page/UserMessageHandler.idl: Added.
2415         * page/UserMessageHandlerDescriptor.cpp: Added.
2416         (WebCore::UserMessageHandlerDescriptor::UserMessageHandlerDescriptor):
2417         (WebCore::UserMessageHandlerDescriptor::~UserMessageHandlerDescriptor):
2418         (WebCore::UserMessageHandlerDescriptor::name):
2419         (WebCore::UserMessageHandlerDescriptor::world):
2420         * page/UserMessageHandlerDescriptor.h: Added.
2421         (WebCore::UserMessageHandlerDescriptor::Client::~Client):
2422         (WebCore::UserMessageHandlerDescriptor::create):
2423         (WebCore::UserMessageHandlerDescriptor::client):
2424         * page/UserMessageHandlerDescriptorTypes.h: Added.
2425         * page/UserMessageHandlersNamespace.cpp: Added.
2426         (WebCore::UserMessageHandlersNamespace::UserMessageHandlersNamespace):
2427         (WebCore::UserMessageHandlersNamespace::~UserMessageHandlersNamespace):
2428         (WebCore::UserMessageHandlersNamespace::handler):
2429         * page/UserMessageHandlersNamespace.h: Added.
2430         (WebCore::UserMessageHandlersNamespace::create):
2431         * page/UserMessageHandlersNamespace.idl: Added.
2432         * page/WebKitNamespace.cpp: Added.
2433         (WebCore::WebKitNamespace::WebKitNamespace):
2434         (WebCore::WebKitNamespace::~WebKitNamespace):
2435         (WebCore::WebKitNamespace::messageHandlers):
2436         * page/WebKitNamespace.h: Added.
2437         (WebCore::WebKitNamespace::create):
2438         * page/WebKitNamespace.idl: Added.
2439
2440 2014-05-18  Maciej Stachowiak  <mjs@apple.com>
2441
2442         REGRESSION (r156546): Default media controls are laid out incorrectly when media element is styled with direction:rtl
2443         https://bugs.webkit.org/show_bug.cgi?id=132531
2444         <rdar://problem/16806267>
2445         
2446         Reviewed by Mark Rowe.
2447
2448         This was already tested by the media/video-rtl.htm reftest, now unskipped.
2449
2450         * Modules/mediacontrols/mediaControlsApple.css:
2451         (audio::-webkit-media-controls-panel): Add missing direction: ltr
2452
2453 2014-05-18  Rik Cabanier  <cabanier@adobe.com>
2454
2455         support for navigator.hardwareConcurrency
2456         https://bugs.webkit.org/show_bug.cgi?id=132588
2457
2458         Reviewed by Filip Pizlo.
2459
2460         Added a new API that returns the number of CPU cores up to 8.
2461
2462         Test: fast/dom/navigator-hardwareConcurrency.html
2463
2464         * Configurations/FeatureDefines.xcconfig:
2465         * page/Navigator.cpp:
2466         (WebCore::Navigator::hardwareConcurrency):
2467         * page/Navigator.h:
2468         * page/Navigator.idl:
2469
2470 2014-05-18  Anders Carlsson  <andersca@apple.com>
2471
2472         Fix iOS build.
2473
2474         * WebCore.exp.in:
2475         Move UserContentController symbols to the right place.
2476
2477 2014-05-18  Jon Lee  <jonlee@apple.com>
2478
2479         Build fix for r169006.
2480
2481         Unreviewed.
2482
2483         * loader/ResourceLoader.h: Return didCreateQuickLookHandle() to public.
2484
2485 2014-05-18  Antti Koivisto  <antti@apple.com>
2486
2487         REGRESSION (r160259): text-combine glyphs are not rendered
2488         https://bugs.webkit.org/show_bug.cgi?id=127324
2489
2490         Reviewed by Andreas Kling.
2491         
2492         The original text gets overwritten by a change that is supposed to affect rendered text only.
2493         Fixed by giving the text update functions well-defined purposes.
2494
2495         Test: fast/text/text-combine-rendering.html
2496
2497         * rendering/RenderCombineText.cpp:
2498         (WebCore::RenderCombineText::styleDidChange):
2499         (WebCore::RenderCombineText::setRenderedText):
2500         (WebCore::RenderCombineText::combineText):
2501         (WebCore::RenderCombineText::setTextInternal): Deleted.
2502         * rendering/RenderCombineText.h:
2503         * rendering/RenderCounter.cpp:
2504         (WebCore::RenderCounter::computePreferredLogicalWidths):
2505         * rendering/RenderText.cpp:
2506         (WebCore::RenderText::setRenderedText):
2507         
2508             This function now updates the rendered text but does not change the original.
2509             Get the original text by calling originalText().
2510
2511         (WebCore::RenderText::setText):
2512         
2513             This the only place original text now changes.
2514
2515         (WebCore::RenderText::setTextInternal): Deleted.
2516         
2517             Renamed to setRenderedText.
2518
2519         * rendering/RenderText.h:
2520         * rendering/svg/RenderSVGInlineText.cpp:
2521         (WebCore::RenderSVGInlineText::setRenderedText):
2522         (WebCore::RenderSVGInlineText::setTextInternal): Deleted.
2523         * rendering/svg/RenderSVGInlineText.h:
2524
2525 2014-05-17  Maciej Stachowiak  <mjs@apple.com>
2526
2527         Don't attempt to update id or name for nodes that are already removed
2528         https://bugs.webkit.org/show_bug.cgi?id=133041
2529
2530         Reviewed by Sam Weinig.
2531
2532         Tests: fast/dom/remove-element-with-id-that-was-inserted-on-DOMNodeRemoved.html
2533                fast/dom/remove-element-with-name-that-was-inserted-on-DOMNodeRemoved.html
2534
2535         * dom/Element.cpp:
2536         (WebCore::Element::removedFrom): Skip updating ids and names for an element not
2537         in a treescope, as we already do for elements not in a document.
2538
2539 2014-05-17  Alexey Proskuryakov  <ap@apple.com>
2540
2541         REGRESSION (NetworkProcess): Trying to use appcache fallback crashes in ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache
2542         https://bugs.webkit.org/show_bug.cgi?id=133007
2543         <rdar://problem/13702706>
2544
2545         appcache tests often fail on the Mac WebKit2 bot
2546         https://bugs.webkit.org/show_bug.cgi?id=82061
2547
2548         Reviewed by Maciej Stachowiak.
2549
2550         Covered by existing tests, which this patch enables.
2551
2552         * WebCore.exp.in: Export ResourceLoader::cancel(const ResourceError&). It used
2553         to be virtual, but marking subclasses final has resulted in the compiler calling
2554         it directly from WebKitLegacy framework. Seeing that no subclass overrides it,
2555         I then made it non-virtual.
2556         Also export ApplicationCacheHost functions that are now used from WebKit2.
2557
2558         * loader/ResourceLoader.h: Made the class abstract (as I didn't realize at first
2559         that it's always either a SubresourceLoader or a NetscapePlugInStreamLoader).
2560         Made ResourceHandleClient functions private, as they should never be called other
2561         than via a ResourceHandleClient pointer.
2562
2563         * loader/NetscapePlugInStreamLoader.h:
2564         * loader/SubresourceLoader.h:
2565         Marked these final.
2566
2567         * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willSwitchToSubstituteResource):
2568         Added a function to be called when switching to a substitute resource. We still
2569         need a ResourceLoader at this point, as substitute resource will be delivered through
2570         it, but we don't want it to continue its current load.
2571
2572         * loader/appcache/ApplicationCacheHost.cpp:
2573         (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
2574         Call the ResourceLoader function instead of using handle, which is null when
2575         using out of process networking.
2576
2577 2014-05-17  Andreas Kling  <akling@apple.com>
2578
2579         We shouldn't make a ScrollingThread on iOS.
2580         <https://webkit.org/b/133038>
2581         <rdar://problem/16947589>
2582
2583         Don't call ScrollingThred::dispatch() from the pressure relief
2584         code on iOS since that will end up instantiating a scrolling thread
2585         which we'd otherwise never have.
2586
2587         Reviewed by Sam Weinig.
2588
2589         * platform/MemoryPressureHandler.cpp:
2590         (WebCore::MemoryPressureHandler::releaseMemory):
2591
2592 2014-05-17  Piotr Grad  <p.grad@samsung.com>
2593
2594         Setting playback rate on video with media controller is not ignored.
2595         https://bugs.webkit.org/show_bug.cgi?id=129048
2596
2597         Reviewed by Jer Noble.
2598
2599         Replaced queries for m_playbackRate with effectivePlaybackRate()
2600         which includes media controller playback rate.
2601
2602         Test: media/video-controller-child-rate.html
2603
2604         * html/HTMLMediaElement.cpp:
2605         (WebCore::HTMLMediaElement::parseAttribute):
2606         * html/HTMLMediaElement.h:
2607
2608 2014-05-16  Anders Carlsson  <andersca@apple.com>
2609
2610         Expose WKUserScript as API
2611         https://bugs.webkit.org/show_bug.cgi?id=133017
2612         <rdar://problem/16948059>
2613
2614         Reviewed by Sam Weinig.
2615
2616         * WebCore.exp.in:
2617         Export symbols.
2618
2619         * WebCore.xcodeproj/project.pbxproj:
2620         Change UserContentController.h to be a private header.
2621
2622         * page/Page.cpp:
2623         (WebCore::Page::Page):
2624         Set m_userContentController from the page configuration and add it if it's not null.
2625
2626         * page/Page.h:
2627         Add UserContentController to PageClients.
2628
2629         * page/PageGroup.cpp:
2630         (WebCore::PageGroup::addPage):
2631         Only try to add a user content controller if the page doesn't already have one.
2632
2633         (WebCore::PageGroup::removePage):
2634         Only try to remove the user content controller if it's the group one.
2635
2636 2014-05-17  Andreas Kling  <akling@apple.com>
2637
2638         REGRESSION (r166422): All RenderBox objects grew 104 bytes from adding repaint timers.
2639         <https://webkit.org/b/133027>
2640         <rdar://problem/16867410>
2641
2642         Instead of storing a rarely-used repaint timer on every RenderBox, store one
2643         on the RenderView, and keep a hash set of renderers needing repaint.
2644
2645         Renderers get a flag tracking whether they have a pending lazy repaint.
2646         This way we can avoid hash lookups in the common case.
2647
2648         Also added a static assertion to catch RenderBox growing in the future.
2649
2650         Reviewed by Antti Koivisto.
2651
2652         * rendering/RenderBox.cpp:
2653         (WebCore::SameSizeAsRenderBox::~SameSizeAsRenderBox):
2654         (WebCore::RenderBox::RenderBox):
2655         (WebCore::RenderBox::~RenderBox):
2656         (WebCore::RenderBox::paintBoxDecorations):
2657         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2658         * rendering/RenderBox.h:
2659         * rendering/RenderElement.cpp:
2660         (WebCore::RenderElement::RenderElement):
2661         * rendering/RenderElement.h:
2662         (WebCore::RenderElement::setRenderBoxNeedsLazyRepaint):
2663         (WebCore::RenderElement::renderBoxNeedsLazyRepaint):
2664         * rendering/RenderView.cpp:
2665         (WebCore::RenderView::RenderView):
2666         (WebCore::RenderView::scheduleLazyRepaint):
2667         (WebCore::RenderView::unscheduleLazyRepaint):
2668         (WebCore::RenderView::lazyRepaintTimerFired):
2669         * rendering/RenderView.h:
2670
2671 2014-05-16  Jer Noble  <jer.noble@apple.com>
2672
2673         [Mac][MSE] setCurrentTime() goes down fastSeek path in MediaPlayerPrivateMediaSourceAVFObjC.
2674         https://bugs.webkit.org/show_bug.cgi?id=133023
2675
2676         Reviewed by Eric Carlson.
2677
2678         When seeking a MSE video, do not go down the fastSeekForMediaTime() path if the
2679         seek resulted from a setCurrentTime() call. The logic can lead to attempted seeks
2680         before buffered ranges.
2681
2682         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2683         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2684         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2685         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2686         (WebCore::MediaSourcePrivateAVFObjC::seekToTime):
2687
2688 2014-05-16  Benjamin Poulain  <bpoulain@apple.com>
2689
2690         [iOS] ScrollView::visibleContentRectInternal is bypassing the iOS code for unobscuredContentRect
2691         https://bugs.webkit.org/show_bug.cgi?id=133008
2692
2693         Reviewed by Simon Fraser.
2694
2695         * platform/ScrollView.cpp:
2696         (WebCore::ScrollView::visibleContentRectInternal):
2697         ScrollView::visibleContentRectInternal() was calling the internal implementation of visibleContentRect().
2698         That was skipping the iOS implementation and getting the framerect directly. That size is invalid on iOS
2699         when the exposed rect and unobscured rect are not the same.
2700
2701 2014-05-16  Jer Noble  <jer.noble@apple.com>
2702
2703         [Mac] naturalSize not updated when preload=metadata
2704         https://bugs.webkit.org/show_bug.cgi?id=132994
2705
2706         Reviewed by Eric Carlson.
2707
2708         Test: media/video-load-preload-metadata-naturalsize.html
2709
2710         When preload=metadata, we never create an AVPlayerItem, and therefore never receive a
2711         presentationSize KVO. When an AVAsset informs us that its tracks have changed, and there
2712         is no AVPlayerItem, recalculate presentation size based on the first video track's natural
2713         size.
2714
2715         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2716         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2717         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2718         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
2719
2720 2014-05-16  Simon Fraser  <simon.fraser@apple.com>
2721
2722         Remove "region-based columns" prefs
2723         https://bugs.webkit.org/show_bug.cgi?id=133006
2724         <rdar://problem/16945824>
2725
2726         Reviewed by Dave Hyatt.
2727
2728         Remove "region-based columns" prefs and related code, since this is only
2729         way to render columns now.
2730
2731         * page/Settings.in:
2732
2733 2014-05-16  Antti Koivisto  <antti@apple.com>
2734
2735         Link search area for touch events is too large in some cases
2736         https://bugs.webkit.org/show_bug.cgi?id=132988
2737         <rdar://problem/16917843>
2738
2739         Reviewed by Simon Fraser.
2740
2741         * page/ios/FrameIOS.mm:
2742         (WebCore::Frame::qualifyingNodeAtViewportLocation):
2743         
2744             - Adjust the search area to screen ppi.
2745             - Remove cut-off at scale 1. This made us pick physically far-away elements when zoomed in.
2746             
2747         * platform/PlatformScreen.h:
2748         * platform/ios/PlatformScreenIOS.mm:
2749         (WebCore::mobileGestaltFloatValue):
2750         (WebCore::screenPPIFactor):
2751
2752             Figure out screens physical PPI relative to a base.
2753
2754 2014-05-16  Jer Noble  <jer.noble@apple.com>
2755
2756         [MSE] Crash at  WebCore::SourceBuffer::~SourceBuffer + 110
2757         https://bugs.webkit.org/show_bug.cgi?id=132973
2758
2759         Reviewed by Eric Carlson.
2760
2761         Change SourceBuffer::m_private into a Ref<>, and add an assertion to
2762         SourceBufferPrivateAVFObjC's destructor if its client has not been cleared.
2763
2764         Eliminate unnecessary churn in MediaSourcePrivateAVFObjC by having the predicate
2765         functor take bare pointers, rather than a PassRefPtr.
2766
2767         The underlying problem seems to be in WebAVStreamDataParserListener. RefPtrs were
2768         being created off the main thread to a non-thread safe ref counted class. In some
2769         situations, this would result in double decrementing the ref, which would cause an
2770         early destruction of the underlying object. Instead replace these RefPtr strong
2771         pointers with explicit weak ones. Ensure the parser and its delegate are not freed
2772         before the append operation completes by passing strong pointers into the async
2773         append operation lambda.
2774
2775         There were a few places where we weren't null checking m_mediaSource before using it,
2776         and at least one place where we weren't clearing m_mediaSource.
2777
2778         * Modules/mediasource/SourceBuffer.cpp:
2779         (WebCore::SourceBuffer::SourceBuffer): Use Ref instead of RefPtr.
2780         (WebCore::SourceBuffer::appendBufferTimerFired): Ditto.
2781         * Modules/mediasource/SourceBuffer.h:
2782         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2783         (WebCore::MediaSourcePrivateAVFObjCHasAudio): Take a bare pointer, instead of a PassRefPtr.
2784         (WebCore::MediaSourcePrivateAVFObjCHasVideo): Ditto.
2785         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2786         (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer): Clear the back pointer when removing a buffer.
2787         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2788         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2789         (-[WebAVStreamDataParserListener initWithParser:parent:WebCore::]): Use WeakPtr instead of RefPtr.
2790         (-[WebAVStreamDataParserListener invalidate]): Ditto.
2791         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]): Ditto.
2792         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]): Ditto.
2793         (-[WebAVStreamDataParserListener streamDataParser:didFailToParseStreamDataWithError:]): Ditto.
2794         (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]): Ditto.
2795         (-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]): Ditto.
2796         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): Ditto.
2797         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2798         (WebCore::SourceBufferPrivateAVFObjC::append): Ditto.
2799
2800 2014-05-16  Zalan Bujtas  <zalan@apple.com>
2801
2802         Subpixel rendering: Push named flows in region to device pixel when painting.
2803         https://bugs.webkit.org/show_bug.cgi?id=132986
2804
2805         Reviewed by Simon Fraser.
2806
2807         Remove integral rounding when named flow sets the painting offset on the graphics context.
2808         Use device pixel snapping instead to ensure that we can paint on odd device pixel positions on retina displays. 
2809
2810         Test: fast/regions/hidpi-region-with-auto-margin-on-subpixel-position.html
2811
2812         * rendering/RenderLayer.cpp:
2813         (WebCore::RenderLayer::calculateClipRects):
2814
2815 2014-05-16  Radu Stavila  <stavila@adobe.com>
2816
2817         [CSS Regions] Add ASSERT to make sure using the flowThread cache does not return incorrect results
2818         https://bugs.webkit.org/show_bug.cgi?id=132906
2819
2820         Reviewed by Simon Fraser.
2821
2822         If flowThreadContainingBlock() is called on an object which is in a different
2823         flow thread than the one currently being laid out, this method will return an incorrect
2824         result. I added an assertion for that to make sure we catch and treat any such scenarios.
2825         For the moment, this assertion is only validated for regions, as multicol still has some issues.
2826
2827         No new tests required.
2828
2829         * rendering/RenderObject.cpp:
2830         (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache):
2831         (WebCore::RenderObject::locateFlowThreadContainingBlock):
2832         * rendering/RenderObject.h:
2833
2834 2014-05-16  Martin Hock  <mhock@apple.com>
2835
2836         MemoryCache::addImageToCache should return the result of add().
2837         https://bugs.webkit.org/show_bug.cgi?id=132928
2838         <rdar://problem/16651547>
2839
2840         Reviewed by Alexey Proskuryakov.
2841
2842         API test: WebKit1.MemoryCacheADdImageToCache (MemoryCacheAddImageToCacheIOS.mm)
2843
2844         * loader/cache/MemoryCache.cpp:
2845         (WebCore::MemoryCache::addImageToCache):
2846
2847 2014-05-16  Andrei Bucur  <abucur@adobe.com>
2848
2849         [CSS Regions] Reduce the RenderRegion invasiveness in rendering code
2850         https://bugs.webkit.org/show_bug.cgi?id=132121
2851
2852         Reviewed by Antti Koivisto.
2853
2854         Remove the RenderRegion / RenderNamedFlowFragment parameters and fields from
2855         the painting / hit testing data structures and use a stateful approach to
2856         correctly handle regions.
2857
2858         When painting or hit testing, the current flow thread is saved along the current
2859         region. They are accessed through the |currentRenderNamedFlowFragment| helper
2860         method on RenderObject or RenderLayer.
2861
2862         The patch also changes a bunch of 0s to nullptrs.
2863
2864         Tests: No new tests, no functional change.
2865
2866         * html/shadow/MediaControlElements.cpp:
2867         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
2868         * rendering/HitTestLocation.cpp:
2869         (WebCore::HitTestLocation::HitTestLocation):
2870         (WebCore::HitTestLocation::operator=):
2871         * rendering/HitTestLocation.h:
2872         (WebCore::HitTestLocation::region): Deleted.
2873         * rendering/HitTestResult.h:
2874         * rendering/PaintInfo.h:
2875         (WebCore::PaintInfo::PaintInfo):
2876         * rendering/RenderBlock.cpp:
2877         (WebCore::RenderBlock::paint):
2878         (WebCore::RenderBlock::paintObject):
2879         (WebCore::RenderBlock::selectionGaps):
2880         (WebCore::RenderBlock::nodeAtPoint):
2881         * rendering/RenderBox.cpp:
2882         (WebCore::RenderBox::nodeAtPoint):
2883         (WebCore::RenderBox::paintBoxDecorations):
2884         (WebCore::RenderBox::pushContentsClip):
2885         * rendering/RenderBoxModelObject.cpp:
2886         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
2887         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2888         * rendering/RenderBoxModelObject.h:
2889         * rendering/RenderLayer.cpp:
2890         (WebCore::RenderLayer::paint):
2891         (WebCore::RenderLayer::paintLayer):
2892         (WebCore::RenderLayer::paintLayerContents):
2893         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2894         (WebCore::RenderLayer::collectFragments):
2895         (WebCore::RenderLayer::updatePaintingInfoForFragments):
2896         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
2897         (WebCore::RenderLayer::paintBackgroundForFragments):
2898         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2899         (WebCore::RenderLayer::paintOutlineForFragments):
2900         (WebCore::RenderLayer::paintMaskForFragments):
2901         (WebCore::RenderLayer::hitTest):
2902         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
2903         (WebCore::RenderLayer::hitTestLayer):
2904         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
2905         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
2906         (WebCore::RenderLayer::calculateClipRects):
2907         * rendering/RenderLayer.h:
2908         * rendering/RenderLayerBacking.cpp:
2909         (WebCore::RenderLayerBacking::updateCompositedBounds):
2910         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
2911         * rendering/RenderLayerCompositor.cpp:
2912         (WebCore::RenderLayerCompositor::addToOverlapMap):
2913         (WebCore::RenderLayerCompositor::clippedByAncestor):
2914         * rendering/RenderObject.cpp:
2915         (WebCore::RenderObject::currentRenderNamedFlowFragment):
2916         * rendering/RenderObject.h:
2917         * rendering/RenderReplaced.cpp:
2918         (WebCore::RenderReplaced::shouldPaint):
2919         * rendering/RenderReplica.cpp:
2920         (WebCore::RenderReplica::paint):
2921         * rendering/RenderTable.cpp:
2922         (WebCore::RenderTable::nodeAtPoint):
2923         * rendering/RenderTableSection.cpp:
2924         (WebCore::RenderTableSection::nodeAtPoint):
2925         * rendering/RenderTreeAsText.cpp:
2926         (WebCore::writeLayers):
2927         * rendering/RootInlineBox.cpp:
2928         (WebCore::RootInlineBox::paint):
2929         * rendering/svg/RenderSVGRoot.cpp:
2930         (WebCore::RenderSVGRoot::paintReplaced):
2931
2932 2014-05-16  Kiran  <kiran.guduru@samsung.com>
2933
2934         RTCDtmfSender default values need to be updated.
2935         https://bugs.webkit.org/show_bug.cgi?id=132952
2936
2937         Reviewed by Eric Carlson.
2938
2939         The default ToneDuration and ToneGap values are modified in the updated spec.
2940         So these values need to be updated.
2941
2942         Test: fast/mediastream/RTCPeerConnection-dtmf.html.
2943
2944         * Modules/mediastream/RTCDTMFSender.cpp:
2945
2946 2014-05-15  Daniel Bates  <dabates@apple.com>
2947
2948         Attempt to fix the Apple Mavericks Release, Apple MountainLion Release,
2949         Apple MountainLion Release (32-bit Build), EFL, and GTK builds following
2950         <http://trac.webkit.org/changeset/168921> (https://bugs.webkit.org/show_bug.cgi?id=132669)
2951
2952         * dom/ContainerNode.cpp: Include SVGElement.h for the definition of Node::hasTagName(const SVGQualifiedName&).
2953
2954 2014-05-15  Daniel Bates  <dabates@apple.com>
2955
2956         ASSERT_NOT_REACHED() in DocumentOrderedMap::get() when removing SVG subtree
2957         https://bugs.webkit.org/show_bug.cgi?id=132669
2958         <rdar://problem/14931432>
2959
2960         Reviewed by Brent Fulgham and Ryosuke Niwa.
2961
2962         Fixes an assertion failure when removing an SVG element with a duplicate id.
2963
2964         When removing an SVG element with id A we synchronously instruct each element that references A
2965         to find the first element with id A, call this N, from the document root and register itself to
2966         either receive subsequent notifications from N (say, there is another element with id A) or as
2967         waiting for an element with id A (say, N = nullptr; => we removed the last element with id A from
2968         the document). Because the elements that reference A perform this operation synchronously when
2969         removing an element they consult an transient state of the DocumentOrderedMap when querying for the
2970         element with id A.
2971     
2972         Without loss of generality, let E, E_1, E_2, and E_3 be elements, where E_1, E_2, E_3 are children
2973         of E in that order and E_1.id = E_2.id = A and E_3.href = #A (that is, it references an element
2974         with id A). Suppose we remove E then we remove E_1, update DocumentOrderedMap to decrement its count
2975         for id A, and notify E_3 to look for an element with id A. This leads to an assertion failure since
2976         DocumentOrderedMap expects to find an element with id A, E_2, but cannot find such an element when
2977         traversing from the document root because E was unlinked from the document root (i.e. E_2 is in a
2978         disjoint subtree).
2979
2980         Tests: svg/custom/change-id-of-use-during-removal.html
2981                svg/custom/remove-subtree-including-path-with-duplicate-id-referenced-by-later-textpath.html
2982                svg/custom/remove-subtree-including-text-with-duplicate-id-referenced-by-later-tref.html
2983                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-earlier-use.html
2984                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-animate.html
2985                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-feimage.html
2986                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-mpath.html
2987                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-use.html
2988                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-later-use2.html
2989                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-use-in-different-subtree.html
2990                svg/custom/remove-subtree-including-use-with-duplicate-id-referenced-by-use-with-duplicate-id-in-different-subtree.html
2991                svg/custom/remove-use-with-duplicate-id-referenced-by-later-use.html
2992
2993         * dom/ContainerNode.cpp:
2994         (WebCore::ContainerNode::removeChild): Call SVGDocumentExtensions::rebuildElements() after we remove
2995         a DOM subtree so that applicable SVG elements can update their referenced element when the DocumentOrderedMap
2996         is in a stable-state.
2997         (WebCore::ContainerNode::removeChildren): Ditto.
2998         * svg/SVGDocumentExtensions.cpp:
2999         (WebCore::SVGDocumentExtensions::rebuildElements): Added; notifies SVG elements that their href attribute
3000         changed so that they query the DocumentOrderedMap for the element they reference by id in their href attribute.
3001         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Added; Called from removing
3002         an SVG element S from the DOM. Appends all elements that reference the id of S to the end of a Vector of
3003         elements to be rebuilt (when SVGDocumentExtensions::rebuildElements() is called) and notifies these elements
3004         that have been marked to be rebuilt so that they can invalidate their state (e.g. stop animating).
3005         (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget): Changed to take its argument by reference
3006         (since it's always non-null) and simplified logic to synchronously notify SVG updates that their referenced element
3007         may have changed. Calling SVGElement::svgAttributeChanged() on an element E should at most remove the dependencies
3008         of E.
3009         * svg/SVGDocumentExtensions.h:
3010         * svg/SVGElement.cpp:
3011         (WebCore::SVGElement::~SVGElement): Substitute "*this" for "this" as SVGDocumentExtensions::rebuildAllElementReferencesForTarget()
3012         now takes a reference instead of a pointer.
3013         (WebCore::SVGElement::removedFrom): Modified to call SVGDocumentExtensions::clearTargetDependencies().
3014         (WebCore::SVGElement::attributeChanged): Substitute "*this" for "this" as SVGDocumentExtensions::rebuildAllElementReferencesForTarget()
3015         now takes a reference instead of a pointer.
3016         * svg/SVGElement.h:
3017         (WebCore::SVGElement::callClearTarget): Added; calls through to private virtual SVGElement::clearTarget().
3018         (WebCore::SVGElement::clearTarget): Added.
3019         * svg/SVGTRefElement.cpp:
3020         (WebCore::SVGTRefElement::clearTarget): Added.
3021         * svg/SVGTRefElement.h:
3022         * svg/animation/SVGSMILElement.cpp:
3023         (WebCore::SVGSMILElement::clearTarget): Added.
3024         * svg/animation/SVGSMILElement.h:
3025
3026 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
3027
3028         [iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end.
3029         https://bugs.webkit.org/show_bug.cgi?id=132978
3030         <rdar://problem/16894428>
3031
3032         Reviewed by Benjamin Poulain.
3033
3034         This was the actual cause of the bug; r168560 changed the rect passed in here
3035         to be the customFixedPositionRect rather than the unobscured rect, but we
3036         used it to call FrameView::rectForViewportConstrainedObjects() which gave back
3037         another bogus rect. So just use the rect passed in.
3038
3039         * page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
3040         (WebCore::ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange):
3041
3042 2014-05-15  Daniel Bates  <dabates@apple.com>
3043
3044         SVG element may reference arbitrary DOM element before running its insertion logic
3045         https://bugs.webkit.org/show_bug.cgi?id=132757
3046         <rdar://problem/15703817>
3047
3048         Reviewed by Ryosuke Niwa.
3049
3050         Fixes an issue where an SVG element may reference an arbitrary DOM element e before e finished being
3051         inserted in the tree.
3052
3053         Currently when an SVG element A is inserted into a document we use document.getElementById() to find the
3054         element B it references (if any). If A is inserted before B and B has the same id as a later element in
3055         the document then A can find B before B is notified that its been inserted into the document (i.e. before
3056         Element::insertedFrom() is called on B). Instead, A should call document.getElementById() only after
3057         cessation of the insertion operation that inserted it to ensure that all inserted nodes (including B)
3058         processed their insertion-specific logic.
3059
3060         Tests: svg/custom/reparent-animate-element.html
3061                svg/custom/reparent-feimage-element.html
3062                svg/custom/reparent-mpath-element.html
3063                svg/custom/reparent-textpath-element.html
3064                svg/custom/reparent-tref-element.html
3065                svg/custom/reparent-use-element.html
3066
3067         * svg/SVGFEImageElement.cpp:
3068         (WebCore::SVGFEImageElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
3069         we are called back to resolve our target element (i.e. call SVGFEImageElement::buildPendingResources())
3070         after the subtree we're in is inserted.
3071         (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Added; turns around and calls SVGFEImageElement::buildPendingResources().
3072         * svg/SVGFEImageElement.h:
3073         * svg/SVGMPathElement.cpp:
3074         (WebCore::SVGMPathElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
3075         we are called back to resolve our target element (i.e. call SVGMPathElement::buildPendingResources())
3076         after the subtree we're in is inserted.
3077         (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Added; turns around and calls SVGMPathElement::buildPendingResources().
3078         * svg/SVGMPathElement.h:
3079         * svg/SVGTRefElement.cpp:
3080         (WebCore::SVGTRefElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
3081         we are called back to resolve our target element (i.e. call SVGTRefElement::buildPendingResources())
3082         after the subtree we're in is inserted.
3083         (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Added; turns around and calls SVGTRefElement::buildPendingResources().
3084         * svg/SVGTRefElement.h:
3085         * svg/SVGTextPathElement.cpp:
3086         (WebCore::SVGTextPathElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
3087         we are called back to resolve our target element (i.e. call SVGTextPathElement::buildPendingResources())
3088         after the subtree we're in is inserted.
3089         (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Added; turns around and calls SVGTextPathElement::buildPendingResources().
3090         * svg/SVGTextPathElement.h:
3091         * svg/SVGUseElement.cpp:
3092         (WebCore::SVGUseElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
3093         we are called back to resolve our target element (i.e. call SVGUseElement::buildPendingResources()) after its subtree is
3094         inserted.
3095         (WebCore::SVGUseElement::didNotifySubtreeInsertions): Added; turns around and calls SVGUseElement::buildPendingResources().
3096         * svg/SVGUseElement.h:
3097         * svg/animation/SVGSMILElement.cpp:
3098         (WebCore::SVGSMILElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
3099         we are called back to resolve our target element (i.e. call SVGSMILElement::buildPendingResources())
3100         after the subtree we're in is inserted.
3101         (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Added; turns around and calls SVGSMILElement::buildPendingResources().
3102         * svg/animation/SVGSMILElement.h:
3103
3104 2014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
3105
3106         JSDOMWindow should not claim HasImpureGetOwnPropertySlot
3107         https://bugs.webkit.org/show_bug.cgi?id=132918
3108
3109         Reviewed by Geoffrey Garen.
3110
3111         Tests: js/cached-window-properties.html
3112                js/cached-window-prototype-properties.html
3113
3114         We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the 
3115         blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding
3116         any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow 
3117         us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used 
3118         across the web.
3119
3120         * bindings/js/JSDOMWindowCustom.cpp:
3121         (WebCore::JSDOMWindow::getOwnPropertySlot):
3122         * bindings/scripts/CodeGeneratorJS.pm:
3123         (HasComplexGetOwnProperty):
3124         (InterfaceRequiresAttributesOnInstance):
3125         (InstanceOverridesGetOwnPropertySlot):
3126         (GenerateHeader):
3127
3128 2014-05-15  Alexey Proskuryakov  <ap@apple.com>
3129
3130         NetworkProcess crashes at ResourceHandle::continueDidReceiveResponse
3131         https://bugs.webkit.org/show_bug.cgi?id=132966
3132         <rdar://problem/16373694>
3133
3134         Reviewed by Brady Eidson.
3135
3136         Covered by many fast/files tests.
3137
3138         * platform/network/BlobResourceHandle.cpp: (WebCore::BlobResourceHandle::continueDidReceiveResponse):
3139         * platform/network/BlobResourceHandle.h:
3140         * platform/network/ResourceHandle.h:
3141         Don't call delegate's continueDidReceiveResponse when loading a blob:// URL,
3142         the delegate is null. On the Mac, we used to lazily create it, which was also wrong,
3143         but at least not observable.
3144
3145 2014-05-15  Commit Queue  <commit-queue@webkit.org>
3146
3147         Unreviewed, rolling out r168899.
3148         https://bugs.webkit.org/show_bug.cgi?id=132965
3149
3150         Broke some compositing regions tests on Mavericks (Requested
3151         by mihnea___ on #webkit).
3152
3153         Reverted changeset:
3154
3155         "[CSS Regions] Reduce the RenderRegion invasiveness in
3156         rendering code"
3157         https://bugs.webkit.org/show_bug.cgi?id=132121
3158         http://trac.webkit.org/changeset/168899
3159
3160 2014-05-15  Alex Christensen  <achristensen@webkit.org>
3161
3162         Add pointer lock to features without enabling it.
3163         https://bugs.webkit.org/show_bug.cgi?id=132961
3164
3165         Reviewed by Sam Weinig.
3166
3167         * Configurations/FeatureDefines.xcconfig:
3168         Added ENABLE_POINTER_LOCK to list of features.
3169         * WebCore.exp.in:
3170         Added linker symbols which differ with pointer lock enabled.
3171         * WebCore.xcodeproj/project.pbxproj:
3172         Added PointerLockController.cpp to build.
3173
3174 2014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
3175
3176         Move subframe name getter lookup later in JSDOMWindow::getOwnPropertySlot
3177         https://bugs.webkit.org/show_bug.cgi?id=132922
3178
3179         Reviewed by Geoffrey Garen.
3180
3181         No new tests.
3182
3183         In JSDOMWindow::getOwnPropertySlot, we currently look for the property on the JSDOMWindow, 
3184         then we search the window's subframes for name getters, then we look in the window's prototype 
3185         chain. Apparently we were doing the lookup in this order to be compatible with Mozilla, but 
3186         Mozilla no longer implements this behavior. Instead, they do the lookup on the prototype before 
3187         looking for subframe name getters. We should change this to match Mozilla. This has the convenient 
3188         side effect of allowing us to cache lookups in the window's prototype chain.
3189
3190         * bindings/js/JSDOMWindowCustom.cpp:
3191         (WebCore::JSDOMWindow::getOwnPropertySlot):
3192
3193 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
3194
3195         [UI-side compositing] Fix copying animations between layers, and pausing them
3196         https://bugs.webkit.org/show_bug.cgi?id=132943
3197         <rdar://problem/16906369&16906541>
3198
3199         Reviewed by Tim Horton.
3200
3201         Pass the animation key back to animationStarted(), though this isn't used
3202         when animations are running in-process.
3203
3204         * platform/graphics/ca/PlatformCALayer.h:
3205         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3206         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3207         (-[WebAnimationDelegate animationDidStart:]):
3208         (PlatformCALayerMac::animationStarted):
3209         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3210         (PlatformCALayerWin::animationStarted):
3211         * platform/graphics/ca/win/PlatformCALayerWin.h:
3212
3213 2014-05-15  Andrei Bucur  <abucur@adobe.com>
3214
3215         [CSS Regions] Reduce the RenderRegion invasiveness in rendering code
3216         https://bugs.webkit.org/show_bug.cgi?id=132121
3217
3218         Reviewed by Antti Koivisto.
3219
3220         Remove the RenderRegion / RenderNamedFlowFragment parameters and fields from
3221         the painting / hit testing data structures and use a stateful approach to
3222         correctly handle regions.
3223
3224         When painting or hit testing, the current flow thread is saved along the current
3225         region. They are accessed through the |currentRenderNamedFlowFragment| helper
3226         method on RenderObject or RenderLayer.
3227
3228         The patch also changes a bunch of 0s to nullptrs.
3229
3230         Tests: No new tests, no functional change.
3231
3232         * html/shadow/MediaControlElements.cpp:
3233         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
3234         * rendering/HitTestLocation.cpp:
3235         (WebCore::HitTestLocation::HitTestLocation):
3236         (WebCore::HitTestLocation::operator=):
3237         * rendering/HitTestLocation.h:
3238         (WebCore::HitTestLocation::region): Deleted.
3239         * rendering/HitTestResult.h:
3240         * rendering/PaintInfo.h:
3241         (WebCore::PaintInfo::PaintInfo):
3242         * rendering/RenderBlock.cpp:
3243         (WebCore::RenderBlock::paint):
3244         (WebCore::RenderBlock::paintObject):
3245         (WebCore::RenderBlock::selectionGaps):
3246         (WebCore::RenderBlock::nodeAtPoint):
3247         * rendering/RenderBox.cpp:
3248         (WebCore::RenderBox::nodeAtPoint):
3249         (WebCore::RenderBox::paintBoxDecorations):
3250         (WebCore::RenderBox::pushContentsClip):
3251         * rendering/RenderBoxModelObject.cpp:
3252         (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
3253         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3254         * rendering/RenderBoxModelObject.h:
3255         * rendering/RenderLayer.cpp:
3256         (WebCore::RenderLayer::paint):
3257         (WebCore::RenderLayer::paintLayer):
3258         (WebCore::RenderLayer::paintLayerContents):
3259         (WebCore::RenderLayer::paintLayerByApplyingTransform):
3260         (WebCore::RenderLayer::collectFragments):
3261         (WebCore::RenderLayer::updatePaintingInfoForFragments):
3262         (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
3263         (WebCore::RenderLayer::paintBackgroundForFragments):
3264         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3265         (WebCore::RenderLayer::paintOutlineForFragments):
3266         (WebCore::RenderLayer::paintMaskForFragments):
3267         (WebCore::RenderLayer::hitTest):
3268         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
3269         (WebCore::RenderLayer::hitTestLayer):
3270         (WebCore::RenderLayer::hitTestTransformedLayerInFragments):
3271         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
3272         (WebCore::RenderLayer::calculateClipRects):
3273         * rendering/RenderLayer.h:
3274         * rendering/RenderLayerBacking.cpp:
3275         (WebCore::RenderLayerBacking::updateCompositedBounds):
3276         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3277         * rendering/RenderLayerCompositor.cpp:
3278         (WebCore::RenderLayerCompositor::addToOverlapMap):
3279         (WebCore::RenderLayerCompositor::clippedByAncestor):
3280         * rendering/RenderObject.cpp:
3281         (WebCore::RenderObject::currentRenderNamedFlowFragment):
3282         * rendering/RenderObject.h:
3283         * rendering/RenderReplaced.cpp:
3284         (WebCore::RenderReplaced::shouldPaint):
3285         * rendering/RenderReplica.cpp:
3286         (WebCore::RenderReplica::paint):
3287         * rendering/RenderTable.cpp:
3288         (WebCore::RenderTable::nodeAtPoint):
3289         * rendering/RenderTableSection.cpp:
3290         (WebCore::RenderTableSection::nodeAtPoint):
3291         * rendering/RenderTreeAsText.cpp:
3292         (WebCore::writeLayers):
3293         * rendering/RootInlineBox.cpp:
3294         (WebCore::RootInlineBox::paint):
3295         * rendering/svg/RenderSVGRoot.cpp:
3296         (WebCore::RenderSVGRoot::paintReplaced):
3297
3298 2014-05-14  Simon Fraser  <simon.fraser@apple.com>
3299
3300         Clean up "has non-zero begin time" terminology in animations
3301         https://bugs.webkit.org/show_bug.cgi?id=132942
3302
3303         Reviewed by Tim Horton.
3304
3305         Change the "non-zero beginTime" terminology in the platform CA animations
3306         code to "explicit beginTime": this flag really means that we explicitly set
3307         the beginTime of the animation, rather than let CA set the beginTime when
3308         committing the animation. This flag is used for animations with negative
3309         delay, and when pausing.
3310         
3311         The WKNonZeroBeginTimeFlag key was spread across PlatformCALayerMac and PlatformCAAnimationMac,
3312         so hide it behind getter/setter functions.
3313         
3314         Remove lots of m_layer.get() in PlatformCAAnimationMac.
3315
3316         * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
3317         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
3318         (WebCore::hasExplicitBeginTime):
3319         (WebCore::setHasExplicitBeginTime):
3320         (PlatformCAAnimationMac::copy):
3321         (PlatformCAAnimationMac::keyPath):
3322         (PlatformCAAnimationMac::beginTime):
3323         (PlatformCAAnimationMac::setBeginTime):
3324         (PlatformCAAnimationMac::duration):
3325         (PlatformCAAnimationMac::setDuration):
3326         (PlatformCAAnimationMac::speed):
3327         (PlatformCAAnimationMac::setSpeed):
3328         (PlatformCAAnimationMac::timeOffset):
3329         (PlatformCAAnimationMac::setTimeOffset):
3330         (PlatformCAAnimationMac::repeatCount):
3331         (PlatformCAAnimationMac::setRepeatCount):
3332         (PlatformCAAnimationMac::autoreverses):
3333         (PlatformCAAnimationMac::setAutoreverses):
3334         (PlatformCAAnimationMac::fillMode):
3335         (PlatformCAAnimationMac::setFillMode):
3336         (PlatformCAAnimationMac::setTimingFunction):
3337         (PlatformCAAnimationMac::copyTimingFunctionFrom):
3338         (PlatformCAAnimationMac::isRemovedOnCompletion):
3339         (PlatformCAAnimationMac::setRemovedOnCompletion):
3340         (PlatformCAAnimationMac::isAdditive):
3341         (PlatformCAAnimationMac::setAdditive):
3342         (PlatformCAAnimationMac::valueFunction):
3343         (PlatformCAAnimationMac::setValueFunction):
3344         (hasNonZeroBeginTimeFlag): Deleted.
3345         (setNonZeroBeginTimeFlag): Deleted.
3346         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3347         (-[WebAnimationDelegate animationDidStart:]):
3348
3349 2014-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3350
3351         [GTK] Compile all installed resources as GResources
3352         https://bugs.webkit.org/show_bug.cgi?id=131099
3353
3354         Reviewed by Philippe Normand.
3355
3356         * PlatformGTK.cmake: Do not install the resources.
3357         * platform/audio/gtk/AudioBusGtk.cpp:
3358         (WebCore::AudioBus::loadPlatformResource): Load the audio resource
3359         from GResources and use createBusFromInMemoryAudioFile().
3360         * platform/graphics/Image.h: Remove unsued function loadPlatformThemeIcon.
3361         * platform/graphics/gtk/ImageGtk.cpp:
3362         (WebCore::loadImageFromGResource): Load the given icon name from GResources.
3363         (WebCore::loadResourceSharedBuffer): Use char* instead of CString.
3364         (WebCore::loadMissingImageIconFromTheme): Try to load the missing
3365         icon from the current GTK icon theme.
3366         (WebCore::Image::loadPlatformResource): Call
3367         loadMissingImageIconFromTheme for missing icon or
3368         loadImageFromGResource for any other icon name.
3369         (WebCore::getPathToImageResource): Deleted.
3370         (WebCore::getThemeIconFileName): Deleted.
3371         (WebCore::loadImageFromFile): Deleted.
3372         (WebCore::Image::loadPlatformThemeIcon): Deleted.
3373
3374 2014-05-14  Beth Dakin  <bdakin@apple.com>
3375
3376         Tiled scrolling indicator needs to take topContentInset into account
3377         https://bugs.webkit.org/show_bug.cgi?id=132940
3378
3379         Reviewed by Simon Fraser.
3380
3381         The tiled scrolling indicator needs to move down by the value of the 
3382         topContentInset. This patch makes that&nb