[Mac] Optimize cookiesForDOM() by filtering and serializing cookies in a single pass
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-10-20  Chris Dumez  <cdumez@apple.com>
2
3         [Mac] Optimize cookiesForDOM() by filtering and serializing cookies in a single pass
4         https://bugs.webkit.org/show_bug.cgi?id=137869
5
6         Reviewed by Darin Adler.
7
8         Optimize cookiesForDOM() by filtering and serializing in 1 pass instead of 2.
9
10         Previously, when accessing document.cookie, we ended up doing the following:
11         1. Call wkHTTPCookiesForURL() to get an NSArray of NSHTTPCookies.
12         2. Call filterCookies() to filter out cookies that are httpOnly or with an
13            empty name, thus allocating a new NSMutableArray.
14         3. Call NSHTTPCookie's requestHeaderFieldsWithCookies() to serialize the
15            cookies
16         4. Construct a WTF::String from the NSString*
17
18         There were several inefficiencies here:
19         1. We needed to pre-filter the cookies and allocate a new NSMutableArray
20            before calling requestHeaderFieldsWithCookies()
21         2. requestHeaderFieldsWithCookies() does more things that we actually need.
22            It constructs a Dictionary of header fields, of which we query the
23            "Cookie" field, even though we merely want a ';'-separated string
24            representation of the cookies in "key=value" form.
25
26         With this patch, we now take care of the string serialization ourselves,
27         using a StringBuilder as it is trivial to do. This also allows us to filter
28         out the httpOnly/invalid cookies as we do the serialization instead of
29         having a first pass to do so.
30
31         When scrolling the http://www.apple.com/iphone/ entire page down, then up,
32         se were spending ~13.1% of the NetworkProcess time in cookiesForDOM()
33         (~96ms) on my machine. With the patch, we spend ~23% less time in
34         cookiesForDOM() (~74ms).
35
36         No new tests, no behavior change.
37
38         * platform/network/mac/CookieJarMac.mm:
39         (WebCore::cookiesForSession):
40         (WebCore::cookiesForDOM):
41         (WebCore::cookieRequestHeaderFieldValue):
42
43 2014-10-19  Chris Dumez  <cdumez@apple.com>
44
45         Kill toRenderedDocumentMarker() by using tighter typing
46         https://bugs.webkit.org/show_bug.cgi?id=137858
47
48         Reviewed by Darin Adler.
49
50         Kill toRenderedDocumentMarker() by using tighter typing. This method
51         was doing no type validation, just a static_cast<>().
52
53         No new tests, no behavior change.
54
55         * dom/DocumentMarkerController.cpp:
56         (WebCore::DocumentMarkerController::addTextMatchMarker):
57         (WebCore::DocumentMarkerController::markersFor):
58         (WebCore::DocumentMarkerController::markersInRange):
59         (DocumentMarkerController::hasMarkers):
60         * dom/DocumentMarkerController.h:
61         * dom/RenderedDocumentMarker.h:
62         (WebCore::toRenderedDocumentMarker): Deleted.
63         * editing/AlternativeTextController.cpp:
64         (WebCore::markersHaveIdenticalDescription):
65         (WebCore::AlternativeTextController::respondToChangedSelection):
66         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
67         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
68         (WebCore::AlternativeTextController::applyDictationAlternative):
69         * editing/CompositeEditCommand.cpp:
70         (WebCore::copyMarkers):
71         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
72         * editing/DeleteSelectionCommand.cpp:
73         (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
74         * editing/Editor.cpp:
75         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
76         (WebCore::Editor::selectionStartHasMarkerFor):
77         * rendering/InlineTextBox.cpp:
78         (WebCore::InlineTextBox::paintDocumentMarker):
79         (WebCore::InlineTextBox::paintTextMatchMarker):
80         (WebCore::InlineTextBox::computeRectForReplacementMarker):
81         (WebCore::InlineTextBox::paintDocumentMarkers):
82         * rendering/InlineTextBox.h:
83         * rendering/svg/SVGInlineFlowBox.cpp:
84         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
85         * testing/Internals.cpp:
86         (WebCore::Internals::markerAt):
87         (WebCore::Internals::markerRangeForNode):
88         (WebCore::Internals::markerDescriptionForNode):
89         * testing/Internals.h:
90
91 2014-10-19  Chris Dumez  <cdumez@apple.com>
92
93         Use is<>() / downcast<>() for all remaining RenderObject subclasses
94         https://bugs.webkit.org/show_bug.cgi?id=137845
95
96         Reviewed by Darin Adler.
97
98         Use is<>() / downcast<>() for all remaining RenderObject subclasses and
99         clean up the surrounding code.
100
101         No new tests, no behavior change.
102
103         * accessibility/AccessibilityProgressIndicator.cpp:
104         (WebCore::AccessibilityProgressIndicator::progressElement):
105         (WebCore::AccessibilityProgressIndicator::meterElement):
106         * accessibility/AccessibilityRenderObject.cpp:
107         (WebCore::AccessibilityRenderObject::layoutCount):
108         (WebCore::AccessibilityRenderObject::widgetForAttachmentView):
109         (WebCore::AccessibilityRenderObject::visiblePositionForPoint):
110         * dom/Document.cpp:
111         (WebCore::widgetForElement):
112         * dom/Position.cpp:
113         (WebCore::Position::getInlineBoxAndOffset):
114         * dom/WebKitNamedFlow.cpp:
115         (WebCore::WebKitNamedFlow::overset):
116         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex):
117         (WebCore::WebKitNamedFlow::getRegionsByContent):
118         (WebCore::WebKitNamedFlow::getRegions):
119         * editing/FrameSelection.cpp:
120         (WebCore::isFrameElement):
121         * html/HTMLEmbedElement.cpp:
122         (WebCore::findWidgetRenderer):
123         * html/HTMLFrameOwnerElement.cpp:
124         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
125         (WebCore::HTMLFrameOwnerElement::renderWidget):
126         * html/HTMLMediaElement.cpp:
127         (WebCore::HTMLMediaElement::parseAttribute):
128         * html/HTMLMeterElement.cpp:
129         (WebCore::HTMLMeterElement::renderMeter):
130         * html/HTMLPlugInElement.cpp:
131         (WebCore::HTMLPlugInElement::supportsFocus):
132         * html/HTMLPlugInImageElement.cpp:
133         (WebCore::HTMLPlugInImageElement::renderEmbeddedObject):
134         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
135         * html/HTMLProgressElement.cpp:
136         (WebCore::HTMLProgressElement::renderProgress):
137         * html/PluginDocument.cpp:
138         (WebCore::PluginDocument::pluginWidget):
139         * html/shadow/MediaControlElements.cpp:
140         (WebCore::MediaControlTimelineElement::defaultEventHandler):
141         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
142         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
143         * inspector/InspectorLayerTreeAgent.cpp:
144         (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
145         * inspector/InspectorOverlay.cpp:
146         (WebCore::buildObjectForElementInfo):
147         * loader/SubframeLoader.cpp:
148         (WebCore::SubframeLoader::loadSubframe):
149         * page/Frame.cpp:
150         (WebCore::Frame::ownerRenderer):
151         * page/FrameView.cpp:
152         (WebCore::FrameView::layout):
153         * page/gtk/EventHandlerGtk.cpp:
154         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
155         * page/ios/EventHandlerIOS.mm:
156         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
157         (WebCore::EventHandler::passSubframeEventToSubframe):
158         * page/mac/EventHandlerMac.mm:
159         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
160         (WebCore::EventHandler::passSubframeEventToSubframe):
161         (WebCore::widgetForEventTarget):
162         * platform/efl/RenderThemeEfl.cpp:
163         (WebCore::RenderThemeEfl::applyEdjeRTLState):
164         * rendering/InlineTextBox.cpp:
165         (WebCore::fontToUse):
166         (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove):
167         (WebCore::InlineTextBox::paint):
168         * rendering/LayoutState.cpp:
169         (WebCore::LayoutState::LayoutState):
170         * rendering/RenderBlock.cpp:
171         (WebCore::RenderBlock::collapseAnonymousBoxChild):
172         (WebCore::RenderBlock::simplifiedLayout):
173         (WebCore::RenderBlock::paintObject):
174         (WebCore::RenderBlock::selectionGaps):
175         (WebCore::RenderBlock::nodeAtPoint):
176         * rendering/RenderBlockFlow.cpp:
177         (WebCore::RenderBlockFlow::layoutBlock):
178         (WebCore::RenderBlockFlow::hitTestFloats):
179         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
180         * rendering/RenderBlockLineLayout.cpp:
181         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
182         * rendering/RenderBox.cpp:
183         (WebCore::RenderBox::scroll):
184         (WebCore::RenderBox::nodeAtPoint):
185         (WebCore::RenderBox::repaintLayerRectsForImage):
186         (WebCore::RenderBox::mapLocalToContainer):
187         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
188         * rendering/RenderCombineText.h:
189         * rendering/RenderElement.cpp:
190         (WebCore::RenderElement::adjustStyleDifference):
191         (WebCore::addLayers):
192         (WebCore::RenderElement::removeLayers):
193         (WebCore::RenderElement::moveLayers):
194         (WebCore::RenderElement::setNeedsPositionedMovementLayout):
195         (WebCore::RenderElement::renderNamedFlowThreadWrapper):
196         * rendering/RenderEmbeddedObject.h:
197         * rendering/RenderFlowThread.cpp:
198         (WebCore::RenderFlowThread::validateRegions):
199         (WebCore::RenderFlowThread::hasCompositingRegionDescendant):
200         (WebCore::RenderFlowThread::regionForCompositedLayer):
201         (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
202         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
203         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
204         (WebCore::RenderFlowThread::addForcedRegionBreak):
205         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
206         * rendering/RenderFlowThread.h:
207         * rendering/RenderLayer.cpp:
208         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
209         (WebCore::transparencyClipBox):
210         (WebCore::accumulateOffsetTowardsAncestor):
211         (WebCore::RenderLayer::collectFragments):
212         (WebCore::RenderLayer::hitTest):
213         (WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions):
214         (WebCore::RenderLayer::calculateClipRects):
215         * rendering/RenderLayerBacking.cpp:
216         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
217         (WebCore::RenderLayerBacking::updateConfiguration):
218         (WebCore::isRestartedPlugin):
219         (WebCore::isCompositedPlugin):
220         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
221         (WebCore::RenderLayerBacking::containsPaintedContent):
222         * rendering/RenderLayerCompositor.cpp:
223         (WebCore::RenderLayerCompositor::updateBacking):
224         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
225         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
226         (WebCore::RenderLayerCompositor::requiresCompositingLayer):
227         (WebCore::RenderLayerCompositor::reasonsForCompositing):
228         (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
229         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
230         (WebCore::RenderLayerCompositor::requiresCompositingForFrame):
231         * rendering/RenderLayerModelObject.h:
232         * rendering/RenderLineBreak.h:
233         * rendering/RenderMeter.h:
234         * rendering/RenderMultiColumnFlowThread.cpp:
235         (WebCore::RenderMultiColumnFlowThread::firstMultiColumnSet):
236         (WebCore::RenderMultiColumnFlowThread::lastMultiColumnSet):
237         (WebCore::RenderMultiColumnFlowThread::layout):
238         (WebCore::RenderMultiColumnFlowThread::addRegionToThread):
239         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
240         (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
241         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantBoxLaidOut):
242         (WebCore::RenderMultiColumnFlowThread::setPageBreak):
243         (WebCore::RenderMultiColumnFlowThread::updateMinimumPageHeight):
244         (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
245         (WebCore::RenderMultiColumnFlowThread::addForcedRegionBreak):
246         (WebCore::RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToRegion):
247         * rendering/RenderMultiColumnFlowThread.h:
248         * rendering/RenderMultiColumnSet.cpp:
249         (WebCore::RenderMultiColumnSet::nextSiblingMultiColumnSet):
250         (WebCore::RenderMultiColumnSet::previousSiblingMultiColumnSet):
251         * rendering/RenderMultiColumnSet.h:
252         * rendering/RenderMultiColumnSpannerPlaceholder.h:
253         * rendering/RenderNamedFlowFragment.cpp:
254         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
255         (WebCore::RenderNamedFlowFragment::namedFlowThread):
256         * rendering/RenderNamedFlowFragment.h:
257         * rendering/RenderNamedFlowThread.cpp:
258         (WebCore::RenderNamedFlowThread::updateWritingMode):
259         (WebCore::addFragmentToList):
260         (WebCore::RenderNamedFlowThread::addRegionToThread):
261         (WebCore::RenderNamedFlowThread::removeRegionFromThread):
262         (WebCore::RenderNamedFlowThread::fragmentFromRenderBoxAsRenderBlock):
263         (WebCore::RenderNamedFlowThread::fragmentFromAbsolutePointAndBox):
264         (WebCore::RenderNamedFlowThread::checkInvalidRegions):
265         (WebCore::RenderNamedFlowThread::checkRegionsWithStyling):
266         (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
267         * rendering/RenderNamedFlowThread.h:
268         * rendering/RenderObject.cpp:
269         (WebCore::scheduleRelayoutForSubtree):
270         (WebCore::RenderObject::setLayerNeedsFullRepaint):
271         (WebCore::RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout):
272         (WebCore::RenderObject::repaintUsingContainer):
273         (WebCore::RenderObject::selectionRoot):
274         (WebCore::RenderObject::shouldUseTransformFromContainer):
275         (WebCore::RenderObject::getTransformFromContainer):
276         (WebCore::RenderObject::isRooted):
277         (WebCore::RenderObject::willBeDestroyed):
278         (WebCore::RenderObject::isComposited):
279         (WebCore::RenderObject::currentRenderNamedFlowFragment):
280         * rendering/RenderObject.h:
281         * rendering/RenderProgress.h:
282         * rendering/RenderRuby.cpp:
283         (WebCore::lastRubyRun):
284         * rendering/RenderRubyBase.cpp:
285         (WebCore::RenderRubyBase::rubyRun):
286         * rendering/RenderRubyRun.cpp:
287         (WebCore::RenderRubyRun::removeChild):
288         * rendering/RenderRubyRun.h:
289         * rendering/RenderSlider.h:
290         * rendering/RenderText.cpp:
291         (WebCore::RenderText::widthFromCache):
292         * rendering/RenderThemeGtk.cpp:
293         (WebCore::RenderThemeGtk::calculateProgressRect):
294         * rendering/RenderThemeIOS.mm:
295         (WebCore::RenderThemeIOS::paintProgressBar):
296         * rendering/RenderThemeMac.mm:
297         (WebCore::RenderThemeMac::paintMeter):
298         (WebCore::RenderThemeMac::paintProgressBar):
299         * rendering/RenderThemeSafari.cpp:
300         (WebCore::RenderThemeSafari::paintMeter):
301         * rendering/RenderThemeWin.cpp:
302         (WebCore::RenderThemeWin::paintMeter):
303         * rendering/RenderTreeAsText.cpp:
304         (WebCore::writeRenderRegionList):
305         (WebCore::writeLayers):
306         * rendering/RenderVideo.h:
307         * rendering/RenderView.cpp:
308         (WebCore::SelectionIterator::checkForSpanner):
309         (WebCore::isComposited):
310         * rendering/RenderView.h:
311         * rendering/RenderWidget.h:
312         * rendering/line/BreakingContextInlineHeaders.h:
313         (WebCore::BreakingContext::handleText):
314         * rendering/line/LineBreaker.cpp:
315         (WebCore::LineBreaker::skipLeadingWhitespace):
316         * testing/Internals.cpp:
317         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
318
319 2014-10-19  Chris Dumez  <cdumez@apple.com>
320
321         Use SPECIALIZE_TYPE_TRAITS_*() macro for RenderScrollbar
322         https://bugs.webkit.org/show_bug.cgi?id=137854
323
324         Reviewed by Darin Adler.
325
326         Use SPECIALIZE_TYPE_TRAITS_*() macro for RenderScrollbar instead of a
327         custom toRenderScrollbar() function, for consistency.
328
329         No new tests, no behavior change.
330
331         * rendering/RenderScrollbar.h:
332         (isType):
333         (WebCore::toRenderScrollbar): Deleted.
334         * rendering/RenderScrollbarTheme.cpp:
335         (WebCore::RenderScrollbarTheme::minimumThumbLength):
336         (WebCore::RenderScrollbarTheme::backButtonRect):
337         (WebCore::RenderScrollbarTheme::forwardButtonRect):
338         (WebCore::RenderScrollbarTheme::trackRect):
339         (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
340         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
341         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
342         (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
343         (WebCore::RenderScrollbarTheme::paintTrackBackground):
344         (WebCore::RenderScrollbarTheme::paintTrackPiece):
345         (WebCore::RenderScrollbarTheme::paintButton):
346         (WebCore::RenderScrollbarTheme::paintThumb):
347
348 2014-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
349
350         [GTK] Move GtkDragAndDropHelper from Platform to WebKit2
351         https://bugs.webkit.org/show_bug.cgi?id=137422
352
353         Reviewed by Martin Robinson.
354
355         Remove ClipboardUtilitiesGtk and GtkDragAndDropHelper.
356
357         * PlatformGTK.cmake:
358         * platform/gtk/ClipboardUtilitiesGtk.cpp: Removed.
359         * platform/gtk/ClipboardUtilitiesGtk.h: Removed.
360         * platform/gtk/GtkDragAndDropHelper.cpp: Removed.
361         * platform/gtk/GtkDragAndDropHelper.h: Removed.
362
363 2014-10-19  Roger Fong  <roger_fong@apple.com>
364
365         Unreviewed. Style fix following r174855.
366
367         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
368         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
369
370 2014-10-18  Antti Koivisto  <antti@apple.com>
371
372         REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error
373         https://bugs.webkit.org/show_bug.cgi?id=137855
374
375         Reviewed by Dan Bernstein.
376
377         We lose the sniffed MIME type for the response when synthesizing an NSURLResponse. Sniffing requires
378         backchannel data that the synthesized response doesn't have.
379
380         Test: http/tests/mime/mime-type-sniff.html
381
382         * platform/network/mac/ResourceResponseMac.mm:
383         (WebCore::ResourceResponse::initNSURLResponse):
384
385             When synthesizing NSURLResponse explicitly set the Content-type header to the sniffed type.
386
387 2014-10-18  Chris Dumez  <cdumez@apple.com>
388
389         [Mac] Use Fast enumeration consistently in WebFontCache.mm
390         https://bugs.webkit.org/show_bug.cgi?id=137791
391
392         Reviewed by Darin Adler.
393
394         Use fast enumeration consistently in WebFontCache.mm as this results in
395         more efficient, concise and safer code.
396
397         No new tests, no behavior change.
398
399         * platform/mac/WebFontCache.mm:
400         (+[WebFontCache getTraits:inFamily:]):
401         Reserve Vector capacity before the loop as we know how many traits we
402         are going to append. Also use uncheckedAppend() for performance.
403
404         (+[WebFontCache internalFontWithFamily:traits:weight:size:]):
405
406 2014-10-18  Chris Fleizach  <cfleizach@apple.com>
407
408         AX: Tables with <colgroups> are not reporting table column headers
409         https://bugs.webkit.org/show_bug.cgi?id=137846
410
411         Reviewed by Mario Sanchez Prada.
412
413         The code to search for header objects was getting stuck on anonymous RenderTableSections.
414         We also need to check more rows for headers, in case the first row or more is not visible or is empty.
415
416         Test: accessibility/table-column-headers-with-captions.html
417
418         * accessibility/AccessibilityTableColumn.cpp:
419         (WebCore::AccessibilityTableColumn::headerObject):
420         (WebCore::AccessibilityTableColumn::headerObjectForSection):
421
422 2014-10-18  KwangHyuk Kim  <hyuki.kim@samsung.com>
423
424         [EFL] build break occurs on webkit efl build.
425         https://bugs.webkit.org/show_bug.cgi?id=137844
426
427         Reviewed by Gyuyoung Kim.
428
429         As local variable elementAddressRegisterIndex is assigned but not used, there is build break for the webkit efl.
430
431         No new tests because it's just to fix build break.
432
433         * cssjit/SelectorCompiler.cpp:
434         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
435
436 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
437
438         Apply std::unique_ptr to FooFont classes
439         https://bugs.webkit.org/show_bug.cgi?id=137769
440
441         Reviewed by Andreas Kling.
442
443         As a step to use std::unique_ptr, this patch applies std::unique_ptr to Font classes.
444
445         No new tests, no behavior changes.
446
447         * platform/graphics/Font.cpp:
448         (WebCore::retrieveOrAddCachedFontGlyphs):
449         (WebCore::Font::createLayout):
450         * platform/graphics/SimpleFontData.cpp:
451         (WebCore::SimpleFontData::DerivedFontData::create):
452         * platform/graphics/SimpleFontData.h:
453         Remove create() factory function because public ctor and std::make_unique<> can replace it.
454         * platform/graphics/mac/ComplexTextController.cpp:
455         (WebCore::Font::createLayout):
456
457 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
458
459         Use std::unique_ptr in WebCore/bindings
460         https://bugs.webkit.org/show_bug.cgi?id=137808
461
462         Reviewed by Andreas Kling.
463
464         Clean up PassOwnPtr|OwnPtr in WebCore/bindings by using std::unique_ptr, std::make_unique
465         and WTF::move.
466
467         No new tests, no behavior changes.
468
469         * bindings/generic/ActiveDOMCallback.h:
470         * bindings/js/JSMessageEventCustom.cpp:
471         (WebCore::handleInitMessageEvent):
472         * bindings/js/SerializedScriptValue.cpp:
473         (WebCore::SerializedScriptValue::SerializedScriptValue):
474         (WebCore::SerializedScriptValue::transferArrayBuffers):
475         (WebCore::SerializedScriptValue::create):
476         * bindings/js/SerializedScriptValue.h:
477         * bindings/js/WorkerScriptDebugServer.cpp:
478         (WebCore::WorkerScriptDebugServer::interruptAndRunTask):
479         * bindings/js/WorkerScriptDebugServer.h:
480         * inspector/WorkerDebuggerAgent.cpp:
481         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
482
483 2014-10-16  Roger Fong  <roger_fong@apple.com>
484
485         Calling glReadPixels with BGRA format on an NVIDIA machine with an opaque context returns the wrong alpha values.
486         https://bugs.webkit.org/show_bug.cgi?id=137793.
487         <rdar://problem/15408133>
488
489         Reviewed by Dean Jackson.
490
491         This fixes conformance test context/context-attribute-preserve-drawing-buffer.html.
492
493         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
494         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
495         On an NVIDIA machine, when the context has alpha turned off, call glReadPixels with RGBA format and then convert to RGBA.
496
497 2014-10-17  Chris Dumez  <cdumez@apple.com>
498
499         Use is<>() / downcast<>() for all SVG RenderObjects
500         https://bugs.webkit.org/show_bug.cgi?id=137840
501
502         Reviewed by Benjamin Poulain.
503
504         Use is<>() / downcast<>() for all SVG RenderObjects and clean up the
505         surrounding code.
506
507         No new tests, no behaviro change.
508
509         * accessibility/AccessibilityRenderObject.cpp:
510         (WebCore::AccessibilityRenderObject::supportsPath):
511         (WebCore::AccessibilityRenderObject::elementPath):
512         * page/FrameView.cpp:
513         (WebCore::FrameView::applyOverflowToViewport):
514         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
515         * rendering/RenderLayerFilterInfo.cpp:
516         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
517         * rendering/svg/RenderSVGGradientStop.cpp:
518         (WebCore::RenderSVGGradientStop::styleDidChange):
519         * rendering/svg/RenderSVGImage.h:
520         * rendering/svg/RenderSVGInlineText.h:
521         * rendering/svg/RenderSVGResourceContainer.cpp:
522         (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
523         * rendering/svg/RenderSVGResourceContainer.h:
524         * rendering/svg/RenderSVGRoot.cpp:
525         (WebCore::RenderSVGRoot::addResourceForClientInvalidation):
526         * rendering/svg/RenderSVGRoot.h:
527         * rendering/svg/RenderSVGShape.h:
528         * rendering/svg/RenderSVGText.cpp:
529         (WebCore::collectLayoutAttributes):
530         (WebCore::RenderSVGText::subtreeChildWillBeRemoved):
531         (WebCore::RenderSVGText::subtreeTextDidChange):
532         (WebCore::updateFontInAllDescendants):
533         * rendering/svg/RenderSVGText.h:
534         * rendering/svg/SVGInlineTextBox.h:
535         * rendering/svg/SVGRenderSupport.cpp:
536         (WebCore::SVGRenderSupport::mapLocalToContainer):
537         (WebCore::SVGRenderSupport::pushMappingToContainer):
538         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
539         * rendering/svg/SVGRenderTreeAsText.cpp:
540         (WebCore::writeStyle):
541         * rendering/svg/SVGRenderingContext.cpp:
542         (WebCore::SVGRenderingContext::bufferForeground):
543         * rendering/svg/SVGResourcesCycleSolver.cpp:
544         (WebCore::SVGResourcesCycleSolver::resolveCycles):
545         * rendering/svg/SVGRootInlineBox.cpp:
546         (WebCore::SVGRootInlineBox::renderSVGText):
547         (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
548         * svg/SVGCircleElement.cpp:
549         (WebCore::SVGCircleElement::svgAttributeChanged):
550         * svg/SVGElement.cpp:
551         (WebCore::SVGElement::svgAttributeChanged):
552         * svg/SVGEllipseElement.cpp:
553         (WebCore::SVGEllipseElement::svgAttributeChanged):
554         * svg/SVGImageElement.cpp:
555         (WebCore::SVGImageElement::svgAttributeChanged):
556         (WebCore::SVGImageElement::didAttachRenderers):
557         * svg/SVGLineElement.cpp:
558         (WebCore::SVGLineElement::svgAttributeChanged):
559         * svg/SVGPolyElement.cpp:
560         (WebCore::SVGPolyElement::svgAttributeChanged):
561         * svg/SVGRectElement.cpp:
562         (WebCore::SVGRectElement::svgAttributeChanged):
563         * svg/SVGSVGElement.cpp:
564         (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
565         (WebCore::SVGSVGElement::currentViewBoxRect):
566         * svg/graphics/SVGImage.cpp:
567         (WebCore::SVGImage::setContainerSize):
568         (WebCore::SVGImage::containerSize):
569
570 2014-10-17  Chris Dumez  <cdumez@apple.com>
571
572         Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms()
573         https://bugs.webkit.org/show_bug.cgi?id=137836
574
575         Reviewed by Andreas Kling.
576
577         Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms().
578         This function is only called from WidthIterator::applyFontTransforms(),
579         which already makes sure to call applyTransforms() if isSVGFont()
580         returns false. This patch replaces the check with a simple assertion.
581
582         No new tests, no behavior change.
583
584         * platform/graphics/SimpleFontData.h:
585         * svg/SVGFontData.h:
586
587 2014-10-17  Michael Saboff  <msaboff@apple.com>
588
589         Don't create cached functions that access lexicalGlobalObject()
590         https://bugs.webkit.org/show_bug.cgi?id=137839
591
592         Reviewed by Geoffrey Garen.
593
594         Made it so that all the JSDOMWindow special functions blur(), close(), focus() and postMessage()
595         are always created as needed for every prototype.  Made it so that JSHTMLDocument does
596         the same for open().  Updated test to account for these methods not being cached
597
598         Updated tests accordingly.
599
600         * bindings/js/JSDOMWindowCustom.cpp: 
601         (WebCore::JSDOMWindow::getOwnPropertySlot): Updated to always create cached versions of the
602         special functions.
603         * bindings/js/JSHTMLDocumentCustom.cpp:
604         (WebCore::JSHTMLDocument::getOwnPropertySlot): Added to create an uncached open() method when
605         it is first accessed.
606         * html/HTMLDocument.idl: Added CustomGetOwnPropertySlot and implemented it in JSHTMLDocumentCustom.cpp.
607
608 2014-10-17  Simon Fraser  <simon.fraser@apple.com>
609
610         [iOS] Speculative fix for a crash under RenderLayerCompositor::updateScrollCoordinatedLayer()
611         https://bugs.webkit.org/show_bug.cgi?id=137837
612         rdar://problem/18545452
613
614         Reviewed by Tim Horton.
615
616         Crash logs suggest that an iframe's RenderView's RenderLayer's backing can be null
617         in a call to updateScrollCoordinatedLayer(), so add an assertion (to help find a reproducible case)
618         and a null check.
619
620         * rendering/RenderLayerCompositor.cpp:
621         (WebCore::RenderLayerCompositor::attachScrollingNode):
622
623 2014-10-17  Andreas Kling  <akling@apple.com>
624
625         Re-arrange parentheses for compilation purposes.
626
627         * cssjit/SelectorCompiler.cpp:
628         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
629
630 2014-10-17  Andreas Kling  <akling@apple.com>
631
632         Unreviewed build fix after r174838.
633
634         Use StackAllocator::addressOf() instead of the old way of grabbing at a stack reference.
635
636         * cssjit/SelectorCompiler.cpp:
637         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
638
639 2014-10-17  Chris Dumez  <cdumez@apple.com>
640
641         Use is<>() / downcast<>() for RenderBox
642         https://bugs.webkit.org/show_bug.cgi?id=137804
643
644         Reviewed by Andreas Kling.
645
646         Use is<>() / downcast<>() for RenderBox and clean up the surrounding
647         code.
648
649         No new tests, no behavior change.
650
651         * accessibility/AccessibilityRenderObject.cpp:
652         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
653         (WebCore::AccessibilityRenderObject::accessibilityHitTest):
654         (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable):
655         (WebCore::AccessibilityRenderObject::scrollTo):
656         * bindings/objc/DOMHTML.mm:
657         (-[DOMHTMLElement scrollYOffset]):
658         (-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
659         * bindings/objc/DOMUIKitExtensions.mm:
660         (-[DOMNode borderRadii]):
661         * css/CSSComputedStyleDeclaration.cpp:
662         (WebCore::sizingBox):
663         (WebCore::computedTransform):
664         (WebCore::zoomAdjustedPaddingOrMarginPixelValue):
665         (WebCore::ComputedStyleExtractor::propertyValue):
666         * dom/ContainerNode.cpp:
667         (WebCore::ContainerNode::getLowerRightCorner):
668         * dom/Document.cpp:
669         (WebCore::Document::webkitWillEnterFullScreenForElement):
670         * dom/Element.cpp:
671         (WebCore::Element::scrollByUnits):
672         * dom/Node.cpp:
673         (WebCore::Node::defaultEventHandler):
674         * dom/Position.cpp:
675         (WebCore::endsOfNodeAreVisuallyDistinctPositions):
676         * editing/DeleteButtonController.cpp:
677         (WebCore::isDeletableElement):
678         * editing/EditorCommand.cpp:
679         (WebCore::verticalScrollDistance):
680         * editing/FrameSelection.cpp:
681         (WebCore::CaretBase::paintCaret):
682         * editing/TextIterator.cpp:
683         (WebCore::fullyClipsContents):
684         (WebCore::shouldEmitExtraNewlineForNode):
685         * editing/htmlediting.cpp:
686         (WebCore::absoluteBoundsForLocalCaretRect):
687         * html/HTMLFormControlElement.cpp:
688         (WebCore::HTMLFormControlElement::isFocusable):
689         * html/HTMLPlugInImageElement.cpp:
690         (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
691         * html/HTMLSelectElement.cpp:
692         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
693         * html/shadow/SliderThumbElement.cpp:
694         (WebCore::SliderThumbElement::setPositionFromPoint):
695         * inspector/InspectorOverlay.cpp:
696         (WebCore::buildObjectForElementInfo):
697         * page/AutoscrollController.cpp:
698         (WebCore::AutoscrollController::updateAutoscrollRenderer):
699         * page/EventHandler.cpp:
700         (WebCore::EventHandler::startPanScrolling):
701         * page/FrameView.cpp:
702         (WebCore::FrameView::embeddedContentBox):
703         * page/GestureTapHighlighter.cpp:
704         * page/SpatialNavigation.cpp:
705         (WebCore::isScrollableNode):
706         * page/animation/CSSPropertyAnimation.cpp:
707         (WebCore::blendFunc):
708         * platform/efl/RenderThemeEfl.cpp:
709         (WebCore::RenderThemeEfl::baselinePosition):
710         * plugins/PluginView.cpp:
711         (WebCore::PluginView::invalidateWindowlessPluginRect):
712         * rendering/InlineBox.cpp:
713         (WebCore::InlineBox::logicalHeight):
714         (WebCore::InlineBox::adjustPosition):
715         * rendering/InlineElementBox.cpp:
716         (WebCore::InlineElementBox::deleteLine):
717         (WebCore::InlineElementBox::extractLine):
718         (WebCore::InlineElementBox::attachLine):
719         (WebCore::InlineElementBox::paint):
720         (WebCore::InlineElementBox::nodeAtPoint):
721         * rendering/InlineFlowBox.cpp:
722         (WebCore::InlineFlowBox::addToLine):
723         (WebCore::InlineFlowBox::addReplacedChildOverflow):
724         * rendering/LayoutState.cpp:
725         (WebCore::LayoutState::LayoutState):
726         * rendering/RenderBlock.cpp:
727         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
728         (WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
729         (WebCore::RenderBlock::clearPercentHeightDescendantsFrom):
730         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
731         (WebCore::RenderBlock::addFocusRingRects):
732         * rendering/RenderBlockFlow.cpp:
733         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
734         (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
735         * rendering/RenderBlockLineLayout.cpp:
736         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
737         (WebCore::RenderBlockFlow::layoutLineBoxes):
738         * rendering/RenderBox.cpp:
739         (WebCore::RenderBox::findAutoscrollable):
740         (WebCore::computeBlockStaticDistance):
741         (WebCore::RenderBox::positionForPoint):
742         (WebCore::RenderBox::layoutOverflowRectForPropagation):
743         * rendering/RenderBox.h:
744         (WebCore::RenderBox::previousSiblingBox):
745         (WebCore::RenderBox::nextSiblingBox):
746         (WebCore::RenderBox::parentBox):
747         (WebCore::RenderBox::firstChildBox):
748         (WebCore::RenderBox::lastChildBox):
749         * rendering/RenderBoxModelObject.cpp:
750         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
751         (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
752         (WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
753         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
754         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
755         * rendering/RenderElement.cpp:
756         (WebCore::RenderElement::removeChildInternal):
757         (WebCore::RenderElement::styleWillChange):
758         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
759         * rendering/RenderEmbeddedObject.cpp:
760         (WebCore::RenderEmbeddedObject::layout):
761         * rendering/RenderFieldset.cpp:
762         (WebCore::RenderFieldset::findLegend):
763         * rendering/RenderFlowThread.cpp:
764         (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
765         (WebCore::RenderFlowThread::currentActiveRenderBox):
766         * rendering/RenderFlowThread.h:
767         * rendering/RenderFullScreen.cpp:
768         (WebCore::RenderFullScreen::unwrapRenderer):
769         * rendering/RenderImage.cpp:
770         (WebCore::RenderImage::layoutShadowControls):
771         (WebCore::RenderImage::computeIntrinsicRatioInformation):
772         * rendering/RenderInline.cpp:
773         (WebCore::RenderInline::absoluteRects):
774         (WebCore::RenderInline::addFocusRingRects):
775         * rendering/RenderLayer.cpp:
776         (WebCore::RenderLayer::updateLayerPosition):
777         (WebCore::RenderLayer::perspectiveTransform):
778         (WebCore::RenderLayer::perspectiveOrigin):
779         (WebCore::parentLayerCrossFrame):
780         (WebCore::RenderLayer::enclosingScrollableLayer):
781         (WebCore::RenderLayer::resize):
782         (WebCore::RenderLayer::scrollsOverflow):
783         (WebCore::computeReferenceBox):
784         (WebCore::RenderLayer::calculateClipRects):
785         * rendering/RenderLayer.h:
786         * rendering/RenderLayerBacking.cpp:
787         (WebCore::RenderLayerBacking::updateTransform):
788         (WebCore::RenderLayerBacking::updateGeometry):
789         (WebCore::RenderLayerBacking::resetContentsRect):
790         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
791         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
792         (WebCore::RenderLayerBacking::contentsBox):
793         (WebCore::RenderLayerBacking::backgroundBoxForPainting):
794         (WebCore::RenderLayerBacking::startAnimation):
795         (WebCore::RenderLayerBacking::startTransition):
796         * rendering/RenderLineBoxList.cpp:
797         (WebCore::RenderLineBoxList::rangeIntersectsRect):
798         * rendering/RenderMediaControlElements.cpp:
799         (WebCore::RenderMediaVolumeSliderContainer::layout):
800         * rendering/RenderMultiColumnFlowThread.cpp:
801         (WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner):
802         (WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf):
803         (WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf):
804         (WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
805         (WebCore::isValidColumnSpanner):
806         (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
807         * rendering/RenderNamedFlowThread.cpp:
808         (WebCore::RenderNamedFlowThread::getRanges):
809         * rendering/RenderObject.cpp:
810         (WebCore::RenderObject::computeRectForRepaint):
811         (WebCore::RenderObject::showRegionsInformation):
812         (WebCore::RenderObject::showRenderObject):
813         (WebCore::RenderObject::mapLocalToContainer):
814         (WebCore::RenderObject::pushMappingToContainer):
815         (WebCore::RenderObject::mapAbsoluteToLocalPoint):
816         (WebCore::RenderObject::addAnnotatedRegions):
817         * rendering/RenderTable.cpp:
818         (WebCore::RenderTable::nodeAtPoint):
819         * rendering/RenderTextControlMultiLine.cpp:
820         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
821         * rendering/RenderTheme.cpp:
822         (WebCore::RenderTheme::baselinePosition):
823         * rendering/RenderThemeGtk.cpp:
824         (WebCore::RenderThemeGtk::baselinePosition):
825         (WebCore::centerRectVerticallyInParentInputElement):
826         * rendering/RenderThemeIOS.mm:
827         (WebCore::RenderThemeIOS::baselinePosition):
828         * rendering/RenderThemeSafari.cpp:
829         (WebCore::RenderThemeSafari::baselinePosition):
830         * rendering/RenderThemeWin.cpp:
831         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
832         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
833         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
834         * rendering/RenderTreeAsText.cpp:
835         (WebCore::RenderTreeAsText::writeRenderObject):
836         (WebCore::externalRepresentation):
837         * rendering/RenderView.cpp:
838         (WebCore::RenderView::paintBoxDecorations):
839         * rendering/RootInlineBox.cpp:
840         (WebCore::RootInlineBox::setLineBreakInfo):
841         * rendering/line/BreakingContextInlineHeaders.h:
842         (WebCore::BreakingContext::handleOutOfFlowPositioned):
843         (WebCore::BreakingContext::handleFloat):
844         (WebCore::BreakingContext::handleReplaced):
845         * rendering/line/LineBreaker.cpp:
846         (WebCore::LineBreaker::skipTrailingWhitespace):
847         (WebCore::LineBreaker::skipLeadingWhitespace):
848         * rendering/mathml/RenderMathMLUnderOver.cpp:
849         (WebCore::RenderMathMLUnderOver::layout):
850         * svg/graphics/SVGImage.cpp:
851         (WebCore::SVGImage::embeddedContentBox):
852
853 2014-10-17  Andreas Kling  <akling@apple.com>
854
855         Get rid of wrapperContext() in DOM bindings.
856         <https://webkit.org/b/137834>
857
858         Reviewed by Chris Dumez.
859
860         The "wrapper context" is always the DOMWrapperWorld, and since we're passing that around
861         already, we don't need a separate mechanism to get at the context.
862
863         The context is extra data stored in the DOM object's JSC::Weak (the wrapper GC object.)
864
865         * bindings/js/JSDOMBinding.h:
866         (WebCore::setInlineCachedWrapper):
867         (WebCore::cacheWrapper):
868         (WebCore::wrapperContext): Deleted.
869         * bindings/scripts/CodeGeneratorJS.pm:
870         (GenerateHeader):
871
872 2014-10-17  Benjamin Poulain  <benjamin@webkit.org>
873
874         Make a better use of the available registers when compiling nested selector lists
875         https://bugs.webkit.org/show_bug.cgi?id=137802
876
877         Reviewed by Andreas Kling.
878
879         Previously, when compiling a nested selector list, the compiler would start by pushing all
880         the allocated registers to the stack to free them for the compiled selector list.
881         While neat to ensure register allocation is correct, this is very inefficient.
882
883         This patch brings the first step for reducing the overhead. Instead of pushing everything
884         to the stack, we just push as many registers as we need for compiling the selector list.
885
886         In most cases, we have so many registers that we don't even need to push anything to the stack.
887
888         Test: fast/selectors/nth-child-of-register-requirement.html
889
890         * cssjit/SelectorCompiler.cpp:
891         Add an explicit type for SelectorList to keep information aggregated from all
892         SelectorFragmentList inside it.
893
894         SelectorFragmentList is also extended to include its register and stack requirements.
895         This information is then used to create a SelectorList and to compile the SelectorFragmentList.
896
897         (WebCore::SelectorCompiler::hasAnyCombinators):
898         We only change the elementAddressRegister when moving over combinators. This is used to detect
899         if a selector list clobber the elementAddressRegister or leave it untouched.
900
901         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
902         (WebCore::SelectorCompiler::computeBacktrackingInformation):
903         Instead of returning a BacktrackingMemoryRequirements, update the SelectorFragmentList and SelectorList directly.
904
905         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
906         This is where the fun happen.
907         First step is keep the input untouched. For now it is simply pushed on the stack. This can be improved later.
908
909         Then we find how many allocated registers we need to save to compile the input selector list. We push those registers
910         to the stack and give them back to the register allocator.
911
912         With enough registers we can now compile the nested selector list. The code has changed a bit for efficiency. Instead
913         of creating a shortcut for success case, the code now exit on error and proceed on success. This is the general pattern
914         of SelectorCompiler and it is quite a bit more efficient in the common cases.
915
916         Finally, we reallocate the registers and get their values back from the stack. The "tail" is duplicated but that's fine
917         because in the vast majority of cases it is 1 or 2 pop.
918
919         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
920         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
921         * cssjit/StackAllocator.h:
922         (WebCore::StackAllocator::push):
923
924 2014-10-17  Chris Dumez  <cdumez@apple.com>
925
926         Use is<>() / downcast<>() for StyleImage
927         https://bugs.webkit.org/show_bug.cgi?id=137824
928
929         Reviewed by Andreas Kling.
930
931         Use is<>() / downcast<>() for StyleImage and clean up the surrouding
932         code.
933
934         No new tests, no behavior change.
935
936         * css/CSSCursorImageValue.cpp:
937         (WebCore::CSSCursorImageValue::detachPendingImage):
938         (WebCore::CSSCursorImageValue::cachedImage):
939         (WebCore::CSSCursorImageValue::cachedImageURL):
940         * css/CSSImageSetValue.cpp:
941         (WebCore::CSSImageSetValue::detachPendingImage):
942         (WebCore::CSSImageSetValue::~CSSImageSetValue):
943         (WebCore::CSSImageSetValue::cachedImageSet):
944         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):
945         * css/CSSImageValue.cpp:
946         (WebCore::CSSImageValue::detachPendingImage):
947         (WebCore::CSSImageValue::cachedImage):
948         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources):
949         * css/StyleResolver.cpp:
950         (WebCore::StyleResolver::loadPendingShapeImage):
951         (WebCore::StyleResolver::loadPendingImages):
952         * page/PageSerializer.cpp:
953         (WebCore::PageSerializer::retrieveResourcesForProperties):
954         * page/animation/CSSPropertyAnimation.cpp:
955         (WebCore::blendFunc):
956         * rendering/style/StyleCachedImage.h:
957         * rendering/style/StyleCachedImageSet.h:
958         * rendering/style/StyleGeneratedImage.h:
959         * rendering/style/StyleImage.h:
960         * rendering/style/StylePendingImage.h:
961
962 2014-10-17  Dean Jackson  <dino@apple.com>
963
964         [Media] Always update controls for <audio> since they are always visible
965         https://bugs.webkit.org/show_bug.cgi?id=137829
966         <rdar://problem/18693987>
967
968         Reviewed by Brent Fulgham.
969
970         Revision 174756 made a change to only update the display of the controls
971         while they are visible. However, <audio> elements didn't detect visibility
972         the same way, since their controls do not auto-hide.
973
974         Change controlsAreHidden to check if we're an audio element.
975
976         * Modules/mediacontrols/mediaControlsApple.js:
977         (Controller.prototype.controlsAreHidden): Audio elements do not auto-hide their controls.
978
979 2014-10-17  peavo@outlook.com  <peavo@outlook.com>
980
981         [WinCairo] Accelerated compositing is not implemented.
982         https://bugs.webkit.org/show_bug.cgi?id=137345
983
984         Reviewed by Brent Fulgham.
985
986         This patch is based on GTK, and the texture mapper graphics layer type.
987
988         * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy texmap headers.
989         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: Added method and flag indicating whether animation has started.
990         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
991         (WebCore::GraphicsLayerTextureMapper::addAnimation):
992         * platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto.
993         (WebCore::GraphicsLayerTextureMapper::startedAnimation):
994         * platform/graphics/texmap/TextureMapperShaderProgram.cpp: Use same precision for uniform in vertex shader as in fragment shader.
995         Otherwise glLinkProgram() will fail, and nothing will be rendered.
996
997 2014-10-17  Alexey Proskuryakov  <ap@apple.com>
998
999         [iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials
1000         https://bugs.webkit.org/show_bug.cgi?id=137826
1001         rdar://problem/17329599
1002
1003         Reviewed by Brady Eidson.
1004
1005         No new tests, as we don't have a way to simulate details of user interaction with
1006         an auth dialog.
1007
1008         * platform/network/cf/ResourceHandleCFNet.cpp:
1009         (WebCore::ResourceHandle::receivedCredential):
1010         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
1011         (WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling):
1012         (WebCore::ResourceHandle::receivedChallengeRejection):
1013         Added null checks before passing m_connection for CFNetwork functions, making this
1014         match what Mac code does when sending a message to a nil receiver.
1015
1016 2014-10-17  Simon Fraser  <simon.fraser@apple.com>
1017
1018         Fix the iOS build.
1019
1020         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1021         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption):
1022
1023 2014-10-16  Jer Noble  <jer.noble@apple.com>
1024
1025         [Mac] Represent AVMediaSelectionOptions as AudioTracks
1026         https://bugs.webkit.org/show_bug.cgi?id=137474
1027
1028         Reviewed by Brent Fulgham.
1029
1030         Test: http/tests/media/hls/hls-audio-tracks.html
1031
1032         Support selecting audio "tracks" in HLS streams by exposing AVMediaSelectionOptions
1033         as entries in the video's AudioTrackList.
1034
1035         AVMediaSessionGroups and AVPlayerItems don't have KVO or notifications to track when options
1036         are selected and deselected, so wrap AVMediaSessionGroup and AVMediaSessionOption in C++
1037         wrappers. Each AVMediaSelectionGroup can have only one AVMediaSelectionOption selected at a
1038         time, so the wrapper will take care of answering which AVMediaSelectionOption is currently
1039         selected, as without KVO notifications, asking the AVMediaSelectionGroup directly is
1040         inconsistent. Because setting the selected option multiple times in the same run-loop can
1041         cause flakiness, coalesce calls to setSelectedOption() by setting a one-shot timer to do
1042         the actual selection in the next run-loop.
1043
1044         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Added.
1045         (WebCore::MediaSelectionOptionAVFObjC::avMediaSelectionOption):
1046         (WebCore::MediaSelectionOptionAVFObjC::clearGroup): Clear backpointer to group from option.
1047         (WebCore::MediaSelectionGroupAVFObjC::selectedOption): Simple accessor.
1048         (WebCore::MediaSelectionGroupAVFObjC::options):  Simple accessor.
1049         (WebCore::MediaSelectionGroupAVFObjC::avMediaSelectionGroup): Simple accessor.
1050         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: Added.
1051         (WebCore::MediaSelectionOptionAVFObjC::create): Simple factory method.
1052         (WebCore::MediaSelectionOptionAVFObjC::MediaSelectionOptionAVFObjC): Simple constructor.
1053         (WebCore::MediaSelectionOptionAVFObjC::setSelected): Pass through to MediaSelectionGroupAVFObjC.
1054         (WebCore::MediaSelectionOptionAVFObjC::selected): Ditto.
1055         (WebCore::MediaSelectionOptionAVFObjC::index): Return index of this object in the group's object.
1056         (WebCore::MediaSelectionGroupAVFObjC::create):
1057         (WebCore::MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC):
1058         (WebCore::MediaSelectionGroupAVFObjC::~MediaSelectionGroupAVFObjC):
1059         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Discover added or removed options.
1060         (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): Set a one shot timer to coalesce multiple calls.
1061         (WebCore::MediaSelectionGroupAVFObjC::selectionTimerFired): Set the selected AVSelectionOption.
1062
1063         Modify AVTrackPrivateAVFObjCImpl to support both AVPlayerItemTracks and these new
1064         MediaSelectionOptionAVFObjC objects.
1065
1066         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
1067         (WebCore::AVTrackPrivateAVFObjCImpl::mediaSelectionOption): Simple accessor.
1068         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1069         (WebCore::AVTrackPrivateAVFObjCImpl::AVTrackPrivateAVFObjCImpl):  Simple constructor.
1070         (WebCore::AVTrackPrivateAVFObjCImpl::~AVTrackPrivateAVFObjCImpl): Simple destructor.
1071         (WebCore::AVTrackPrivateAVFObjCImpl::enabled): Use MediaSelectionOptionAVFObjC, if present.
1072         (WebCore::AVTrackPrivateAVFObjCImpl::setEnabled): Ditto.
1073         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind): Ditto.
1074         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind): Ditto.
1075         (WebCore::AVTrackPrivateAVFObjCImpl::index): Ditto.
1076         (WebCore::AVTrackPrivateAVFObjCImpl::id): Ditto.
1077         (WebCore::AVTrackPrivateAVFObjCImpl::label): Ditto.
1078         (WebCore::AVTrackPrivateAVFObjCImpl::language): Ditto.
1079         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption): Ditto.
1080         (WebCore::AVTrackPrivateAVFObjCImpl::trackID): Ditto.
1081
1082         Allow AudioTrackPrivateAVFObjC and VideoTrackPrivateAVFObjC to be created with
1083         a MediaSelectionOptionAVFObjC.
1084
1085         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h:
1086         (WebCore::AudioTrackPrivateAVFObjC::create): Takes a MediaSelectionOptionAVFObjC.
1087         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
1088         (WebCore::AudioTrackPrivateAVFObjC::AudioTrackPrivateAVFObjC): Simple constructor.
1089         (WebCore::AudioTrackPrivateAVFObjC::setMediaSelectionOption): Create a new AVTrackPrivateAVFObjCImpl.
1090         (WebCore::AudioTrackPrivateAVFObjC::mediaSelectionOption): Simple accessor.
1091         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:
1092         (WebCore::VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC): Simple constructor.
1093         (WebCore::VideoTrackPrivateAVFObjC::setMediaSelectonOption): Create a new AVTrackPrivateAVFObjCImpl.
1094         (WebCore::VideoTrackPrivateAVFObjC::mediaSelectionOption): Simple accessor.
1095         * platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.h:
1096
1097         Because IDs are not necessarily unique across AVPlayerItemTracks and AVMediaSelectionOptions,
1098         use the index of the track or option instead of it's self-declared ID for ordering for the
1099         trackIndex.
1100
1101         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
1102         (WebCore::AudioTrackPrivateAVFObjC::resetPropertiesFromTrack):
1103         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
1104         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):
1105
1106         Rather than making allowing the AVPlayerItem to automatically select the "best"
1107         AVMediaSelectionOption, select the automatic options when creating the AVPlayerItem
1108         and thereafter allow the users manual selections "stick".
1109
1110         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1111         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1112         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayer):
1113         (WebCore::MediaPlayerPrivateAVFoundationObjC::ensureAVPlayerItem):
1114
1115         Determine whether any MediaSelectionOptionsAVFObjC have been added or removed and send trackChange events accordingly.
1116
1117         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1118         (WebCore::determineChangedTracksFromNewTracksAndOldItems): Added.
1119         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks): Search for updated selection options.
1120         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks): Ditto.
1121         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Return selection group, if available.
1122         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
1123         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Filter out AVPlayerItemTracks without
1124             AVAssetTracks, as these will be represented by MediaSelectionGroupObjCs instead.
1125         
1126         Add new files to project.
1127         * WebCore.xcodeproj/project.pbxproj:
1128
1129 2014-10-17  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1130
1131         [EFL] window.screen.width returns wrong value if more displays are available
1132         https://bugs.webkit.org/show_bug.cgi?id=137778
1133
1134         Reviewed by Gyuyoung Kim.
1135
1136         ecore_x_screen_size_get() retrieves the size of Ecore_X_Screen, for example,
1137         having two displays of 1680x1050, it will return 3360x1050.
1138
1139         Unlike EFL's MiniBrowser, Firefox and Chrome return screen of the current display.
1140
1141         No new tests. Hardware specific bug including multiple displays.
1142
1143         * platform/efl/PlatformScreenEfl.cpp:
1144         (WebCore::screenRect):
1145         Use ecore's xrandr to determine the screen on which browser window is displayed.
1146
1147 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1148
1149         [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
1150         https://bugs.webkit.org/show_bug.cgi?id=137782
1151
1152         Reviewed by Sergio Villar Senin.
1153
1154         * platform/gtk/SharedTimerGtk.cpp:
1155         (WebCore::setSharedTimerFireInterval): Use microseconds instead of
1156         milliseconds.
1157
1158 2014-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1159
1160         [GTK] Move touch events handling from Platform to WebKit2
1161         https://bugs.webkit.org/show_bug.cgi?id=137735
1162
1163         Reviewed by Sergio Villar Senin.
1164
1165         Remove GtkTouchContextHelper.
1166
1167         * PlatformGTK.cmake:
1168         * platform/gtk/GtkTouchContextHelper.cpp: Removed.
1169         * platform/gtk/GtkTouchContextHelper.h: Removed.
1170
1171 2014-10-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1172
1173         Remove unused function in WorkerThreadableLoader.h 
1174         https://bugs.webkit.org/show_bug.cgi?id=137811
1175
1176         Reviewed by Csaba Osztrogon√°c.
1177
1178         mainThreadCreateLoader() isn't used anywhere. Even there is no implementation.
1179
1180         * loader/WorkerThreadableLoader.h:
1181
1182 2014-10-15  Yusuke Suzuki  <utatane.tea@gmail.com>
1183
1184         CSS Selectors Level 4: Implement :matches in SelectorChecker
1185         https://bugs.webkit.org/show_bug.cgi?id=137393
1186
1187         Reviewed by Benjamin Poulain.
1188
1189         In this patch, we introduce initial :matches implementation.
1190         In this current implementation, we don't consider pseudo elements.
1191
1192         Test: fast/selectors/querySelector-matches.html
1193
1194         * css/SelectorChecker.cpp:
1195         (WebCore::SelectorChecker::checkOne):
1196
1197 2014-10-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1198
1199         CSS JIT: Introduce StackAllocator::addressOf
1200         https://bugs.webkit.org/show_bug.cgi?id=137771
1201
1202         Reviewed by Benjamin Poulain.
1203
1204         Introduce StackAllocator::addressOf and drop offsetToStackReference, it's too primitive.
1205
1206         * cssjit/SelectorCompiler.cpp:
1207         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
1208         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateParentElementTreeWalker):
1209         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
1210         (WebCore::SelectorCompiler::SelectorCodeGenerator::loadCheckingContext):
1211         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
1212         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail):
1213         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
1214         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
1215         * cssjit/StackAllocator.h:
1216         (WebCore::StackAllocator::addressOf):
1217         (WebCore::StackAllocator::offsetToStackReference):
1218
1219 2014-10-16  Alexey Proskuryakov  <ap@apple.com>
1220
1221         REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website
1222         https://bugs.webkit.org/show_bug.cgi?id=137679
1223         rdar://problem/18450335
1224
1225         Reviewed by Enrica Casucci.
1226
1227         Test: platform/mac/editing/input/selected-composed-text-painting.html
1228
1229         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint
1230         selection beckground for unconfirmed text with underlines, so we should use a regular
1231         style for text painting, as well.
1232
1233 2014-10-16  Chris Dumez  <cdumez@apple.com>
1234
1235         Use is<>() / downcast<>() for BasicShape subclasses
1236         https://bugs.webkit.org/show_bug.cgi?id=137766
1237
1238         Reviewed by Andreas Kling.
1239
1240         Use is<>() / downcast<>() for BasicShape subclasses and clean up the
1241         surrounding code.
1242
1243         No new tests, no behavior change.
1244
1245         * css/BasicShapeFunctions.cpp:
1246         (WebCore::valueForBasicShape):
1247         (WebCore::basicShapeForValue):
1248         * css/BasicShapeFunctions.h:
1249         * css/CSSComputedStyleDeclaration.cpp:
1250         (WebCore::shapePropertyValue):
1251         * page/animation/CSSPropertyAnimation.cpp:
1252         (WebCore::blendFunc):
1253         * rendering/ClipPathOperation.h:
1254         (WebCore::ShapeClipPathOperation::create):
1255         Take a PassRef<BasicShape> in argument to make it obvious it is never
1256         null.
1257
1258         (WebCore::ShapeClipPathOperation::basicShape):
1259         Return a reference instead of a pointer as it can never return null.
1260
1261         (WebCore::ShapeClipPathOperation::windRule):
1262         (WebCore::ShapeClipPathOperation::pathForReferenceRect):
1263         Make it non-const due to the const-correctness of Ref::get().
1264
1265         (WebCore::ShapeClipPathOperation::ShapeClipPathOperation):
1266         * rendering/RenderBlock.cpp:
1267         (WebCore::RenderBlock::nodeAtPoint):
1268         * rendering/RenderLayer.cpp:
1269         (WebCore::RenderLayer::setupClipPath):
1270         * rendering/shapes/Shape.cpp:
1271         (WebCore::Shape::createShape):
1272         * rendering/shapes/Shape.h:
1273         * rendering/shapes/ShapeOutsideInfo.cpp:
1274         (WebCore::ShapeOutsideInfo::computedShape):
1275         * rendering/style/BasicShapes.cpp:
1276         (WebCore::BasicShape::canBlend):
1277         (WebCore::BasicShapeCircle::blend):
1278         (WebCore::BasicShapeEllipse::blend):
1279         (WebCore::BasicShapePolygon::blend):
1280         (WebCore::BasicShapeInset::blend):
1281         * rendering/style/BasicShapes.h:
1282         * rendering/svg/SVGRenderingContext.cpp:
1283         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1284
1285 2014-10-16  Chris Dumez  <cdumez@apple.com>
1286
1287         Leverage the new RenderElement::m_isCSSAnimating flag in more places
1288         https://bugs.webkit.org/show_bug.cgi?id=137786
1289
1290         Reviewed by Simon Fraser.
1291
1292         Leverage the new RenderElement::m_isCSSAnimating flag that was introduced
1293         in r174703 in more places, for performance. This avoids doing extra work
1294         for renderers on which we are not running animations on. This patch also
1295         updates the API a bit to use more references instead of pointers, making
1296         it clear the RenderElement cannot be null and thus avoiding unnecessary
1297         null checks.
1298
1299         No new tests, no behavior change.
1300
1301         * css/CSSComputedStyleDeclaration.cpp:
1302         (WebCore::computeRenderStyleForProperty):
1303         * page/animation/AnimationController.cpp:
1304         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
1305         (WebCore::AnimationControllerPrivate::clear):
1306         (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer):
1307         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
1308         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
1309         (WebCore::AnimationControllerPrivate::pauseAnimationAtTime):
1310         (WebCore::AnimationControllerPrivate::pauseTransitionAtTime):
1311         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
1312         (WebCore::AnimationController::cancelAnimations):
1313         (WebCore::AnimationController::updateAnimations):
1314         (WebCore::AnimationController::getAnimatedStyleForRenderer):
1315         (WebCore::AnimationController::notifyAnimationStarted):
1316         (WebCore::AnimationController::isRunningAnimationOnRenderer):
1317         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
1318         * page/animation/AnimationController.h:
1319         * page/animation/AnimationControllerPrivate.h:
1320         * rendering/RenderElement.cpp:
1321         (WebCore::RenderElement::willBeDestroyed):
1322         * rendering/RenderLayer.cpp:
1323         (WebCore::RenderLayer::currentTransform):
1324         * rendering/RenderLayerBacking.cpp:
1325         (WebCore::RenderLayerBacking::updateGeometry):
1326         (WebCore::RenderLayerBacking::notifyAnimationStarted):
1327         * rendering/RenderLayerCompositor.cpp:
1328         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1329         (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation):
1330
1331 2014-10-16  Adrien Destugues  <pulkomandy@gmail.com>
1332
1333         Missing RefPtr.release() calls in TextureMapper
1334         https://bugs.webkit.org/show_bug.cgi?id=137777
1335
1336         Reviewed by Chris Dumez.
1337
1338         No new tests: no functional change, cleanup/optimization.
1339
1340         Avoids useless ref/deref cycle when returning from functions.
1341
1342         * platform/graphics/texmap/TextureMapper.cpp:
1343         (WebCore::TextureMapper::acquireTextureFromPool):
1344         * platform/graphics/texmap/TextureMapperLayer.cpp:
1345         (WebCore::TextureMapperLayer::paintIntoSurface):
1346
1347 2014-10-16  Chris Dumez  <cdumez@apple.com>
1348
1349         Use is<>() / downcast<>() for ContentData subclasses
1350         https://bugs.webkit.org/show_bug.cgi?id=137768
1351
1352         Reviewed by Andreas Kling.
1353
1354         Use is<>() / downcast<>() for ContentData subclasses.
1355
1356         No new tests, no behavior change.
1357
1358         * css/CSSComputedStyleDeclaration.cpp:
1359         (WebCore::contentToCSSValue):
1360         * css/StyleResolver.cpp:
1361         (WebCore::StyleResolver::loadPendingImages):
1362         * rendering/RenderElement.cpp:
1363         (WebCore::RenderElement::createFor):
1364         * rendering/style/ContentData.h:
1365         (WebCore::operator==):
1366         * rendering/style/RenderStyle.cpp:
1367         (WebCore::RenderStyle::setContent):
1368
1369 2014-10-16  Commit Queue  <commit-queue@webkit.org>
1370
1371         Unreviewed, rolling out r174744.
1372         https://bugs.webkit.org/show_bug.cgi?id=137790
1373
1374         Caused another WebGL conformance test to fail (Requested by
1375         rfong on #webkit).
1376
1377         Reverted changeset:
1378
1379         "glReadPixels on NVIDIA cards returns the wrong values for the
1380         alpha channel when alpha is off."
1381         https://bugs.webkit.org/show_bug.cgi?id=137752
1382         http://trac.webkit.org/changeset/174744
1383
1384 2014-10-16  Tim Horton  <timothy_horton@apple.com>
1385
1386         Implement selection services menu for Legacy WebKit
1387         https://bugs.webkit.org/show_bug.cgi?id=137582
1388         <rdar://problem/18604241>
1389
1390         Reviewed by Brady Eidson.
1391
1392         * WebCore.exp.in:
1393         * editing/Editor.h:
1394         * editing/ios/EditorIOS.mm:
1395         (WebCore::Editor::replaceSelectionWithAttributedString):
1396         * editing/mac/EditorMac.mm:
1397         (WebCore::Editor::replaceSelectionWithAttributedString):
1398         Add replaceSelectionWithAttributedString, which replaces the selection
1399         with the given attributed string (converting to plain text if the destination
1400         is not richly editable).
1401
1402 2014-10-16  Alexey Proskuryakov  <ap@apple.com>
1403
1404         Crashes in ResourceHandleCFURLConnectionDelegateWithOperationQueue due to unimplemented retain/release
1405         https://bugs.webkit.org/show_bug.cgi?id=137779
1406         rdar://problem/18679320
1407
1408         Reviewed by Brady Eidson.
1409
1410         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
1411         (WebCore::ResourceHandleCFURLConnectionDelegate::retain):
1412         (WebCore::ResourceHandleCFURLConnectionDelegate::release):
1413         (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
1414         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
1415         Implemented retain/release. They are necessary, as ResourceHandle goes away when
1416         it's canceled, and there is noone else to keep the client object alive but
1417         CFURLConnection itself.
1418
1419         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1420         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
1421         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1422         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1423         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1424         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
1425         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
1426         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
1427         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
1428         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
1429         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
1430         Added a FIXME about potential improvements that I spotted while invsestigating this.
1431
1432 2014-10-15  Andrei Bucur  <abucur@adobe.com>
1433
1434         ASSERTION  FAILED in WebCore::RenderFlowThread::getRegionRangeForBox
1435         https://bugs.webkit.org/show_bug.cgi?id=135563
1436
1437         Reviewed by David Hyatt.
1438
1439         The new multi-column code doesn't work correctly when the document contains nested fragmentation
1440         contexts. The problem is the current flow thread concept that can store only one RenderFlowThread
1441         at a time and use it during layout.
1442
1443         The stored flow thread is always correct for regions because named flow threads are absolutley positioned
1444         so every child renderer is contained inside them (with the expcetion of fixed positioned elements which are
1445         treated separately).
1446
1447         For multi-column elements this is no longer the case. An absolutely positioned element inside a static
1448         multi-column element will be contained by a block outside the fragmentation context. It can even be
1449         contained by a different multi-column element in the case of nested flow threads.
1450
1451         The patch below explores a solution that's not based on a current flow thread stored globally. The proposed
1452         patch makes every block to store a pointer to its fragmentation context and a flag that states if this pointer
1453         needs to be updated or not. If the renderer is not a block it will get its flow thread from the containing
1454         block. Once the containing flow thread is requested for the block, the pointer is computed and cached until
1455         invalidated:
1456         - when a subtree is removed from a flow thread
1457         - when the position property of an element inside a flow thread changes
1458
1459         The process is recursive and it doesn't affect elements that are not nested inside a flow thread. If a block
1460         changes position from relative to static, any element that was contained by it can only be contained by an
1461         ancestor of the block. This ancestor will still be outside of any flow thread. This ensures that non-fragmentation
1462         code is not affected from a performance perspective.
1463
1464         The patch affects the results of the performance tests:
1465         - the regions layout tests have a decreased performance raging from 2% to 5-6%
1466         - the regions selection tests have an increased performance raging from 1-2% to 10%
1467         - the multicolumn layout tests (now pending review in b137687) have an increased performance
1468         raging from 1.8% to 5%
1469
1470         Tests: fast/multicol/multicol-all-positioned-crash.html
1471                fast/multicol/multicol-transform-containing-block.html
1472
1473         * rendering/FlowThreadController.cpp:
1474         (WebCore::FlowThreadController::FlowThreadController):
1475         * rendering/FlowThreadController.h:
1476         (WebCore::FlowThreadController::currentRenderFlowThread): Deleted.
1477         (WebCore::FlowThreadController::setCurrentRenderFlowThread): Deleted.
1478         * rendering/LayoutState.h:
1479         (WebCore::LayoutState::currentRenderFlowThread):
1480         (WebCore::LayoutState::setCurrentRenderFlowThread):
1481         * rendering/RenderBlock.cpp:
1482         (WebCore::RenderBlockRareData::RenderBlockRareData):
1483         (WebCore::RenderBlock::styleWillChange):
1484         (WebCore::RenderBlock::styleDidChange):
1485         (WebCore::RenderBlock::collapseAnonymousBoxChild):
1486         (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
1487         (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
1488         (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
1489         (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
1490         (WebCore::RenderBlock::locateFlowThreadContainingBlock):
1491         * rendering/RenderBlock.h:
1492         * rendering/RenderBlockFlow.cpp:
1493         (WebCore::RenderBlockFlow::styleWillChange):
1494         * rendering/RenderBox.cpp:
1495         (WebCore::RenderBox::borderBoxRectInRegion):
1496         * rendering/RenderFlowThread.cpp:
1497         (WebCore::RenderFlowThread::layout):
1498         (WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
1499         (WebCore::RenderFlowThread::repaintRectangleInRegions):
1500         (WebCore::CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer): Deleted.
1501         (WebCore::CurrentRenderFlowThreadMaintainer::~CurrentRenderFlowThreadMaintainer): Deleted.
1502         (WebCore::CurrentRenderFlowThreadDisabler::CurrentRenderFlowThreadDisabler): Deleted.
1503         (WebCore::CurrentRenderFlowThreadDisabler::~CurrentRenderFlowThreadDisabler): Deleted.
1504         * rendering/RenderFlowThread.h:
1505         * rendering/RenderLayer.cpp:
1506         (WebCore::RenderLayer::paintLayer):
1507         (WebCore::RenderLayer::hitTestLayer):
1508         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
1509         (WebCore::RenderLayer::calculateClipRects):
1510         * rendering/RenderObject.cpp:
1511         (WebCore::RenderObject::showRegionsInformation):
1512         (WebCore::RenderObject::insertedIntoTree):
1513         (WebCore::RenderObject::removeFromRenderFlowThread):
1514         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
1515         (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants):
1516         (WebCore::RenderObject::currentRenderNamedFlowFragment):
1517         (WebCore::RenderObject::locateFlowThreadContainingBlock):
1518         (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache): Deleted.
1519         (WebCore::RenderObject::removeFromRenderFlowThreadRecursive): Deleted.
1520         * rendering/RenderObject.h:
1521         (WebCore::RenderObject::flowThreadContainingBlock):
1522         * rendering/RenderRegion.cpp:
1523         (WebCore::RenderRegion::computeOverflowFromFlowThread):
1524         * rendering/RenderView.cpp:
1525         (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
1526         (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
1527         * rendering/RenderView.h:
1528
1529 2014-10-15  Chris Dumez  <cdumez@apple.com>
1530
1531         Use is<>() / downcast<>() for list-related render objects
1532         https://bugs.webkit.org/show_bug.cgi?id=137764
1533
1534         Reviewed by Benjamin Poulain.
1535
1536         Use is<>() / downcast<>() for list-related render objects and clean up
1537         the surrounding code.
1538
1539         No new tests, no behavior change.
1540
1541         * accessibility/AccessibilityListBox.cpp:
1542         (WebCore::AccessibilityListBox::visibleChildren):
1543         (WebCore::AccessibilityListBox::elementAccessibilityHitTest):
1544         * accessibility/AccessibilityListBoxOption.cpp:
1545         (WebCore::AccessibilityListBoxOption::elementRect):
1546         * accessibility/AccessibilityObject.cpp:
1547         (WebCore::renderListItemContainerForNode):
1548         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1549         (getRangeLengthForObject):
1550         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1551         (accessibilityObjectLength):
1552         (offsetAdjustmentForListItem):
1553         (webkitAccessibleTextGetText):
1554         * editing/BreakBlockquoteCommand.cpp:
1555         (WebCore::BreakBlockquoteCommand::doApply):
1556         * html/HTMLLIElement.cpp:
1557         (WebCore::HTMLLIElement::didAttachRenderers):
1558         (WebCore::HTMLLIElement::parseValue):
1559         * html/HTMLSelectElement.cpp:
1560         (WebCore::HTMLSelectElement::nextSelectableListIndexPageAway):
1561         (WebCore::HTMLSelectElement::scrollToSelection):
1562         (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
1563         (WebCore::HTMLSelectElement::selectOption):
1564         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
1565         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
1566         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
1567         * html/HTMLSelectElementWin.cpp:
1568         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
1569         * page/mac/EventHandlerMac.mm:
1570         (WebCore::EventHandler::platformPrepareForWheelEvents):
1571         * rendering/InlineFlowBox.cpp:
1572         (WebCore::InlineFlowBox::addToLine):
1573         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
1574         * rendering/RenderCounter.cpp:
1575         (WebCore::planCounter):
1576         * rendering/RenderListBox.h:
1577         * rendering/RenderListItem.cpp:
1578         (WebCore::nextListItem):
1579         (WebCore::previousListItem):
1580         * rendering/RenderListItem.h:
1581         * rendering/RenderListMarker.h:
1582         * rendering/RenderMenuList.h:
1583         * rendering/RenderTreeAsText.cpp:
1584         (WebCore::markerTextForListItem):
1585         * rendering/TextAutoSizing.cpp:
1586         (WebCore::TextAutoSizingValue::adjustNodeSizes):
1587         * rendering/line/BreakingContextInlineHeaders.h:
1588         (WebCore::BreakingContext::handleReplaced):
1589         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
1590         * testing/Internals.cpp:
1591         (WebCore::Internals::isSelectPopupVisible):
1592
1593 2014-10-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1594
1595         Use std::unique_ptr for CachedResource
1596         https://bugs.webkit.org/show_bug.cgi?id=137736
1597
1598         Reviewed by Darin Adler.
1599
1600         No new tests, no behavior change.
1601
1602         * loader/cache/CachedResource.cpp: Use std::unique_ptr instead of PassOwnPtr|OwnPtr.
1603         (WebCore::CachedResource::removeClient):
1604         * loader/cache/CachedResource.h: Set ctor from private to public.
1605         (WebCore::CachedResource::CachedResourceCallback::schedule):
1606
1607 2014-10-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1608
1609         Move TextCodec classes to std::unique_ptr
1610         https://bugs.webkit.org/show_bug.cgi?id=137738
1611
1612         Reviewed by Darin Adler.
1613
1614         Replace uses of PassOwnPtr in code under TextCodecFoo class with std::unique_ptr.
1615         To do this, ctor of TextCodecFoo classes is changed from private to public. Besides
1616         related classes follow this change as well.
1617
1618         No new tests, no behavior change.
1619
1620         * html/parser/HTMLMetaCharsetParser.h:
1621         * loader/TextResourceDecoder.cpp:
1622         (WebCore::TextResourceDecoder::setEncoding):
1623         (WebCore::TextResourceDecoder::flush):
1624         * loader/TextResourceDecoder.h:
1625         * platform/text/TextCodec.h:
1626         * platform/text/TextCodecICU.cpp:
1627         (WebCore::TextCodecICU::create):
1628         * platform/text/TextCodecICU.h:
1629         * platform/text/TextCodecLatin1.cpp:
1630         (WebCore::newStreamingTextDecoderWindowsLatin1):
1631         * platform/text/TextCodecUTF16.cpp:
1632         (WebCore::newStreamingTextDecoderUTF16LE):
1633         (WebCore::newStreamingTextDecoderUTF16BE):
1634         * platform/text/TextCodecUTF8.cpp:
1635         (WebCore::TextCodecUTF8::create):
1636         * platform/text/TextCodecUTF8.h:
1637         * platform/text/TextCodecUserDefined.cpp:
1638         (WebCore::newStreamingTextDecoderUserDefined):
1639         * platform/text/TextEncodingRegistry.cpp:
1640         (WebCore::newTextCodec):
1641         * platform/text/TextEncodingRegistry.h:
1642         * platform/text/mac/TextCodecMac.cpp:
1643         (WebCore::newTextCodecMac):
1644
1645 2014-10-15  Dean Jackson  <dino@apple.com>
1646
1647         [Media] Reduce style updates (painting) in controls
1648         https://bugs.webkit.org/show_bug.cgi?id=137763
1649         <rdar://problem/17833045>
1650
1651         Reviewed by Simon Fraser.
1652
1653         Media controls were causing a lot of repaints they were
1654         constantly updating the style of the widgets, the value
1655         of the forms, or the text in the display.
1656
1657         This is necessary when the controls are visible, but not
1658         necessary when they are hidden. Return immediately in that case.
1659
1660         * Modules/mediacontrols/mediaControlsApple.js:
1661         (Controller.prototype.createControls): Initialise the slider to a zero value.
1662         (Controller.prototype.handleDurationChange): Force an update even though we might be hidden.
1663         (Controller.prototype.updateProgress): Don't update if we're hidden.
1664         (Controller.prototype.updateTime): Ditto.
1665         * Modules/mediacontrols/mediaControlsiOS.js:
1666         (ControllerIOS.prototype.updateProgress): Ditto.
1667
1668 2014-10-15  Chris Dumez  <cdumez@apple.com>
1669
1670         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel) - Part 2
1671         https://bugs.webkit.org/show_bug.cgi?id=137721
1672
1673         Reviewed by Darin Adler.
1674
1675         Follow-up patch to r174717 addressing review comments made after the patch landed:
1676         - Use modern C++ loop
1677         - Remove explicit calls to String(NSString*) constructor
1678
1679         No new tests, no new tests.
1680
1681         * platform/network/mac/ResourceResponseMac.mm:
1682         (WebCore::ResourceResponse::platformLazyInit):
1683
1684 2014-10-15  Chris Dumez  <cdumez@apple.com>
1685
1686         Use is<>() / downcast<>() for InlineBox subclasses
1687         https://bugs.webkit.org/show_bug.cgi?id=137749
1688
1689         Reviewed by Darin Adler.
1690
1691         Use is<>() / downcast<>() for InlineBox subclasses and clean up the
1692         surrounding code.
1693
1694         No new tests, no behavior change.
1695
1696         * dom/Position.cpp:
1697         (WebCore::Position::upstream):
1698         (WebCore::Position::downstream):
1699         * editing/VisibleUnits.cpp:
1700         (WebCore::wordBreakIteratorForMinOffsetBoundary):
1701         (WebCore::wordBreakIteratorForMaxOffsetBoundary):
1702         (WebCore::visualWordPosition):
1703         (WebCore::startPositionForLine):
1704         (WebCore::endPositionForLine):
1705         * rendering/InlineBox.cpp:
1706         (WebCore::InlineBox::root):
1707         (WebCore::InlineBox::nextLeafChild):
1708         (WebCore::InlineBox::prevLeafChild):
1709         (WebCore::InlineBox::nextLeafChildIgnoringLineBreak):
1710         * rendering/InlineBox.h:
1711         * rendering/InlineElementBox.h:
1712         * rendering/InlineFlowBox.cpp:
1713         (WebCore::InlineFlowBox::getFlowSpacingLogicalWidth):
1714         (WebCore::InlineFlowBox::addToLine):
1715         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
1716         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection):
1717         (WebCore::InlineFlowBox::requiresIdeographicBaseline):
1718         (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
1719         (WebCore::InlineFlowBox::computeLogicalBoxHeights):
1720         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1721         (WebCore::InlineFlowBox::computeMaxLogicalTop):
1722         (WebCore::InlineFlowBox::flipLinesInBlockDirection):
1723         (WebCore::InlineFlowBox::computeOverflow):
1724         (WebCore::InlineFlowBox::firstLeafChild):
1725         (WebCore::InlineFlowBox::lastLeafChild):
1726         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
1727         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment):
1728         * rendering/InlineFlowBox.h:
1729         * rendering/InlineTextBox.h:
1730         * rendering/RenderBlockFlow.cpp:
1731         (WebCore::RenderBlockFlow::positionForBox):
1732         * rendering/RenderBlockFlow.h:
1733         (WebCore::RenderBlockFlow::firstRootBox):
1734         (WebCore::RenderBlockFlow::lastRootBox):
1735         * rendering/RenderBlockLineLayout.cpp:
1736         (WebCore::RenderBlockFlow::createLineBoxes):
1737         (WebCore::RenderBlockFlow::constructLine):
1738         (WebCore::setLogicalWidthForTextRun):
1739         (WebCore::computeExpansionForJustifiedText):
1740         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1741         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine):
1742         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
1743         * rendering/RenderText.cpp:
1744         (WebCore::RenderText::localCaretRect):
1745         * rendering/RootInlineBox.cpp:
1746         (WebCore::RootInlineBox::isHyphenated):
1747         (WebCore::RootInlineBox::ascentAndDescentForBox):
1748         * rendering/RootInlineBox.h:
1749         (WebCore::RootInlineBox::nextRootBox):
1750         (WebCore::RootInlineBox::prevRootBox):
1751         * rendering/svg/RenderSVGInlineText.cpp:
1752         (WebCore::RenderSVGInlineText::localCaretRect):
1753         (WebCore::RenderSVGInlineText::positionForPoint):
1754         * rendering/svg/RenderSVGText.cpp:
1755         (WebCore::RenderSVGText::positionForPoint):
1756         * rendering/svg/SVGInlineFlowBox.cpp:
1757         (WebCore::SVGInlineFlowBox::paintSelectionBackground):
1758         (WebCore::SVGInlineFlowBox::paint):
1759         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
1760         * rendering/svg/SVGInlineFlowBox.h:
1761         * rendering/svg/SVGInlineTextBox.h:
1762         * rendering/svg/SVGRenderTreeAsText.cpp:
1763         (WebCore::writeRenderSVGTextBox):
1764         (WebCore::writeSVGInlineTextBoxes):
1765         * rendering/svg/SVGRootInlineBox.cpp:
1766         (WebCore::SVGRootInlineBox::paint):
1767         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes):
1768         (WebCore::SVGRootInlineBox::layoutChildBoxes):
1769         (WebCore::reverseInlineBoxRangeAndValueListsIfNeeded):
1770         * rendering/svg/SVGRootInlineBox.h:
1771         * rendering/svg/SVGTextQuery.cpp:
1772         (WebCore::SVGTextQuery::collectTextBoxesInFlowBox):
1773
1774 2014-10-15  Roger Fong  <roger_fong@apple.com>
1775
1776         glReadPixels on NVIDIA cards returns the wrong values for the alpha channel when alpha is off.
1777         https://bugs.webkit.org/show_bug.cgi?id=137752.
1778         <rdar://problem/15408133>
1779
1780         Reviewed by Brent Fulgham.
1781
1782         This change fixed the 1.0.2 conformance test: context/context-attribute-preserve-drawing-buffer.html
1783
1784         * platform/graphics/GraphicsContext3D.h:
1785         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1786         Manually set the alpha channel to 255 when alpha is off on the rendering context.
1787
1788 2014-10-13  Chris Fleizach  <cfleizach@apple.com>
1789
1790         AX: Going back is broken for VoiceOver
1791         https://bugs.webkit.org/show_bug.cgi?id=137382
1792
1793         Reviewed by Darin Adler.
1794
1795         There were two issues preventing VoiceOver from navigating when using page history to go back/forward.
1796           1) Existing AXLoadComplete does not get fired when you just move through page history. 
1797                There were existing frameLoad notifications used by GTK. I think we should use those which seem more reliable.
1798           2) The AccessibilityScrollView cached its children, but on some history page loads, that cache was never cleared out.
1799                Rather than trying to find those places to clear out the cache, it's easier to just add the elements to the children
1800                array everytime it's asked for. Since there's only ever 3 elements (web area + 2 scroll bars) this should not be a performance hit.
1801
1802         Tests are not possible since they require monitoring notifications across multiple page loads.
1803
1804         * accessibility/AXObjectCache.h:
1805         * accessibility/AccessibilityScrollView.cpp:
1806         (WebCore::AccessibilityScrollView::updateChildrenIfNecessary):
1807         * accessibility/ios/AXObjectCacheIOS.mm:
1808         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1809         * accessibility/mac/AXObjectCacheMac.mm:
1810         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
1811         * dom/Document.cpp:
1812         (WebCore::Document::implicitClose):
1813
1814 2014-10-15  Simon Fraser  <simon.fraser@apple.com>
1815
1816         Sometimes can't scroll overflow:scroll areas in subframes
1817         https://bugs.webkit.org/show_bug.cgi?id=137746
1818         rdar://problem/18603560
1819
1820         Reviewed by Tim Horton.
1821         
1822         r169733 introduced a regression which caused us to no longer update the non-fast
1823         scrollable region on every layout in subframes, by adding a bogus isMainFrame() check.
1824         Revert to the previous code.
1825
1826         Test: platform/mac-wk2/tiled-drawing/scrolling/frames/scroll-region-after-frame-layout.html
1827
1828         * page/scrolling/AsyncScrollingCoordinator.cpp:
1829         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1830
1831 2014-10-15  Chris Dumez  <cdumez@apple.com>
1832
1833         Use is<>() / downcast<>() for TransformOperation subclasses
1834         https://bugs.webkit.org/show_bug.cgi?id=137731
1835
1836         Reviewed by Darin Adler.
1837
1838         Use is<>() / downcast<>() for TransformOperation subclasses and clean
1839         up the surrounding code.
1840
1841         No new tests, no behavior change.
1842
1843         * platform/graphics/GraphicsLayer.cpp:
1844         (WebCore::GraphicsLayer::validateTransformOperations):
1845         * platform/graphics/ca/GraphicsLayerCA.cpp:
1846         (WebCore::getTransformFunctionValue):
1847         * platform/graphics/transforms/IdentityTransformOperation.h:
1848         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1849         (WebCore::Matrix3DTransformOperation::operator==):
1850         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1851         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1852         (WebCore::MatrixTransformOperation::operator==):
1853         (WebCore::MatrixTransformOperation::blend):
1854         * platform/graphics/transforms/MatrixTransformOperation.h:
1855         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1856         (WebCore::PerspectiveTransformOperation::operator==):
1857         (WebCore::PerspectiveTransformOperation::blend):
1858         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1859         * platform/graphics/transforms/RotateTransformOperation.cpp:
1860         (WebCore::RotateTransformOperation::operator==):
1861         (WebCore::RotateTransformOperation::blend):
1862         * platform/graphics/transforms/RotateTransformOperation.h:
1863         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1864         (WebCore::ScaleTransformOperation::operator==):
1865         (WebCore::ScaleTransformOperation::blend):
1866         * platform/graphics/transforms/ScaleTransformOperation.h:
1867         * platform/graphics/transforms/SkewTransformOperation.cpp:
1868         (WebCore::SkewTransformOperation::operator==):
1869         (WebCore::SkewTransformOperation::blend):
1870         * platform/graphics/transforms/SkewTransformOperation.h:
1871         * platform/graphics/transforms/TransformOperation.h:
1872         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1873         (WebCore::TranslateTransformOperation::operator==):
1874         (WebCore::TranslateTransformOperation::blend):
1875         * platform/graphics/transforms/TranslateTransformOperation.h:
1876
1877 2014-10-15  Chris Dumez  <cdumez@apple.com>
1878
1879         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine
1880         https://bugs.webkit.org/show_bug.cgi?id=137727
1881
1882         Reviewed by Darin Adler.
1883
1884         Use is<>() / downcast<>() for RenderTextControl / RenderTextControlSingleLine.
1885
1886         No new tests, no behavior change.
1887
1888         * accessibility/AccessibilityRenderObject.cpp:
1889         (WebCore::AccessibilityRenderObject::selectedText):
1890         (WebCore::AccessibilityRenderObject::selectedTextRange):
1891         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1892         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
1893         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
1894         * editing/TextIterator.cpp:
1895         (WebCore::TextIterator::handleReplacedElement):
1896         * html/TextFieldInputType.cpp:
1897         (WebCore::TextFieldInputType::forwardEvent):
1898         * html/shadow/TextControlInnerElements.cpp:
1899         (WebCore::TextControlInnerElement::customStyleForRenderer):
1900         * page/EventHandler.cpp:
1901         (WebCore::EventHandler::capsLockStateMayHaveChanged):
1902         * page/ios/FrameIOS.mm:
1903         (WebCore::ancestorRespondingToScrollWheelEvents):
1904         * rendering/RenderTextControl.h:
1905         * rendering/RenderTextControlSingleLine.h:
1906         * rendering/SimpleLineLayout.cpp:
1907         (WebCore::SimpleLineLayout::canUseFor):
1908
1909 2014-10-15  Chris Dumez  <cdumez@apple.com>
1910
1911         Use is<>() / downcast<>() for ClipPathOperation subclasses
1912         https://bugs.webkit.org/show_bug.cgi?id=137733
1913
1914         Reviewed by Mihnea Ovidenie.
1915
1916         Use is<>() / downcast<>() for ClipPathOperation subclasses.
1917
1918         No new tests, no behavior change.
1919
1920         * css/CSSComputedStyleDeclaration.cpp:
1921         (WebCore::ComputedStyleExtractor::propertyValue):
1922         * css/DeprecatedStyleBuilder.cpp:
1923         (WebCore::ApplyPropertyClipPath::applyValue):
1924         * rendering/ClipPathOperation.h:
1925         * rendering/RenderBlock.cpp:
1926         (WebCore::RenderBlock::nodeAtPoint):
1927         * rendering/RenderLayer.cpp:
1928         (WebCore::RenderLayer::setupClipPath):
1929         * rendering/svg/SVGRenderingContext.cpp:
1930         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1931
1932 2014-10-15  Chris Dumez  <cdumez@apple.com>
1933
1934         [Mac] Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable()
1935         https://bugs.webkit.org/show_bug.cgi?id=137723
1936
1937         Reviewed by Simon Fraser.
1938
1939         Use CFDictionaryContainsKey() in ImageSource::isSizeAvailable() instead
1940         of CFDictionaryGetValue() as we are not actually interested in the
1941         value.
1942
1943         No new tests, no behavior change.
1944
1945         * platform/graphics/cg/ImageSourceCG.cpp:
1946         (WebCore::ImageSource::isSizeAvailable):
1947
1948 2014-10-15  Mihnea Ovidenie  <mihnea@adobe.com>
1949
1950         Use modern loops in subtrees selection code
1951         https://bugs.webkit.org/show_bug.cgi?id=137688
1952
1953         Reviewed by Andreas Kling.
1954
1955         No new tests as no change in functionality.
1956
1957         * rendering/RenderView.cpp:
1958         (WebCore::RenderView::splitSelectionBetweenSubtrees):
1959         (WebCore::RenderView::updateSelectionForSubtrees):
1960         (WebCore::RenderView::clearSubtreeSelection):
1961         (WebCore::RenderView::applySubtreeSelection):
1962         * rendering/RenderView.h:
1963
1964 2014-10-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1965
1966         Clean up unnecessary PassOwnPtr.h inclusion
1967         https://bugs.webkit.org/show_bug.cgi?id=137726
1968
1969         Reviewed by Chris Dumez.
1970
1971         No new tests, no behavior changes.
1972
1973         * dom/Document.h: Remove PassOwnPtr.h inclusion.
1974         * loader/ResourceBuffer.h: ditto.
1975         * loader/cocoa/DiskCacheMonitorCocoa.mm: ditto.
1976         * page/scrolling/AxisScrollSnapOffsets.h: ditto.
1977         * page/scrolling/ScrollingStateScrollingNode.h: ditto.
1978         * platform/ColorChooserClient.h: ditto.
1979         * platform/ScrollableArea.cpp: ditto.
1980         * platform/ScrollbarThemeClient.h: ditto.
1981         * platform/SharedBuffer.cpp: ditto.
1982         * platform/Supplementable.h: ditto.
1983         * platform/graphics/surfaces/GraphicsSurface.h: ditto.
1984         * platform/graphics/surfaces/GraphicsSurfaceToken.h: ditto.
1985         * platform/graphics/win/WKCAImageQueue.cpp: ditto.
1986         * platform/win/CursorWin.cpp: ditto.
1987
1988 2014-10-14  Chris Dumez  <cdumez@apple.com>
1989
1990         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
1991         https://bugs.webkit.org/show_bug.cgi?id=137728
1992
1993         Reviewed by Benjamin Poulain.
1994
1995         Have offsetFromContainer() / offsetFromAncestorContainer() take a RenderElement&
1996         instead of a RenderObject*. The argument passed is never null and the type
1997         should be a RenderElement as the argument is a container.
1998
1999         No new tests, no behavior change.
2000
2001         * editing/htmlediting.cpp:
2002         (WebCore::localCaretRectInRendererForCaretPainting):
2003         * page/GestureTapHighlighter.cpp:
2004         * rendering/RenderBox.cpp:
2005         (WebCore::RenderBox::mapLocalToContainer):
2006         (WebCore::RenderBox::pushMappingToContainer):
2007         (WebCore::RenderBox::offsetFromContainer):
2008         (WebCore::RenderBox::computeRectForRepaint):
2009         * rendering/RenderBox.h:
2010         * rendering/RenderBoxModelObject.cpp:
2011         (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
2012         * rendering/RenderInline.cpp:
2013         (WebCore::RenderInline::computeRectForRepaint):
2014         (WebCore::RenderInline::offsetFromContainer):
2015         (WebCore::RenderInline::mapLocalToContainer):
2016         (WebCore::RenderInline::pushMappingToContainer):
2017         * rendering/RenderInline.h:
2018         * rendering/RenderMultiColumnFlowThread.cpp:
2019         (WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
2020         * rendering/RenderMultiColumnFlowThread.h:
2021         * rendering/RenderNamedFlowFragment.cpp:
2022         (WebCore::RenderNamedFlowFragment::offsetFromContainer):
2023         * rendering/RenderNamedFlowFragment.h:
2024         * rendering/RenderObject.cpp:
2025         (WebCore::RenderObject::offsetFromContainer):
2026         (WebCore::RenderObject::offsetFromAncestorContainer):
2027         * rendering/RenderObject.h:
2028         * rendering/RenderTableCell.cpp:
2029         (WebCore::RenderTableCell::offsetFromContainer):
2030         * rendering/RenderTableCell.h:
2031         * rendering/RenderThemeMac.mm:
2032         (WebCore::RenderThemeMac::convertToPaintingRect):
2033
2034 2014-10-14  Jer Noble  <jer.noble@apple.com>
2035
2036         REGRESSION (r159208): Crash when clicking scrubber after navigating away/back to video
2037         https://bugs.webkit.org/show_bug.cgi?id=137715
2038
2039         Reviewed by Darin Adler.
2040
2041         Simple null-check of m_player in refreshCachedTime.
2042
2043         * html/HTMLMediaElement.cpp:
2044         (WebCore::HTMLMediaElement::refreshCachedTime):
2045
2046 2014-10-14  Chris Dumez  <cdumez@apple.com>
2047
2048         [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel)
2049         https://bugs.webkit.org/show_bug.cgi?id=137721
2050
2051         Reviewed by Geoffrey Garen.
2052
2053         There were several inefficiencies with the Mac implementation of
2054         ResourceResponse::platformLazyInit(InitLevel):
2055         1. We end up initializing uncommon fields even if called with
2056            'CommonFieldsOnly' initLevel.
2057         2. If called with 'AllFields' initLevel (and if currently
2058            uninitialized), we end up populating m_httpHeaderFields twice, once
2059            with only the common headers, then a second time with ALL the
2060            headers. We can skip the common-header case in this case to avoid
2061            wasting CPU time.
2062
2063         This patch addresses both inefficiencies and cleans up the code a
2064         little bit to reduce variable scope and to use fast enumeration of
2065         header names.
2066
2067         As a result, we spend almost twice as little time in platformLazyInit()
2068         when loading msn.com (~30ms -> ~18ms).
2069
2070         No new tests, no behavior change.
2071
2072         * platform/network/mac/ResourceResponseMac.mm:
2073         (WebCore::ResourceResponse::platformLazyInit):
2074
2075 2014-10-14  Zalan Bujtas  <zalan@apple.com>
2076
2077         REGRESSION (Safari 7.1/8.0): Border-radius and overflow hidden renders incorrectly.
2078         https://bugs.webkit.org/show_bug.cgi?id=137205
2079
2080         Reviewed by Simon Fraser.
2081
2082         Child layer should not reset radius clipping behaviour.
2083
2084         Test: fast/layers/parent-clipping-overflow-is-overwritten-by-child-clipping.html
2085
2086         * rendering/RenderLayer.cpp:
2087         (WebCore::RenderLayer::calculateClipRects):
2088
2089 2014-10-14  Chris Dumez  <cdumez@apple.com>
2090
2091         Use is<>() / downcast<>() for PlatformCAAnimation subclasses
2092         https://bugs.webkit.org/show_bug.cgi?id=137722
2093
2094         Reviewed by Simon Fraser.
2095
2096         Use is<>() / downcast<>() for PlatformCAAnimation subclasses and clean
2097         up the surrounding code.
2098
2099         No new tests, no behavior change.
2100
2101         * page/mac/ServicesOverlayController.mm:
2102         (WebCore::ServicesOverlayController::Highlight::fadeIn):
2103         (WebCore::ServicesOverlayController::Highlight::fadeOut):
2104         * platform/graphics/ca/GraphicsLayerCA.cpp:
2105         (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation):
2106         (WebCore::GraphicsLayerCA::updateAnimations):
2107         (WebCore::GraphicsLayerCA::setAnimationOnLayer):
2108         (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
2109         * platform/graphics/ca/GraphicsLayerCA.h:
2110         * platform/graphics/ca/PlatformCAAnimation.h:
2111         * platform/graphics/ca/PlatformCALayer.h:
2112         * platform/graphics/ca/mac/PlatformCAAnimationMac.h:
2113         * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
2114         (PlatformCAAnimationMac::copy):
2115         (PlatformCAAnimationMac::copyTimingFunctionFrom):
2116         (PlatformCAAnimationMac::copyFromValueFrom):
2117         (PlatformCAAnimationMac::copyToValueFrom):
2118         (PlatformCAAnimationMac::copyValuesFrom):
2119         (PlatformCAAnimationMac::copyKeyTimesFrom):
2120         (PlatformCAAnimationMac::copyTimingFunctionsFrom):
2121         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2122         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2123         (PlatformCALayerMac::addAnimationForKey):
2124         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
2125         (PlatformCAAnimationWin::copy):
2126         (PlatformCAAnimationWin::copyTimingFunctionFrom):
2127         (PlatformCAAnimationWin::copyFromValueFrom):
2128         (PlatformCAAnimationWin::copyToValueFrom):
2129         (PlatformCAAnimationWin::copyValuesFrom):
2130         (PlatformCAAnimationWin::copyKeyTimesFrom):
2131         (PlatformCAAnimationWin::copyTimingFunctionsFrom):
2132         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
2133         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2134         (PlatformCALayerWin::addAnimationForKey):
2135         * platform/graphics/ca/win/PlatformCALayerWin.h:
2136
2137 2014-10-14  Chris Dumez  <cdumez@apple.com>
2138
2139         Use is<>() / downcast<>() for RenderInline
2140         https://bugs.webkit.org/show_bug.cgi?id=137704
2141
2142         Reviewed by Darin Adler.
2143
2144         Use is<>() / downcast<>() for RenderInline and clean up the surrounding
2145         code.
2146
2147         No new tests, no behavior change.
2148
2149         * accessibility/AccessibilityRenderObject.cpp:
2150         (WebCore::firstChildInContinuation):
2151         * editing/SimplifyMarkupCommand.cpp:
2152         (WebCore::SimplifyMarkupCommand::doApply):
2153         * inspector/InspectorOverlay.cpp:
2154         (WebCore::buildRendererHighlight):
2155         * page/FrameView.cpp:
2156         (WebCore::FrameView::paintContents):
2157         * rendering/InlineFlowBox.cpp:
2158         (WebCore::InlineFlowBox::removeLineBoxFromRenderObject):
2159         (WebCore::InlineFlowBox::extractLineBoxFromRenderObject):
2160         (WebCore::InlineFlowBox::attachLineBoxToRenderObject):
2161         (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
2162         (WebCore::InlineFlowBox::nodeAtPoint):
2163         (WebCore::InlineFlowBox::paint):
2164         * rendering/InlineIterator.h:
2165         (WebCore::bidiFirstSkippingEmptyInlines):
2166         * rendering/LayoutState.cpp:
2167         (WebCore::LayoutState::LayoutState):
2168         * rendering/RenderBlock.cpp:
2169         (WebCore::RenderBlock::willBeDestroyed):
2170         (WebCore::RenderBlock::paintObject):
2171         (WebCore::RenderBlock::inlineElementContinuation):
2172         (WebCore::RenderBlock::addFocusRingRects):
2173         * rendering/RenderBlockFlow.cpp:
2174         (WebCore::RenderBlockFlow::willBeDestroyed):
2175         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2176         * rendering/RenderBlockFlow.h:
2177         * rendering/RenderBlockLineLayout.cpp:
2178         (WebCore::constructBidiRunsForSegment):
2179         (WebCore::RenderBlockFlow::layoutLineBoxes):
2180         * rendering/RenderBox.cpp:
2181         (WebCore::RenderBox::offsetFromContainer):
2182         (WebCore::RenderBox::computeRectForRepaint):
2183         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
2184         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
2185         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2186         (WebCore::RenderBox::computePositionedLogicalWidthReplaced):
2187         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2188         * rendering/RenderBoxModelObject.cpp:
2189         (WebCore::accumulateInFlowPositionOffsets):
2190         * rendering/RenderElement.cpp:
2191         (WebCore::RenderElement::willBeRemovedFromTree):
2192         * rendering/RenderElement.h:
2193         (WebCore::RenderElement::dirtyLinesFromChangedChild):
2194         * rendering/RenderFlowThread.cpp:
2195         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
2196         * rendering/RenderInline.cpp:
2197         (WebCore::RenderInline::willBeDestroyed):
2198         (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
2199         (WebCore::RenderInline::clippedOverflowRectForRepaint):
2200         * rendering/RenderInline.h:
2201         * rendering/RenderLayer.cpp:
2202         (WebCore::RenderLayer::updateLayerPosition):
2203         (WebCore::RenderLayer::calculateClipRects):
2204         * rendering/RenderLineBoxList.cpp:
2205         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
2206         * rendering/RenderLineBoxList.h:
2207         * rendering/RenderNamedFlowThread.cpp:
2208         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
2209         * rendering/RenderObject.cpp:
2210         (WebCore::RenderObject::insertedIntoTree):
2211         * rendering/RenderRegion.cpp:
2212         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
2213         (WebCore::RenderRegion::visualOverflowRectForBox):
2214         (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
2215         * rendering/RenderRegion.h:
2216         * rendering/RenderReplaced.cpp:
2217         (WebCore::RenderReplaced::willBeDestroyed):
2218         * rendering/RenderTextLineBoxes.cpp:
2219         (WebCore::RenderTextLineBoxes::removeAllFromParent):
2220         (WebCore::RenderTextLineBoxes::dirtyRange):
2221         * rendering/line/BreakingContextInlineHeaders.h:
2222         (WebCore::inlineLogicalWidth):
2223         (WebCore::BreakingContext::handleEmptyInline):
2224         * rendering/line/LineInlineHeaders.h:
2225         (WebCore::requiresLineBox):
2226         (WebCore::setStaticPositions):
2227         * rendering/svg/SVGInlineTextBox.cpp:
2228         (WebCore::SVGInlineTextBox::paint):
2229
2230 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2231
2232         [Win] Unreviewed build fix after r174710.
2233
2234         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2235         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
2236
2237 2014-10-14  Dan Bernstein  <mitz@apple.com>
2238
2239         URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior
2240         https://bugs.webkit.org/show_bug.cgi?id=137718
2241
2242         Reviewed by Alexey Proskuryakov.
2243
2244         Added cases to fast/loader/url-parse-1.html.
2245
2246         * platform/URL.cpp:
2247         (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional
2248         slashes after the ://, as prescribed by the authority-ignore-slashes state in the current
2249         URL spec.
2250
2251 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2252
2253         [Win] Unreviewed build fix after r174698 and r174709.
2254
2255         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2256         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2257         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2258         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
2259         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2260         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2261
2262 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2263
2264         [Win] Unreviewed build fix after r174698
2265
2266         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2267         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2268         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2269         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
2270
2271 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
2272
2273         Improve debug description of WAKViews
2274         https://bugs.webkit.org/show_bug.cgi?id=137716
2275
2276         Reviewed by Simon Fraser.
2277
2278         No new tests because there is no behavior change.
2279
2280         * platform/ios/wak/WAKView.mm:
2281         (-[WAKView description]):
2282         * platform/ios/wak/WKView.h:
2283         * platform/ios/wak/WKView.mm:
2284         (WKViewGetOrigin):
2285
2286 2014-10-14  Chris Dumez  <cdumez@apple.com>
2287
2288         Introduce an isCSSAnimated flag on RenderElement for performance
2289         https://bugs.webkit.org/show_bug.cgi?id=137583
2290
2291         Reviewed by Simon Fraser.
2292
2293         I noticed when profiling the ebay.com page load that isRunningAnimationOnRenderer()
2294         and isRunningAcceleratedAnimationOnRenderer() were called frequently, causing
2295         ~4.7 millions m_compositeAnimations HashMap lookups.
2296
2297         This patch introduces an isCSSAnimated flag on RenderElement to return early if
2298         there is no animation on the renderer, thus avoiding HashMap lookups. This reduces
2299         the number of HashMap lookups from ~4.7 millions to ~68k. On my machine, I see
2300         the following performance improvements:
2301         - isRunning*AnimationOnRenderer() / computeCompositingRequirements()
2302           - before: ~45ms  / ~90ms
2303           - after:  ~4ms / ~30ms
2304
2305         No new tests, no behavior change.
2306
2307         * page/animation/AnimationController.cpp:
2308         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
2309         (WebCore::AnimationControllerPrivate::clear):
2310         (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer):
2311         (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer):
2312         (WebCore::AnimationController::isRunningAnimationOnRenderer):
2313         (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer):
2314         * rendering/RenderElement.cpp:
2315         (WebCore::RenderElement::RenderElement):
2316         * rendering/RenderElement.h:
2317         (WebCore::RenderElement::isCSSAnimating):
2318         (WebCore::RenderElement::setIsCSSAnimating):
2319
2320 2014-10-14  Dean Jackson  <dino@apple.com>
2321
2322         Crash in WebCore::UserGestureIndicator::processingUserGesture with WebWorkers
2323         https://bugs.webkit.org/show_bug.cgi?id=137676
2324         <rdar://problem/15735049>
2325
2326         Reviewed by Alexey Proskuryakov.
2327
2328         Remove the code I added that tracks the timestamp of the most recent
2329         user gesture from the event handling dispatch, as it was both
2330         a silly place to do it and it originally crashed when events were fired from
2331         Worker threads (although this was fixed in r152238).
2332
2333         It's now recorded by going through UserGestureIndicator, which is good because
2334         it knows when a user has triggered an event. Its constructor now takes
2335         a pointer to Document, and updates the timestamp there if necessary.
2336
2337         Not all UserGestureIndicator instances needed to reset the timestamp; Those did
2338         not have to pass along the Document.
2339
2340         This is untestable due to the fix mentioned above.
2341
2342         * WebCore.exp.in: Change constructor signature.
2343
2344         * accessibility/AccessibilityNodeObject.cpp: Pass a pointer to the Document into the UserGestureIndicator.
2345         (WebCore::AccessibilityNodeObject::increment):
2346         (WebCore::AccessibilityNodeObject::decrement):
2347         * accessibility/AccessibilityObject.cpp: Ditto.
2348         (WebCore::AccessibilityObject::press):
2349
2350         * dom/Document.cpp:
2351         (WebCore::Document::updateLastHandledUserGestureTimestamp): Renamed.
2352         * dom/Document.h:
2353
2354         * dom/EventTarget.cpp: Remove the code to update the timestamp.
2355         (WebCore::EventTarget::fireEventListeners):
2356
2357         * dom/UserGestureIndicator.cpp:
2358         (WebCore::UserGestureIndicator::UserGestureIndicator): If there is a Document and
2359         this is a user gesture, then reset the timestamp.
2360         * dom/UserGestureIndicator.h:
2361
2362         * page/EventHandler.cpp: Pass a pointer to the Document.
2363         (WebCore::EventHandler::handleMousePressEvent):
2364         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2365         (WebCore::EventHandler::handleMouseReleaseEvent):
2366         (WebCore::EventHandler::keyEvent):
2367         (WebCore::EventHandler::handleTouchEvent):
2368
2369         * rendering/HitTestResult.cpp: Ditto.
2370         (WebCore::HitTestResult::toggleMediaFullscreenState):
2371         (WebCore::HitTestResult::enterFullscreenForVideo):
2372
2373 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2374
2375         [Win] Unreviewed gardening. Ignore Visual Studio *.sdf files.
2376
2377         * WebCore.vcxproj: Modified property svn:ignore.
2378
2379 2014-10-14  Brent Fulgham  <bfulgham@apple.com>
2380
2381         [Win] Enable Encrypted Media Support
2382         https://bugs.webkit.org/show_bug.cgi?id=137710
2383         <rdar://problem/18652699>
2384
2385         Reviewed by Jer Noble.
2386
2387         This feature is covered by existing media tests.
2388
2389         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2390         (WebCore::destroyAVFWrapper): Remove redundant ASSERT.
2391         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2392         (displayOnMainThreadContext::displayOnMainThreadContext): Added.
2393         (redispatchOnMainQueue): Added.
2394         (PlatformCALayerWinInternal::displayCallback): Check if a display
2395         call is happening on a background queue, and re-dispatch on the
2396         main thread if necessary.
2397
2398 2014-10-14  Chris Dumez  <cdumez@apple.com>
2399
2400         [Mac] Avoid unnecessary dictionary lookup in ImageSource::isSizeAvailable()
2401         https://bugs.webkit.org/show_bug.cgi?id=137701
2402
2403         Reviewed by Simon Fraser.
2404
2405         The CG implementation of ImageSource::isSizeAvailable() was looking up
2406         both the width and the height keys in the dictionary before determining
2407         if the size is available. We can abort early and return false if the
2408         first key (the width) is missing, thus avoiding an extra dictionary
2409         lookup in this case.
2410
2411         This is a small win but ImageSource::isSizeAvailable() is called quite
2412         frequently during page loads
2413
2414         No new tests, no behavior change.
2415
2416         * platform/graphics/cg/ImageSourceCG.cpp:
2417         (WebCore::ImageSource::isSizeAvailable):
2418
2419 2014-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
2420
2421         Remove unnecessary logging from SimpleFontData
2422         https://bugs.webkit.org/show_bug.cgi?id=137699
2423
2424         Reviewed by Andreas Kling.
2425
2426         Because of web fonts, fonts that don't have a glyph page 0 are common and expected. Printing out a
2427         message is not helpful, especially if you're not dealing with a font-related piece of WebKit.
2428
2429         No new tests because there is no behavior change.
2430
2431         * platform/graphics/SimpleFontData.cpp:
2432         (WebCore::SimpleFontData::platformGlyphInit):
2433
2434 2014-10-14  Martin Hock  <mhock@apple.com>
2435
2436         Update ViewportConfiguration whenever its size attributes change
2437         https://bugs.webkit.org/show_bug.cgi?id=137682
2438         rdar://problem/18643655
2439
2440         Reviewed by Benjamin Poulain.
2441
2442         * page/ViewportConfiguration.cpp:
2443         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
2444         (WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
2445
2446 2014-10-14  Joseph Pecoraro  <pecoraro@apple.com>
2447
2448         Web Inspector: Processing Instruction Nodes appear poorly in DOM Tree
2449         https://bugs.webkit.org/show_bug.cgi?id=137681
2450
2451         Reviewed by Timothy Hatcher.
2452
2453         * inspector/InspectorDOMAgent.cpp:
2454         (WebCore::InspectorDOMAgent::buildObjectForNode):
2455         Include the nodeName, localName, and nodeValue (string data)
2456         properties for processing instruction nodes.
2457
2458 2014-10-14  Chris Dumez  <cdumez@apple.com>
2459
2460         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet
2461         https://bugs.webkit.org/show_bug.cgi?id=137696
2462
2463         Reviewed by Darin Adler.
2464
2465         Use is<>() / downcast<>() for RenderFrame / RenderFrameSet.
2466
2467         No new tests, no behavior change.
2468
2469         * html/HTMLFrameSetElement.cpp:
2470         (WebCore::HTMLFrameSetElement::defaultEventHandler):
2471         * rendering/RenderFrame.cpp:
2472         (WebCore::RenderFrame::updateFromElement):
2473         * rendering/RenderFrame.h:
2474         * rendering/RenderFrameSet.cpp:
2475         (WebCore::RenderFrameSet::computeEdgeInfo):
2476         (WebCore::RenderFrameSet::positionFramesWithFlattening):
2477         * rendering/RenderFrameSet.h:
2478
2479 2014-10-14  Youenn Fablet  <youennf@gmail.com>
2480
2481         [XHR] Abort method execution when m_loader->cancel() in internalAbort() caused reentry
2482         https://bugs.webkit.org/show_bug.cgi?id=126975
2483
2484         Reviewed by Alexey Proskuryakov.
2485
2486         Merging https://chromium.googlesource.com/chromium/blink/+/0d75daf2053631518606ae15daaece701a25b2c4
2487         Ensuring new test from https://codereview.chromium.org/76133002/ is passing.
2488
2489         Test: http/tests/xmlhttprequest/reentrant-cancel-abort.html
2490
2491         * xml/XMLHttpRequest.cpp:
2492         (WebCore::XMLHttpRequest::open): exit early if internalAbort asks so
2493         (WebCore::XMLHttpRequest::abort): exit early if internalAbort asks so
2494         (WebCore::XMLHttpRequest::internalAbort): ask calling function to exit early if a new loader is created during the cancellation of the loader (potential reentrant case through window.onload callback)   
2495         (WebCore::XMLHttpRequest::didTimeout): exit early if internalAbort asks so
2496         * xml/XMLHttpRequest.h:
2497
2498 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
2499
2500         Multiple refactors in RenderMathMLOperator
2501         https://bugs.webkit.org/show_bug.cgi?id=137611
2502
2503         Reviewed by Darin Adler.
2504
2505         The changes include:
2506         - Rename m_operator to m_textContent.
2507         - Make most of the functions private, we needed to create some
2508         public member functions to be able to make the some funtions private
2509         and move trailingSpaceError to RenderMathMLOperator.
2510         - Fix incorrect capitalization of setOperatorProperties function.
2511         - Make all data members private and move them to the end of the
2512         class defition.
2513
2514         No new tests as no change in functionality.
2515
2516         * rendering/mathml/RenderMathMLOperator.cpp:
2517         (WebCore::RenderMathMLOperator::RenderMathMLOperator):
2518         (WebCore::RenderMathMLOperator::setOperatorProperties): Renamed,
2519         incorrect capitalization
2520         (WebCore::RenderMathMLOperator::stretchTo):
2521         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
2522         (WebCore::RenderMathMLOperator::rebuildTokenContent):
2523         (WebCore::RenderMathMLOperator::updateFromElement):
2524         (WebCore::RenderMathMLOperator::updateOperatorProperties):
2525         (WebCore::RenderMathMLOperator::shouldAllowStretching):
2526         (WebCore::RenderMathMLOperator::updateStyle):
2527         (WebCore::RenderMathMLOperator::trailingSpaceError):
2528         (WebCore::RenderMathMLOperator::SetOperatorProperties): Deleted.
2529         (WebCore::RenderMathMLOperator::advanceForGlyph): Deleted.
2530         (WebCore::RenderMathMLOperator::updateTokenContent): Deleted.
2531         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): Deleted.
2532         * rendering/mathml/RenderMathMLOperator.h:
2533         (WebCore::RenderMathMLOperator::setLeadingSpace): Added.
2534         (WebCore::RenderMathMLOperator::setTrailingSpace):  Added.
2535         (WebCore::RenderMathMLOperator::textContent): Added.
2536         (WebCore::RenderMathMLOperator::isInvisibleOperator):
2537         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
2538         (WebCore::RenderMathMLRadicalOperator::setOperatorProperties):
2539         Renamed, incorrect capitalization
2540         (WebCore::RenderMathMLRadicalOperator::SetOperatorProperties): Deleted.
2541         (WebCore::RenderMathMLRadicalOperator::trailingSpaceError): Deleted.
2542         * rendering/mathml/RenderMathMLRadicalOperator.h:
2543
2544 2014-10-14  Alejandro G. Castro  <alex@igalia.com>
2545
2546         Changes in the stretchy attribute do not update rendering
2547         https://bugs.webkit.org/show_bug.cgi?id=136883
2548
2549         Reviewed by Darin Adler.
2550
2551         Test: mathml/presentation/mo-stretch-update.html
2552
2553         We need to relayout when a change in the stretchy attribute
2554         happens.
2555
2556         * mathml/MathMLTextElement.cpp:
2557         (WebCore::MathMLTextElement::parseAttribute): Parse the
2558         modifications of the stretchy attribute.
2559         * mathml/MathMLTextElement.h:
2560         * rendering/mathml/RenderMathMLOperator.cpp:
2561         (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded):
2562         Add function that receives the value instead of looking for it and
2563         checks if the change should schedule a layout.
2564         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute):
2565         (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue):
2566         Add function that receives the value instead of looking for it.
2567         * rendering/mathml/RenderMathMLOperator.h:
2568
2569 2014-10-14  Chris Dumez  <cdumez@apple.com>
2570
2571         Use is<>() / downcast<>() for RenderImage
2572         https://bugs.webkit.org/show_bug.cgi?id=137683
2573
2574         Reviewed by Mihnea Ovidenie.
2575
2576         Use is<>() / downcast<>() for RenderImage.
2577
2578         No new tests, no behavior change.
2579
2580         * accessibility/AccessibilityNodeObject.cpp:
2581         (WebCore::AccessibilityNodeObject::alternativeText):
2582         * accessibility/AccessibilityRenderObject.cpp:
2583         (WebCore::AccessibilityRenderObject::addImageMapChildren):
2584         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
2585         * bindings/objc/DOM.mm:
2586         (-[DOMElement image]):
2587         (-[DOMElement _imageTIFFRepresentation]):
2588         * editing/TextIterator.cpp:
2589         (WebCore::TextIterator::handleReplacedElement):
2590         * editing/cocoa/HTMLConverter.mm:
2591         (fileWrapperForElement):
2592         * editing/gtk/EditorGtk.cpp:
2593         (WebCore::getImageForElement):
2594         * editing/ios/EditorIOS.mm:
2595         (WebCore::getImage):
2596         * editing/mac/EditorMac.mm:
2597         (WebCore::getImage):
2598         * html/HTMLAnchorElement.cpp:
2599         (WebCore::appendServerMapMousePosition):
2600         * html/HTMLAreaElement.cpp:
2601         (WebCore::HTMLAreaElement::setFocus):
2602         * html/HTMLImageElement.cpp:
2603         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
2604         (WebCore::HTMLImageElement::parseAttribute):
2605         (WebCore::HTMLImageElement::didAttachRenderers):
2606         (WebCore::HTMLImageElement::createImageControls):
2607         (WebCore::HTMLImageElement::destroyImageControls):
2608         * html/HTMLVideoElement.cpp:
2609         (WebCore::HTMLVideoElement::didAttachRenderers):
2610         (WebCore::HTMLVideoElement::parseAttribute):
2611         * html/ImageInputType.cpp:
2612         (WebCore::ImageInputType::altAttributeChanged):
2613         (WebCore::ImageInputType::attach):
2614         * html/canvas/CanvasRenderingContext2D.cpp:
2615         (WebCore::size):
2616         * html/shadow/mac/ImageControlsRootElementMac.cpp:
2617         (WebCore::RenderImageControls::updateLogicalWidth):
2618         (WebCore::RenderImageControls::computeLogicalHeight):
2619         * loader/ImageLoader.cpp:
2620         (WebCore::ImageLoader::renderImageResource):
2621         * page/ContextMenuController.cpp:
2622         (WebCore::imageFromImageElementNode):
2623         * page/DragController.cpp:
2624         (WebCore::getCachedImage):
2625         (WebCore::getImage):
2626         * platform/win/PasteboardWin.cpp:
2627         (WebCore::Pasteboard::writeImage):
2628         (WebCore::getCachedImage):
2629         * rendering/HitTestResult.cpp:
2630         (WebCore::HitTestResult::image):
2631         * rendering/RenderImage.h:
2632         * rendering/RenderImageResource.cpp:
2633         (WebCore::RenderImageResource::getImageSize):
2634         * rendering/RenderLayerBacking.cpp:
2635         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
2636         (WebCore::RenderLayerBacking::updateImageContents):
2637         * rendering/RenderReplaced.cpp:
2638         (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox):
2639         * rendering/shapes/ShapeOutsideInfo.cpp:
2640         (WebCore::ShapeOutsideInfo::createShapeForImage):
2641
2642 2014-10-14  Andrzej Badowski  <a.badowski@samsung.com>
2643
2644         [AX] Improve AccessibilityTableCell columnHeaders and rowHeaders functions.
2645         https://bugs.webkit.org/show_bug.cgi?id=136818
2646
2647         Reviewed by Chris Fleizach.
2648
2649         Take into account that <th> elements can be both the column headers and row headers 
2650         improved the operation of two functions: columnHeaders and rowHeaders.
2651
2652         Test: accessibility/table-headers.html
2653
2654         * accessibility/AccessibilityTableCell.cpp:
2655         (WebCore::AccessibilityTableCell::isColumnHeaderCell):
2656         A new function that helps the main goal.
2657         (WebCore::AccessibilityTableCell::isRowHeaderCell):
2658         A new function that helps the main goal.
2659         (WebCore::AccessibilityTableCell::columnHeaders):
2660         Use isColumnHeaderCell instead of isTableHeaderCell.
2661         (WebCore::AccessibilityTableCell::rowHeaders):
2662         Use isRowHeaderCell also includes <th> row header element next to the scope attribute.
2663         * accessibility/AccessibilityTableCell.h:
2664         Adds new functions to the header file.
2665
2666 2014-10-14  Csaba Osztrogon√°c  <ossy@webkit.org>
2667
2668         Fix the !ENABLE(VIDEO) build after r174353
2669         https://bugs.webkit.org/show_bug.cgi?id=137655
2670
2671         Reviewed by Darin Adler.
2672
2673         * dom/Document.cpp:
2674         * dom/Document.h:
2675         * page/Page.cpp:
2676         * page/Page.h:
2677
2678 2014-10-14  peavo@outlook.com  <peavo@outlook.com>
2679
2680         [Curl] Compile error in CurlDownload.cpp.
2681         https://bugs.webkit.org/show_bug.cgi?id=137654
2682
2683         Reviewed by Philippe Normand.
2684
2685         A template specialization is not needed anymore.
2686
2687         * platform/network/curl/CurlDownload.cpp:
2688
2689 2014-10-13  Joseph Pecoraro  <pecoraro@apple.com>
2690
2691         Web Inspector: Remove unused stale Page protocol methods
2692         https://bugs.webkit.org/show_bug.cgi?id=137678
2693
2694         Reviewed by Andreas Kling.
2695
2696         * inspector/InspectorClient.h:
2697         (WebCore::InspectorClient::canShowDebugBorders): Deleted.
2698         (WebCore::InspectorClient::setShowDebugBorders): Deleted.
2699         (WebCore::InspectorClient::canShowFPSCounter): Deleted.
2700         (WebCore::InspectorClient::setShowFPSCounter): Deleted.
2701         (WebCore::InspectorClient::canContinuouslyPaint): Deleted.
2702         (WebCore::InspectorClient::setContinuousPaintingEnabled): Deleted.
2703         * inspector/InspectorPageAgent.cpp:
2704         (WebCore::InspectorPageAgent::disable):
2705         (WebCore::InspectorPageAgent::canShowDebugBorders): Deleted.
2706         (WebCore::InspectorPageAgent::setShowDebugBorders): Deleted.
2707         (WebCore::InspectorPageAgent::canShowFPSCounter): Deleted.
2708         (WebCore::InspectorPageAgent::setShowFPSCounter): Deleted.
2709         (WebCore::InspectorPageAgent::canContinuouslyPaint): Deleted.
2710         (WebCore::InspectorPageAgent::setContinuousPaintingEnabled): Deleted.
2711         * inspector/InspectorPageAgent.h:
2712         * inspector/protocol/Page.json:
2713
2714 2014-10-13  Eric Carlson  <eric.carlson@apple.com>
2715
2716         [iOS] Refactor AirPlay monitoring code
2717         https://bugs.webkit.org/show_bug.cgi?id=137645
2718         <rdar://problem/18444817>
2719
2720         Reviewed by Jer Noble.
2721
2722         Refactor AirPlay route change monitoring code:
2723         + Have MediaSessionManager register/unregister for route changes depending on the state of
2724             all sessions so it does the right thing when there is more than one media element.
2725         + Make HTMLMediaElement unregister with MediaSession as soon as the media player is cleared
2726             because there can be no wireless playback without a player.
2727
2728         * html/HTMLMediaElement.cpp:
2729         (WebCore::HTMLMediaElement::~HTMLMediaElement): Call mediaSession->setHasPlaybackTargetAvailabilityListeners
2730             when there are target availability changed listeners.
2731         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
2732         (WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): New, media session client method.
2733         * html/HTMLMediaElement.h:
2734
2735         * html/HTMLMediaSession.cpp:
2736         (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_hasPlaybackTargetAvailabilityListeners.
2737         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Remember whether or not
2738             the client has a target availability listener and tell the media session manager to reconfigure
2739             itself instead of telling it to start or stop listening for route changes so it does the 
2740             right thing when there is more than one media element.
2741         * html/HTMLMediaSession.h:
2742         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Return true when the client 
2743             has a target availability listener, false otherwise.
2744
2745         * platform/audio/MediaSession.cpp:
2746         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Inform the client that routes have changed.
2747         * platform/audio/MediaSession.h:
2748         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
2749         (WebCore::MediaSessionClient::wirelessRoutesAvailableDidChange):
2750
2751         * platform/audio/MediaSessionManager.cpp:
2752         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Implement it.
2753         * platform/audio/MediaSessionManager.h:
2754         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
2755         (WebCore::MediaSessionManager::hasWirelessTargetsAvailable):
2756         (WebCore::MediaSessionManager::sessions):
2757         (WebCore::MediaSessionManager::startMonitoringAirPlayRoutes): Deleted.
2758         (WebCore::MediaSessionManager::stopMonitoringAirPlayRoutes): Deleted.
2759
2760         * platform/audio/ios/MediaSessionManagerIOS.h:
2761         * platform/audio/ios/MediaSessionManagerIOS.mm:
2762         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Start or stop monitoring
2763             for route changes depending on client state.
2764         (WebCore::MediaSessionManageriOS::startMonitoringAirPlayRoutes): Deleted.
2765         (WebCore::MediaSessionManageriOS::stopMonitoringAirPlayRoutes): Deleted.
2766
2767 2014-10-13  Chris Dumez  <cdumez@apple.com>
2768
2769         [Mac] Return value of createImageSourceOptions() is leaked in ImageSourceCG
2770         https://bugs.webkit.org/show_bug.cgi?id=137677
2771
2772         Reviewed by Simon Fraser.
2773
2774         The return value of createImageSourceOptions() was leaked in
2775         ImageSourceCG.cpp. It was returning a CFDictionaryRef created using
2776         CFDictionaryCreate(). Therefore, the return value should have been
2777         released but wasn't.
2778
2779         This patch makes createImageSourceOptions() return a
2780         RetainPtr<CFDictionaryRef> to make sure the CFDictionaryRef properly
2781         gets released after use.
2782
2783         No new tests, no behavior change.
2784
2785         * platform/graphics/cg/ImageSourceCG.cpp:
2786         (WebCore::createImageSourceOptions):
2787         (WebCore::imageSourceOptions):
2788         (WebCore::ImageSource::isSizeAvailable):
2789         (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
2790         (WebCore::ImageSource::frameSizeAtIndex):
2791         (WebCore::ImageSource::orientationAtIndex):
2792         (WebCore::ImageSource::getHotSpot):
2793         (WebCore::ImageSource::repetitionCount):
2794         (WebCore::ImageSource::createFrameAtIndex):
2795         (WebCore::ImageSource::frameDurationAtIndex):
2796
2797 2014-10-13  Yusuke Suzuki  <utatane.tea@gmail.com>
2798
2799         CSS JIT: Implement :visited pseudo class
2800         https://bugs.webkit.org/show_bug.cgi?id=135293
2801
2802         Reviewed by Benjamin Poulain.
2803
2804         This patch implements CSS JIT for :visited. And it makes :not(:link) JIT-ed.
2805         Following the design discussed at the other bug[1], implemented :visited JIT
2806         without tracking VisitedMatchEnabled state.
2807
2808         In this patch, we change the semantics of :visited / :link
2809         inside functional pseudo classes for further CSS Selector Level 4 extensions.
2810
2811         Edge cases are tested by the existing tests.
2812         :not(:link)
2813             fast/history/link-inside-not.html
2814         :not(:visited)
2815             fast/history/visited-inside-not.html
2816         :-webkit-any(:link)
2817             fast/history/link-inside-any.html
2818         :-webkit-any(:visited)
2819             fast/history/visited-inside-any.html
2820
2821         [1]: https://bugs.webkit.org/show_bug.cgi?id=135639
2822
2823         Test: fast/history/link-inside-not-inside-any.html
2824             To cover the :-webkit-any(:not(:link)), added new tests.
2825
2826         * css/SelectorChecker.cpp:
2827         (WebCore::SelectorChecker::checkOne):
2828         * cssjit/SelectorCompiler.cpp:
2829         (WebCore::SelectorCompiler::addPseudoClassType):
2830         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2831         (WebCore::SelectorCompiler::constructFragments):
2832         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
2833         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
2834         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateRightmostTreeWalker):
2835         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2836         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
2837         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
2838         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):
2839
2840 2014-10-13  Chris Dumez  <cdumez@apple.com>
2841
2842         Use modern loops in RenderLayerCompositor
2843         https://bugs.webkit.org/show_bug.cgi?id=137670
2844
2845         Reviewed by Simon Fraser.
2846
2847         Use modern range for-loops in RenderLayerCompositor.
2848
2849         No new tests, no behavior change.
2850
2851         * rendering/RenderLayerCompositor.cpp:
2852         (WebCore::OverlapMapContainer::overlapsLayers):
2853         (WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
2854         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
2855         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
2856         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2857         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
2858         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2859         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
2860         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
2861         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2862         (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
2863         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
2864         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
2865         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
2866         (WebCore::resetTrackedRepaintRectsRecursive):
2867         (WebCore::RenderLayerCompositor::layerHas3DContent):
2868         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
2869         (WebCore::RenderLayerCompositor::registerAllScrollingLayers):
2870         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
2871
2872 2014-10-13  Chris Dumez  <cdumez@apple.com>
2873
2874         Drop unnecessary overlapMap null checks in computeCompositingRequirements()
2875         https://bugs.webkit.org/show_bug.cgi?id=137668
2876
2877         Reviewed by Andreas Kling.
2878
2879         Drop unnecessary overlapMap null checks in computeCompositingRequirements().
2880         The function is never called with a null overlapMap so we can make the
2881         argument a reference and drop all the null checks.
2882
2883         No new tests, no behavior change.
2884
2885         * rendering/RenderLayerCompositor.cpp:
2886         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2887         (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
2888         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2889         (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
2890         * rendering/RenderLayerCompositor.h:
2891
2892 2014-10-13  Chris Dumez  <cdumez@apple.com>
2893
2894         Use is<>() / downcast<>() for PlatformCALayer subclasses
2895         https://bugs.webkit.org/show_bug.cgi?id=137661
2896
2897         Reviewed by Simon Fraser.
2898
2899         Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
2900         the surrounding code.
2901
2902         No new tests, no behavior change.
2903
2904         * platform/graphics/ca/GraphicsLayerCA.cpp:
2905         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
2906         (WebCore::GraphicsLayerCA::updateContentsRects):
2907         (WebCore::GraphicsLayerCA::updateReplicatedLayers):
2908         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
2909         (WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
2910         * platform/graphics/ca/PlatformCALayer.h:
2911         * platform/graphics/ca/TileCoverageMap.cpp:
2912         (WebCore::TileCoverageMap::TileCoverageMap):
2913         * platform/graphics/ca/TileGrid.cpp:
2914         (WebCore::TileGrid::ensureTilesForRect):
2915         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2916         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2917         (PlatformCALayerMac::clone):
2918         (PlatformCALayerMac::appendSublayer):
2919         (PlatformCALayerMac::insertSublayer):
2920         (PlatformCALayerMac::replaceSublayer):
2921         (PlatformCALayerMac::adoptSublayers):
2922         (PlatformCALayerMac::copyFiltersFrom):
2923         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2924         (WebCore::CACFLayerTreeHost::setRootChildLayer):
2925         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2926         (PlatformCALayerWin::clone):
2927         (PlatformCALayerWin::rootLayer):
2928         (PlatformCALayerWin::appendSublayer):
2929         (PlatformCALayerWin::insertSublayer):
2930         (PlatformCALayerWin::replaceSublayer):
2931         (PlatformCALayerWin::adoptSublayers):
2932         (PlatformCALayerWin::copyFiltersFrom):
2933         * platform/graphics/ca/win/PlatformCALayerWin.h:
2934         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2935         (PlatformCALayerWinInternal::insertSublayer):
2936         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
2937
2938 2014-10-13  Chris Dumez  <cdumez@apple.com>
2939
2940         Use is<>() / downcast<>() for Filter / FilterOperation subclasses
2941         https://bugs.webkit.org/show_bug.cgi?id=137644
2942
2943         Reviewed by Darin Adler.
2944
2945         Use is<>() / downcast<>() for Filter / FilterOperation subclasses.
2946
2947         No new tests, no behavior change.
2948
2949         * css/CSSComputedStyleDeclaration.cpp:
2950         (WebCore::ComputedStyleExtractor::valueForFilter):
2951         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
2952         (PlatformCAFilters::filterValueForOperation):
2953         (PlatformCAFilters::colorMatrixValueForFilter):
2954         * platform/graphics/filters/Filter.h:
2955         * platform/graphics/filters/FilterOperation.cpp:
2956         (WebCore::DefaultFilterOperation::operator==):
2957         (WebCore::ReferenceFilterOperation::operator==):
2958         (WebCore::BasicColorMatrixFilterOperation::blend):
2959         (WebCore::BasicColorMatrixFilterOperation::operator==):
2960         (WebCore::BasicComponentTransferFilterOperation::blend):
2961         (WebCore::BasicComponentTransferFilterOperation::operator==):
2962         (WebCore::BlurFilterOperation::operator==):
2963         (WebCore::BlurFilterOperation::blend):
2964         (WebCore::DropShadowFilterOperation::operator==):
2965         (WebCore::DropShadowFilterOperation::blend):
2966         * platform/graphics/filters/FilterOperation.h:
2967         * platform/graphics/filters/FilterOperations.cpp:
2968         (WebCore::FilterOperations::outsets):
2969         * rendering/FilterEffectRenderer.cpp:
2970         (WebCore::FilterEffectRenderer::build):
2971         * rendering/RenderLayerFilterInfo.cpp:
2972         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
2973         * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
2974         (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
2975         * svg/graphics/filters/SVGFilter.h:
2976         (isType):
2977
2978 2014-10-13  Chris Dumez  <cdumez@apple.com>
2979
2980         Use is<>() / downcast<>() for Table render objects
2981         https://bugs.webkit.org/show_bug.cgi?id=137641
2982
2983         Reviewed by Mihnea Ovidenie.
2984
2985         Use is<>() / downcast<>() for table-related render objects and clean
2986         up the surrounding code.
2987
2988         No new tests, no behavior change.
2989
2990         * accessibility/AccessibilityARIAGrid.cpp:
2991         (WebCore::AccessibilityARIAGrid::addChildren):
2992         * accessibility/AccessibilityTable.cpp:
2993         (WebCore::AccessibilityTable::tableElement):
2994         (WebCore::AccessibilityTable::isDataTable):
2995         (WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
2996         (WebCore::AccessibilityTable::addChildren):
2997         * accessibility/AccessibilityTableCell.cpp:
2998         (WebCore::AccessibilityTableCell::parentTable):
2999         (WebCore::AccessibilityTableCell::rowIndexRange):
3000         (WebCore::AccessibilityTableCell::columnIndexRange):
3001         (WebCore::AccessibilityTableCell::titleUIElement):
3002         * accessibility/AccessibilityTableColumn.cpp:
3003         (WebCore::AccessibilityTableColumn::headerObject):
3004         * editing/DeleteSelectionCommand.cpp:
3005         (WebCore::DeleteSelectionCommand::removeNode):
3006         * editing/TextIterator.cpp:
3007         (WebCore::shouldEmitTabBeforeNode):
3008         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
3009         * html/HTMLTableCellElement.cpp:
3010         (WebCore::HTMLTableCellElement::parseAttribute):
3011         (WebCore::HTMLTableCellElement::cellAbove):
3012         * html/HTMLTableColElement.cpp:
3013         (WebCore::HTMLTableColElement::parseAttribute):
3014         * mathml/MathMLElement.cpp:
3015         (WebCore::MathMLElement::parseAttribute):
3016         * rendering/AutoTableLayout.cpp:
3017         (WebCore::AutoTableLayout::recalcColumn):
3018         (WebCore::shouldScaleColumns):
3019         * rendering/RenderBlockFlow.cpp:
3020         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
3021         * rendering/RenderBox.cpp:
3022         (WebCore::RenderBox::computePercentageLogicalHeight):
3023         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3024         * rendering/RenderElement.cpp:
3025         (WebCore::RenderElement::addChild):
3026         * rendering/RenderLayer.cpp:
3027         (WebCore::RenderLayer::calculateClipRects):
3028         * rendering/RenderTable.cpp:
3029         (WebCore::RenderTable::addChild):
3030         (WebCore::RenderTable::layout):
3031         (WebCore::RenderTable::firstColumn):
3032         (WebCore::RenderTable::recalcSections):
3033         (WebCore::RenderTable::sectionAbove):
3034         (WebCore::RenderTable::sectionBelow):
3035         (WebCore::RenderTable::bottomSection):
3036         * rendering/RenderTable.h:
3037         * rendering/RenderTableCaption.cpp:
3038         (WebCore::RenderTableCaption::table):
3039         * rendering/RenderTableCell.h:
3040         (WebCore::RenderTableCell::nextCell):
3041         (WebCore::RenderTableCell::previousCell):
3042         (WebCore::RenderTableRow::firstCell):
3043         (WebCore::RenderTableRow::lastCell):
3044         * rendering/RenderTableCol.cpp:
3045         (WebCore::RenderTableCol::table):
3046         (WebCore::RenderTableCol::enclosingColumnGroup):
3047         (WebCore::RenderTableCol::nextColumn):
3048         * rendering/RenderTableCol.h:
3049         Make updateFromElement() public to allow the callers to use tighter
3050         typing and devitualize the call as the class is final.
3051
3052         * rendering/RenderTableRow.cpp:
3053         (WebCore::RenderTableRow::addChild):
3054         * rendering/RenderTableRow.h:
3055         (WebCore::RenderTableSection::firstRow):
3056         (WebCore::RenderTableSection::lastRow):
3057         (WebCore::RenderTableRow::nextRow):
3058         (WebCore::RenderTableRow::previousRow):
3059         * rendering/RenderTableSection.cpp:
3060         (WebCore::RenderTableSection::addChild):
3061         (WebCore::RenderTableSection::layoutRows):
3062         (WebCore::RenderTableSection::paintCell):
3063         * rendering/RenderTableSection.h:
3064         * rendering/RenderTreeAsText.cpp:
3065         (WebCore::writeTextRun):
3066         (WebCore::writeSimpleLine):
3067
3068 2014-10-08  Jer Noble  <jer.noble@apple.com>
3069
3070         MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
3071         https://bugs.webkit.org/show_bug.cgi?id=137533
3072
3073         Reviewed by Darin Adler.
3074
3075         When a new AVAsset is returned out of the AVStreamDataParser, notify the HTMLMediaElement that
3076         characteristics of the player may have changed.
3077
3078         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3079         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3080         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::characteristicsChanged):
3081         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3082         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
3083
3084 2014-10-13  Jer Noble  <jer.noble@apple.com>
3085
3086         [iOS] Stop listening for wireless playback target availability when the default controls are hidden.
3087         https://bugs.webkit.org/show_bug.cgi?id=137633
3088
3089         Reviewed by Dean Jackson.
3090
3091         In order to minimize the excess bandwidth and power consumption required for actively listening
3092         for wireless playback target availablity, unregister for those notifications while the controls
3093         are hidden due to playback, or when the element's document is hidden.
3094
3095         * Modules/mediacontrols/mediaControlsiOS.js:
3096         (ControllerIOS.prototype.createBase): Register for document visiblity change notfications.
3097         (ControllerIOS.prototype.setControlsType): Call updateShouldListenForPlaybackTargetAvailabilityEvent()
3098             instead of setShouldListenForPlaybackTargetAvailabilityEvent()
3099         (ControllerIOS.prototype.hideControls): Ditto.
3100         (ControllerIOS.prototype.showControls): Ditto.
3101         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
3102         (ControllerIOS.prototype.handleVisibilityChange): Ditto.
3103         (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent): Added. Only listen
3104             for target availability when the video has no errors, is not in the initial "big play button"
3105             controls state, and when the controls are not hidden.
3106         * platform/audio/ios/MediaSessionManagerIOS.mm:
3107         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Explicitly set the discoveryMode to "disabled"
3108             rather than waiting for the autoreleasepool to destroy our routing controller.
3109
3110 2014-10-13  Simon Fraser  <simon.fraser@apple.com>
3111
3112         iOS DRT snapshots are limited to the page visible area
3113         https://bugs.webkit.org/show_bug.cgi?id=137650
3114
3115         Reviewed by Daniel Bates.
3116
3117         LegacyTileCache drawing was limited to the window's visible area, found by
3118         crawling up the layer hierarchy to the root layer. This caused test snapshots to
3119         be missing non-composited content outside the iPhone visible area, which hinders
3120         testing.
3121         
3122         Fix by adding a test-only mode where the window visible area is the entire window.
3123
3124         * platform/ios/wak/WAKWindow.h:
3125         * platform/ios/wak/WAKWindow.mm:
3126         (-[WAKWindow setEntireWindowVisibleForTesting:]):
3127         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
3128
3129 2014-10-13  Mihnea Ovidenie  <mihnea@adobe.com>
3130
3131         [CSSRegions] Make RenderNamedFlowFragment::computeStyleInRegion const
3132         https://bugs.webkit.org/show_bug.cgi?id=137604
3133
3134         Reviewed by Andrei Bucur.
3135
3136         The method computeStyleInRegion should be const as it does not modify
3137         the state of the RenderNamedFlowFragment instance. Make pointers to
3138         the region used for styling const along the way. No new tests as no
3139         change in functionality.
3140
3141         * css/ElementRuleCollector.h:
3142         (WebCore::ElementRuleCollector::ElementRuleCollector):
3143         (WebCore::ElementRuleCollector::setRegionForStyling):
3144         * css/StyleResolver.cpp:
3145         (WebCore::StyleResolver::State::initForStyleResolve):
3146         (WebCore::StyleResolver::styleForElement):
3147         * css/StyleResolver.h:
3148         * rendering/RenderNamedFlowFragment.cpp:
3149         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
3150         * rendering/RenderNamedFlowFragment.h:
3151
3152 2014-09-30  Sergio Villar Senin  <svillar@igalia.com>
3153
3154         [CSS Grid Layout] Pass the valid set of tracks to grow beyond growth limits
3155         https://bugs.webkit.org/show_bug.cgi?id=137253
3156
3157         Reviewed by Darin Adler.
3158
3159         Section 10.4 of the specs describe how to resolve content based
3160         track sizing functions. Among others it describes the "distribute
3161         extra space" algorithm. The 3rd bullet of that algorithm specifies
3162         how to distribute (and also the target tracks) the extra space
3163         once all the tracks have reached their growth limits.
3164
3165         Our implementation had 2 problems. First we were not passing a
3166         valid subset of tracks (instead we were always using all of
3167         them). Now we use a function that filters the right tracks to be
3168         the target of the extra space distribution depending on whether
3169         we're computing the min track function or the max track function.
3170
3171         Secondly the algorithm that was distributing the extra space was
3172         not using that list of passed in tracks (it iterated over all of
3173         them). From now on it will use the set of tracks selected using
3174         the filter function described above.
3175
3176         * rendering/RenderGrid.cpp:
3177         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3178         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3179         (WebCore::RenderGrid::distributeSpaceToTracks):
3180         * rendering/RenderGrid.h:
3181         * rendering/style/GridTrackSize.h:
3182         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
3183         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
3184
3185 2014-10-12  Mike West  <mkwst@chromium.org>
3186
3187         Referrer Policy: Update <meta name="referrer"> values to match the spec
3188         https://bugs.webkit.org/show_bug.cgi?id=137635
3189
3190         Reviewed by Jochen Eisinger.
3191
3192         The Referrer Policy specification ([Working Draft][WD], [Editor's
3193         draft[ED]) defines different keywords than we originally
3194         implemented. We should support them in the interests of clarity and
3195         interoperability with other browsers implementing the specification.
3196
3197         [WD]: http://www.w3.org/TR/referrer-policy/#referrer-policy-delivery-meta
3198         [ED]: http://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-delivery-meta
3199
3200         This patch is a port of Blink's https://codereview.chromium.org/607433002/
3201
3202         Tests: http/tests/security/referrer-policy-conflicting-policies.html
3203                http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html
3204                http/tests/security/referrer-policy-https-no-referrer.html
3205                http/tests/security/referrer-policy-https-unsafe-url.html
3206                http/tests/security/referrer-policy-no-referrer-when-downgrade.html
3207                http/tests/security/referrer-policy-no-referrer.html
3208
3209         * dom/Document.cpp:
3210         (WebCore::Document::processReferrerPolicy):
3211
3212 2014-10-12  Dhi Aurrahman  <diorahman@rockybars.com>
3213
3214         Support activation behavior of link element
3215         https://bugs.webkit.org/show_bug.cgi?id=137597
3216
3217         Reviewed by Benjamin Poulain.
3218
3219         Support activation behavior of link elements as defined in [1],
3220         i.e. to follow the hyperlink created by the link element when it is fully active.
3221
3222         [1] https://html.spec.whatwg.org/multipage/semantics.html#the-link-element
3223
3224         Tests: fast/dom/html-link-element-activation-behavior-on-element-click.html
3225                fast/dom/html-link-element-activation-behavior-on-mouse-click.html
3226                fast/dom/html-link-element-activation-behavior-url-is-null.html
3227
3228         * dom/MouseEvent.cpp:
3229         (WebCore::MouseEvent::triggerActivationBehavior):
3230         * dom/MouseEvent.h:
3231         * html/HTMLAnchorElement.cpp:
3232         (WebCore::HTMLAnchorElement::defaultEventHandler):
3233         (WebCore::isLinkClick): Deleted.
3234         * html/HTMLAnchorElement.h:
3235         * html/HTMLLinkElement.cpp:
3236         (WebCore::HTMLLinkElement::defaultEventHandler):
3237         (WebCore::HTMLLinkElement::handleClick):
3238         * html/HTMLLinkElement.h:
3239         * svg/SVGAElement.cpp:
3240         (WebCore::SVGAElement::defaultEventHandler):
3241
3242 2014-10-11  KwangHyuk Kim  <hyuki.kim@samsung.com>
3243
3244         [EFL] Enable WebP support.
3245         https://bugs.webkit.org/show_bug.cgi?id=136156
3246
3247         Reviewed by Gyuyoung Kim.
3248
3249         Add WebP library and inlcude path to WebCore path for WK2 Efl.
3250         No new tests since existing feature is just enabled for WK2 Efl.
3251
3252         * PlatformEfl.cmake:
3253
3254 2014-10-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3255
3256         [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource
3257         https://bugs.webkit.org/show_bug.cgi?id=137485
3258
3259         Reviewed by Sergio Villar Senin.
3260
3261         Use GThreadSafeMainLoopSource for GStreamer sources, since they
3262         can be used from different threads. Also update GMutexLocker
3263         usages, since it's now a template.
3264
3265         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
3266         (WebCore::AudioFileReader::createBus):
3267         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3268         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3269         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3270         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
3271         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3272         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3273         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3274         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3275         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3276         (webkitVideoSinkTimeoutCallback):
3277         (webkitVideoSinkRender):
3278         (unlockBufferMutex):
3279         (webkitVideoSinkUnlockStop):
3280         (webkitVideoSinkStart):
3281         * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp:
3282         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3283         (webKitWebSrcGetProperty):
3284         (webKitWebSrcStop):
3285         (webKitWebSrcStart):
3286         (webKitWebSrcChangeState):
3287         (webKitWebSrcQueryWithParent):
3288         (webKitWebSrcGetUri):
3289         (webKitWebSrcSetUri):
3290         (webKitWebSrcNeedDataMainCb):
3291         (webKitWebSrcNeedDataCb):
3292         (webKitWebSrcEnoughDataMainCb):
3293         (webKitWebSrcEnoughDataCb):
3294         (webKitWebSrcSeekDataCb):
3295         (webKitWebSrcSetMediaPlayer):
3296         (StreamingClient::createReadBuffer):
3297         (StreamingClient::handleResponseReceived):
3298         (StreamingClient::handleDataReceived):
3299         (StreamingClient::handleNotifyFinished):
3300         (ResourceHandleStreamingClient::wasBlocked):
3301         (ResourceHandleStreamingClient::cannotShowURL):
3302
3303 2014-10-10  Chris Dumez  <cdumez@apple.com>
3304
3305         Use is<>() / downcast<>() for Image subclasses
3306         https://bugs.webkit.org/show_bug.cgi?id=137625
3307
3308         Reviewed by Andreas Kling.
3309
3310         Use is<>() / downcast<>() for Image subclasses.
3311
3312         No new tests, no behavior change.
3313
3314         * accessibility/AccessibilityRenderObject.cpp:
3315         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
3316         * loader/cache/CachedImage.cpp:
3317         (WebCore::CachedImage::imageSizeForRenderer):
3318         (WebCore::CachedImage::createImage):
3319         * platform/graphics/BitmapImage.h:
3320         * platform/graphics/Image.h:
3321         * platform/mac/DragImageMac.mm:
3322         (WebCore::createDragImageFromImage):
3323         * rendering/RenderImage.cpp:
3324         (WebCore::RenderImage::embeddedContentBox):
3325         * svg/graphics/SVGImage.h:
3326
3327 2014-10-10  Chris Dumez  <cdumez@apple.com>
3328
3329         Use is<>() / downcast<>() for RenderElement
3330         https://bugs.webkit.org/show_bug.cgi?id=137622
3331
3332         Reviewed by Benjamin Poulain.
3333
3334         Use is<>() / downcast<>() for RenderElement and clean up the
3335         surrounding code.
3336
3337         No new tests, no behavior change.
3338
3339         * accessibility/AccessibilityImageMapLink.cpp:
3340         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
3341         * accessibility/AccessibilityRenderObject.cpp:
3342         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3343         * css/CSSComputedStyleDeclaration.cpp:
3344         (WebCore::computeRenderStyleForProperty):
3345         * dom/Node.cpp:
3346         (WebCore::Node::materializeRareData):
3347         * dom/Position.cpp:
3348         (WebCore::isNonTextLeafChild):
3349         (WebCore::searchAheadForBetterMatch):
3350         * dom/PseudoElement.cpp:
3351         (WebCore::PseudoElement::didRecalcStyle):
3352         * editing/CompositeEditCommand.cpp:
3353         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
3354         * editing/htmlediting.cpp:
3355         (WebCore::isEmptyTableCell):
3356         * rendering/InlineIterator.h:
3357         (WebCore::bidiNextShared):
3358         * rendering/RenderBlock.cpp:
3359         (WebCore::RenderBlock::getFirstLetter):
3360         * rendering/RenderBox.cpp:
3361         (WebCore::RenderBox::layout):
3362         * rendering/RenderCounter.cpp:
3363         (WebCore::RenderCounter::rendererRemovedFromTree):
3364         (WebCore::RenderCounter::rendererSubtreeAttached):
3365         (showCounterRendererTree):
3366         * rendering/RenderElement.cpp:
3367         (WebCore::RenderElement::insertChildInternal):
3368         (WebCore::RenderElement::removeChildInternal):
3369         (WebCore::RenderElement::findNextLayer):
3370         (WebCore::RenderElement::layout):
3371         * rendering/RenderElement.h:
3372         (WebCore::RenderObject::isRenderLayerModelObject):
3373         (WebCore::RenderObject::isBoxModelObject):
3374         (WebCore::RenderObject::isRenderBlock):
3375         (WebCore::RenderObject::isRenderBlockFlow):
3376         (WebCore::RenderObject::isRenderReplaced):
3377         (WebCore::RenderObject::isRenderInline):
3378         (WebCore::RenderObject::style):
3379         (WebCore::RenderObject::firstLineStyle):
3380         (WebCore::ContainerNode::renderer):
3381         * rendering/RenderFrameSet.cpp:
3382         (WebCore::RenderFrameSet::paint):
3383         * rendering/RenderLayer.cpp:
3384         (WebCore::RenderLayer::calculateClipRects):
3385         * rendering/RenderNamedFlowFragment.cpp:
3386         (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
3387         (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion):
3388         (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
3389         * rendering/RenderObject.cpp:
3390         (WebCore::RenderObject::clearNeedsLayout):
3391         (WebCore::RenderObject::willBeDestroyed):
3392         (WebCore::RenderObject::collectAnnotatedRegions):
3393         * rendering/RenderVTTCue.cpp:
3394         (WebCore::RenderVTTCue::initializeLayoutParameters):
3395         (WebCore::RenderVTTCue::repositionGenericCue):
3396         * rendering/mathml/RenderMathMLFraction.cpp:
3397         (WebCore::RenderMathMLFraction::addChild):
3398         * rendering/mathml/RenderMathMLMenclose.cpp:
3399         (WebCore::RenderMathMLMenclose::addChild):
3400         * rendering/mathml/RenderMathMLOperator.cpp:
3401         (WebCore::RenderMathMLOperator::rebuildTokenContent):
3402         (WebCore::RenderMathMLOperator::updateStyle):
3403         * rendering/mathml/RenderMathMLRoot.cpp:
3404         (WebCore::RenderMathMLRoot::addChild):
3405         (WebCore::RenderMathMLRoot::layout):
3406         * rendering/mathml/RenderMathMLToken.cpp:
3407         (WebCore::RenderMathMLToken::addChild):
3408         (WebCore::RenderMathMLToken::updateTokenContent):
3409         (WebCore::RenderMathMLToken::updateStyle):
3410         * rendering/mathml/RenderMathMLUnderOver.cpp:
3411         (WebCore::RenderMathMLUnderOver::layout):
3412         * rendering/svg/RenderSVGResource.cpp:
3413         (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
3414         * rendering/svg/RenderSVGText.cpp:
3415         (WebCore::findPreviousAndNextAttributes):
3416         (WebCore::RenderSVGText::subtreeStyleDidChange):
3417         (WebCore::updateFontInAllDescendants):
3418         * rendering/svg/SVGRenderSupport.cpp:
3419         (WebCore::SVGRenderSupport::layoutChildren):
3420         * rendering/svg/SVGResourcesCache.cpp:
3421         (WebCore::SVGResourcesCache::clientWasAddedToTree):
3422         (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
3423         * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
3424         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForTextRenderer):
3425         (WebCore::SVGTextLayoutAttributesBuilder::buildLayoutAttributesForForSubtree):
3426         (WebCore::SVGTextLayoutAttributesBuilder::rebuildMetricsForTextRenderer):
3427         * rendering/svg/SVGTextLayoutAttributesBuilder.h:
3428         * rendering/svg/SVGTextMetricsBuilder.cpp:
3429         (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
3430         (WebCore::SVGTextMetricsBuilder::measureTextRenderer):
3431         (WebCore::SVGTextMetricsBuilder::walkTree):
3432         (WebCore::SVGTextMetricsBuilder::buildMetricsAndLayoutAttributes):
3433         * rendering/svg/SVGTextMetricsBuilder.h:
3434         * rendering/svg/SVGTextRunRenderingContext.cpp:
3435         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator):
3436         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs):
3437         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
3438         * svg/SVGFontData.cpp:
3439         (WebCore::SVGFontData::applySVGGlyphSelection):
3440
3441 2014-10-10  Benjamin Poulain  <benjamin@webkit.org>
3442