Sharing SharedBuffer between WebCore and ImageIO is racy and crash prone
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-07-24  Pratik Solanki  <psolanki@apple.com>
2
3         Sharing SharedBuffer between WebCore and ImageIO is racy and crash prone
4         https://bugs.webkit.org/show_bug.cgi?id=135069
5         <rdar://problem/17470655>
6
7         Reviewed by Simon Fraser.
8
9         When passing image data to ImageIO for decoding, we pass an NSData subclass that is a wraper
10         around SharedBuffer. This can be a problem when ImageIO tries to access the data on the CA
11         thread. End result is data corruption on large image loads and potential crashes. The fix is
12         to have SharedBuffer create a copy of its data if the data has been passed to ImageIO and
13         might be accessed concurrently.
14
15         Since Vector is not refcounted, we do this by having a new refcounted object in SharedBuffer
16         that contains the buffer and we pass that in our NSData subclass WebCoreSharedBufferData.
17         Code that would result in the Vector memory moving e.g. append(), resize(), now checks to
18         see if the buffer was shared and if so, will create a new copy of the vector. This ensures
19         that the main thread does not end up invalidating the vector memory that we have passed it
20         to ImageIO.
21
22         No new tests because no functional changes.
23
24         * loader/cache/CachedResource.cpp:
25         (WebCore::CachedResource::makePurgeable):
26             Remove early return - createPurgeableMemory() has the correct check now.
27         * platform/SharedBuffer.cpp:
28         (WebCore::SharedBuffer::SharedBuffer):
29         (WebCore::SharedBuffer::adoptVector):
30         (WebCore::SharedBuffer::createPurgeableBuffer):
31             Don't create purgeable buffer if we are sharing the buffer.
32         (WebCore::SharedBuffer::append):
33         (WebCore::SharedBuffer::clear):
34         (WebCore::SharedBuffer::copy):
35         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Added.
36             Create a new copy of the data if we have shared the buffer and if appending to it would
37             exceed the capacity of the vector resulting in memmove.
38         (WebCore::SharedBuffer::appendToInternalBuffer): Added.
39         (WebCore::SharedBuffer::clearInternalBuffer): Added.
40         (WebCore::SharedBuffer::buffer):
41             Create a new copy of the buffer if we have shared it.
42         (WebCore::SharedBuffer::getSomeData):
43         * platform/SharedBuffer.h:
44         * platform/cf/SharedBufferCF.cpp:
45         (WebCore::SharedBuffer::SharedBuffer):
46         (WebCore::SharedBuffer::singleDataArrayBuffer):
47         (WebCore::SharedBuffer::maybeAppendDataArray):
48         * platform/mac/SharedBufferMac.mm:
49             Pass the InternalBuffer object to WebCoreSharedBufferData
50         (-[WebCoreSharedBufferData dealloc]):
51         (-[WebCoreSharedBufferData initWithSharedBufferInternalBuffer:]):
52         (-[WebCoreSharedBufferData length]):
53         (-[WebCoreSharedBufferData bytes]):
54         (WebCore::SharedBuffer::createNSData):
55             Call createCFData() instead of duplicating code.
56         (WebCore::SharedBuffer::createCFData):
57             If the data is in purgeable memory, make a copy of it since m_buffer was cleared when
58             creating the purgeable buffer.
59         (-[WebCoreSharedBufferData initWithSharedBuffer:]): Deleted.
60
61 2014-07-24  peavo@outlook.com  <peavo@outlook.com>
62
63         [Curl] Enable file logging.
64         https://bugs.webkit.org/show_bug.cgi?id=135202
65
66         Reviewed by Alex Christensen.
67
68         The Curl api offers the possibility to write log messages to file. Enable this for debugging purposes.
69
70         * platform/network/curl/ResourceHandleManager.cpp:
71         (WebCore::ResourceHandleManager::ResourceHandleManager):
72         (WebCore::ResourceHandleManager::~ResourceHandleManager):
73         (WebCore::ResourceHandleManager::initializeHandle):
74         * platform/network/curl/ResourceHandleManager.h:
75
76 2014-07-24  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
77
78         Sort WebCore.exp.in after r171252
79         https://bugs.webkit.org/show_bug.cgi?id=135239
80
81         Reviewed by Csaba Osztrogonác.
82
83         * WebCore.exp.in:
84
85 2014-07-24  Mihnea Ovidenie  <mihnea@adobe.com>
86
87         [New Multicolumn] Assertion failure when an input element has multicolumn style
88         https://bugs.webkit.org/show_bug.cgi?id=135234
89
90         Reviewed by Andrei Bucur.
91
92         Restrict the assertion in RenderBlock::canComputeRegionRangeForBox
93         only to RenderNamedFlowThread objects since for RenderMultiColumnFlowThread
94         objects we can compute a range of regions during their parent block layout.   
95
96         Test: fast/multicol/newmulticol/input-as-multicol.html
97
98         * rendering/RenderBlock.cpp:
99         (WebCore::canComputeRegionRangeForBox):
100
101 2014-07-23  Jeremy Jones  <jeremyj@apple.com>
102
103         Transparent fullscreen background when video is not present.
104         https://bugs.webkit.org/show_bug.cgi?id=135226
105
106         Reviewed by Simon Fraser.
107
108         Set background to black just before beginning the animation to fullscreen.
109
110         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
111         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): set background color black.
112
113 2014-07-23  Joseph Pecoraro  <pecoraro@apple.com>
114
115         ScriptController::updateDocument ASSERT mutating map while iterating map
116         https://bugs.webkit.org/show_bug.cgi?id=135211
117
118         Reviewed by Oliver Hunt.
119
120         Avoid iterating over m_windowShells in more places. This prevents
121         the possibility of a collection during JSC allocation which might
122         cause a mutation to m_windowShells (HTMLMediaElement destruction).
123
124         Have ScriptController defriend ScriptCachedFrameData by providing
125         a getter for the list of window shells.
126
127         * bindings/js/ScriptCachedFrameData.cpp:
128         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
129         (WebCore::ScriptCachedFrameData::restore):
130         * bindings/js/ScriptController.cpp:
131         (WebCore::ScriptController::windowShells):
132         (WebCore::ScriptController::clearWindowShell):
133         (WebCore::ScriptController::attachDebugger):
134         (WebCore::ScriptController::updateDocument):
135         * bindings/js/ScriptController.h:
136
137 2014-07-23  Commit Queue  <commit-queue@webkit.org>
138
139         Unreviewed, rolling out r171498.
140         https://bugs.webkit.org/show_bug.cgi?id=135223
141
142         It will regress some scroll position restoration on navigation
143         (r167916). (Requested by smfr on #webkit).
144
145         Reverted changeset:
146
147         "[iOS WK2] Header bar on nytimes articles lands in the wrong
148         place after rubberbanding"
149         https://bugs.webkit.org/show_bug.cgi?id=135221
150         http://trac.webkit.org/changeset/171498
151
152 2014-07-23  Tim Horton  <timothy_horton@apple.com>
153
154         REGRESSION (r171376): Sometimes we detect less than the whole phone number
155         https://bugs.webkit.org/show_bug.cgi?id=135220
156         <rdar://problem/17783423>
157
158         Reviewed by Brady Eidson.
159
160         * editing/Editor.cpp:
161         (WebCore::Editor::scanSelectionForTelephoneNumbers):
162         Use the visible selection's start and end instead of base and extent, because they'll
163         always be in the right order in the case of a directional selection (base can be *after* extent
164         if you select from right to left). This fixes the code that expands the selection.
165
166         Pass the *entire* expanded selection to DataDetectors, instead of using TextIterator.
167         This way, we will find each number only once, and will never get part of a phone number once
168         and then the whole phone number later.
169
170 2014-07-23  Simon Fraser  <simon.fraser@apple.com>
171
172         [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding
173         https://bugs.webkit.org/show_bug.cgi?id=135221
174
175         Reviewed by Tim Horton.
176
177         Add a function on GraphicsLayer to force a flush of the layer position
178         to the underlying graphics system, so that when layers cease being
179         scroll-coordinated, we can ensure that their layers are repositioned
180         in the correct location.
181
182         * WebCore.exp.in:
183         * platform/graphics/GraphicsLayer.h:
184         (WebCore::GraphicsLayer::forcePositionUpdate):
185         * platform/graphics/ca/GraphicsLayerCA.cpp:
186         (WebCore::GraphicsLayerCA::forcePositionUpdate):
187         * platform/graphics/ca/GraphicsLayerCA.h:
188         * rendering/RenderLayerCompositor.cpp:
189         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
190
191 2014-07-23  Pratik Solanki  <psolanki@apple.com>
192
193         Get rid of SharedBuffer::NSDataRetainPtrWithoutImplicitConversionOperator
194         https://bugs.webkit.org/show_bug.cgi?id=135219
195
196         Reviewed by Anders Carlsson.
197
198         No new tests because no functional changes.
199
200         * loader/ResourceBuffer.h:
201         * loader/mac/ResourceBuffer.mm:
202         (WebCore::ResourceBuffer::createNSData):
203         * platform/SharedBuffer.h:
204         (WebCore::SharedBuffer::NSDataRetainPtrWithoutImplicitConversionOperator::NSDataRetainPtrWithoutImplicitConversionOperator): Deleted.
205         * platform/mac/SharedBufferMac.mm:
206         (WebCore::SharedBuffer::createNSData):
207
208 2014-07-23  Zalan Bujtas  <zalan@apple.com>
209
210         Subpixel rendering: Cleanup RenderLayerCompositor::deviceScaleFactor()
211         https://bugs.webkit.org/show_bug.cgi?id=135208
212
213         Reviewed by Simon Fraser.
214
215         Use m_renderView.document() to retrieve device scale factor value. m_renderView.document()
216         is always available while this->page() is not.
217
218         No change in behavior.
219
220         * rendering/RenderLayerBacking.cpp:
221         (WebCore::RenderLayerBacking::updateTransform):
222         (WebCore::RenderLayerBacking::computeTransformOriginForPainting):
223         * rendering/RenderLayerCompositor.cpp:
224         (WebCore::RenderLayerCompositor::deviceScaleFactor):
225
226 2014-07-23  peavo@outlook.com  <peavo@outlook.com>
227
228         [WinCairo] Gstreamer rendering is not working.
229         https://bugs.webkit.org/show_bug.cgi?id=135201
230
231         Reviewed by Alex Christensen.
232
233         WinCairo does not support accelerated rendering yet.
234
235         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
236         (WebCore::MediaPlayerPrivateGStreamerBase::supportsAcceleratedRendering):
237
238 2014-07-23  Commit Queue  <commit-queue@webkit.org>
239
240         Unreviewed, rolling out r171455.
241         https://bugs.webkit.org/show_bug.cgi?id=135209
242
243         completely broke selection highlight invalidation (Requested
244         by thorton on #webkit).
245
246         Reverted changeset:
247
248         "REGRESSION (r169105): Crash in selection"
249         https://bugs.webkit.org/show_bug.cgi?id=134303
250         http://trac.webkit.org/changeset/171455
251
252 2014-07-23  Alex Christensen  <achristensen@webkit.org>
253
254         Compile window-inactive and fullscreen pseudoclasses in css selectors.
255         https://bugs.webkit.org/show_bug.cgi?id=135200
256
257         Reviewed by Benjamin Poulain.
258
259         * css/SelectorChecker.cpp:
260         (WebCore::SelectorChecker::checkOne):
261         Removed the check of context.hasSelectionPseudo for a window-inactive pseudoclass.
262         Moved logic to SelectorCheckerTestFunctions.h to share with the selector compiler.
263         * css/SelectorCheckerTestFunctions.h:
264         (WebCore::isWindowInactive):
265         (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
266         (WebCore::matchesFullScreenAncestorPseudoClass):
267         (WebCore::matchesFullScreenDocumentPseudoClass):
268         Added from SelectorChecker.cpp.
269         * cssjit/SelectorCompiler.cpp:
270         (WebCore::SelectorCompiler::addPseudoClassType):
271         Added unoptimized pseudoclass cases for window-inactive and fullscreen pseudoclasses.
272         Explicitly listed uncompiled pseudoclasses for future work instead of using a default.
273
274 2014-07-23  Brent Fulgham  <bfulgham@apple.com>
275
276         [Win] Use NO_RETURN_DUE_TO_CRASH on Windows.
277         https://bugs.webkit.org/show_bug.cgi?id=13519
278
279         Reviewed by Mark Lam.
280
281         * svg/SVGZoomAndPan.h: Add NO_RETURN_DUE_TO_CRASH to
282         header so function declarations match implementation.
283
284 2014-07-23  Joseph Pecoraro  <pecoraro@apple.com>
285
286         JSDOMWindowShell leaks on pages with media elements
287         https://bugs.webkit.org/show_bug.cgi?id=135178
288
289         Reviewed by Oliver Hunt.
290
291         The DOMWindowWorld for HTMLMediaElements with MEDIA_CONTROLS_SCRIPT
292         was not getting cleared and removed.
293
294         * bindings/js/ScriptController.cpp:
295         (WebCore::ScriptController::clearWindowShell):
296         Iterate over a copy of the values. A sweep / garbage collection caused by
297         any JSC allocation during iteration could trigger a mutation of the m_windowShells
298         table that was being iterating. So instead iterate a list that won't mutate.
299
300         * html/HTMLMediaElement.cpp:
301         (WebCore::HTMLMediaElement::~HTMLMediaElement):
302         If we had an isolated world, release as much memory as possible.
303
304 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
305
306         Ensure we compute the min and max height of replaced elements to 'none' or 0 when appropriate.
307         https://bugs.webkit.org/show_bug.cgi?id=135181
308
309         Reviewed by David Hyatt.
310
311         If a replaced element has a percentage min or max height specified then that height value should
312         compute to 'none' for max-height and 0 for min-height when its containing block
313         does not have a height 'specified explicitly'.
314
315         This is based on a Blink patch by Robert Hogan.
316
317         Tests: css2.1/20110323/max-height-percentage-003.html
318                fast/replaced/max-height-percentage-quirks.html
319                fast/replaced/min-height-percentage-quirks.html
320                fast/replaced/min-height-percentage.html
321
322         * rendering/RenderBox.cpp:
323         (WebCore::RenderBox::logicalHeightComputesAsNone):
324         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
325         * rendering/RenderBox.h:
326
327 2014-07-23  Bem Jones-Bey  <bjonesbe@adobe.com>
328
329         Remove CSS_EXCLUSIONS compile flag and leftover code
330         https://bugs.webkit.org/show_bug.cgi?id=135175
331
332         Reviewed by Zoltan Horvath.
333
334         At this point, the CSS_EXCLUSIONS flag guards nothing but some useless
335         stubs. This removes the flag and the useless code.
336
337         No new tests, just removing code.
338
339         * Configurations/FeatureDefines.xcconfig:
340         * bindings/generic/RuntimeEnabledFeatures.cpp:
341         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
342         * bindings/generic/RuntimeEnabledFeatures.h:
343         (WebCore::RuntimeEnabledFeatures::setCSSExclusionsEnabled): Deleted.
344         (WebCore::RuntimeEnabledFeatures::cssExclusionsEnabled): Deleted.
345         * testing/InternalSettings.cpp:
346         (WebCore::InternalSettings::Backup::Backup):
347         (WebCore::InternalSettings::Backup::restoreTo):
348         (WebCore::InternalSettings::setCSSExclusionsEnabled): Deleted.
349         * testing/InternalSettings.h:
350         * testing/InternalSettings.idl:
351
352 2014-07-23  Jer Noble  <jer.noble@apple.com>
353
354         [MSE][Mac] Support abort() in SourceBufferPrivateAVFObjC.
355         https://bugs.webkit.org/show_bug.cgi?id=135163
356
357         Reviewed by Brent Fulgham.
358
359         Recreate the parser when asked to abort().
360
361         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
362         (WebCore::SourceBufferPrivateAVFObjC::abort):
363
364 2014-07-23  Myles C. Maxfield  <mmaxfield@apple.com>
365
366         Migrate accessibility/ to using nullptr instead of 0
367         https://bugs.webkit.org/show_bug.cgi?id=135185
368
369         Reviewed by Simon Fraser.
370
371         No new tests because there is no behavior change.
372
373         * accessibility/AXObjectCache.cpp:
374         (WebCore::AXObjectCache::focusedImageMapUIElement):
375         (WebCore::AXObjectCache::focusedUIElementForPage):
376         (WebCore::AXObjectCache::get):
377         (WebCore::AXObjectCache::getOrCreate):
378         (WebCore::AXObjectCache::rootObject):
379         (WebCore::AXObjectCache::rootObjectForFrame):
380         * accessibility/AXObjectCache.h:
381         (WebCore::AXObjectCache::focusedUIElementForPage):
382         (WebCore::AXObjectCache::get):
383         (WebCore::AXObjectCache::getOrCreate):
384         (WebCore::AXObjectCache::rootObject):
385         (WebCore::AXObjectCache::rootObjectForFrame):
386         (WebCore::AXObjectCache::rootAXEditableElement):
387         * accessibility/AccessibilityARIAGridRow.cpp:
388         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
389         * accessibility/AccessibilityImageMapLink.cpp:
390         (WebCore::AccessibilityImageMapLink::AccessibilityImageMapLink):
391         (WebCore::AccessibilityImageMapLink::parentObject):
392         * accessibility/AccessibilityListBox.cpp:
393         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject):
394         (WebCore::AccessibilityListBox::elementAccessibilityHitTest):
395         * accessibility/AccessibilityListBoxOption.cpp:
396         (WebCore::AccessibilityListBoxOption::AccessibilityListBoxOption):
397         (WebCore::AccessibilityListBoxOption::parentObject):
398         (WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
399         * accessibility/AccessibilityMenuListPopup.cpp:
400         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
401         * accessibility/AccessibilityMockObject.cpp:
402         (WebCore::AccessibilityMockObject::AccessibilityMockObject):
403         * accessibility/AccessibilityMockObject.h:
404         * accessibility/AccessibilityNodeObject.cpp:
405         (WebCore::AccessibilityNodeObject::detach):
406         (WebCore::AccessibilityNodeObject::firstChild):
407         (WebCore::AccessibilityNodeObject::lastChild):
408         (WebCore::AccessibilityNodeObject::previousSibling):
409         (WebCore::AccessibilityNodeObject::nextSibling):
410         (WebCore::AccessibilityNodeObject::parentObject):
411         (WebCore::AccessibilityNodeObject::document):
412         (WebCore::AccessibilityNodeObject::anchorElement):
413         (WebCore::nativeActionElement):
414         (WebCore::AccessibilityNodeObject::actionElement):
415         (WebCore::AccessibilityNodeObject::mouseButtonListener):
416         (WebCore::AccessibilityNodeObject::labelForElement):
417         (WebCore::AccessibilityNodeObject::menuItemElementForMenu):
418         (WebCore::AccessibilityNodeObject::menuButtonForMenu):
419         * accessibility/AccessibilityObject.cpp:
420         (WebCore::AccessibilityObject::AccessibilityObject):
421         (WebCore::AccessibilityObject::detach):
422         (WebCore::AccessibilityObject::firstAccessibleObjectFromNode):
423         (WebCore::AccessibilityObject::findMatchingObjects):
424         (WebCore::renderListItemContainerForNode):
425         (WebCore::AccessibilityObject::accessibilityObjectForPosition):
426         (WebCore::AccessibilityObject::document):
427         (WebCore::AccessibilityObject::page):
428         (WebCore::AccessibilityObject::documentFrameView):
429         (WebCore::AccessibilityObject::anchorElementForNode):
430         (WebCore::AccessibilityObject::headingElementForNode):
431         (WebCore::AccessibilityObject::firstAnonymousBlockChild):
432         (WebCore::AccessibilityObject::element):
433         (WebCore::AccessibilityObject::focusedUIElement):
434         (WebCore::AccessibilityObject::scrollToMakeVisibleWithSubFocus):
435         * accessibility/AccessibilityObject.h:
436         (WebCore::AccessibilityObject::node):
437         (WebCore::AccessibilityObject::renderer):
438         (WebCore::AccessibilityObject::selectedRadioButton):
439         (WebCore::AccessibilityObject::selectedTabItem):
440         (WebCore::AccessibilityObject::accessibilityHitTest):
441         (WebCore::AccessibilityObject::firstChild):
442         (WebCore::AccessibilityObject::lastChild):
443         (WebCore::AccessibilityObject::previousSibling):
444         (WebCore::AccessibilityObject::nextSibling):
445         (WebCore::AccessibilityObject::parentObjectIfExists):
446         (WebCore::AccessibilityObject::observableObject):
447         (WebCore::AccessibilityObject::titleUIElement):
448         (WebCore::AccessibilityObject::correspondingLabelForControlElement):
449         (WebCore::AccessibilityObject::correspondingControlForLabelElement):
450         (WebCore::AccessibilityObject::scrollBar):
451         (WebCore::AccessibilityObject::anchorElement):
452         (WebCore::AccessibilityObject::actionElement):
453         (WebCore::AccessibilityObject::widget):
454         (WebCore::AccessibilityObject::widgetForAttachmentView):
455         (WebCore::AccessibilityObject::activeDescendant):
456         (WebCore::AccessibilityObject::mathRadicandObject):
457         (WebCore::AccessibilityObject::mathRootIndexObject):
458         (WebCore::AccessibilityObject::mathUnderObject):
459         (WebCore::AccessibilityObject::mathOverObject):
460         (WebCore::AccessibilityObject::mathNumeratorObject):
461         (WebCore::AccessibilityObject::mathDenominatorObject):
462         (WebCore::AccessibilityObject::mathBaseObject):
463         (WebCore::AccessibilityObject::mathSubscriptObject):
464         (WebCore::AccessibilityObject::mathSuperscriptObject):
465         (WebCore::AccessibilityObject::getScrollableAreaIfScrollable):
466         * accessibility/AccessibilityProgressIndicator.cpp:
467         (WebCore::AccessibilityProgressIndicator::progressElement):
468         (WebCore::AccessibilityProgressIndicator::meterElement):
469         * accessibility/AccessibilityRenderObject.cpp:
470         (WebCore::AccessibilityRenderObject::detach):
471         (WebCore::AccessibilityRenderObject::renderBoxModelObject):
472         (WebCore::AccessibilityRenderObject::firstChild):
473         (WebCore::AccessibilityRenderObject::lastChild):
474         (WebCore::startOfContinuations):
475         (WebCore::childBeforeConsideringContinuations):
476         (WebCore::AccessibilityRenderObject::previousSibling):
477         (WebCore::AccessibilityRenderObject::nextSibling):
478         (WebCore::nextContinuation):
479         (WebCore::AccessibilityRenderObject::renderParentObject):
480         (WebCore::AccessibilityRenderObject::parentObject):
481         (WebCore::AccessibilityRenderObject::anchorElement):
482         (WebCore::AccessibilityRenderObject::textUnderElement):
483         (WebCore::AccessibilityRenderObject::node):
484         (WebCore::AccessibilityRenderObject::labelElementContainer):
485         (WebCore::AccessibilityRenderObject::internalLinkElement):
486         (WebCore::AccessibilityRenderObject::titleUIElement):
487         (WebCore::AccessibilityRenderObject::setFocused):
488         (WebCore::AccessibilityRenderObject::topRenderer):
489         (WebCore::AccessibilityRenderObject::document):
490         (WebCore::AccessibilityRenderObject::widget):
491         (WebCore::AccessibilityRenderObject::accessibilityParentForImageMap):
492         (WebCore::AccessibilityRenderObject::documentFrameView):
493         (WebCore::AccessibilityRenderObject::widgetForAttachmentView):
494         (WebCore::AccessibilityRenderObject::rootEditableElementForPosition):
495         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
496         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
497         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest):
498         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
499         (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement):
500         (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
501         (WebCore::AccessibilityRenderObject::observableObject):
502         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
503         (WebCore::AccessibilityRenderObject::detachRemoteSVGRoot):
504         (WebCore::AccessibilityRenderObject::addHiddenChildren):
505         (WebCore::AccessibilityRenderObject::setAccessibleName):
506         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable):
507         (WebCore::AccessibilityRenderObject::mathRadicandObject):
508         (WebCore::AccessibilityRenderObject::mathRootIndexObject):
509         (WebCore::AccessibilityRenderObject::mathNumeratorObject):
510         (WebCore::AccessibilityRenderObject::mathDenominatorObject):
511         (WebCore::AccessibilityRenderObject::mathUnderObject):
512         (WebCore::AccessibilityRenderObject::mathOverObject):
513         (WebCore::AccessibilityRenderObject::mathBaseObject):
514         (WebCore::AccessibilityRenderObject::mathSubscriptObject):
515         (WebCore::AccessibilityRenderObject::mathSuperscriptObject):
516         * accessibility/AccessibilitySVGRoot.cpp:
517         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
518         * accessibility/AccessibilityScrollView.cpp:
519         (WebCore::AccessibilityScrollView::detach):
520         (WebCore::AccessibilityScrollView::scrollBar):
521         (WebCore::AccessibilityScrollView::updateScrollbars):
522         (WebCore::AccessibilityScrollView::addChildScrollbar):
523         (WebCore::AccessibilityScrollView::clearChildren):
524         (WebCore::AccessibilityScrollView::webAreaObject):
525         (WebCore::AccessibilityScrollView::accessibilityHitTest):
526         (WebCore::AccessibilityScrollView::documentFrameView):
527         (WebCore::AccessibilityScrollView::parentObject):
528         (WebCore::AccessibilityScrollView::parentObjectIfExists):
529         * accessibility/AccessibilityScrollbar.cpp:
530         (WebCore::AccessibilityScrollbar::document):
531         * accessibility/AccessibilitySpinButton.cpp:
532         (WebCore::AccessibilitySpinButton::AccessibilitySpinButton):
533         * accessibility/AccessibilityTable.cpp:
534         (WebCore::AccessibilityTable::AccessibilityTable):
535         (WebCore::AccessibilityTable::clearChildren):
536         (WebCore::AccessibilityTable::cellForColumnAndRow):
537         * accessibility/AccessibilityTableCell.cpp:
538         (WebCore::AccessibilityTableCell::parentTable):
539         (WebCore::AccessibilityTableCell::titleUIElement):
540         * accessibility/AccessibilityTableColumn.cpp:
541         (WebCore::AccessibilityTableColumn::headerObject):
542         (WebCore::AccessibilityTableColumn::headerObjectForSection):
543         * accessibility/AccessibilityTableRow.cpp:
544         (WebCore::AccessibilityTableRow::parentTable):
545         (WebCore::AccessibilityTableRow::headerObject):
546         * accessibility/ios/AXObjectCacheIOS.mm:
547         (WebCore::AXObjectCache::detachWrapper):
548         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
549         (-[WebAccessibilityObjectWrapper detach]):
550         (-[WebAccessibilityObjectWrapper tableCellParent]):
551         (-[WebAccessibilityObjectWrapper tableParent]):
552         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
553         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
554         (rendererForView):
555         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
556         * accessibility/mac/AXObjectCacheMac.mm:
557         (WebCore::AXObjectCache::detachWrapper):
558         * accessibility/mac/AccessibilityObjectMac.mm:
559         (WebCore::AccessibilityObject::detachFromParent):
560         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
561         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
562         (-[WebAccessibilityObjectWrapperBase detach]):
563         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
564         (CreateCGColorIfDifferent):
565         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
566         (rendererForView):
567         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
568         * accessibility/win/AccessibilityObjectWrapperWin.h:
569         (WebCore::AccessibilityObjectWrapper::AccessibilityObjectWrapper):
570
571 2014-07-23  Mihnea Ovidenie  <mihnea@adobe.com>
572
573         ASSERTION FAILED: generatingElement() in WebCore::RenderNamedFlowFragment::regionOversetState
574         https://bugs.webkit.org/show_bug.cgi?id=135153
575
576         Reviewed by David Hyatt.
577
578         Even though the CSSRegions spec defines the behaviour of a multicolumn region,
579         we currently do not support this functionality. This patch ensures that a multicolumn
580         element does not become a region. In the future, when we will implement the multicolumn
581         as region functionality, http://dev.w3.org/csswg/css-regions/#multi-column-regions, we
582         will remove this restriction.
583
584         Test: fast/regions/multicol-as-region-prevented.html
585
586         * rendering/RenderBlockFlow.cpp:
587         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
588
589 2014-07-23  Zan Dobersek  <zdobersek@igalia.com>
590
591         [CMake] Avoid building WebCore with ANGLE's OpenGL/EGL headers
592         https://bugs.webkit.org/show_bug.cgi?id=135167
593
594         Reviewed by Martin Robinson.
595
596         * CMakeLists.txt: Don't add ANGLE/include to the WebCore_INCLUDE_DIRECTORIES list
597         as this results in ANGLE's OpenGL and EGL headers being included, instead of the
598         headers that are provided by the system. Only the ANGLESupport library should be built
599         with that specific header inclusion path.
600
601 2014-07-10  Radu Stavila  <stavila@adobe.com>
602
603         REGRESSION (r169105): Crash in selection
604         https://bugs.webkit.org/show_bug.cgi?id=134303
605
606         Reviewed by David Hyatt.
607
608         When splitting the selection between different subtrees, all subtrees must have their selection cleared before
609         starting to apply the new selection. Otherwise, when selecting objects in a named flow thread and going up
610         its containing block chain, we can end up in the view's selection root, which has not yet been updated and so
611         we get inconsistent data.
612
613         To achieve this goal, the selection update was split into a "clear" and an "apply" method. The updateSelectionForSubtrees
614         method first iterates through all subtrees and performs the "clear" method and then starts all over again
615         and performs the "apply" method.
616
617         Also, the selectionStart/End members in RenderView have been renamed to fix problems caused by the fact that
618         RenderView inherits SelectionSubtreeRoot, which also has the same selectionStart/End members.
619
620         Test: fast/regions/selection/crash-deselect.html
621
622         * WebCore.xcodeproj/project.pbxproj:
623         * rendering/RenderBlock.cpp:
624         (WebCore::RenderBlock::isSelectionRoot):
625         * rendering/RenderSelectionInfo.h:
626         * rendering/RenderView.cpp:
627         (WebCore::RenderView::RenderView):
628         (WebCore::RenderView::setSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
629         (WebCore::RenderView::splitSelectionBetweenSubtrees):
630         (WebCore::RenderView::updateSelectionForSubtrees): Added, clears and re-applies selection for all selection subtrees.
631         (WebCore::RenderView::clearSubtreeSelection): Added, clears selection and returns previously selected information.
632         (WebCore::RenderView::applySubtreeSelection): Added, updates the selection status of all objects inside the selection tree, compares old and new data and repaints accordingly.
633         (WebCore::RenderView::getSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
634         (WebCore::RenderView::setSubtreeSelection): Deleted.
635         * rendering/RenderView.h:
636         * rendering/SelectionSubtreeRoot.cpp:
637         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
638         * rendering/SelectionSubtreeRoot.h:
639         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData):
640
641 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
642
643         [Win] Build fix for bot.
644
645         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
646         (WebCore::createLegibleOutputSubtypes): Declare 'wvtt' locally, rather
647         than relying on potentially unavailable declaration.
648
649 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
650
651         [Win] Build fix for Windows bots
652
653         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Provide missing
654         structure definition when needed by bot.
655
656 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
657
658         [Win] Build fix for EWS bots.
659
660         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Forward declare
661         structure definition.
662
663 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
664
665         [Win] Fix Crash when handling Legible Output callbacks
666         https://bugs.webkit.org/show_bug.cgi?id=134946
667
668         Reviewed by Dean Jackson.
669
670         Relanding after adding fixes to support build bots.
671
672         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
673         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Remove
674         Windows-specific 'ASSERT_NOT_REACHED' code path.
675         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
676         (WebCore::createLegibleOutputSubtypes): Added.
677         (WebCore::AVFWrapper::createPlayerItem): Updated to request native
678         samples from AVFoundationCF.
679
680 2014-07-16  Myles C. Maxfield  <mmaxfield@apple.com>
681
682         Copying and pasting trivial H2 content causes a crash in firstPositionInNode
683         https://bugs.webkit.org/show_bug.cgi?id=134897
684
685         Reviewed by Ryosuke Niwa.
686
687         ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder() attempts
688         to move pasted headings out of existed headings, with out regard to if the existing
689         heading is the contenteditable root.
690
691         Test: editing/pasteboard/heading-crash.html
692
693         * editing/ReplaceSelectionCommand.cpp:
694         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
695
696 2014-07-22  Ryuan Choi  <ryuan.choi@samsung.com>
697
698         Remove dead APIs from TiledBackingStore
699         https://bugs.webkit.org/show_bug.cgi?id=135158
700
701         Reviewed by Gyuyoung Kim.
702
703         setContentsFrozen and related code of TiledBackingStore are not used since Qt port is removed.
704
705         * platform/graphics/TiledBackingStore.cpp:
706         (WebCore::TiledBackingStore::TiledBackingStore):
707         (WebCore::TiledBackingStore::updateTileBuffers):
708         (WebCore::TiledBackingStore::setContentsScale):
709         (WebCore::TiledBackingStore::createTiles):
710         (WebCore::TiledBackingStore::startTileBufferUpdateTimer):
711         (WebCore::TiledBackingStore::startBackingStoreUpdateTimer):
712         (WebCore::TiledBackingStore::commitScaleChange): Deleted.
713         (WebCore::TiledBackingStore::isBackingStoreUpdatesSuspended): Deleted.
714         (WebCore::TiledBackingStore::isTileBufferUpdatesSuspended): Deleted.
715         (WebCore::TiledBackingStore::setContentsFrozen): Deleted.
716         * platform/graphics/TiledBackingStore.h:
717         (WebCore::TiledBackingStore::contentsFrozen): Deleted.
718
719 2014-07-22  Alex Christensen  <achristensen@webkit.org>
720
721         Fix window-inactive css selectors when using querySelector.
722         https://bugs.webkit.org/show_bug.cgi?id=135149
723
724         Reviewed by Tim Horton.
725
726         Test: fast/selectors/querySelector-window-inactive.html
727
728         * css/SelectorChecker.cpp:
729         (WebCore::SelectorChecker::checkOne):
730         Removed default and implemented case PseudoClassWindowInactive.
731
732 2014-07-22  Tim Horton  <timothy_horton@apple.com>
733
734         REGRESSION (r171016): Reproducible infinite spin selecting phone number
735         https://bugs.webkit.org/show_bug.cgi?id=135183
736         <rdar://problem/17727342>
737
738         Reviewed by Ryosuke Niwa.
739
740         * editing/Editor.cpp:
741         (WebCore::Editor::scanRangeForTelephoneNumbers):
742         Make use of TextIterator::subrange, which knows how to make a subrange from character positions,
743         instead of assuming that our character positions translate directly to positions in the incoming range.
744         Make use of DocumentMarkerController::addMarker, which takes a range and applies the marker to
745         all text nodes inside the range as appropriate.
746         Fix naming of the shadowed 'length' local.
747         Fix a typo in the comment.
748
749 2014-07-22  Myles C. Maxfield  <mmaxfield@apple.com>
750
751         [iOS] [OSX] Don't transcode WOFF on platforms that support it natively
752         https://bugs.webkit.org/show_bug.cgi?id=134904
753
754         Reviewed by Andreas Kling.
755
756         No new tests because there is no behavior change.
757
758         * loader/cache/CachedFont.cpp:
759         (WebCore::CachedFont::ensureCustomFontData):
760
761 2014-07-22  peavo@outlook.com  <peavo@outlook.com>
762
763         [Win] Crash after plugin is unloaded.
764         https://bugs.webkit.org/show_bug.cgi?id=119044
765
766         Reviewed by Darin Adler.
767
768         We need to invalidate all runtime objects when a plugin view is destroyed, in case the plugin is unloaded,
769         and one of these runtime objects accesses the plugin function table upon destruction afterwards, which will cause a crash.
770         If we use the weak pointer to the runtime object when invalidating, it will be null if it's in the WeakImpl::Dead state.
771         This means the runtime object will not be invalidated, possibly causing a crash if the plugin is unloaded.
772         It should be safe to use the raw pointer to the runtime object when invalidating, since finalized runtime objects
773         will be removed from the set of runtime objects in the method RootObject::finalize().
774
775         * bridge/runtime_root.cpp:
776         (JSC::Bindings::RootObject::invalidate): Make sure all runtime objects are invalidated by getting the raw runtime object pointer from the hash key.
777
778 2014-07-22  Enrica Casucci  <enrica@apple.com>
779
780         REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling.
781         https://bugs.webkit.org/show_bug.cgi?id=135180
782         <rdar://problem/16721055>
783
784         Reviewed by Simon Fraser.
785
786         AsyncScrollingCoordinator will force a selection update on iOS
787         when scrolling terminates in an overflow scroll.
788
789         * loader/EmptyClients.h:
790         * page/EditorClient.h:
791         * page/scrolling/AsyncScrollingCoordinator.cpp:
792         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
793         * page/scrolling/ScrollingTree.h:
794         (WebCore::ScrollingTree::scrollingTreeNodeWillStartScroll):
795         (WebCore::ScrollingTree::scrollingTreeNodeDidEndScroll):
796
797 2014-07-22  Myles C. Maxfield  <mmaxfield@apple.com>
798
799         [Mac] Cocoa throws exception when the return type of NSAccessibilityLinkedUIElementsAttribute is not an array
800         https://bugs.webkit.org/show_bug.cgi?id=135165
801
802         Reviewed by Simon Fraser.
803
804         Return an empty array instead of nil.
805
806         Updated tests.
807
808         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
809         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
810
811 2014-07-22  Commit Queue  <commit-queue@webkit.org>
812
813         Unreviewed, rolling out r171357.
814         https://bugs.webkit.org/show_bug.cgi?id=135173
815
816         broke Windows build. (Requested by bfulgham on #webkit).
817
818         Reverted changeset:
819
820         "[Win] Fix Crash when handling Legible Output callbacks"
821         https://bugs.webkit.org/show_bug.cgi?id=134946
822         http://trac.webkit.org/changeset/171357
823
824 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
825
826         [Win] Fix Crash when handling Legible Output callbacks
827         https://bugs.webkit.org/show_bug.cgi?id=134946
828
829         Reviewed by Dean Jackson.
830
831         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
832         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Remove
833         Windows-specific 'ASSERT_NOT_REACHED' code path.
834         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
835         (WebCore::createLegibleOutputSubtypes): Added.
836         (WebCore::AVFWrapper::createPlayerItem): Updated to request native
837         samples from AVFoundationCF.
838
839 2014-07-21  Sam Weinig  <sam@webkit.org>
840
841         [Cocoa] WKScriptMessageHandlers don't seem to function properly after navigating
842         https://bugs.webkit.org/show_bug.cgi?id=135148
843
844         Reviewed by Geoffrey Garen.
845
846         The "webkit" property on the window was not getting installed for subsequent
847         loads due to intricate dance playing setting the JSDOMWindow where the DOMWindow
848         object is not yet in a Frame when the JSDOMWindow is created. Since we were
849         adding the "webkit" property on construction, the property was returning null
850         thinking it had no Frame and was in a bad state. We can fix this by making the
851         "webkit" property behave like all the other window properties moving its getting
852         to JSDOMWindow::getOwnPropertySlot.
853
854         Added API test (WebKit2Cocoa/UserContentController).
855
856         * bindings/js/JSDOMWindowBase.cpp:
857         (WebCore::JSDOMWindowBase::finishCreation):
858         * bindings/js/JSDOMWindowCustom.cpp:
859         (WebCore::jsDOMWindowWebKit):
860         (WebCore::JSDOMWindow::getOwnPropertySlot):
861
862 2014-07-22  Brent Fulgham  <bfulgham@apple.com>
863
864         [Win] Fix Leak in WebCore::createGlobalImageFileDescriptor 
865         https://bugs.webkit.org/show_bug.cgi?id=134423
866         <rdar://problem/17492758>
867
868         Reviewed by Geoffrey Garen.
869
870         * platform/win/PasteboardWin.cpp:
871         (WebCore::createGlobalImageFileDescriptor): Unlock and release the
872         HGLOBAL when exiting early.
873
874 2014-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
875
876         Clicking on links while accessibility is enabled sometimes crashes
877         https://bugs.webkit.org/show_bug.cgi?id=135074
878
879         Reviewed by Chris Fleizach.
880
881         When an accessibility request comes in from the system, we call updateBackingStore() on the
882         relevant AccessibilityObject, which triggers a relayout of the entire document. This relayout
883         might delete that accessibility node and its parent, which would cause the node to be deleted.
884         After the stack unwinds, we then call a member function on the node without checking for this
885         condition.
886
887         Test: accessibility/parent-delete.html
888
889         * accessibility/AccessibilityObject.cpp:
890         (WebCore::AccessibilityObject::updateBackingStore): Retain the node for the duration of the
891         function.
892
893 2014-07-22  Jeremy Jones  <jeremyj@apple.com>
894
895         Don't create new UIWindow for video fullscreen.
896         https://bugs.webkit.org/show_bug.cgi?id=135038
897
898         Reviewed by Darin Adler.
899
900         * WebCore.exp.in:
901         * platform/ios/WebVideoFullscreenControllerAVKit.h: use UIView instead of UIScreen.
902         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
903         (-[WebVideoFullscreenController enterFullscreen:]): provide parent UIView.
904         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: remove UIWindow.
905         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
906         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): ditto 
907         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): ditto
908         (WebVideoFullscreenInterfaceAVKit::invalidate): ditto
909         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto
910
911 2014-07-22  Carlos Alberto Lopez Perez  <clopez@igalia.com>
912
913         [GTK] Rollout r170529 due to ~10% performance regression on the
914         perf test Animation/balls.
915         https://bugs.webkit.org/show_bug.cgi?id=134972
916
917         Reviewed by Martin Robinson.
918
919         Reverted changeset:
920         "Increase priority on SharedTimer source."
921         https://trac.webkit.org/r170529
922
923 2014-07-18  Dirk Schulze  <krit@webkit.org>
924
925         Turn width/height to presentation attributes
926         https://bugs.webkit.org/show_bug.cgi?id=135046
927
928         Reviewed by Dean Jackson.
929
930         The elements <svg>, <image>, <pattern>, <mask> and <foreignObject> have the
931         'width' and 'height' attributes. So far they can just be set by SVG DOM or
932         setAttribute. Furthermore, animations just work with SVG Animation - No support
933         for CSS Animations and CSS Transitions. We started to turn the width and height
934         attributes on SVG roots to presentation attributes already. A presentation
935         attribute is a CSS property that can also be set by DOM (or now by SVG DOM).
936
937         This patch turns all width and height attributes to presentation attributes. It
938         basically allows authors to style width and height with CSS as well. Width and
939         height can now be set with CSS style sheets and can be animated with CSS.
940
941         To some degree it made it possible to remove code duplication. However, since
942         SVG DOM requires us to use SVGLength types and since we did not turn all
943         SVG attributes to the CSS length values (and our internal Length struct) yet,
944         we still need a hybrid - a bridge between SVGLength (for SVG DOM) and Length (for
945         RenderStyle). Once we move all attributes to use the Length struct, we can make SVGLength
946         a wrapper for Length and can move more code to the render tree.
947
948         The current challenge is to synchronize SVG DOM, normal DOM and RenderStyle.
949         With this patch we handle most part in RenderStyle. SVG DOM changes are
950         synchronized to DOM and RenderStyle will call needsStyleRecalc. Furthermore,
951         SVG Animations will continue to animate the SVG DOM (and synchronize the changes
952         back to RenderStyle) if the element has a JS property for the currently animated
953         attribute.
954
955         Short example:
956
957             <rect>
958                 <animate attributeName="width">
959             </rect>
960
961         The <rect> element has the SVG DOM property 'width'. Therefore, we animate the SVG DOM
962         property and synchronize RenderStyle.
963
964             <ellipse>
965                 <animate attributeName="width">
966             </ellipse>
967
968         The <ellipse> element does NOT have the SVG DOM property 'width'. Therefore, we
969         animate the CSS property directly. With synchronizing RenderStyle in all cases, we
970         make sure that the CSS cascade works even on animating on multiple SVG hierarchy
971         levels (animation of 'width' on <g> and inheriting the property value on a child
972         <rect>).
973
974         With using presentation attributes, we also inherit the CSS property parsing for
975         SVG attributes. <rect width="  100px  "> is possible now. (Note the trailing whitespaces.)
976         This follows a recent resolution of the SVG WG.
977
978         Since we turned width and height to presentation attributes, the layout optimization
979         selfHasRelativeLengths() in the DOM can't be used anymore. selfHasRelativeLengths() was
980         intended to solve a problem where we did not layout relatively position/sized elements
981         when the parent changes its size. However, as a side effect it did not call layout
982         for absolutely positioned/sized elements since the layout does not change. I run
983         all performance tests that we have and even wrote a test with hundreds of elements
984         that would be affected by this optimization. The differences were inside the sigma
985         of a normal test run. (Means I couldn't measure a performance difference.)
986         Therefore, it is not worth it to keep the "optimization" around and I will probably
987         remove it entirely for all basic shapes but <path> and <polygon> in future patches.
988
989         Tests: svg/css/parse-height.html
990                svg/css/parse-width.html
991                svg/css/width-height-presentation-attribute-expected.svg
992                svg/css/width-height-presentation-attribute.svg
993
994         * css/CSSComputedStyleDeclaration.cpp:
995         (WebCore::ComputedStyleExtractor::propertyValue): We never calculated the computed
996             value of width/height for SVG elements and returned auto instead. This is based
997             on a rule of CSS 2 and needs to be fixed in CSS3.
998         * css/DeprecatedStyleBuilder.cpp:
999         (WebCore::ApplyPropertyLength::applyValue): Length always incorporates the zoom level.
1000             In SVG we still apply the zoom after all operations by scaling the context. We need
1001             to take this in account for Length and don't apply zoom on SVG inline elements.
1002         * css/StyleResolver.cpp:
1003         (WebCore::StyleResolver::useSVGZoomRulesForLength):
1004             See above.
1005         * css/StyleResolver.h:
1006         * rendering/svg/RenderSVGRect.cpp:
1007         (WebCore::RenderSVGRect::updateShapeFromElement): Do not call width() and height() on
1008             SVG DOM but use the values of RenderStyle instead.
1009         * rendering/svg/SVGPathData.cpp:
1010         (WebCore::updatePathFromRectElement): Ditto.
1011         * svg/SVGAnimateElement.cpp:
1012         (WebCore::SVGAnimateElement::resetAnimatedType): We need to differ between CSS properties
1013             with and without SVG DOM on the current element. In the later case we animate the 
1014             SVG DOM and need to synch RenderStyle.
1015         (WebCore::SVGAnimateElement::clearAnimatedType): Ditto.
1016         (WebCore::SVGAnimateElement::applyResultsToTarget): Ditto.
1017         * svg/SVGAnimationElement.cpp:
1018         (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): This checks if the CSS property
1019             has to be synched with SVG DOM.
1020         (WebCore::SVGAnimationElement::shouldApplyAnimation): Ditto.
1021         * svg/SVGAnimationElement.h:
1022         * svg/SVGElement.cpp:
1023         (WebCore::populateAttributeNameToCSSPropertyIDMap): Add width and heigth to the CSS property
1024             list for presentation attributes.
1025         (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): CSS properties with
1026             SVG DOM synchronization need to be treated differently. Collect them in a separate map.
1027         (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Caller for the map.
1028         (WebCore::SVGElement::animatedPropertyTypeForAttribute): We need to check both maps here:
1029             CSS properties and CSS properties with SVG DOM synch.
1030         (WebCore::SVGElement::isAnimatableCSSProperty): Ditto.
1031         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Just return true if the property name
1032             is in the map of properties with SVG DOM for the current element.
1033         * svg/SVGElement.h:
1034         (WebCore::SVGElement::invalidateSVGPresentationAttributeStyle): Call needsStyleRecalc.
1035         * svg/SVGFilterElement.cpp: Make width/height presentation attribute.
1036         (WebCore::SVGFilterElement::svgAttributeChanged):
1037         (WebCore::SVGFilterElement::selfHasRelativeLengths): Deleted.
1038         * svg/SVGFilterElement.h: Ditto.
1039         * svg/SVGForeignObjectElement.cpp:
1040         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
1041         (WebCore::SVGForeignObjectElement::selfHasRelativeLengths): Deleted.
1042         * svg/SVGForeignObjectElement.h:
1043         * svg/SVGImageElement.cpp: Ditto.
1044         (WebCore::SVGImageElement::svgAttributeChanged):
1045         (WebCore::SVGImageElement::isPresentationAttribute): Deleted.
1046         (WebCore::SVGImageElement::collectStyleForPresentationAttribute): Deleted.
1047         (WebCore::SVGImageElement::selfHasRelativeLengths): Deleted.
1048         * svg/SVGImageElement.h:
1049         * svg/SVGLength.h: Transform an Length value to an absolute value by taking the SVG viewport
1050             into account. (An SVG viewport is not the same as the CSS viewport.)
1051         * svg/SVGLengthContext.cpp: Ditto.
1052         (WebCore::SVGLengthContext::valueForLength):
1053         * svg/SVGLengthContext.h:
1054         * svg/SVGMaskElement.cpp: Make width/height presentation attribute.
1055         (WebCore::SVGMaskElement::svgAttributeChanged):
1056         (WebCore::SVGMaskElement::selfHasRelativeLengths): Deleted.
1057         * svg/SVGMaskElement.h:
1058         * svg/SVGPatternElement.cpp: Ditto.
1059         (WebCore::SVGPatternElement::svgAttributeChanged):
1060         (WebCore::SVGPatternElement::selfHasRelativeLengths): Deleted.
1061         * svg/SVGPatternElement.h:
1062         * svg/SVGRectElement.cpp: Ditto.
1063         (WebCore::SVGRectElement::svgAttributeChanged):
1064         (WebCore::SVGRectElement::selfHasRelativeLengths): Deleted.
1065         * svg/SVGRectElement.h:
1066         * svg/SVGSVGElement.cpp: Ditto.
1067         (WebCore::SVGSVGElement::svgAttributeChanged): Clean up redundant layout calls.
1068         (WebCore::SVGSVGElement::isPresentationAttribute): Deleted.
1069         (WebCore::SVGSVGElement::collectStyleForPresentationAttribute): Deleted.
1070         * svg/SVGSVGElement.h:
1071         * svg/properties/SVGAnimatedProperty.cpp: Synchronize SVG DOM with DOM.
1072         (WebCore::SVGAnimatedProperty::commitChange):
1073
1074 2014-07-22  Adrian Perez de Castro  <aperez@igalia.com>
1075
1076         [GStreamer] [GTK] WebKit does not build with GStreamer 1.4
1077         https://bugs.webkit.org/show_bug.cgi?id=135114
1078
1079         Reviewed by Philippe Normand.
1080
1081         Fix build with GStreamer 1.4
1082
1083         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1084         Change GstMpegTs-prefixed types to use the GstMpegts prefix.
1085         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1086         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
1087         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1088         Ditto.
1089
1090 2014-07-21  Benjamin Poulain  <bpoulain@apple.com>
1091
1092         [iOS][WK2] Improve event throttling for Scroll Events
1093         https://bugs.webkit.org/show_bug.cgi?id=135082
1094         <rdar://problem/17445266>
1095
1096         Reviewed by Simon Fraser.
1097
1098         This patch is composed of two parts. The first part in the WebKit layer
1099         track an approximate measurement of the main thread responsiveness.
1100         The second part in WebCore use that information to avoid sending events
1101         if a page is unresponsive.
1102
1103         In WebCore, this patch only consider scroll events so far. Hopefully the concept
1104         should be easy to generalize.
1105
1106         * loader/EmptyClients.h:
1107         * page/ChromeClient.h:
1108         Chrome client provides us with one information: how long an incoming event should be delayed.
1109         Every port is free to implement whatever logic is suitable for them.
1110
1111         * page/FrameView.cpp:
1112         (WebCore::FrameView::FrameView):
1113         (WebCore::FrameView::reset):
1114         (WebCore::FrameView::delayedScrollEventTimerFired):
1115         (WebCore::FrameView::scrollPositionChanged):
1116         (WebCore::FrameView::sendScrollEvent):
1117         * page/FrameView.h:
1118         Scroll events do not have any associated information so they can be coalesced by just skipping
1119         all input hapenning during the throttling delay.
1120
1121         The implementation is done by using a timer to delay the events.
1122
1123 2014-07-21  Tim Horton  <timothy_horton@apple.com>
1124
1125         Avoid putting empty-sized surfaces into IOSurfacePool
1126         https://bugs.webkit.org/show_bug.cgi?id=135136
1127
1128         Reviewed by Simon Fraser.
1129
1130         * platform/graphics/cg/IOSurfacePool.cpp:
1131         (WebCore::IOSurfacePool::addSurface):
1132         Avoid adding 0x0 surfaces to the pool, because they will wreak havoc
1133         when their size is used as the key in the CachedSurfaceMap.
1134         Additionally, avoid any empty sizes, because they're just pointless.
1135
1136 2014-07-21  Beth Dakin  <bdakin@apple.com>
1137
1138         WK1 should always setAcceleratedCompositingForFixedPositionEnabled(true) on 
1139         Yosemite
1140         https://bugs.webkit.org/show_bug.cgi?id=135135
1141
1142         Reviewed by Darin Adler.
1143
1144         This patch gets rid of the ChromeClient function that was introduced with 
1145         http://trac.webkit.org/changeset/171308 We’ll just enable the Setting instead.
1146         * css/StyleResolver.cpp:
1147         (WebCore::StyleResolver::adjustRenderStyle):
1148         (WebCore::fixedPositionCreatesStackingContext): Deleted.
1149         * page/ChromeClient.h:
1150         (WebCore::ChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition): Deleted.
1151         * rendering/RenderLayerCompositor.cpp:
1152         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1153
1154 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
1155
1156         [iOS WK2] Turn off position:fixed behavior when the keyboard is up
1157         https://bugs.webkit.org/show_bug.cgi?id=132537
1158
1159         Reviewed by Benjamin Poulain.
1160
1161         Export RenderObject::localToContainerPoint().
1162
1163         * WebCore.exp.in:
1164
1165 2014-07-21  Jer Noble  <jer.noble@apple.com>
1166
1167         [MSE] YouTube video decode error when variant-switching
1168         https://bugs.webkit.org/show_bug.cgi?id=135128
1169
1170         Reviewed by Brent Fulgham.
1171
1172         Test: media/media-source/media-source-overlapping-decodetime.html
1173
1174         When variant-switching, the situation can arise where an existing sample with a presentation
1175         timestamp of N and a decode timestamp of M, and a new sample with a presentation timestamp > N
1176         and the same decode timestamp of M, will keep the new sample from being added to the SampleMap.
1177         This can result in a decode error when samples depending on that new, missing sample are enqueued.
1178
1179         The MSE spec is silent on the issue of overlapping decode timestamps. However, it guarantees that
1180         presentation timestamps are non-overlapping. So instead of using just the decode timestamp as a key
1181         for storing the samples in decode order, use both the decode timestamp and the presentation timestamp.
1182         That ensures that samples with different presentation times but equal decode times are both inserted
1183         into the decode queue, and in the correct order.
1184
1185         * Modules/mediasource/SampleMap.cpp:
1186         (WebCore::SampleIsRandomAccess::operator()): Update the parameter type to match the new KeyType.
1187         (WebCore::SampleMap::addSample): Pass both decodeTime and presentationTime as the key to decodeOrder.
1188         (WebCore::SampleMap::removeSample): Ditto.
1189         (WebCore::DecodeOrderSampleMap::findSampleWithDecodeKey): Renamed from findSampleWithDecodeTime.
1190         (WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeKey): renamed from reverseFindSampleWithDecodeTime.
1191         (WebCore::DecodeOrderSampleMap::findSyncSamplePriorToPresentationTime): Use renamed version of above.
1192         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime): Ditto.
1193         (WebCore::DecodeOrderSampleMap::findDependentSamples): Ditto.
1194         (WebCore::DecodeOrderSampleMap::findSampleWithDecodeTime): Deleted.
1195         (WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeTime): Deleted.
1196         * Modules/mediasource/SampleMap.h:
1197         * Modules/mediasource/SourceBuffer.cpp:
1198         (WebCore::SourceBuffer::removeCodedFrames): Ditto.
1199         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
1200         (WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.
1201
1202 2014-07-21  Andy Estes  <aestes@apple.com>
1203
1204         [iOS] Handle QuickLook ResourceLoaders in the web process
1205         https://bugs.webkit.org/show_bug.cgi?id=135113
1206
1207         Reviewed by David Kilzer.
1208
1209         No new tests. QuickLook is not testable from WebKit.
1210
1211         * WebCore.exp.in:
1212         * loader/ResourceLoadScheduler.cpp:
1213         (WebCore::ResourceLoadScheduler::maybeLoadQuickLookResource): Start loading the ResourceLoader if it is for a QuickLook resource.
1214         * loader/ResourceLoadScheduler.h:
1215
1216 2014-07-21  Alexey Proskuryakov  <ap@apple.com>
1217
1218         Case sensitive file system build fix.
1219
1220         * page/scrolling/ScrollingStateTree.cpp:
1221
1222 2014-07-21  Beth Dakin  <bdakin@apple.com>
1223
1224         Put position:fixed elements into layers when a WK1 view is layer-backed
1225         https://bugs.webkit.org/show_bug.cgi?id=135075
1226
1227         Reviewed by Darin Adler.
1228
1229         This patch adds a new ChromeClient function called 
1230         requiresAcceleratedCompositingForViewportConstrainedPosition(). Since a view can 
1231         go in and out of layer backing, we need a ChromeClient method that can be 
1232         dynamically re-evaluated rather than using the existing settings for enabling 
1233         accelerated fixed and fixed that creates a stacking context.
1234
1235         Ensure that fixed elements create a stacking context when 
1236         requiresAcceleratedCompositingForViewportConstrainedPosition is true.
1237         * css/StyleResolver.cpp:
1238         (WebCore::StyleResolver::adjustRenderStyle):
1239
1240         New ChromeClient function.
1241         * page/ChromeClient.h:
1242
1243 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
1244
1245         Add helper functions to dump the scrolling state tree from the debugger
1246         https://bugs.webkit.org/show_bug.cgi?id=135101
1247
1248         Reviewed by Darin Adler.
1249
1250         Add debug-only showScrollingStateTree() functions that take a ScrollingStateTree* and ScrollingStateNode*
1251         for use while debugging.
1252
1253         * page/scrolling/ScrollingStateTree.cpp:
1254         (showScrollingStateTree):
1255         * page/scrolling/ScrollingStateTree.h:
1256
1257 2014-07-20  Simon Fraser  <simon.fraser@apple.com>
1258
1259         [iOS WK1] Single touch div scrolling doesn't work in framesets (breaks Word previews)
1260         https://bugs.webkit.org/show_bug.cgi?id=135103
1261         <rdar://problem/11830219>
1262
1263         Reviewed by Darin Adler.
1264
1265         After r166117 all layer flushing starts on the root frame; we no longer flush layers
1266         for each frame during painting. However, flushing GraphicsLayers can set some state
1267         on a subframe RenderLayerCompositor that is now never processed, which breaks scroll
1268         layer registration.
1269         
1270         Fix by doing a walk of the Frame tree, and calling didFlushLayers() on subframe RenderLayerCompositors
1271         before calling didFlushLayers() on self.
1272
1273         * rendering/RenderLayerCompositor.cpp:
1274         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
1275         (WebCore::RenderLayerCompositor::didFlushLayers):
1276         (WebCore::RenderLayerCompositor::notifySubframesAfterLayerFlush):
1277         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers): Drive-by nullptr.
1278         * rendering/RenderLayerCompositor.h:
1279
1280 2014-07-21  Eric Carlson  <eric.carlson@apple.com>
1281
1282         [iOS] a Paused media session is not active
1283         https://bugs.webkit.org/show_bug.cgi?id=135108
1284
1285         Reviewed by Darin Adler.
1286
1287         Activating the shared AudioSession will pause audio playing in another application,
1288         so only report a Playing media sessions as active.
1289
1290         * platform/audio/MediaSessionManager.cpp:
1291         * platform/audio/MediaSessionManager.h:
1292         (WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
1293         clear what it does. Only return true for a session that is Playing.
1294
1295         * platform/audio/mac/MediaSessionManagerMac.cpp:
1296         (MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.
1297
1298 2014-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1299
1300         Unreviewed. Update GObject DOM bindings test results after r171285.
1301
1302         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
1303         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1304         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
1305         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
1306         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
1307         * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
1308         * bindings/scripts/test/GObject/WebKitDOMTestGenerateIsReachable.cpp:
1309         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1310         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
1311         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
1312         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
1313         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.cpp:
1314         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1315         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructors.cpp:
1316         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
1317         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
1318         * bindings/scripts/test/GObject/WebKitDOMattribute.cpp:
1319         * bindings/scripts/test/GObject/WebKitDOMreadonly.cpp:
1320
1321 2014-07-20  Pratik Solanki  <psolanki@apple.com>
1322
1323         Reduce the chances of a race condition when sharing SharedBuffer
1324         https://bugs.webkit.org/show_bug.cgi?id=135060
1325         <rdar://problem/17729444>
1326
1327         Reviewed by Darin Adler.
1328
1329         We currently pass a SharedBuffer wrapped in WebCoreSharedBufferData to ImageIO for image
1330         decoding. This is not thread safe since ImageIO will access this buffer on a separate
1331         thread. We access SharedBuffer::buffer() on the other thread which resizes the Vector
1332         m_buffer if m_size is greater than the vector size. Since the code in SharedBuffer::append()
1333         sets m_size before appending the data to the buffer, m_size is out of sync with the m_buffer
1334         size for the entire duration of the Vector append which could be doing a lot of copying if
1335         the resource is large. While this change does not fix the race condition, we can at least
1336         reduce the chances of SharedBuffer::buffer() calling resize() by setting m_size after the
1337         cector has finished appending.
1338
1339         No new tests because no functional changes.
1340
1341         * platform/SharedBuffer.cpp:
1342         (WebCore::SharedBuffer::append):
1343
1344 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1345
1346         Fix test crashes when cloning video layer since r171286
1347         https://bugs.webkit.org/show_bug.cgi?id=135112
1348
1349         Unreviewed. Fix crashing tests by conditionalizing inline video layer change.
1350         compositing/video/video-reflection.html [ Crash ]
1351         media/video-layer-crash.html [ Crash ]
1352
1353         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add conditional
1354         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: ditto
1355         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): ditto
1356         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): ditto
1357         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): ditto
1358
1359 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1360
1361         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
1362         https://bugs.webkit.org/show_bug.cgi?id=134894
1363
1364         Reviewed by Darin Adler.
1365
1366         * WebCore.exp.in: add symbol for canPlayFastReverse
1367         * html/HTMLMediaElement.cpp: Add two new accessors
1368         (WebCore::HTMLMediaElement::nextScanRate): possibly limit scanRate
1369         (WebCore::HTMLMediaElement::canPlayFastForward): added
1370         (WebCore::HTMLMediaElement::canPlayFastReverse): added
1371         * html/HTMLMediaElement.h: declare two new methods
1372         * platform/graphics/MediaPlayer.cpp: Plumb through two new accessors
1373         (WebCore::MediaPlayer::maxFastForwardRate): added
1374         (WebCore::MediaPlayer::minFastReverseRate): added
1375         * platform/graphics/MediaPlayer.h: Declare new methods
1376         * platform/graphics/MediaPlayerPrivate.h: Added two new methods.
1377         (WebCore::MediaPlayerPrivateInterface::maxFastForwardRate): added
1378         (WebCore::MediaPlayerPrivateInterface::minFastReverseRate): added
1379         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: member to cache ff/rw enabled state
1380         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1381         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): observe on item canPlayFastForward canPlayFastReverse
1382         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastForwardDidChange): added
1383         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayFastReverseDidChange): added
1384         (WebCore::itemKVOProperties): observe canPlayFastForward canPlayFastRewind
1385         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): ditto
1386         * platform/ios/WebVideoFullscreenInterface.h: add new method
1387         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto
1388         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: ditto
1389         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): Set value on WebAVPlayerController.
1390         (-[WebAVPlayerController canScanBackward]): Deleted.
1391         (+[WebAVPlayerController keyPathsForValuesAffectingCanScanBackward]): Deleted.
1392         * platform/ios/WebVideoFullscreenModelMediaElement.mm:
1393         (WebVideoFullscreenModelMediaElement::updateForEventName): update canPlayFastReverse.
1394
1395 2014-07-18  Gavin Barraclough  <baraclough@apple.com>
1396
1397         HTMLMediaElement should registerWithDocument on iOS
1398         https://bugs.webkit.org/show_bug.cgi?id=135084
1399         <rdar://problem/17702531>
1400
1401         Reviewed by Andreas Kling.
1402
1403         Otherwise it won't know when the visibility changes!
1404
1405         * html/HTMLMediaElement.cpp:
1406         (WebCore::HTMLMediaElement::registerWithDocument):
1407         (WebCore::HTMLMediaElement::unregisterWithDocument):
1408
1409 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
1410
1411         Decrease flicker when enter and exit fullscreen.
1412         https://bugs.webkit.org/show_bug.cgi?id=134919
1413
1414         Reviewed by Simon Fraser.
1415
1416         Put AVPlayerLayer in a container layer so moving it between inline and fullscreen
1417         is as easy as adding and removing it from a containter layer; no need to do a layout.
1418
1419         Make sure fullscreen layers are transparent before moving moving the AVPlayerLayer
1420         between inline and fullscreen so you don't briefly see the empty fullscreen layers.
1421
1422         * html/HTMLMediaElement.cpp:
1423         (WebCore::HTMLMediaElement::platformLayer): remove fullscreen special case.
1424         (WebCore::HTMLMediaElement::setVideoFullscreenLayer): no need to recalc style
1425         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: add inline container layer
1426         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
1427         add WebVideoContainerLayer to contain AVPlayerLayer and keep layout correct.
1428         (-[WebVideoContainerLayer setBounds:]): forward setbounds to set child frame.
1429         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): create the video container layer
1430         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer): destroy the video container layer
1431         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer): use container layer instead of video layer
1432         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): use transactions to prevent unwanted animation.
1433         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame): ditto
1434         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1435         (PlatformCALayerMac::layerTypeForPlatformLayer): WebVideoContainerLayer is a kind of AVPlayerLayer
1436         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1437         (-[WebVideoFullscreenController didCleanupFullscreen]): remove video fullscreen layer first
1438         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1439         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): make background transparent during transition.
1440            dispatch_async to allow CATransaction to complete before calling didSetupFullscreen()
1441
1442 2014-07-20  Ryuan Choi  <ryuan.choi@samsung.com>
1443
1444         Move ExceptionCodeDescription.h into the files that actually need it
1445         https://bugs.webkit.org/show_bug.cgi?id=134968
1446
1447         Reviewed by Darin Adler.
1448
1449         No new tests because no functional changes.
1450
1451         * Modules/indexeddb/IDBDatabaseException.cpp:
1452         * Modules/webdatabase/SQLException.cpp:
1453         * bindings/js/JSDOMBinding.cpp:
1454         * bindings/objc/ExceptionHandlers.mm:
1455         * bindings/scripts/CodeGeneratorGObject.pm:
1456         (Generate):
1457         * dom/DOMCoreException.cpp:
1458         * dom/EventException.cpp:
1459         * dom/ExceptionBase.cpp:
1460         * dom/ExceptionCode.h:
1461         * dom/RangeException.cpp:
1462         * fileapi/FileException.cpp:
1463         * inspector/DOMEditor.cpp:
1464         * inspector/InspectorDOMAgent.cpp:
1465         * svg/SVGException.cpp:
1466         * xml/XMLHttpRequestException.cpp:
1467         * xml/XPathException.cpp:
1468
1469 2014-07-20  Dan Bernstein  <mitz@apple.com>
1470
1471         <rdar://problems/17742611> -[_WKActivatedElementInfo image] is often empty
1472         https://bugs.webkit.org/show_bug.cgi?id=135107
1473
1474         Reviewed by Sam Weinig.
1475
1476         Test: TestWebKitAPI/Tests/mac/RenderedImageFromDOMNode.mm
1477
1478         * page/FrameView.cpp:
1479         (WebCore::FrameView::paintContents): To work around http://webkit.org/b/135106, replace the
1480         paint root with its nearest ancestor that isn’t an inline with culled line boxes, if needed.
1481
1482 2014-07-20  Darin Adler  <darin@apple.com>
1483
1484         Crashes seen in wheel event handling
1485         https://bugs.webkit.org/show_bug.cgi?id=135102
1486
1487         Reviewed by Beth Dakin.
1488
1489         Speculative fix based on guesses about what could be crashing.
1490         The crash seems to be calling ref on an event target, and my guess is that this
1491         has something to do with latching.
1492
1493         * page/EventHandler.cpp:
1494         (WebCore::EventHandler::platformPrepareForWheelEvents): Updated argument types.
1495         (WebCore::EventHandler::handleWheelEvent): Refactored a little and made some local
1496         variables use RefPtr instead of raw pointers. Also added some comments.
1497
1498         * page/EventHandler.h: Changed argument types to RefPtr.
1499
1500         * page/mac/EventHandlerMac.mm:
1501         (WebCore::EventHandler::platformPrepareForWheelEvents): Updated argument types.
1502         Also added a FIXME.
1503
1504 2014-07-20  Simon Fraser  <simon.fraser@apple.com>
1505
1506         Print layerIDs in GraphicsLayer dumps
1507         https://bugs.webkit.org/show_bug.cgi?id=135100
1508
1509         Reviewed by Darin Adler.
1510
1511         When calling showGraphicsLayerTree() from the debugger, it's useful to show
1512         layerIDs so they can be correlated with remote layer tree transactions. So
1513         when dumping with debug info, dump the primary layer ID.
1514
1515         * platform/graphics/GraphicsLayer.cpp:
1516         (WebCore::GraphicsLayer::dumpProperties):
1517
1518 2014-07-20  Eric Carlson  <eric.carlson@apple.com>
1519
1520         [iOS] ignore requests to set volume
1521         https://bugs.webkit.org/show_bug.cgi?id=135081
1522
1523         Applied post-review comments from Darin Adler.
1524
1525         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1526         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Don't include unreachable
1527             code on iOS.
1528
1529 2014-07-19  Mark Rowe  <mrowe@apple.com>
1530
1531         <https://webkit.org/b/135085> Ensure that make_names.pl generates the same result when run multiple times.
1532
1533         Perl 5.18 introduced hash randomization. This results in the iteration order of hashes being different
1534         from one run to the next. To ensure identical output we can iterate over the hash keys in sorted order.
1535
1536         Reviewed by Alexey Proskuryakov.
1537
1538         * bindings/scripts/StaticString.pm:
1539         (GenerateStrings):
1540         (GenerateStringAsserts):
1541         * dom/make_names.pl:
1542
1543 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
1544
1545         Document::unregisterNodeListforInvalidation() and Document::unregisterCollection() have incorrect assertions
1546         https://bugs.webkit.org/show_bug.cgi?id=134869
1547
1548         Reviewed by Darin Adler.
1549
1550         Both methods should assert that the relevant HashMap is either empty if invalidation originates
1551         from Document::invalidateNodeListAndCollectionCaches() or acutally contains the element that is
1552         being invalidated. In the first case the HashMap is empty because its entries were moved out in
1553         the Document::invalidateNodeListAndCollectionCaches().
1554
1555         This was exposed by r170995 (later rolled out in r170999) which introduced move constructor and
1556         move assignment operators for HashTable. The assertions in the titular methods won't be passing
1557         until r170995 relands.
1558
1559         * dom/Document.cpp:
1560         (WebCore::Document::unregisterNodeListForInvalidation):
1561
1562 2014-07-18  Eric Carlson  <eric.carlson@apple.com>
1563
1564         [iOS] ignore requests to set volume
1565         https://bugs.webkit.org/show_bug.cgi?id=135081
1566
1567         Reviewed by Jer Noble.
1568
1569         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1570         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Do nothing on iOS.
1571
1572 2014-07-18  Andy Estes  <aestes@apple.com>
1573
1574         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
1575         https://bugs.webkit.org/show_bug.cgi?id=135072
1576         <rdar://problem/17528188>
1577
1578         Reviewed by David Kilzer.
1579
1580         No new tests. Content filtering is not testable from WebKit.
1581
1582         * WebCore.exp.in: Exported necessary ContentFilter symbols.
1583         * loader/DocumentLoader.cpp:
1584         (WebCore::DocumentLoader::finishedLoading): Called FrameLoaderClient::contentFilterDidBlockLoad().
1585         (WebCore::DocumentLoader::responseReceived): Created a new ContentFilter.
1586         (WebCore::DocumentLoader::dataReceived): Called FrameLoaderClient::contentFilterDidBlockLoad().
1587         (WebCore::DocumentLoader::setContentFilterForBlockedLoad): Deleted.
1588         (WebCore::DocumentLoader::handleContentFilterRequest): Deleted.
1589         * loader/DocumentLoader.h:
1590         * loader/FrameLoaderClient.h:
1591         (WebCore::FrameLoaderClient::contentFilterDidBlockLoad):
1592         * loader/PolicyChecker.cpp:
1593         (WebCore::PolicyChecker::checkNavigationPolicy): Removed the check for unblock navigations, as this is now
1594         handled at the WebKit layer.
1595         * platform/ContentFilter.h: ContentFilter no longer needs to be RefCounted, so made various changes in order to
1596         make it compatible with unique_ptr.
1597         * platform/ios/ContentFilterIOS.mm:
1598         (WebCore::scheme): Changed from a public member function to a static inline free function.
1599         (WebCore::ContentFilter::handleUnblockRequestAndDispatchIfSuccessful): Renamed from requestUnblockAndDispatchIfSuccessful.
1600         * platform/mac/ContentFilterMac.mm:
1601         (WebCore::ContentFilter::ContentFilter): Added a default constructor for use during message decoding.
1602         (WebCore::ContentFilter::addData): Removed calls to ref() and deref(). These were never actually needed since
1603         we were dispatching the block synchronously.
1604         (WebCore::ContentFilter::finishedAddingData): Ditto.
1605         (WebCore::ContentFilter::encode): Encoded m_platformContentFilter to the NSKeyedArchiver if it conforms to NSSecureCoding.
1606         (WebCore::ContentFilter::decode): Decoded m_platformContentFilter from the NSKeyedUnarchiver if it conforms to NSSecureCoding.
1607         (WebCore::ContentFilter::create): Deleted.
1608
1609 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
1610
1611         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
1612         https://bugs.webkit.org/show_bug.cgi?id=135078
1613         <rdar://problem/17401823>
1614
1615         Reviewed by Tim Horton.
1616         
1617         When the UI-side scrolling tree receives a requested scroll position update, it scrolls
1618         the node (e.g. a frame) then traverses child nodes to update them, e.g. for fixed position.
1619         However, we would always use a viewport rect for the main document (from the scrolling tree),
1620         which is not appropriate for subframes. Subframes should just use their own visible
1621         rect to position fixed children.
1622
1623         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/fixed-inside-frame.html
1624
1625         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1626         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
1627
1628 2014-07-18  Beth Dakin  <bdakin@apple.com>
1629
1630         Fixed position elements are misplaced when a WK1 view has contentInsets set
1631         https://bugs.webkit.org/show_bug.cgi?id=135031
1632         -and corresponding-
1633         <rdar://problem/17682335>
1634
1635         Reviewed by Tim Horton.
1636
1637         [NSScrollView documentVisibleRect] includes content that is within the inset-area 
1638         of a view, but WebCore is interested in the content that is fully visible, so we 
1639         need to factor the inset sizes out of this rect.
1640
1641         Implement contract() to avoid the awkwardness of calling expand() with negative 
1642         values.
1643         * platform/graphics/IntSize.h:
1644         (WebCore::IntSize::contract):
1645
1646         Factor out insets
1647         * platform/mac/ScrollViewMac.mm:
1648         (WebCore::ScrollView::platformVisibleContentRect):
1649         (WebCore::ScrollView::platformVisibleContentSize):
1650
1651 2014-07-18  Tim Horton  <timothy_horton@apple.com>
1652
1653         Take navigation snapshots whenever the current back-forward item is going to change
1654         https://bugs.webkit.org/show_bug.cgi?id=135058
1655         <rdar://problem/17464515>
1656
1657         Reviewed by Dan Bernstein.
1658
1659         * loader/HistoryController.cpp:
1660         (WebCore::HistoryController::updateForCommit):
1661         (WebCore::HistoryController::recursiveUpdateForCommit):
1662         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
1663         (WebCore::HistoryController::createItem):
1664         Use setCurrentItem instead of duplicating the contents of it inside each of these functions.
1665
1666         (WebCore::HistoryController::setCurrentItem):
1667         (WebCore::HistoryController::replaceCurrentItem):
1668         When setting or replacing the current item, let the FrameLoaderClient know that we're going
1669         to change which history item is "current".
1670
1671         * loader/FrameLoaderClient.h:
1672         (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Added.
1673
1674 2014-07-18  Commit Queue  <commit-queue@webkit.org>
1675
1676         Unreviewed, rolling out r171207.
1677         https://bugs.webkit.org/show_bug.cgi?id=135056
1678
1679         Broke multiple tests on Yosemite (Requested by ap on #webkit).
1680
1681         Reverted changeset:
1682
1683         "Fixed position elements are misplaced when a WK1 view has
1684         contentInsets set"
1685         https://bugs.webkit.org/show_bug.cgi?id=135031
1686         http://trac.webkit.org/changeset/171207
1687
1688 2014-07-18  Commit Queue  <commit-queue@webkit.org>
1689
1690         Unreviewed, rolling out r171218.
1691         https://bugs.webkit.org/show_bug.cgi?id=135055
1692
1693         Made fast/dom/HTMLObjectElement/beforeload-set-text-
1694         crash.xhtml crash (Requested by ap on #webkit).
1695
1696         Reverted changeset:
1697
1698         "REGRESSION (r169105): Crash in selection"
1699         https://bugs.webkit.org/show_bug.cgi?id=134303
1700         http://trac.webkit.org/changeset/171218
1701
1702 2014-07-18  Radu Stavila  <stavila@adobe.com>
1703
1704         REGRESSION (r169105): Crash in selection
1705         https://bugs.webkit.org/show_bug.cgi?id=134303
1706
1707         Reviewed by Ryosuke Niwa.
1708
1709         When splitting the selection between different subtrees, all subtrees must have their selection cleared before
1710         starting to apply the new selection. Otherwise, when selecting objects in a named flow thread and going up
1711         its containing block chain, we can end up in the view's selection root, which has not yet been updated and so
1712         we get inconsistent data.
1713
1714         To achieve this goal, the selection update was split into a "clear" and an "apply" method. The updateSelectionForSubtrees
1715         method first iterates through all subtrees and performs the "clear" method and then starts all over again
1716         and performs the "apply" method.
1717
1718         Also, the selectionStart/End members in RenderView have been renamed to fix problems caused by the fact that
1719         RenderView inherits SelectionSubtreeRoot, which also has the same selectionStart/End members.
1720
1721         Test: fast/regions/selection/crash-deselect.html
1722
1723         * WebCore.xcodeproj/project.pbxproj:
1724         * rendering/RenderBlock.cpp:
1725         (WebCore::RenderBlock::isSelectionRoot):
1726         * rendering/RenderSelectionInfo.h:
1727         * rendering/RenderView.cpp:
1728         (WebCore::RenderView::RenderView):
1729         (WebCore::RenderView::setSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
1730         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1731         (WebCore::RenderView::updateSelectionForSubtrees): Added, clears and re-applies selection for all selection subtrees.
1732         (WebCore::RenderView::clearSubtreeSelection): Added, clears selection and returns previously selected information.
1733         (WebCore::RenderView::applySubtreeSelection): Added, updates the selection status of all objects inside the selection tree, compares old and new data and repaints accordingly.
1734         (WebCore::RenderView::getSelection): Renamed m_selectionStart/End to m_unsplitSelectionStart/End
1735         (WebCore::RenderView::setSubtreeSelection): Deleted.
1736         * rendering/RenderView.h:
1737         * rendering/SelectionSubtreeRoot.cpp:
1738         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
1739         * rendering/SelectionSubtreeRoot.h:
1740         (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData):
1741
1742 2014-07-17  Jer Noble  <jer.noble@apple.com>
1743
1744         [MSE] Re-enqueue after a removeCodedFrames() only if the removed frames overlap what may have possibly been enqueued but undisplayed.
1745         https://bugs.webkit.org/show_bug.cgi?id=135039
1746
1747         Reviewed by Eric Carlson.
1748
1749         When a client calls removeCodedFrames(), we must re-enqueue those ranges if the removed samples overlap with
1750         enqueued but possibly un-displayed samples. Otherwise, replacement samples may lead to decode errors as those
1751         new samples dependencies are not met. But if we re-enqueue too frequently, this may cause subtle but noticible
1752         display timing glitches, so only re-enqueue when removeCodedFrames have a possiblity of removing enqueued, but
1753         not yet displayed samples.
1754
1755         * Modules/mediasource/SourceBuffer.cpp:
1756         (WebCore::SourceBuffer::removeCodedFrames):
1757
1758 2014-07-17  David Kilzer  <ddkilzer@apple.com>
1759
1760         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
1761         <http://webkit.org/b/135006>
1762
1763         Reviewed by Darin Adler.
1764
1765         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
1766         WebCore.xcconfig.
1767         * Configurations/DebugRelease.xcconfig: Remove empty
1768         SECTORDER_FLAGS definition.
1769         * Configurations/WebCoreTestShim.xcconfig: Ditto.
1770         * Configurations/WebCoreTestSupport.xcconfig: Ditto.
1771         * Configurations/WebCore.xcconfig: Use $(CONFIGURATION) so
1772         SECTORDER_FLAGS is only set on Production builds.
1773
1774 2014-07-17  Zalan Bujtas  <zalan@apple.com>
1775
1776         Subpixel rendering: Embedded non-compositing rotate transform paints to wrong position.
1777         https://bugs.webkit.org/show_bug.cgi?id=135028
1778
1779         Reviewed by Simon Fraser.
1780
1781         CTM always translates to where the layer's renderer() is going to paint.
1782         It ensures that the pixel snapped renderer() always end up painting to (0, 0) which is
1783         required to be able to position properly on transformed context.
1784
1785         Test: fast/layers/hidpi-transform-on-child-content-is-mispositioned.html
1786
1787         * rendering/RenderLayer.cpp:
1788         (WebCore::RenderLayer::beginTransparencyLayers):
1789         (WebCore::RenderLayer::clipToRect):
1790         (WebCore::RenderLayer::paintLayerByApplyingTransform):
1791         (WebCore::RenderLayer::paintBackgroundForFragments):
1792         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
1793         (WebCore::RenderLayer::paintOutlineForFragments):
1794         (WebCore::RenderLayer::paintMaskForFragments):
1795         (WebCore::RenderLayer::paintOverflowControlsForFragments):
1796         (WebCore::RenderLayer::calculateClipRects):
1797         * rendering/RenderLayer.h:
1798
1799 2014-07-17  Beth Dakin  <bdakin@apple.com>
1800
1801         Fixed position elements are misplaced when a WK1 view has contentInsets set
1802         https://bugs.webkit.org/show_bug.cgi?id=135031
1803         -and corresponding-
1804         <rdar://problem/17682335>
1805
1806         Reviewed by Tim Horton.
1807
1808         [NSScrollView documentVisibleRect] is not the rect that we are looking for when 
1809         this function is called. WebCore is interested in the rect that does not include 
1810         content that is within the inset region.
1811
1812         Implement contract() to avoid the awkwardness of calling expand() with negative 
1813         values.
1814         * platform/graphics/IntSize.h:
1815         (WebCore::IntSize::contract):
1816
1817         Use _insetBounds instead of documentVisibleRect, and when it’s necessary to use 
1818         the frame’s dimensions, extract the inset from that size.
1819         * platform/mac/ScrollViewMac.mm:
1820         (WebCore::ScrollView::platformVisibleContentRect):
1821         (WebCore::ScrollView::platformVisibleContentSize):
1822
1823 2014-07-17  Enrica Casucci  <enrica@apple.com>
1824
1825         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
1826         https://bugs.webkit.org/show_bug.cgi?id=135023
1827         <rdar://problem/17617282>
1828
1829         Reviewed by Benjamin Poulain.
1830
1831         Adding some exports.
1832         
1833         * WebCore.exp.in:
1834
1835 2014-07-17  Timothy Hatcher  <timothy@apple.com>
1836
1837         Make console.profile record to the Timeline.
1838
1839         https://bugs.webkit.org/show_bug.cgi?id=134643
1840
1841         Reviewed by Joseph Pecoraro.
1842
1843         Passes existing profiler tests in fast/profiler.
1844
1845         * bindings/js/ScriptState.cpp:
1846         (WebCore::domWindowFromExecState):
1847         (WebCore::frameFromExecState):
1848         (WebCore::scriptExecutionContextFromExecState):
1849         (WebCore::mainWorldExecState):
1850         (WebCore::execStateFromNode):
1851         * bindings/js/ScriptState.h:
1852         * inspector/InspectorController.cpp:
1853         (WebCore::InspectorController::InspectorController):
1854         (WebCore::InspectorController::profilerEnabled):
1855         (WebCore::InspectorController::setProfilerEnabled):
1856         * inspector/InspectorController.h:
1857         * inspector/InspectorInstrumentation.cpp:
1858         (WebCore::InspectorInstrumentation::startProfilingImpl):
1859         (WebCore::InspectorInstrumentation::stopProfilingImpl):
1860         * inspector/InspectorTimelineAgent.cpp:
1861         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
1862         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
1863         (WebCore::InspectorTimelineAgent::start):
1864         (WebCore::InspectorTimelineAgent::stop):
1865         (WebCore::startProfiling):
1866         (WebCore::stopProfiling):
1867         (WebCore::InspectorTimelineAgent::startFromConsole):
1868         (WebCore::InspectorTimelineAgent::stopFromConsole):
1869         (WebCore::InspectorTimelineAgent::didWriteHTML):
1870         (WebCore::InspectorTimelineAgent::breakpointActionProbe):
1871         (WebCore::toProtocol):
1872         (WebCore::InspectorTimelineAgent::addRecordToTimeline):
1873         (WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
1874         (WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
1875         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
1876         (WebCore::InspectorTimelineAgent::sendEvent):
1877         (WebCore::InspectorTimelineAgent::createRecordEntry):
1878         (WebCore::InspectorTimelineAgent::pushCurrentRecord):
1879         * inspector/InspectorTimelineAgent.h:
1880         (WebCore::InspectorTimelineAgent::TimelineRecordEntry::TimelineRecordEntry):
1881         (WebCore::InspectorTimelineAgent::pushCurrentRecord):
1882         * inspector/InstrumentingAgents.cpp:
1883         (WebCore::InstrumentingAgents::InstrumentingAgents):
1884         (WebCore::InstrumentingAgents::reset):
1885         * inspector/InstrumentingAgents.h:
1886         (WebCore::InstrumentingAgents::persistentInspectorTimelineAgent):
1887         (WebCore::InstrumentingAgents::setPersistentInspectorTimelineAgent):
1888         * inspector/TimelineRecordFactory.cpp:
1889         (WebCore::TimelineRecordFactory::createConsoleProfileData):
1890         * inspector/TimelineRecordFactory.h:
1891         * inspector/protocol/Timeline.json:
1892         * page/PageConsole.cpp:
1893         (WebCore::PageConsole::profileEnd):
1894
1895 2014-07-16  Sam Weinig  <sam@webkit.org>
1896
1897         Don't send geolocation permission requests when the page is not visible
1898         <rdar://problem/17208715>
1899         https://bugs.webkit.org/show_bug.cgi?id=134989
1900
1901         Reviewed by Darin Adler.
1902
1903         Instead of eagerly requesting geolocation permission for pages that aren't visible,
1904         store a set of pending requests, and send them only once the page has become visible.
1905
1906         * Modules/geolocation/GeolocationController.cpp:
1907         (WebCore::GeolocationController::GeolocationController):
1908         (WebCore::GeolocationController::~GeolocationController):
1909         (WebCore::GeolocationController::requestPermission):
1910         (WebCore::GeolocationController::cancelPermissionRequest):
1911         (WebCore::GeolocationController::viewStateDidChange):
1912         (WebCore::provideGeolocationTo):
1913         * Modules/geolocation/GeolocationController.h:
1914         Store pending requests to be fired once the page is visible.
1915
1916         * WebCore.xcodeproj/project.pbxproj:
1917         Add ViewStateChangeObserver.h
1918
1919         * page/Page.cpp:
1920         (WebCore::Page::addViewStateChangeObserver):
1921         (WebCore::Page::removeViewStateChangeObserver):
1922         (WebCore::Page::setViewState):
1923         * page/Page.h:
1924         Add a set of registered view state observers, and notify them when the
1925         view state changes.
1926
1927         * page/ViewStateChangeObserver.h: Added.
1928         (WebCore::ViewStateChangeObserver::~ViewStateChangeObserver):
1929         Add an observer that can register with the page for view state changes.
1930
1931 2014-07-17  Jer Noble  <jer.noble@apple.com>
1932
1933         Enable legacy fullscreen API in media controls
1934         https://bugs.webkit.org/show_bug.cgi?id=134985
1935
1936         Reviewed by Eric Carlson.
1937
1938         Allow clients who have not enabled HTML5 Fullscreen APIs to still use fullscreen mode
1939         with <video> elements by using the legacy, video-element-specific fullscreen APIs in
1940         the <video> media controls.
1941
1942         * Modules/mediacontrols/mediaControlsApple.js:
1943         (Controller):
1944         (Controller.prototype.handleReadyStateChange):
1945         (Controller.prototype.isFullScreen):
1946         (Controller.prototype.handlePlayButtonClicked):
1947         (Controller.prototype.updateFullscreenButton):
1948         (Controller.prototype.handleFullscreenButtonClicked):
1949
1950 2014-07-17  Vineet Chaudhary  <code.vineet@gmail.com>
1951
1952         [GObject] StrictTypeChecking extended attribute fails for methods with sequence<T>.
1953         https://bugs.webkit.org/show_bug.cgi?id=121698
1954
1955         Reviewed by Antonio Gomes.
1956
1957         GodeGenerator was including wrong heeaders as WebKitDOMlong[] for methods with
1958         array parameters and StrictTypeChecking extended attribute.
1959         No new tests. TestObj.idl covers the tests.
1960
1961         * bindings/scripts/CodeGenerator.pm:
1962         (GetArrayOrSequenceType):
1963         * bindings/scripts/CodeGeneratorGObject.pm:
1964         (GenerateFunction):
1965         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1966         (webkit_dom_test_obj_strict_function_with_array):
1967         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1968         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
1969         (webkit_dom_test_typedefs_func):
1970         (webkit_dom_test_typedefs_nullable_array_arg):
1971         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:
1972         * bindings/scripts/test/TestObj.idl:
1973
1974 2014-07-17  Yusuke Suzuki  <utatane.tea@gmail.com>
1975
1976         CSS JIT: Clean up return path
1977         https://bugs.webkit.org/show_bug.cgi?id=135011
1978
1979         Reviewed by Benjamin Poulain.
1980
1981         Clean up the existing CSS JIT return path before adding new early return path
1982         for pseudo elements.
1983
1984         * cssjit/SelectorCompiler.cpp:
1985         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1986         * cssjit/StackAllocator.h:
1987         (WebCore::StackAllocator::StackReference::StackReference):
1988         (WebCore::StackAllocator::StackReference::isValid):
1989         (WebCore::StackAllocator::popAndDiscard): Deleted.
1990
1991 2014-07-16  Zalan Bujtas  <zalan@apple.com>
1992
1993         Subpixel rendering: Adjust cliprect with devicePixelFractionFromRenderer() before painting.
1994         https://bugs.webkit.org/show_bug.cgi?id=134950
1995         <rdar://problem/17617994>
1996
1997         Reviewed by Simon Fraser.
1998
1999         The cliprect coming from the graphics layer needs to be adjusted with the subpixel gap
2000         from renderer. This is symmetric with the offsetting we do, when the dirty rect is sent off to the GraphicsLayer.
2001         It puts us back to the correct coordinating system for intersecting with renderers.
2002
2003         Test: compositing/hidpi-compositing-layer-with-tile-layers-on-subpixel-position.html
2004
2005         * rendering/RenderLayer.cpp:
2006         (WebCore::RenderLayer::beginTransparencyLayers):
2007         (WebCore::RenderLayer::clipToRect):
2008
2009 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
2010
2011         Fix a typo noticed by Darin.
2012         
2013         * rendering/RenderBox.cpp:
2014         (WebCore::shouldApplyContainersClipAndOffset):
2015         (WebCore::RenderBox::computeRectForRepaint):
2016         (WebCore::shouldAppyContainersClipAndOffset): Deleted.
2017
2018 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
2019
2020         Improve showTree() logging
2021         https://bugs.webkit.org/show_bug.cgi?id=134997
2022
2023         Reviewed by Tim Horton.
2024
2025         Have the debug showTree(), which dumps the Node/Element tree, show which nodes need
2026         style recalc, and print element renderers.
2027
2028         * dom/Node.cpp:
2029         (WebCore::Node::showNode):
2030
2031 2014-07-16  Simon Fraser  <simon.fraser@apple.com>
2032
2033         [iOS] Expose the points on WebEventRegion
2034         https://bugs.webkit.org/show_bug.cgi?id=134978
2035
2036         Reviewed by Tim Horton.
2037
2038         Expose WebEventRegion's points so that UIKit can get at them.
2039
2040         * page/ios/WebEventRegion.h:
2041         * page/ios/WebEventRegion.mm:
2042         (-[WebEventRegion p1]):
2043         (-[WebEventRegion p2]):
2044         (-[WebEventRegion p3]):
2045         (-[WebEventRegion p4]):
2046
2047 2014-07-16  Brady Eidson  <beidson@apple.com>
2048
2049         Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
2050         <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
2051
2052         Reviewed by Dan Bernstein.
2053
2054         Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
2055         * UIProcess/API/Cocoa/WKProcessPool.mm:
2056         (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
2057         (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
2058         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2059
2060         Add a big shiny comment in a few key places:
2061         * DatabaseProcess/DatabaseProcess.cpp:
2062         (WebKit::DatabaseProcess::initializeDatabaseProcess):
2063         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2064         (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
2065         * UIProcess/WebContext.cpp:
2066         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
2067         (WebKit::WebContext::ensureDatabaseProcess):
2068
2069 2014-07-16  Roger Fong  <roger_fong@apple.com>
2070
2071         Captions container should not clip content.
2072         https://bugs.webkit.org/show_bug.cgi?id=134840.
2073         <rdar://problem/14553608>.
2074
2075         Reviewed by Simon Fraser.
2076
2077         Tests: media/track/track-in-band-subtitles-too-large.html
2078                media/track/track-long-word-container-sizing.html
2079
2080         * Modules/mediacontrols/mediaControlsApple.css:
2081         (video::-webkit-media-text-track-container):
2082         Set word break property of WebCTT cues to normal to make it consistent with in-band cues.
2083         * html/track/TextTrackCueGeneric.cpp:
2084         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
2085         Set -webkit-min-content on min-width/min-height property of the text track display.
2086         * html/track/VTTCue.cpp:
2087         (WebCore::VTTCueBox::applyCSSProperties):
2088         Do the same for WebVTT cues.
2089
2090 2014-07-16  Eric Carlson  <eric.carlson@apple.com>
2091
2092         [Mac] replace AVPlayerItem on the main thread
2093         https://bugs.webkit.org/show_bug.cgi?id=134983
2094
2095         Reviewed by Jer Noble.
2096
2097         No new tests, this fixes a problem with a thread configuration not present in the
2098         test environment.
2099
2100         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2101         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2102         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem): New, when called off of 
2103             the main thread, dispatch to the main thread before setting AVPlayerItem.
2104         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setAVPlayerItem.
2105         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Ditto.
2106         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Ditto.
2107
2108 2014-07-16  Jer Noble  <jer.noble@apple.com>
2109
2110         [MSE] http/tests/media/media-source/mediasource-buffered.html is flakey
2111         https://bugs.webkit.org/show_bug.cgi?id=134949
2112
2113         Reviewed by Eric Carlson.
2114
2115         Depending on which SourceBuffer is successfully parsed first, the order of activeSourceBuffers
2116         may change from run to run, breaking the http/tests/media/media-source/mediasource-buffered.html
2117         test. Make the order of activeSourceBuffers the same as (a subset of) sourceBuffers, by replacing
2118         calls to activeSourceBuffers->add() and with a new call to regenerateActiveSourceBuffers(), which
2119         swaps the contents of the SourceBufferList with a new, ordered Vector.
2120
2121         * Modules/mediasource/MediaSource.cpp:
2122         (WebCore::MediaSource::addSourceBuffer):
2123         (WebCore::MediaSource::sourceBufferDidChangeAcitveState):
2124         (WebCore::MediaSource::regenerateActiveSourceBuffers):
2125         * Modules/mediasource/MediaSource.h:
2126         * Modules/mediasource/SourceBufferList.cpp:
2127         (WebCore::SourceBufferList::swap):
2128         * Modules/mediasource/SourceBufferList.h:
2129
2130 2014-07-16  Mike West  <mkwst@chromium.org>
2131
2132         CSP: Drop 'script-nonce' directive.
2133         https://bugs.webkit.org/show_bug.cgi?id=134926
2134
2135         Reviewed by Darin Adler.
2136
2137         This patch drops the outdated 'script-nonce' Content Security
2138         Policy directive. It was removed from the spec, and replaced in
2139         CSP2 with a new 'script-src' syntax. We should implement that
2140         instead.
2141
2142         Until then, removing the outdated syntax will ensure that no one
2143         ends up relying on it in WebKit's implementation.
2144
2145         This should have limited web-visible impact, as the feature is
2146         behind the CSP_NEXT flag, which is not enabled by default.
2147
2148         * dom/ScriptElement.cpp:
2149         (WebCore::ScriptElement::requestScript):
2150         (WebCore::ScriptElement::executeScript):
2151         * page/ContentSecurityPolicy.cpp:
2152         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
2153         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
2154         (WebCore::CSPDirectiveList::addDirective):
2155         (WebCore::NonceDirective::NonceDirective): Deleted.
2156         (WebCore::NonceDirective::allows): Deleted.
2157         (WebCore::NonceDirective::parse): Deleted.
2158         (WebCore::CSPDirectiveList::checkNonce): Deleted.
2159         (WebCore::CSPDirectiveList::checkNonceAndReportViolation): Deleted.
2160         (WebCore::CSPDirectiveList::allowScriptNonce): Deleted.
2161         (WebCore::isAllowedByAllWithNonce): Deleted.
2162         (WebCore::ContentSecurityPolicy::allowScriptNonce): Deleted.
2163         (WebCore::ContentSecurityPolicy::reportInvalidNonce): Deleted.
2164         * page/ContentSecurityPolicy.h:
2165
2166 2014-07-16  Jer Noble  <jer.noble@apple.com>
2167
2168         REGRESSION(r171069) 75% repro crash in WebCore::AudioHardwareListenerMac::processIsRunningChanged()
2169         https://bugs.webkit.org/show_bug.cgi?id=134986
2170
2171         Reviewed by Eric Carlson.
2172
2173         Add a WeakPtrFactory to AudioHardwareListenerMac, so that if CoreAudio calls our block after
2174         being unregistered, we can bail early instead of calling into a deleted object.
2175
2176         * platform/audio/mac/AudioHardwareListenerMac.cpp:
2177         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
2178         * platform/audio/mac/AudioHardwareListenerMac.h:
2179
2180 2014-07-16  Jer Noble  <jer.noble@apple.com>
2181
2182         [MSE] REGRESSION(r171033): ASSERT in WebCore::MediaSource::onReadyStateChange()
2183         https://bugs.webkit.org/show_bug.cgi?id=134941
2184
2185         Reviewed by Eric Carlson.
2186
2187         Only do our modified-order change of the readyState if the error parameter is empty,
2188         as that's the only case where a duration change will cause an inadvertant readyState
2189         change.
2190
2191         * Modules/mediasource/MediaSource.cpp:
2192         (WebCore::MediaSource::streamEndedWithError):
2193
2194 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
2195
2196         Remove svn:executable property erroneously added in <http://trac.webkit.org/changeset/171144> somehow.
2197
2198         * ChangeLog: Removed property svn:executable.
2199         * svg/SVGSVGElement.h: Removed property svn:executable.
2200         * svg/animation/SVGSMILElement.h: Removed property svn:executable.
2201
2202 2014-07-16  Daniel Bates  <dabates@apple.com>
2203
2204         Substitute CGRectZero for NSZeroRect in -[DOMNode hrefFrame].
2205
2206         Rubber-stamped by Zalan Bujtas.
2207
2208         The method -[DOMNode hrefFrame] returns a CGRect. So, when we don't have a renderer
2209         we should return CGRectZero instead of a NSZeroRect.
2210
2211         * bindings/objc/DOM.mm:
2212         (-[DOMNode hrefFrame]): Also, fix up some code style issues.
2213
2214 2014-07-16  Jeongeun Kim  <je_julie.kim@samsung.com>
2215
2216         mutable pointers from const methods, timeContainer().
2217         https://bugs.webkit.org/show_bug.cgi?id=134757
2218
2219         Reviewed by Alexey Proskuryakov.
2220
2221         Avoid return mutable pointers from const methods.
2222         No new tests, no behavior change.
2223
2224         * svg/SVGSVGElement.h:
2225         * svg/animation/SVGSMILElement.h:
2226         (WebCore::SVGSMILElement::timeContainer):
2227
2228 2014-07-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2229
2230         CSS: Generalize CSS First Letter treatment
2231         https://bugs.webkit.org/show_bug.cgi?id=134936
2232
2233         Reviewed by Benjamin Poulain.
2234
2235         first-letter pseudo element rule is handled differently from the other rules
2236         such as first-line. This patch removes this special handling in SelectorChecker
2237         and handles it in RulesFeatureSet.
2238
2239         * css/RuleFeature.cpp:
2240         (WebCore::RuleFeatureSet::collectFeaturesFromSelector):
2241         (WebCore::RuleFeatureSet::add):
2242         (WebCore::RuleFeatureSet::clear):
2243         * css/RuleFeature.h:
2244         (WebCore::RuleFeatureSet::RuleFeatureSet):
2245         * css/SelectorChecker.cpp:
2246         (WebCore::SelectorChecker::matchRecursively):
2247         * css/StyleResolver.h:
2248         (WebCore::StyleResolver::usesFirstLetterRules):
2249         * dom/DocumentStyleSheetCollection.cpp:
2250         (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags):
2251         (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags):
2252         * dom/DocumentStyleSheetCollection.h:
2253         (WebCore::DocumentStyleSheetCollection::setUsesFirstLetterRules): Deleted.
2254
2255 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
2256
2257         Fix non-iOS builds.
2258
2259         * rendering/RenderBox.cpp:
2260         (WebCore::shouldAppyContainersClipAndOffset):
2261
2262 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
2263
2264         [iOS] Fix touches inside accelerated overflow:scroll
2265         https://bugs.webkit.org/show_bug.cgi?id=134961
2266         <rdar://problem/16088789>
2267
2268         Reviewed by Benjamin Poulain.
2269
2270         When individual elements inside an overflow:scroll with -webkit-overflow-scrolling: touch
2271         had touch event listeners, we would fail to take the scroll offset into account when
2272         building the touch event region, causing touches on those elements to fail after scrolling.
2273         
2274         Touch event region building uses RenderObject::absoluteClippedOverflowRect(), and that
2275         code path tries to fix up repaint rects to work correctly in composited overflow:scroll.
2276         However, that broke the touch region computation.
2277         
2278         Fix by only ignoring the scroll offset for calls to computeRectForRepaint() which
2279         have a non-null repaintContainer (which indicates that we're doing a repaint in the
2280         compositing layer), and for which the repaintContainer is the containing block
2281         which is using composited scrolling. This restores correct behavior to the event region
2282         code which always calls this with a null repaintContainer.
2283
2284         * rendering/RenderBox.cpp:
2285         (WebCore::shouldAppyContainersClipAndOffset):
2286         (WebCore::RenderBox::computeRectForRepaint):
2287
2288 2014-07-15  Simon Fraser  <simon.fraser@apple.com>
2289
2290         [iOS] Fix issues drawing subsampled image elements and CSS images
2291         https://bugs.webkit.org/show_bug.cgi?id=134944
2292         <rdar://problem/17634095>
2293
2294         Reviewed by Dean Jackson.
2295
2296         After r170675 it is important for BitmapImage::draw() to be given a srcRect computed
2297         using the original size of the image, not the subsampled size.
2298         
2299         So fix various code paths that end up in image drawing to use the originalSize(),
2300         which requires giving Image a virtual function that just returns size(), and hence has
2301         a FloatSize return value.
2302         
2303         Tested by setting a very low subsampling threshold and browsing various sites.
2304         
2305         A better longterm fix will happen via bug 134916.
2306
2307         * platform/graphics/BitmapImage.cpp:
2308         (WebCore::BitmapImage::originalSize):
2309         * platform/graphics/BitmapImage.h:
2310         * platform/graphics/GraphicsContext.cpp:
2311         (WebCore::GraphicsContext::drawImage):
2312         * platform/graphics/Image.cpp:
2313         (WebCore::Image::drawTiled):
2314         (WebCore::Image::computeIntrinsicDimensions):
2315         * platform/graphics/Image.h:
2316         (WebCore::Image::originalSize):
2317         * platform/graphics/cg/BitmapImageCG.cpp:
2318         (WebCore::BitmapImage::BitmapImage): Just use m_size for initializing the other members.
2319         (WebCore::BitmapImage::draw):
2320         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2321         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2322         * platform/graphics/cg/ImageCG.cpp:
2323         (WebCore::Image::drawPattern):
2324
2325 2014-07-15  Brent Fulgham  <bfulgham@apple.com>
2326
2327         [Win] Unreviewed build fix after r171069.
2328
2329         Add missing AudioHardwareListener implementation on Windows.
2330
2331         * WebCore.vcxproj/WebCore.vcxproj:
2332         * WebCore.vcxproj/WebCore.vcxproj.filters:
2333
2334 2014-07-15  Antti Koivisto  <antti@apple.com>
2335
2336         REGRESSION (r155957): Invalid cast in WebCore::RenderNamedFlowThread::getRanges
2337         https://bugs.webkit.org/show_bug.cgi?id=134888
2338
2339         Reviewed by Mihnea Ovidenie.
2340
2341         Test: fast/regions/flowthread-getranges-box-cast.html
2342
2343         * rendering/RenderNamedFlowThread.cpp:
2344         (WebCore::RenderNamedFlowThread::getRanges): Test the type before casting.
2345
2346 2014-07-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2347
2348         [GTK] Update GObject DOM bindings symbols file after r171014.
2349         https://bugs.webkit.org/show_bug.cgi?id=134907
2350
2351         Reviewed by Philippe Normand.
2352
2353         * bindings/gobject/webkitdom.symbols: Update to the current API.
2354
2355 2014-07-15  Manuel Rego Casasnovas  <rego@igalia.com>
2356
2357         Unreviwed fix wrong indentation from r171082.
2358
2359         * rendering/RenderGrid.cpp:
2360         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2361
2362 2014-07-14  Zalan Bujtas  <zalan@apple.com>
2363
2364         Subpixel rendering: Zero sized compositing container's content positioned off by one device pixel.
2365         https://bugs.webkit.org/show_bug.cgi?id=134903
2366
2367         Reviewed by Simon Fraser.
2368
2369         The compositing layer boundaries are calculated using its renderer()'s and the renderer()'s
2370         descendants' bounds. However when the renderer() is zero sized, its bounds are omitted.
2371         In such cases, when the child content has offset from the renderer(), the subpixel adjustment
2372         of the compositing layer becomes negative (-meaning that the compositing layer is to the right/bottom
2373         direction from its renderer()). Remove fabs() to be able to express such direction.
2374
2375         Test: compositing/hidpi-compositing-layer-with-zero-sized-container.html
2376
2377         * rendering/RenderLayerBacking.cpp:
2378         (WebCore::RenderLayerBacking::updateGeometry):
2379
2380 2014-07-14  Jeremy Jones  <jeremyj@apple.com>
2381
2382         Fix crash on WebVideoFullscreenManagerProxy construction.
2383         https://bugs.webkit.org/show_bug.cgi?id=134909
2384
2385         Unreviewed fix crash from r171089
2386
2387         Remove unnecessary dispatch to main queue since it can happen during construction.
2388
2389         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2390         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): remove dispatch_async
2391
2392 2014-07-14  Jeremy Jones  <jeremyj@apple.com>
2393
2394         WebVideoFullscreenInterfaceAVKit should only call the UI from main thread.
2395         https://bugs.webkit.org/show_bug.cgi?id=134890
2396
2397         Reviewed by Eric Carlson.
2398
2399         dispatch_async to the main thread before setting properties that would affect the UI.
2400
2401         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2402         (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): wrap in call to dispatch_async
2403         (WebVideoFullscreenInterfaceAVKit::setDuration): ditto
2404         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
2405         (WebVideoFullscreenInterfaceAVKit::setRate): ditto
2406         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
2407         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
2408         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
2409         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
2410         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto
2411
2412 2014-07-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
2413
2414         Fix the !ENABLE(FILTERS) && !ENABLE(CSS_FILTERS) build after r167497
2415         https://bugs.webkit.org/show_bug.cgi?id=134679
2416
2417         Reviewed by Darin Adler.
2418
2419         * html/ImageData.cpp:
2420         * platform/graphics/cairo/ImageBufferCairo.cpp:
2421
2422 2014-07-14  Manuel Rego Casasnovas  <rego@igalia.com>
2423
2424         [CSS Grid Layout] Support sparse in auto-placement algorithm
2425         https://bugs.webkit.org/show_bug.cgi?id=134544
2426
2427         Reviewed by Sergio Villar Senin.
2428
2429         This patch implements sparse mode for auto-placement algorithm, which is
2430         the default mode in the new grid-auto-flow syntax. It keeps track of the
2431         auto-placement cursor in
2432         RenderGrid::placeAutoMajorAxisItemsOnGrid() and updates it accordingly
2433         when auto-positioned items are placed.
2434         If we're in dense mode it resets the cursor after each item (which keeps
2435         the old behavior that was using dense mode by default).
2436
2437         GridIterator has been adapted to look for empty areas from a given
2438         position in both directions.
2439
2440         Test: fast/css-grid-layout/grid-auto-flow-sparse.html
2441
2442         * rendering/RenderGrid.cpp:
2443         (WebCore::RenderGrid::GridIterator::GridIterator): Modify constructor to
2444         add an optional argument for the varying index. This allows to look for
2445         empty areas in both axis.
2446         (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Defined the
2447         auto-placement cursor and rested after each item if we're in dense mode.
2448         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Use auto-placement
2449         cursor to look for empty areas from the last auto-positioned item
2450         placed.
2451         * rendering/RenderGrid.h: Modify placeAutoMajorAxisItemOnGrid() header
2452         to receive the auto-placement cursor.
2453
2454 2014-07-14  Brent Fulgham  <bfulgham@apple.com>
2455
2456         [iOS] Some videos play as inline audio-only content
2457         https://bugs.webkit.org/show_bug.cgi?id=134898.
2458         <rdar://problem/17629379>
2459
2460         Reviewed by Eric Carlson.
2461
2462         Add a new 'presentationType' accessor that indicates if the media
2463         element is playing in 'audio' mode. This can happen if a video
2464         element plays an HLS stream that starts off in audio-only mode.
2465
2466         * html/HTMLMediaElement.cpp:
2467         (WebCore::HTMLMediaElement::presentationType): Added.
2468         * html/HTMLMediaElement.h:
2469         * platform/audio/MediaSession.cpp:
2470         (WebCore::MediaSession::presentationType): Added.
2471         * platform/audio/MediaSession.h:
2472         * platform/audio/MediaSessionManager.cpp: 
2473         (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
2474         Use the presentationType, rather than the mediaType to control
2475         inline playback behavior.
2476         * platform/audio/ios/AudioDestinationIOS.h:
2477         (WebCore::AudioDestinationMac::presentationType): Add presentationType.
2478         * platform/audio/mac/AudioDestinationMac.h:
2479         (WebCore::AudioDestinationMac::presentationType): Ditto.
2480
2481 2014-07-14  Bear Travis  <betravis@adobe.com>
2482
2483         [Feature Queries] Enable Feature Queries on Mac
2484         https://bugs.webkit.org/show_bug.cgi?id=134404
2485
2486         Reviewed by Antti Koivisto.
2487
2488         Enable Feature Queries on Mac and resume running the
2489         feature tests.
2490
2491         * Configurations/FeatureDefines.xcconfig: Turn on
2492         ENABLE_CSS3_CONDITIONAL_RULES.
2493
2494 2014-07-11  David Hyatt  <hyatt@apple.com>
2495
2496         <rdar://problem/17305458> Cannot interact with video controls in ePubs
2497         Bug 134836 - [New Multicolumn] Crawl to check for compositing between us and the enclosingPaginationLayer
2498         https://bugs.webkit.org/show_bug.cgi?id=134836
2499
2500         Reviewed by Dean Jackson.
2501
2502         The paginatedAndComposited bit being set in updateLayerPositions just didn't work, since compositing states
2503         can change without triggering that function. This patch just gets rid of the bit and does a crawl every time
2504         to check. This ensures that changes in compositing states don't necessitate any changes in pagination,
2505         since the lookup will always check the current compositing state.
2506         
2507         The new function that does this check is hasCompositedLayerInEnclosingPaginationChain.
2508         
2509         I have been unable to reproduce this issue, and this is therefore a purely speculative fix. I have no test
2510         case to provide because of this.
2511
2512         * rendering/RenderLayer.cpp:
2513         (WebCore::RenderLayer::RenderLayer):
2514         (WebCore::RenderLayer::updateLayerPositions):
2515         (WebCore::RenderLayer::hasCompositedLayerInEnclosingPaginationChain):
2516         (WebCore::RenderLayer::updatePagination):
2517         * rendering/RenderLayer.h:
2518
2519 2014-07-14  Zalan Bujtas  <zalan@apple.com>
2520
2521         Move composite bounds calculation to RenderLayerBacking.
2522         https://bugs.webkit.org/show_bug.cgi?id=134864
2523
2524         Reviewed by Darin Adler.
2525
2526         No change in functionality.
2527
2528         * rendering/RenderLayerBacking.cpp:
2529         (WebCore::RenderLayerBacking::updateCompositedBounds):
2530         * rendering/RenderLayerCompositor.cpp: it was just proxying the calculateLayerBounds()
2531         to the RenderLayer.
2532         (WebCore::RenderLayerCompositor::calculateCompositedBounds): Deleted.
2533         * rendering/RenderLayerCompositor.h:
2534
2535 2014-07-14  Tim Horton  <timothy_horton@apple.com>
2536
2537         Fix the build.
2538
2539         * platform/audio/MediaSessionManager.h:
2540
2541 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
2542
2543         [Mac] don't enable low power audio mode on external output devices
2544         https://bugs.webkit.org/show_bug.cgi?id=134877
2545
2546         Reviewed by Sam Weinig.
2547
2548         No new tests, this deals with changes to the audio hardware at runtime.
2549
2550         * WebCore.xcodeproj/project.pbxproj: Remove AudioSessionListener.h.
2551         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2552
2553         * platform/audio/AudioHardwareListener.cpp:
2554         (WebCore::AudioHardwareListener::AudioHardwareListener): Initialize m_outputDeviceSupportsLowPowerMode
2555             to true on iOS.
2556         * platform/audio/AudioHardwareListener.h:
2557         (WebCore::AudioHardwareListener::outputDeviceSupportsLowPowerMode): New accessor.
2558         (WebCore::AudioHardwareListener::setHardwareActivity): New setter for derived classes.
2559         (WebCore::AudioHardwareListener::setOutputDeviceSupportsLowPowerMode): Ditto.
2560
2561         Remove AudioSessionListener interface, it wasn't being used.
2562         * platform/audio/AudioSession.cpp:
2563         (WebCore::AudioSession::addListener): Deleted.
2564         (WebCore::AudioSession::removeListener): Deleted.
2565         (WebCore::AudioSession::beganAudioInterruption): Deleted.
2566         (WebCore::AudioSession::endedAudioInterruption): Deleted.
2567         * platform/audio/AudioSession.h:
2568         * platform/audio/AudioSessionListener.h: Removed.
2569
2570         * platform/audio/MediaSessionManager.cpp:
2571         (WebCore::MediaSessionManager::addSession): Allocate the AudioHardwareListener if necessary.
2572         (WebCore::MediaSessionManager::removeSession): Free the AudioHardwareListener if necessary.
2573         (WebCore::MediaSessionManager::audioOutputDeviceChanged): AudioHardwareListener client interface
2574             called when the output device changes, call updateSessionState to make sure we are using
2575             the correct buffer size.
2576         * platform/audio/MediaSessionManager.h:
2577
2578         * platform/audio/ios/AudioDestinationIOS.h:
2579         * platform/audio/ios/AudioSessionIOS.mm:
2580         (WebCore::AudioSessionPrivate::AudioSessionPrivate): Drive-by cleanup, remove ObjC helper object
2581             that was used to listen for OS notifications, it is no longer used.
2582         (SOFT_LINK_POINTER): Deleted.
2583         (-[WebAudioSessionHelper initWithCallback:]): Deleted.
2584         (-[WebAudioSessionHelper dealloc]): Deleted.
2585         (-[WebAudioSessionHelper interruption:]): Deleted.
2586
2587         * platform/audio/mac/AudioHardwareListenerMac.cpp:
2588         (WebCore::currentDeviceSupportsLowPowerBufferSize): New, return true only if using build-in 
2589             transport device.
2590         (WebCore::processIsRunningPropertyDescriptor): Return reference to static AudioObjectPropertyAddress
2591             for kAudioHardwarePropertyProcessIsRunning instead of declaring one in every method
2592             that needs one.
2593         (WebCore::outputDevicePropertyDescriptor): Return reference to static AudioObjectPropertyAddress
2594             for kAudioHardwarePropertyDefaultOutputDevice.
2595         (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac): Restructure and add audio object
2596             listener for default output device.
2597         (WebCore::AudioHardwareListenerMac::~AudioHardwareListenerMac): *Remove* listener audio object
2598             property listener instead of *Adding* a new one. Remove new listener.
2599         (WebCore::AudioHardwareListenerMac::propertyChanged): Enumerate the properties that changed,
2600             call appropriate method.
2601         (WebCore::AudioHardwareListenerMac::processIsRunningChanged): Renamed from setHardwareActive, 
2602             cleanup.
2603         (WebCore::AudioHardwareListenerMac::outputDeviceChanged): New, call client.audioHardwareOutputDeviceChanged.
2604         (WebCore::AudioHardwareListenerMac::setHardwareActive): Deleted, renamed processIsRunningChanged.
2605         * platform/audio/mac/AudioHardwareListenerMac.h:
2606
2607         * platform/audio/mac/MediaSessionManagerMac.cpp:
2608         (MediaSessionManager::updateSessionState): Only set the output buffer size to 4K when hardware
2609             supports it.
2610
2611 2014-07-13  Benjamin Poulain  <benjamin@webkit.org>
2612
2613         Remove SelectorCheckerFastPath from the style resolution algorithm
2614         https://bugs.webkit.org/show_bug.cgi?id=134866
2615
2616         Reviewed by Antti Koivisto.
2617
2618         SelectorCheckerFastPath is now pure overhead because it can almost never match
2619         if the CSS JIT was unable to compile.
2620
2621         * css/ElementRuleCollector.cpp:
2622         (WebCore::ElementRuleCollector::ruleMatches):
2623         The "pre-filter" behind fastCheckableSelector had two parts:
2624         1) Filtering the pseudoID.
2625         2) Filtering on the rule hash.
2626
2627         The first part has been generalized (RuleDatacanMatchPseudoElement())
2628         and moved to collectMatchingRulesForList(). 
2629
2630         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
2631         * css/RuleSet.cpp:
2632         (WebCore::selectorCanMatchPseudoElement):
2633         (WebCore::RuleData::RuleData):
2634         (WebCore::RuleSet::addRegionRule):
2635         (WebCore::RuleSet::addRulesFromSheet):
2636         * css/RuleSet.h:
2637         (WebCore::RuleData::canMatchPseudoElement):
2638         (WebCore::RuleData::hasFastCheckableSelector): Deleted.
2639         * css/StyleResolver.cpp:
2640
2641 2014-07-13  Benjamin Poulain  <benjamin@webkit.org>
2642
2643         Remove an useless check from SelectorChecker
2644         https://bugs.webkit.org/show_bug.cgi?id=134868
2645
2646         Reviewed by Darin Adler.
2647
2648         * css/SelectorChecker.cpp:
2649         (WebCore::SelectorChecker::matchRecursively):
2650         The condition of this if() branch can never be met for the mode "QueryingRules".
2651
2652         The next condition in that if() is "dynamicPseudo != NOPSEUDO", which implies
2653         a pseudo element was matched prior to the current context/simple selector.
2654         This cannot happen with QueryingRules, since we never match pseudo elements for
2655         SelectorQuery.
2656
2657 2014-07-12  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
2658
2659         Elements with rendering disabled due to dimensions should not contribute to parent bounding box
2660         https://bugs.webkit.org/show_bug.cgi?id=134184
2661
2662         Reviewed by Dirk Schulze.
2663
2664         SVG elements that have rendering disabled should not contribute to any ancestor elements bounding box.
2665         Examples of elements with rendering disabled:
2666         - basic shape with width <= 0 or height <= 0
2667         - path with no path data (d attribute missing or empty)
2668         - polyline or polygon element with no point data (points attribute missing or empty)
2669
2670         To achieve this a method (isRenderingDisabled) was added to RenderSVGShape and it's derived classes.
2671         This is used to determine if an element is included when creating the union of child bounding boxes
2672         in a container element.
2673
2674         Tests: svg/custom/GetBBox-path-nodata.html
2675                svg/custom/GetBBox-polygon-nodata.html
2676                svg/custom/GetBBox-polyline-nodata.html
2677                svg/custom/getBBox-container-hiddenchild.html
2678
2679         * rendering/svg/RenderSVGEllipse.cpp:
2680         (WebCore::RenderSVGEllipse::isRenderingDisabled):
2681         New method added. Checks bounding box to determine if rendering is disabled.
2682         * rendering/svg/RenderSVGEllipse.h:
2683         * rendering/svg/RenderSVGPath.cpp:
2684         (WebCore::RenderSVGPath::isRenderingDisabled):
2685         New method added. Checks bounding box to determine if rendering is disabled.
2686         * rendering/svg/RenderSVGPath.h:
2687         * rendering/svg/RenderSVGRect.cpp:
2688         (WebCore::RenderSVGRect::isRenderingDisabled):
2689         New method added. Checks bounding box to determine if rendering is disabled.
2690         * rendering/svg/RenderSVGRect.h:
2691         * rendering/svg/RenderSVGShape.h:
2692         (WebCore::RenderSVGShape::isRenderingDisabled):
2693         New method added. Always returns false so that derived classes that do not
2694         implement this method retain the existing behaviour.
2695         * rendering/svg/SVGRenderSupport.cpp:
2696         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
2697         For each element potentially being included in the unioned bounding box of
2698         a container, check isRenderingDisabled and skip that element if true.
2699
2700         * rendering/svg/RenderSVGEllipse.cpp:
2701         (WebCore::RenderSVGEllipse::isRenderingDisabled):
2702         * rendering/svg/RenderSVGEllipse.h:
2703         * rendering/svg/RenderSVGPath.cpp:
2704         (WebCore::RenderSVGPath::isRenderingDisabled):
2705         * rendering/svg/RenderSVGPath.h:
2706         * rendering/svg/RenderSVGRect.cpp:
2707         (WebCore::RenderSVGRect::isRenderingDisabled):
2708         * rendering/svg/RenderSVGRect.h:
2709         * rendering/svg/RenderSVGShape.h:
2710         * rendering/svg/SVGRenderSupport.cpp:
2711         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
2712
2713 2014-07-12  Benjamin Poulain  <benjamin@webkit.org>
2714
2715         Rename selectorListContainsUncommonAttributeSelector() to selectorListContainsAttributeSelector()
2716         https://bugs.webkit.org/show_bug.cgi?id=134862
2717
2718         Reviewed by Sam Weinig.
2719
2720         Unlike containsUncommonAttributeSelector(), selectorListContainsUncommonAttributeSelector() does not
2721         evaluate the attribute for "uncommon" types.
2722
2723         It would be possible to change the function instead to evaluate common attributes based
2724         on the match type and the pseudo class type. Such change would be more risky
2725         and we would get very little benefit from it, I leave that for later if that ever becomes useful.
2726
2727         * css/RuleSet.cpp:
2728         (WebCore::selectorListContainsAttributeSelector):
2729         (WebCore::containsUncommonAttributeSelector):
2730         (WebCore::selectorListContainsUncommonAttributeSelector): Deleted.
2731
2732 2014-07-12  Zan Dobersek  <zdobersek@igalia.com>
2733
2734         Use braced-init-list to create one-item Vector object in insertPerformanceEntry
2735         https://bugs.webkit.org/show_bug.cgi?id=133675
2736
2737         Reviewed by Darin Adler.
2738
2739         * page/PerformanceUserTiming.cpp:
2740         (WebCore::insertPerformanceEntry): Avoid wasting three lines for creating a
2741         Vector object with just one item that in the end gets copied. Use the
2742         braced-init-list syntax instead, leveraging Vector's std::initializer_list
2743         constructor.
2744
2745 2014-07-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2746
2747         Memory leaks with autoLoadImages off
2748         https://bugs.webkit.org/show_bug.cgi?id=124411
2749
2750         Reviewed by Darin Adler.
2751
2752         Do not emit notifyFinished for images with deferred load,
2753         and allow deferred loads to be cancelled.
2754
2755         * loader/cache/CachedResource.cpp:
2756         (WebCore::CachedResource::checkNotify):
2757         (WebCore::CachedResource::cancelLoad):
2758
2759 2014-07-11  Jer Noble  <jer.noble@apple.com>
2760
2761         [MSE] http/tests/media/media-source/mediasource-duration.html is failing.
2762         https://bugs.webkit.org/show_bug.cgi?id=134852
2763
2764         Reviewed by Eric Carlson.
2765
2766         Fixes the following tests:
2767         http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
2768         http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
2769         http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
2770         http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
2771         http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
2772         http/tests/media/media-source/mediasource-duration.html
2773         http/tests/media/media-source/mediasource-play.html
2774
2775         The primary change necessary to fix the mediasource-duration.html test was to add support
2776         for delaying the completion of a seek operation until the HTMLMediaElement's readyState
2777         rises to > HAVE_CURRENT_DATA. This is accomplished by modifying MediaSourcePrivate to have
2778         waitForSeekCompleted() and seekCompleted() virtual methods. These are called by MediaSource
2779         when a seek operation results in the current time moving outside the currently buffered time
2780         ranges, and when an append operation results in the readyState changing, respectively.
2781
2782         A number of other drive-by fixes were necessary to get this test fully passing, as noted
2783         below.
2784
2785         Make the MediaSource the primary owner of the media's duration, rather than the MediaSourcePrivate.
2786         Move the MediaSourcePrivateClient pointer to the MediaSourcePrivate from the MediaPlayerPrivate, so
2787         the MediaSource's duration can be retrieved.  While we're at it, do the same thing for buffered.
2788
2789         * Modules/mediasource/MediaSource.cpp:
2790         (WebCore::MediaSource::MediaSource): Initialize m_duration.
2791         (WebCore::MediaSource::duration): Simple accessor.
2792         (WebCore::MediaSource::setDurationInternal): Bring 'duration change algorithm' up to spec.
2793         (WebCore::MediaSource::setReadyState): Reset m_duration on close.
2794         * Modules/mediasource/MediaSource.h:
2795         * platform/graphics/MediaSourcePrivate.h:
2796         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2797         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Do not call setPrivateAndOpen().
2798         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Pass through to MediaSourcePrivateAVFObjC.
2799         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Ditto.
2800         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2801         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2802         (WebCore::MediaSourcePrivateAVFObjC::create): Call setPrivateAndOpen().
2803         (WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): Set m_client.
2804         (WebCore::MediaSourcePrivateAVFObjC::duration): Pass through to MediaSourcePrivateClient.
2805         (WebCore::MediaSourcePrivateAVFObjC::buffered): Ditto.
2806         (WebCore::MediaSourcePrivateAVFObjC::durationChanged): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
2807         (WebCore::MediaSourcePrivateAVFObjC::setDuration): Deleted.
2808         * platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
2809         (WebCore::MediaSourceGStreamer::open): Pass in MediaSourcePrivateClient.
2810         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer): Initialize m_mediaSource.
2811         (WebCore::MediaSourceGStreamer::durationChanged): Retrieve the duration from MediaSourcePrivateClient.
2812         (WebCore::MediaSourceGStreamer::markEndOfStream): Remove unnecssary ASSERT.
2813         (WebCore::MediaSourceGStreamer::unmarkEndOfStream): Ditto.
2814         (WebCore::MediaSourceGStreamer::setDuration): Deleted.
2815         * platform/graphics/gstreamer/MediaSourceGStreamer.h:
2816         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2817         (WebCore::MockMediaPlayerMediaSource::load): Do not call setPrivateAndOpen().
2818         (WebCore::MockMediaPlayerMediaSource::buffered): Pass through to MockMediaSourcePrivate.
2819         (WebCore::MockMediaPlayerMediaSource::durationDouble): Ditto.
2820         (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime): Ditto.
2821         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2822         (WebCore::MockMediaSourcePrivate::create): Call setPrivateAndOpen().
2823         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Set m_client.
2824         (WebCore::MockMediaSourcePrivate::duration): Pass through to MediaSourcePrivateClient.
2825         (WebCore::MockMediaSourcePrivate::buffered): Ditto.
2826         (WebCore::MockMediaSourcePrivate::durationChanged): Pass thorugh to MockMediaPlayerMediaSource.
2827         (WebCore::MockMediaSourcePrivate::setDuration): Deleted.
2828
2829         Route seekToTime through MediaSource, rather than through MediaSourcePrivate, so that
2830         the time can be compared against the buffered ranges, and trigger the delay of the seek
2831         operation if necessary. Add a seekTimer to MediaPlayerPrivateMediaSourceAVFObjC, as this
2832         guarantees the order of asynchronous operations, rather than callOnMainThread, which can
2833         cause async operations to occur out of order.
2834
2835         * Modules/mediasource/MediaSource.cpp:
2836         (WebCore::MediaSource::seekToTime): Bring up to spec.
2837         (WebCore::MediaSource::completeSeek): Ditto.
2838         (WebCore::MediaSource::monitorSourceBuffers): Call completeSeek() when appropriate.
2839         * Modules/mediasource/SourceBuffer.cpp:
2840         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Deleted.
2841         (WebCore::SourceBuffer::seekToTime): Renamed from sourceBufferPrivateSeekToTime().
2842         * platform/graphics/MediaSourcePrivate.h:
2843         * platform/graphics/MediaSourcePrivateClient.h:
2844         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2845         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2846         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Add seekTimer. Only
2847             call timeChanged() if no longer seeking, thereby triggering a 'seeked' event.
2848         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): Clear m_seekTimer.
2849         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): Use m_seekTimer.
2850         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekTimerFired): Call seekInternal.
2851         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): Add logging.
2852         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): Added.
2853         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): Added; trigger 'seeked'.
2854         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): No longer attempt to finish seek when
2855             readyState changes here; this has been moved up to MediaSource.cpp.
2856         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2857         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2858         (WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
2859         (WebCore::MediaSourcePrivateAVFObjC::seekCompleted): Ditto.
2860         (WebCore::MediaSourcePrivateAVFObjC::seekToTime): Pass through to MediaSourcePrivateClient.
2861         (WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
2862         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2863         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource): Initialize m_seekCompleted.
2864         (WebCore::MockMediaPlayerMediaSource::seeking): Check for an uncompleted seek operation. 
2865         (WebCore::MockMediaPlayerMediaSource::seekWithTolerance): Ditto.
2866         (WebCore::MockMediaPlayerMediaSource::waitForSeekCompleted): Added.
2867         (WebCore::MockMediaPlayerMediaSource::seekCompleted): Added; trigger 'seeked'.
2868         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
2869         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
2870         (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Pass through to MockMediaPlayerMediaSource.
2871         (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
2872         * platform/mock/mediasource/MockMediaSourcePrivate.h:
2873
2874         Drive-by fixes.
2875
2876         * Modules/mediasource/MediaSource.cpp:
2877         (WebCore::MediaSource::streamEndedWithError): Re-order the steps in streamEndedWithError()
2878             to avoid the MediaSource being closed and re-opened by the resulting duration change
2879             operation.
2880         * Modules/mediasource/MediaSource.h:
2881         * Modules/mediasource/SourceBuffer.cpp:
2882         (WebCore::SourceBuffer::remove): Added logging.
2883         (WebCore::SourceBuffer::removeCodedFrames): Ditto.
2884         (WebCore::SourceBuffer::hasFutureTime): Swap an ASSERT for an early-return; it's possible
2885             for currentTime() to be outside of a buffered area.
2886         * Modules/mediasource/SourceBuffer.h:
2887         * html/HTMLMediaElement.cpp:
2888         (WebCore::HTMLMediaElement::parseAttribute): Do not issue an additional 'timeupdate' event
2889             after finishSeek() issues one of its own.
2890         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2891         (WebCore::globalDataParserQueue): Allow parsing operations to happen concurrently on
2892             background queues.
2893
2894 2014-07-12  Eric Carlson  <eric.carlson@apple.com>
2895
2896         [iOS] update control type when playback state changes
2897         https://bugs.webkit.org/show_bug.cgi?id=134856
2898
2899         Reviewed by Dean Jackson.
2900
2901         Check to make sure the correct type of media controls are showing when playback state
2902         changes so we don't end up with the wrong type of controls during playback.
2903
2904         * Modules/mediacontrols/mediaControlsApple.js: 
2905         (Controller.prototype.HandledVideoEvents): Drive-by fix, call handlePlay on 'playing' instead
2906             of 'play' so controls don't hide too early.
2907         * Modules/mediacontrols/mediaControlsiOS.js:
2908         (ControllerIOS.prototype.setPlaying): New, call updateControls to make sure inline
2909             controls are shown when appropriate.
2910
2911 2014-07-12  Dean Jackson  <dino@apple.com>
2912
2913         [iOS Media] Start playback button should indicate when it can't play
2914         https://bugs.webkit.org/show_bug.cgi?id=134851
2915
2916         Post-commit review with Eric Carlson on IRC.
2917
2918         * Modules/mediacontrols/mediaControlsiOS.js:
2919         (ControllerIOS.prototype.updateStatusDisplay): Remove the line that sets the
2920         class on the inline play button.
2921
2922 2014-07-11  Dean Jackson  <dino@apple.com>
2923
2924         [iOS Media] Start playback button should indicate when it can't play
2925         https://bugs.webkit.org/show_bug.cgi?id=134851
2926
2927         Reviewed by Sam Weinig.
2928
2929         If a video element has errors and cannot play, then the start
2930         playback button should use the "broken" icon.
2931
2932         * Modules/mediacontrols/mediaControlsApple.js: Add a new "failed" class.
2933         * Modules/mediacontrols/mediaControlsiOS.js:
2934         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): We need a playback button
2935         even when there is an error.
2936         (ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): Don't offer Airplay
2937         if we're in an error state.
2938         (ControllerIOS.prototype.updateStatusDisplay): Set the "failed" class on
2939         the playback buttons if we are in an error state.
2940
2941 2014-07-11  Benjamin Poulain  <benjamin@webkit.org>
2942
2943         Partition the CSS rules based on the most specific filter of the rightmost fragment
2944         https://bugs.webkit.org/show_bug.cgi?id=134828
2945
2946         Reviewed by Andreas Kling.
2947
2948         Previously, RuleSet was partitioning each rule based on the rightmost filter.
2949         While fast, this had the side effect of putting many selectors with ID match in the class
2950         bucket (because the selectors are generally written starting with the ID).
2951
2952         This patch replace the code of findBestRuleSetAndAdd() by a simple loop going over all
2953         the simple selectors in the rightmost fragment to find the best bucket.
2954
2955         * css/ElementRuleCollector.cpp:
2956         (WebCore::ElementRuleCollector::ruleMatches):
2957         * css/RuleSet.cpp:
2958         (WebCore::isSelectorMatchingHTMLBasedOnRuleHash):
2959         I unified ruleData.hasRightmostSelectorMatchingHTMLBasedOnRuleHash() and hasMultipartSelector().
2960
2961         (WebCore::RuleData::RuleData):
2962         (WebCore::rulesCountForName):
2963         (WebCore::RuleSet::addRule):
2964         I removed the recursive part of findBestRuleSetAndAdd() (which was wrong anyway). The function
2965         was useless so I just moved the algorithm to addRule() directly.
2966
2967         We first loop over all the CSSSelectors related by SubSelector, this correspond to the rightmost fragment.
2968         If a filter with high specificity is found, we add the rule immediately and end there.
2969         If a filter that is not very specific is found, we keep a pointer to the selector to use it later.
2970
2971         (WebCore::RuleSet::findBestRuleSetAndAdd): Deleted.
2972         * css/RuleSet.h:
2973         (WebCore::RuleData::hasMultipartSelector): Deleted.
2974
2975 2014-07-11  Alex Christensen  <achristensen@webkit.org>
2976
2977         [WinCairo] Unreviewed build fix after r170937.
2978
2979         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
2980         Update and apply changes applied to WebCoreGenerated.make in r170937.
2981
2982 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
2983
2984         Web Inspector: Crash when using a stale InspectableNode Node
2985         https://bugs.webkit.org/show_bug.cgi?id=134849
2986
2987         Reviewed by Timothy Hatcher.
2988
2989         * inspector/PageConsoleAgent.cpp:
2990
2991 2014-07-11  Jer Noble  <jer.noble@apple.com>
2992
2993         [MSE] Separate MediaSource logging into its own log channel
2994         https://bugs.webkit.org/show_bug.cgi?id=134809
2995
2996         Reviewed by Eric Carlson.
2997
2998         Separate out MediaSource logging (which can be quite verbose) into its own log channel,
2999         distinct from the Media log channel. Add some per-sample logging and further sequester that
3000         logging into its own MediaSourceSamples log channel.
3001
3002         Add the MediaSource and MediaSourceSamples channels:
3003         * platform/Logging.h:
3004
3005         Move LOG(Media) -> LOG(MediaSource):
3006         * Modules/mediasource/MediaSource.cpp:
3007         (WebCore::MediaSource::MediaSource):
3008         (WebCore::MediaSource::~MediaSource):
3009         (WebCore::MediaSource::setReadyState):
3010         (WebCore::MediaSource::addSourceBuffer):
3011         (WebCore::MediaSource::removeSourceBuffer):
3012         (WebCore::MediaSource::isTypeSupported):
3013         * Modules/mediasource/SourceBuffer.cpp:
3014         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
3015         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
3016         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3017         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
3018         (WebCore::SourceBuffer::provideMediaData):
3019         (WebCore::SourceBuffer::monitorBufferingRate):
3020         (WebCore::SourceBuffer::textTrackAddCues):
3021         (WebCore::SourceBuffer::hasFutureTime):
3022         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3023         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3024         (WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
3025         (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
3026         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3027         (WebCore::SourceBufferPrivateAVFObjC::append):
3028         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
3029         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
3030         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
3031         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3032
3033 2014-07-11  Brady Eidson  <beidson@apple.com>
3034
3035         Phone numbers that span two lines are not detected.
3036         <rdar://problem/17601146> and https://bugs.webkit.org/show_bug.cgi?id=134808
3037
3038         Reviewed by Tim Horton.
3039
3040         * editing/Editor.cpp:
3041         (WebCore::Editor::scanSelectionForTelephoneNumbers): After scanning a range from the TextIterator,
3042             create an "edge range" window around the end of the TextIterator range, and scan it.
3043             Also make sure to not accumulate duplicate ranges that might have showed up in both the
3044             TextIterator range and the edge window range.
3045
3046 2014-07-11  Enrica Casucci  <enrica@apple.com>
3047
3048         Implement textStylingAtPosition in WK2.
3049         https://bugs.webkit.org/show_bug.cgi?id=134843
3050         <rdar://problem/17614981>
3051         
3052         Reviewed by Benjamin Poulain.
3053
3054         Adding some exports and making styleForSelectionStart public.
3055
3056         * WebCore.exp.in:
3057         * editing/Editor.h:
3058
3059 2014-07-11  Zalan Bujtas  <zalan@apple.com>
3060
3061         REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior.
3062         https://bugs.webkit.org/show_bug.cgi?id=134841
3063         <rdar://problem/17577563>
3064
3065         Reviewed by Simon Fraser.
3066
3067         Revert back to type int for Element.scroll* APIs in order to preserve exception handling
3068         behavior.
3069
3070         Test: cssom/non-subpixel-scroll-top-left-values.html
3071
3072         * dom/Element.cpp:
3073         (WebCore::Element::scrollLeft):
3074         (WebCore::Element::scrollTop):
3075         (WebCore::Element::setScrollLeft):
3076         (WebCore::Element::setScrollTop):
3077         (WebCore::Element::scrollWidth):
3078         (WebCore::Element::scrollHeight):
3079         * dom/Element.h:
3080         * dom/Element.idl:
3081         * html/HTMLBodyElement.cpp:
3082         (WebCore::adjustForZoom):
3083         (WebCore::HTMLBodyElement::scrollLeft):
3084         (WebCore::HTMLBodyElement::setScrollLeft):
3085         (WebCore::HTMLBodyElement::scrollTop):
3086         (WebCore::HTMLBodyElement::setScrollTop):
3087         (WebCore::HTMLBodyElement::scrollHeight):
3088         (WebCore::HTMLBodyElement::scrollWidth):
3089         * html/HTMLBodyElement.h:
3090
3091 2014-07-11  Joseph Pecoraro  <pecoraro@apple.com>
3092
3093         Web Inspector: Debugger Pause button does not work
3094         https://bugs.webkit.org/show_bug.cgi?id=134785
3095
3096         Reviewed by Timothy Hatcher.
3097
3098         * CMakeLists.txt:
3099         * DerivedSources.make:
3100         * inspector/CommandLineAPIModuleSource.js:
3101         Minification strips the sourceURL command. Add it back with minification.
3102
3103 2014-07-11  Andreas Kling  <akling@apple.com>
3104
3105         Use the bare minimum tile coverage rect when under memory pressure.
3106         <https://webkit.org/b/134837>
3107
3108         When the browser is under critical memory pressure, don't generate any
3109         more tiles than are needed to cover the exposed viewport rect.
3110
3111         Reviewed by Pratik Solanki.
3112
3113         * page/FrameView.cpp:
3114         (WebCore::FrameView::computeCoverageRect):
3115
3116 2014-07-11  Javier Fernandez  <jfernandez@igalia.com>
3117
3118         [CSS Grid Layout] Implement justify-self css property
3119         https://bugs.webkit.org/show_bug.cgi?id=134419
3120
3121         Reviewed by Dean Jackson.
3122
3123         This change adds the justify-self property from CSS 3 Box Alignment
3124         and implements the parsing.
3125
3126         From Blink r164685 by <jchaffraix@chromium.org>
3127
3128         Test: fast/css/parse-justify-self.html
3129
3130         * css/CSSComputedStyleDeclaration.cpp:
3131         (WebCore::ComputedStyleExtractor::propertyValue):
3132         * css/CSSParser.cpp:
3133         (WebCore::isValidKeywordPropertyAndValue):
3134         (WebCore::CSSParser::parseValue):
3135         (WebCore::isItemPositionKeyword):
3136         (WebCore::CSSParser::parseJustifySelf):
3137         * css/CSSParser.h:
3138         * css/CSSPrimitiveValueMappings.h:
3139         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3140         (WebCore::CSSPrimitiveValue::operator EJustifySelf):
3141         (WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment):
3142         * css/CSSPropertyNames.in:
3143         * css/CSSValueKeywords.in:
3144         * css/DeprecatedStyleBuilder.cpp:
3145         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3146         * css/StyleResolver.cpp:
3147         (WebCore::StyleResolver::applyProperty):
3148         * rendering/style/RenderStyle.h:
3149         * rendering/style/RenderStyleConstants.h:
3150         * rendering/style/StyleRareNonInheritedData.cpp:
3151         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3152         (WebCore::StyleRareNonInheritedData::operator==):
3153         * rendering/style/StyleRareNonInheritedData.h:
3154
3155 2014-07-11  Bear Travis  <betravis@adobe.com>
3156
3157         [Feature Queries] Feature Query CSS Grammar Productions Should Return a Value
3158         https://bugs.webkit.org/show_bug.cgi?id=134810
3159
3160         Reviewed by Antti Koivisto.
3161
3162         The parsing return values are used to determine if a feature query is valid. Two
3163         grammar productions have been updated to correctly return a value.
3164
3165         Tests exist for this feature but will not be run until the feature is turned on.
3166         See https://bugs.webkit.org/show_bug.cgi?id=134404.
3167
3168         * css/CSSGrammar.y.in: Adding return values for two valid feature query productions.
3169
3170 2014-07-10  Brent Fulgham  <bfulgham@apple.com>
3171
3172         Use a separate backdrop element to allow cues to have highlight and background color
3173         https://bugs.webkit.org/show_bug.cgi?id=134821
3174         <rdar://problem/15999721>
3175
3176         Reviewed by Eric Carlson.
3177
3178         Add a new <div> element wrapping the existing cue <span>. This allows
3179         us to have a highlight on the cue (in the <span> background), as well
3180         as an overall background color.
3181
3182         * Modules/mediacontrols/mediaControlsApple.css:
3183         (video::-webkit-media-text-track-display-backdrop): New markup for
3184         the backdrop element of the caption.
3185         * html/track/VTTCue.cpp:
3186         (WebCore::VTTCue::cueBackdropShadowPseudoId): Added to
3187         allow user customization of the cue backdrop.
3188         (WebCore::VTTCue::initialize): Rename the old "m_cueBackgroundBox" to
3189         "m_cueHighlightBox" and add a new "m_cueBackdropBox" member.
3190         (WebCore::VTTCue::updateDisplayTree): Update for m_cueHighlightBox.
3191         (WebCore::VTTCue::getDisplayTree): Make m_cueHighlightBox a child
3192         of the new m_cueBackdropBox element, and add m_cueBackdropBox to
3193         the display tree.
3194         * html/track/VTTCue.h:
3195         (WebCore::VTTCue::element):
3196         * page/CaptionUserPreferencesMediaAF.cpp:
3197         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
3198         Fix for missing caption style updates. Even if we are already
3199         listening for caption changes, we still want to update the new
3200         instance's style sheet to match.
3201         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
3202         * rendering/RenderVTTCue.cpp:
3203         (WebCore::RenderVTTCue::initializeLayoutParameters): Take the new
3204         <div> into consideration when looking for the Cue text element.
3205
3206 2014-07-11  Zalan Bujtas  <zalan@apple.com>
3207
3208         Subpixel layout: return integral results for offset*, client*, scroll* by default.
3209         https://bugs.webkit.org/show_bug.cgi?id=134651
3210
3211         Reviewed by Simon Fraser.
3212
3213         Revert to returning integral values for Element.offset* client* scroll* by default.
3214         Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
3215
3216         Since snapped dimension depends on both the original point and the width/height of the box,
3217         we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
3218
3219         Covered by existing tests
3220  
3221         * dom/Element.cpp:
3222         (WebCore::subpixelMetricsEnabled):
3223         (WebCore::convertToNonSubpixelValueIfNeeded):
3224         (WebCore::Element::offsetLeft):
3225         (WebCore::Element::offsetTop):
3226         (WebCore::Element::offsetWidth):
3227         (WebCore::Element::offsetHeight):
3228         (WebCore::Element::clientLeft):
3229         (WebCore::Element::clientTop):
3230         (WebCore::Element::clientWidth):
3231         (WebCore::Element::clientHeight):
3232         * page/Settings.in:
3233
3234 2014-07-11  Zalan Bujtas  <zalan@apple.com>
3235
3236         Subpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
3237         https://bugs.webkit.org/show_bug.cgi?id=134824
3238         <rdar://problem/17612729>
3239
3240         Reviewed by Simon Fraser.
3241
3242         Transparent layer clipping needs device pixel offset adjusting.
3243
3244         Test: fast/layers/wrong-clipping-semi-transparent-compositing-layer-on-subpixel-position.html
3245
3246         * rendering/RenderLayer.cpp:
3247         (WebCore::RenderLayer::beginTransparencyLayers):
3248         (WebCore::RenderLayer::paintLayer):
3249         (WebCore::RenderLayer::paintLayerContents):
3250         (WebCore::RenderLayer::paintBackgroundForFragments):
3251         (WebCore::RenderLayer::paintForegroundForFragments):
3252         * rendering/RenderLayer.h:
3253
3254 2014-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3255
3256         Unreviewed. Remove unused file.
3257
3258         * html/shadow/MediaControlsGtk.h: Removed.
3259
3260 2014-07-11  Manuel Rego Casasnovas  <rego@igalia.com>
3261
3262         [CSS Grid Layout] Update grid-auto-flow to the new syntax
3263         https://bugs.webkit.org/show_bug.cgi?id=134057
3264
3265         Reviewed by Sergio Villar Senin.
3266
3267         In last versions of the spec grid-auto-flow syntax has changed. New
3268         syntax is:
3269         [ row | column ] && dense? | stack && [ row | column ]?
3270
3271         Implemented parsing for new syntax and added/modified test cases in
3272         current layout tests.
3273
3274         For the moment, the implementation keeps working in the same way, but
3275         using "stack" value for grid-auto-flow property instead of "none". This
3276         should be fixed in a follow-up patch once "stack" is properly
3277         implemented.
3278
3279         Also "dense" needs to be reviewed. Right now auto-placement algorithm is
3280         always "dense" and never "sparse".
3281
3282         No new tests, update current tests to add new cases.
3283
3284         * css/CSSComputedStyleDeclaration.cpp:
3285         (WebCore::ComputedStyleExtractor::propertyValue): Adapt to new syntax.
3286         * css/CSSParser.cpp:
3287         (WebCore::isValidKeywordPropertyAndValue): Removed grid-auto-flow as it
3288         is not a keyword anymore.
3289         (WebCore::isKeywordPropertyID): Ditto.
3290         (WebCore::CSSParser::parseValue): Add specific method for parsing
3291         grid-auto-flow.
3292         (WebCore::CSSParser::parseGridShorthand): Adapt parsing for
3293         grid-auto-flow property inside the shorthand.
3294         (WebCore::isValidGridAutoFlowId): Helper method to check if the CSSValue
3295         id is a valid keyword for grid-auto-flow property.
3296         (WebCore::CSSParser::parseGridAutoFlow): Implement new parsing for
3297         grid-auto-flow.
3298         * css/CSSParser.h: Method header for grid-auto-flow parsing.
3299         * css/CSSPrimitiveValueMappings.h:
3300         (WebCore::CSSPrimitiveValue::operator GridAutoFlow): Deleted.
3301         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
3302         * css/CSSValueKeywords.in: Add new keywords required by grid-auto-flow:
3303         "dense" and "stack".
3304         * css/DeprecatedStyleBuilder.cpp:
3305         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Remove
3306         default handler as grid-auto-flow is not a keyword now.
3307         * css/StyleResolver.cpp:
3308         (WebCore::StyleResolver::applyProperty): Implement particular handler
3309         for new grid-auto-flow syntax.
3310         * rendering/RenderGrid.cpp:
3311         (WebCore::RenderGrid::placeItemsOnGrid): Keep old "none" behavior as
3312         "stack" behavior for the moment.
3313         (WebCore::RenderGrid::autoPlacementMajorAxisDirection): Use the new
3314         helper methods in RenderStyle.
3315         (WebCore::RenderGrid::autoPlacementMinorAxisDirection): Ditto.
3316         * rendering/style/GridResolvedPosition.cpp:
3317         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle): Again
3318         keep old "none" behavior for "stack".
3319         * rendering/style/RenderStyle.h: Add new helper methods to know the
3320         direction and algorithm of grid-auto-flow property.
3321         * rendering/style/RenderStyleConstants.h: Redefine GridAutoFlow enum
3322         using flags for algorithm and direction.
3323         * rendering/style/StyleGridData.h: Change m_gridAutoFlow type to
3324         unsigned.
3325
3326 2014-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
3327
3328         [iOS] Pasting rich content does not perform a two-step paste
3329         https://bugs.webkit.org/show_bug.cgi?id=134795
3330
3331         Reviewed by Benjamin Poulain.
3332
3333         UIKit requires writing something (anything!) to a particular pasteboard
3334         during copy in order to flag the content as rich. When a paste occurs,
3335         UIKit will read this flag and perform a two-step paste.
3336
3337         Test: platform/ios-sim/editing/pasteboard/two-step-paste.html
3338
3339         * platform/ios/PlatformPasteboardIOS.mm:
3340         (WebCore::PlatformPasteboard::write):
3341
3342 2014-07-09  Andy Estes  <aestes@apple.com>
3343
3344         [iOS] Some QuickLook documents are not displayed as previews
3345         https://bugs.webkit.org/show_bug.cgi?id=134788
3346         <rdar://problem/17278194>
3347
3348         Reviewed by Pratik Solanki.
3349
3350         ResourceRequest::isMainResourceRequest() is not reliable (e.g. ResourceRequests reconstituted from an
3351         NSURLRequest have no way to set this bit properly) and should probably be removed. Instead of using
3352         isMainResourceRequest() to check if a QuickLookHandle should be created when the Network Process is in use,
3353         just check if the current ResourceLoader is the same as the DocumentLoader's ResourceLoader.
3354
3355         No new tests. QuickLook is not testable from WebKit.
3356
3357         * platform/network/ios/QuickLook.mm:
3358         (WebCore::QuickLookHandle::create):
3359
3360 2014-07-10  Andreas Kling  <akling@apple.com>
3361
3362         [iOS WebKit2] Don't uninstall the memory pressure listener after first signal.
3363         <https://webkit.org/b/134814>
3364
3365         The call to uninstall() should not be made on iOS since iOS doesn't use the
3366         hold-off mechanism in MemoryPressureHandler.
3367
3368         Reviewed by Benjamin Poulain.
3369
3370         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3371         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
3372
3373 2014-07-10  Jer Noble  <jer.noble@apple.com>
3374
3375         [MSE] Overlapping appended ranges must cause the decoder to flush and re-enqueue.
3376         https://bugs.webkit.org/show_bug.cgi?id=134805
3377
3378         Reviewed by Eric Carlson.
3379
3380         When appending a range of media data which overlaps with an existing range, SourceBuffer
3381         must cause the decoder to flush and re-enqueue samples. Those samples removed by appending
3382         the overlapping range may have already been enqueued for display, and unless the decode
3383         queue is flushed, corruption or decode errors may occur as the new samples are enqueued for
3384         display.
3385
3386         Add a boolean flag onto TrackBuffer to indicate whether the decoder needs to be flushed and
3387         re-enqueued the next time an append operation completes. Set this flag whenever samples are
3388         removed due to overlapping or an explicit call to removeCodedFrames(). Move the contents of
3389         sourceBufferPrivateSeekToTime() (which previously did flushing and re-enqueueing) into a new
3390         function, reenqueueMediaForTime(), which can be called from sourceBufferPrivateAppendComplete().
3391
3392         Drive-by fix: findSyncSampleAfterDecodeIterator() would return the passed in iterator if that
3393         sample is a sync-sample. Fix this to correctly return the next sync sample.
3394
3395         Drive-by fix: Use a SampleMap, rather than a DecodeOrderSampleMap, to track erased samples
3396         so that the erasedSamples are correctly accounted for in both presentation and decode orders.
3397
3398         * Modules/mediasource/SampleMap.cpp:
3399         (WebCore::SampleMap::empty): Add convenience method.
3400         (WebCore::DecodeOrderSampleMap::findSyncSampleAfterDecodeIterator): Drive-by&