[Coordinated Graphics] Remove unused method in CoordinatedGraphicsLayer
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-09-04  Jae Hyun Park  <jae.park@company100.net>
2
3         [Coordinated Graphics] Remove unused method in CoordinatedGraphicsLayer
4         https://bugs.webkit.org/show_bug.cgi?id=120664
5
6         Reviewed by Darin Adler.
7
8         CoordinatedGraphicsLayer::hasPendingVisibleChanges is not used as of
9         r148952.
10
11         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
12         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
13
14 2013-09-04  Hans Muller  <hmuller@adobe.com>
15
16         [CSS Shapes] Revise the ShapeInterval set operations' implementation
17         https://bugs.webkit.org/show_bug.cgi?id=120349
18
19         Reviewed by Alexandru Chiculita.
20
21         Revised the ShapeIntervals unite, intersect, and subtract operations to
22         improve efficiency and clarity.
23
24         No new tests are required, this is just an internal refactoring.
25
26         * rendering/shapes/PolygonShape.cpp:
27         (WebCore::computeOverlappingEdgeXProjections): Removed call to ShapeInterval<T>sortVector(), since calling std::sort directly is simpler.
28         * rendering/shapes/ShapeInterval.h:
29         (WebCore::ShapeInterval::contains): True if the interval parameter is within this interval.
30         (WebCore::ShapeInterval::intersect): Substantially revised version of the original method.
31         (WebCore::ShapeInterval::uniteVectors): Ditto.
32         (WebCore::ShapeInterval::intersectVectors): Ditto.
33         (WebCore::ShapeInterval::subtractVectors): Ditto.
34
35 2013-09-04  Krzysztof Czech  <k.czech@samsung.com>
36
37         [ATK] Adds an accessibility support to access a value of the color control element
38         https://bugs.webkit.org/show_bug.cgi?id=114354
39
40         Reviewed by Mario Sanchez Prada.
41
42         Implements a possibility of retrieving a value of the color control element.
43
44         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
45         (webkitAccessibleTextGetText):
46         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
47         (getInterfaceMaskFromObject):
48
49 2013-09-04  Andreas Kling  <akling@apple.com>
50
51         Use Vector<Ref<T>> in three random WebCore loops.
52         <https://webkit.org/b/120661>
53
54         Reviewed by Darin Adler.
55
56         Clean up three little loops to use Refs to avoid null checking known-valid objects.
57         Also apply auto, reserveInitialCapacity and uncheckedAppend as appropriate.
58
59         * page/DOMWindow.cpp:
60         (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
61         (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
62         * platform/graphics/FontCache.cpp:
63         (WebCore::FontCache::invalidate):
64
65 2013-09-04  Claudio Saavedra  <csaavedra@igalia.com>
66
67         [GTK] Color of input button's text broken with recent gnome-themes-standard
68         https://bugs.webkit.org/show_bug.cgi?id=120581
69
70         Reviewed by Carlos Garcia Campos.
71
72         * platform/gtk/RenderThemeGtk3.cpp:
73         (WebCore::getStyleContext): add the "text-button" class.
74         (WebCore::RenderThemeGtk::systemColor): Use the ACTIVE state flag,
75         as this is the one actually used for button labels.
76
77 2013-09-04  Zan Dobersek  <zdobersek@igalia.com>
78
79         [GTK] Add support for the Wayland build target
80         https://bugs.webkit.org/show_bug.cgi?id=120627
81
82         Reviewed by Gustavo Noronha Silva.
83
84         * GNUmakefile.list.am: Reorder the Source/WebCore/plugins/np* source files.
85         The X11-specific source files should only be included if the X11 target is being built. PluginPackageNone and
86         PluginViewNone source files must be included in non-X11-target builds. Other source files that were previously
87         guarded with the TARGET_X11 conditional should also be built for the Wayland target, so the new TARGET_X11_OR_WAYLAND
88         conditional is used. If neither of those two targets is being built we fall back to adding source files to the build
89         as necessary by the actual build target.
90         * platform/gtk/GtkVersioning.c:
91         (gdk_screen_get_monitor_workarea): Additionally guard bits of code that depend on the GDK_WINDOWING_X11 macro being
92         defined - these should only be built when building the X11 target, checked for with PLATFORM(X11).
93
94 2013-09-04  Mario Sanchez Prada  <mario.prada@samsung.com>
95
96         [GTK] Reimplement atk_text_get_text_*_offset for SENTENCE boundaries
97         https://bugs.webkit.org/show_bug.cgi?id=114873
98
99         Reviewed by Chris Fleizach.
100
101         Re-implement these functions without using GailTextUtil nor Pango.
102
103         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
104         (webkitAccessibleTextWordForBoundary): Renamed from webkitAccessibleTextGetWordForBoundary,
105         to keep it consistent with names for new functions.
106         (isSentenceBoundary): Helper function to know when we are either
107         at the beginning or the end of a sentence.
108         (isWhiteSpaceBetweenSentences): It returns true if we are in the
109         middle of a white space between sentences. Useful for implementing
110         the SENTENCE_END boundary type.
111         (sentenceAtPositionForAtkBoundary): New helper function to find the
112         sentence at a given position considering values of AtkTextBoundary.
113         (webkitAccessibleTextSentenceForBoundary): New function,
114         implementing atk_text_get_text_*_offset for SENTENCE.
115         (webkitAccessibleTextGetTextForOffset): Replace usage of Gail for
116         SENTENCE boundaries with webkitAccessibleTextSentenceForBoundary().
117
118 2013-09-04  Andrei Bucur  <abucur@adobe.com>
119
120         [CSS Regions] Extend the RenderRegionRange class to include overflow information + apply the layout overflow
121         https://bugs.webkit.org/show_bug.cgi?id=116299
122
123         Reviewed by David Hyatt.
124
125         Patch for computing overflow for boxes per region and applying it for layout overflow.
126         The approach is based on adding a RenderOverflow object inside the RenderBoxRegionInfo
127         structure. The RenderOverflow object is manipulated by the RenderRegion using some utility
128         functions that receive the target box as a parameter.
129         When computing the portion of a box inside a region it is necessary to split the border
130         rect of the box between regions. This means mapping the rectangle in the flow thread
131         coordinates, making the split and then remapping the fragment in the box coordinates.
132         For now, this is not optimized and walks the render tree to compute the block offsets.
133         The function getRegionRangeForBox is used to determine in what regions a box should
134         be rendered into. The range is computed at layout time and it depends on the height of
135         the box, if its unsplittable for fragmentation etc.
136         The patch also propagates the layout overflow to the regions. This enables to correctly
137         display scrollbars when chaining varying size regions (currently the horizontal overflow
138         is as wide as the widest region for all the regions). Unsplittable boxes will also generate
139         layout overflow in the start region so they can be scrolled and fully reachable. This
140         functionality depends on fixing the visual overflow and adapting the layout to take into
141         account the unsplittable box. Besides this, the relative positioning and transforms are applied
142         at a fragment level. This is in line with the CSS3 Break specification:
143         http://dev.w3.org/csswg/css-break/#transforms
144
145         Tests: fast/regions/overflow-scrollable-rel-pos-fragment.html
146                fast/regions/overflow-scrollable-rotated-fragment.html
147                fast/regions/overflow-scrollable-unsplittable-fragment.html
148                fast/regions/overflow-scrollable-varying-width-1.html
149                fast/regions/overflow-scrollable-varying-width-2.html
150
151         * rendering/RenderBlock.cpp:
152         (WebCore::RenderBlock::computeOverflow):
153         (WebCore::RenderBlock::clearLayoutOverflow):
154         (WebCore::RenderBlock::addVisualOverflowFromTheme):
155         (WebCore::RenderBlock::relayoutForPagination):
156         * rendering/RenderBlockLineLayout.cpp:
157         (WebCore::RenderBlock::addOverflowFromInlineChildren):
158         * rendering/RenderBox.cpp:
159         (WebCore::RenderBox::clientBoxRectInRegion):
160         (WebCore::RenderBox::addVisualEffectOverflow):
161         (WebCore::RenderBox::applyVisualEffectOverflow):
162         (WebCore::RenderBox::addOverflowFromChild):
163         (WebCore::RenderBox::clearOverflow):
164         * rendering/RenderBox.h:
165         * rendering/RenderBoxRegionInfo.h:
166         (WebCore::RenderBoxRegionInfo::createOverflow):
167         (WebCore::RenderBoxRegionInfo::overflow):
168         (WebCore::RenderBoxRegionInfo::clearOverflow):
169         * rendering/RenderEmbeddedObject.cpp:
170         (WebCore::RenderEmbeddedObject::layout):
171         * rendering/RenderFlowThread.cpp:
172         (WebCore::RenderFlowThread::updateLogicalWidth):
173         (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded):
174         (WebCore::RenderFlowThread::mapFromLocalToFlowThread):
175         (WebCore::RenderFlowThread::mapFromFlowThreadToLocal):
176         (WebCore::RenderFlowThread::addRegionsVisualEffectOverflow):
177         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
178         (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
179         (WebCore::RenderFlowThread::addRegionsLayoutOverflow):
180         (WebCore::RenderFlowThread::clearRegionsOverflow):
181         * rendering/RenderFlowThread.h:
182         * rendering/RenderIFrame.cpp:
183         (WebCore::RenderIFrame::layout):
184         * rendering/RenderRegion.cpp:
185         (WebCore::RenderRegion::computeOverflowFromFlowThread):
186         (WebCore::RenderRegion::setRenderBoxRegionInfo):
187         (WebCore::RenderRegion::ensureOverflowForBox):
188         (WebCore::RenderRegion::rectFlowPortionForBox):
189         (WebCore::RenderRegion::addLayoutOverflowForBox):
190         (WebCore::RenderRegion::addVisualOverflowForBox):
191         (WebCore::RenderRegion::layoutOverflowRectForBox):
192         (WebCore::RenderRegion::visualOverflowRectForBox):
193         (WebCore::RenderRegion::layoutOverflowRectForBoxForPropagation):
194         (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation):
195         * rendering/RenderRegion.h:
196         * rendering/RenderReplaced.cpp:
197         (WebCore::RenderReplaced::layout):
198         * rendering/RenderTableSection.cpp:
199         (WebCore::RenderTableSection::computeOverflowFromCells):
200
201 2013-09-04  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
202
203         [GStreamer] cannot play live streams
204         https://bugs.webkit.org/show_bug.cgi?id=116831
205
206         Reviewed by Philippe Normand.
207
208         Fix issues with rtsp streams embedded on <video> not loading.
209
210         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
211         Do not reset pipeline to READY state on STATE_CHANGE_ASYNC when entering PAUSED state for
212         live streams, otherwise we enter an endless loop of READY->PAUSED->READY->PAUSED when
213         starting playback.
214
215 2013-09-03  Chris Fleizach  <cfleizach@apple.com>
216
217         AX: REGRESSION: @title is exposed as AXDescription when label label from contents already exists.
218         https://bugs.webkit.org/show_bug.cgi?id=120550
219
220         Reviewed by Mario Sanchez Prada.
221
222         Resolve a FIXME from the accessible name computation refactoring so that alternative text for links do not
223         show up in the title field and do not duplicate naming when a title tag is used.
224
225         Effectively, this means that links no longer use AXTitle for alternative text. They use AXDescription
226         like all other elements.
227
228         Test: platform/mac/accessibility/link-with-title.html
229
230         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
231         (-[WebAccessibilityObjectWrapper accessibilityTitle]):
232         (-[WebAccessibilityObjectWrapper accessibilityDescription]):
233
234 2013-09-03  Darin Adler  <darin@apple.com>
235
236         Change type of Document::doctype back to a raw pointer
237         https://bugs.webkit.org/show_bug.cgi?id=120617
238
239         Reviewed by Andreas Kling.
240
241         * dom/Document.cpp:
242         (WebCore::Document::doctype): Return a raw pointer.
243         (WebCore::Document::childrenChanged): Use the raw pointer.
244         Also added a FIXME about this code that is probably in the wrong place.
245         * dom/Document.h: More of the same.
246
247         * editing/markup.cpp:
248         (WebCore::documentTypeString): Get rid of local variable entirely,
249         since null is already handled right by createMarkup, and also remove
250         the call to get since doctype is just a raw pointer.
251
252 2013-09-03  Andreas Kling  <akling@apple.com>
253
254         ASSERTION FAILED: frame().view() == this closing a page with SVG or video
255         <https://webkit.org/b/120645>
256
257         Reviewed by Antti Koivisto.
258
259         Have RenderSVGResourceContainer check if the document is being destroyed before
260         triggering any repaints. This replaces the previous check for a null RenderView
261         which meant basically the same thing.
262
263         We could add more and better assertions to catch unnecessary work during tree
264         teardown, but let's do that separately.
265
266         * rendering/svg/RenderSVGResourceContainer.cpp:
267         (WebCore::RenderSVGResourceContainer::markClientForInvalidation):
268
269 2013-09-03  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
270
271         Fix uninitialized build warning in make_names.pl
272         https://bugs.webkit.org/show_bug.cgi?id=120658
273
274         Reviewed by Andreas Kling.
275
276         No new tests, no behavior change.
277
278         * dom/make_names.pl:
279         (printTypeChecks): Fixed a build warning since r154965.
280
281 2013-09-03  Darin Adler  <darin@apple.com>
282
283         Fix backwards branch in ~Node from r154967
284         https://bugs.webkit.org/show_bug.cgi?id=120659
285
286         Reviewed by Andreas Kling.
287
288         * dom/Node.cpp:
289         (WebCore::Node::~Node): Fix backwards branch. The old code ran the code only
290         when we did not remove the item from the table. I removed a ! from this expression
291         after review; bad idea.
292
293 2013-09-03  Enrica Casucci  <enrica@apple.com>
294
295         Can't select Katakana word by double-clicking.
296         <rdar://problem/14654926>
297
298         Reviewed by Alexey Proskuryakov and Ryosuke Niwa.
299
300         For some languages, like Japanese we need
301         to use more context for word breaking.
302
303         New test: editing/selection/doubleclick-japanese-text.html
304
305         * platform/text/TextBoundaries.h:
306         (WebCore::requiresContextForWordBoundary):
307
308 2013-09-03  Mark Lam  <mark.lam@apple.com>
309
310         Converting StackIterator to a callback interface.
311         https://bugs.webkit.org/show_bug.cgi?id=120564.
312
313         Reviewed by Filip Pizlo.
314
315         No new tests.
316
317         * bindings/js/JSXMLHttpRequestCustom.cpp:
318         (WebCore::SendFunctor::SendFunctor):
319         (WebCore::SendFunctor::hasViableFrame):
320         (WebCore::SendFunctor::operator()):
321         (WebCore::JSXMLHttpRequest::send):
322         * bindings/js/ScriptCallStackFactory.cpp:
323         (WebCore::CreateScriptCallStackFunctor::CreateScriptCallStackFunctor):
324         (WebCore::CreateScriptCallStackFunctor::operator()):
325         (WebCore::createScriptCallStack):
326         (WebCore::CreateScriptCallStackForConsoleFunctor::CreateScriptCallStackForConsoleFunctor):
327         (WebCore::CreateScriptCallStackForConsoleFunctor::operator()):
328
329 2013-09-03  Oliver Hunt  <oliver@apple.com>
330
331         Support structured clone of Map and Set
332         https://bugs.webkit.org/show_bug.cgi?id=120654
333
334         Reviewed by Simon Fraser.
335
336         Add support for cloning Map and Set.  Fairly self explanatory change.
337         Needed to add Forwarding headers for the JSMap, JSSet and MapData classes.
338
339         * ForwardingHeaders/runtime/JSMap.h: Added.
340         * ForwardingHeaders/runtime/JSSet.h: Added.
341         * ForwardingHeaders/runtime/MapData.h: Added.
342         * bindings/js/SerializedScriptValue.cpp:
343         (WebCore::CloneSerializer::isMap):
344         (WebCore::CloneSerializer::isSet):
345         (WebCore::CloneSerializer::startSet):
346         (WebCore::CloneSerializer::startMap):
347         (WebCore::CloneSerializer::serialize):
348         (WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible):
349         (WebCore::CloneDeserializer::deserialize):
350
351 2013-09-03  Bear Travis  <betravis@adobe.com>
352
353         [CSS Shapes] Shape's content gets extra left offset when left-border is positive on the content box
354         https://bugs.webkit.org/show_bug.cgi?id=117573
355
356         Reviewed by David Hyatt.
357
358         Nested blocks need to take into account their offset from the shape-inside container.
359         The new code calculates the offset from the shape-inside container, then applies the
360         offset to the computed segments. The line must be moved down by the offset's height,
361         and each segment must be moved left by the offset's width.
362
363         Test: fast/shapes/shape-inside/shape-inside-offset-block-children.html
364
365         * rendering/RenderBlock.cpp:
366         (WebCore::RenderBlock::relayoutShapeDescendantIfMoved): Relayout a block child if its
367         new logical left would cause it to rest at a new position within a shape container.
368         (WebCore::RenderBlock::logicalOffsetFromShapeAncestorContainer): Calculate the logical
369         offset form a shape inside ancestor container.
370         (WebCore::RenderBlock::layoutBlockChild): Call relayoutShapeDescendantIfMoved with the
371         new position offset.
372         * rendering/RenderBlock.h:
373         * rendering/RenderBlockLineLayout.cpp:
374         (WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLine): Use layout offset, rather
375         than just vertical offset.
376         (WebCore::RenderBlock::updateShapeAndSegmentsForCurrentLineInFlowThread): Ditto.
377         (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Ditto.
378         * rendering/shapes/ShapeInsideInfo.h:
379         (WebCore::ShapeInsideInfo::computeSegmentsForLine): Shift segments logically left when
380         there is an inline offset.
381
382 2013-09-03  Antoine Quint  <graouts@apple.com>
383
384         Web Inspector: exceptions triggered from console evaluation do not pause the debugger
385         https://bugs.webkit.org/show_bug.cgi?id=120460
386
387         Reviewed by Timothy Hatcher.
388
389         * inspector/InjectedScriptSource.js:
390         Explicitly set a sourceURL such that the frontend may identify injected script when
391         processing call frames in order to hide such code from the debugger.
392
393 2013-09-03  Andreas Kling  <akling@apple.com>
394
395         Support Vector<Ref<T>>.
396         <https://webkit.org/b/120637>
397
398         Reviewed by Antti Koivisto.
399
400         Use Vector<Ref<T>> internally in Page.
401
402         * page/Page.cpp:
403         (WebCore::networkStateChanged):
404         (WebCore::Page::refreshPlugins):
405
406             Clean up these functions and use Vector<Ref<Frame>> to store pointers to frames
407             since we know they are not going to be null.
408
409         (WebCore::Page::pluginViews):
410
411             Changed this to return a Vector<Ref<PluginView>> by value instead of passing a
412             writable vector as an argument. Clean up loops with 'auto'.
413
414         (WebCore::Page::storageBlockingStateChanged):
415         (WebCore::Page::privateBrowsingStateChanged):
416
417             Tweaked for pluginViews() returning a Vector now.
418
419         (WebCore::Page::setVisibilityState):
420
421             Store Documents that need a visibilitychange event in a Vector<Ref<Document>>.
422
423 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
424
425         [CSS Grid Layout] Add parsing for named grid lines
426         https://bugs.webkit.org/show_bug.cgi?id=119540
427
428         Reviewed by Andreas Kling.
429
430         From Blink r150381,r150587 by <jchaffraix@chromium.org>
431
432         Adds parsing support for named grid lines at <grid-line> level,
433         i.e., inside grid-{row|column}-{start|end}. This change covers
434         only the parsing, layout changes coming in a follow up patch.
435
436         * css/CSSComputedStyleDeclaration.cpp:
437         (WebCore::valueForGridPosition):
438         * css/CSSParser.cpp:
439         (WebCore::CSSParser::parseIntegerOrStringFromGridPosition):
440         (WebCore::CSSParser::parseGridPosition):
441         * css/CSSParser.h:
442         * css/StyleResolver.cpp:
443         (WebCore::createGridPosition):
444         * rendering/RenderGrid.cpp:
445         (WebCore::RenderGrid::resolveGridPositionFromStyle):
446         * rendering/style/GridPosition.h:
447         (WebCore::GridPosition::setExplicitPosition):
448         (WebCore::GridPosition::setSpanPosition):
449         (WebCore::GridPosition::integerPosition):
450         (WebCore::GridPosition::namedGridLine):
451
452 2013-09-03  Alexey Proskuryakov  <ap@apple.com>
453
454         [Mac] Hyphenation respects regional format settings language instead of primary language
455         https://bugs.webkit.org/show_bug.cgi?id=120641
456
457         Reviewed by Dan Bernstein.
458
459         Fixes hyphenation tests on my machine with non-English regional format settings.
460
461         * platform/text/cf/HyphenationCF.cpp: (createValueForNullKey):
462         Use primary UI language for hyphenation, not regional settings language.
463
464 2013-09-03  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
465
466         [GTK][EFL] include missing localized strings for subtitle auto track
467         https://bugs.webkit.org/show_bug.cgi?id=120629
468
469         those methods are necessary to show the "Auto" track on webkitgtk
470
471         Reviewed by Gustavo Noronha Silva.
472
473         * platform/efl/LocalizedStringsEfl.cpp:
474         (WebCore::textTrackAutomaticMenuItemText):
475         * platform/gtk/LocalizedStringsGtk.cpp:
476         (WebCore::textTrackAutomaticMenuItemText):
477
478 2013-09-03  Daniel Bates  <dabates@apple.com>
479
480         Require layout when -webkit-overflow-scrolling changes
481         https://bugs.webkit.org/show_bug.cgi?id=120535
482
483         Reviewed by Darin Adler.
484
485         Test: fast/repaint/overflow-scroll-touch-repaint.html
486
487         We want to require a layout when the value of -webkit-overflow-scrolling changes
488         since -webkit-overflow-scrolling creates a stacking context.
489
490         * rendering/style/RenderStyle.cpp:
491         (WebCore::RenderStyle::changeRequiresLayout):
492
493 2013-09-02  Ryosuke Niwa  <rniwa@webkit.org>
494
495         Support the "json" responseType and JSON response entity in XHR
496         https://bugs.webkit.org/show_bug.cgi?id=73648
497
498         Reviewed by Oliver Hunt.
499
500         Based on the patch written by Jarred Nicholls.
501
502         Implement 'json' type for XMLHttpRequest.response. We cache the result on JSC side as a cached attribute
503         unlike other response types like 'document' and 'blob' for which the parsed response object is cached
504         in XMLHttpRequest itself. In the long run, we should do the same for other types of response types.
505
506         Also refactored the various code to share the code.
507
508         Tests: fast/xmlhttprequest/xmlhttprequest-responsetype-json-invalid.html
509                fast/xmlhttprequest/xmlhttprequest-responsetype-json-utf16.html
510                fast/xmlhttprequest/xmlhttprequest-responsetype-json-valid.html
511
512         * ForwardingHeaders/runtime/JSONObject.h: Added.
513
514         * bindings/js/JSXMLHttpRequestCustom.cpp:
515         (WebCore::JSXMLHttpRequest::visitChildren):
516         (WebCore::JSXMLHttpRequest::response): Use JSONParse to parse the response text and cache the result.
517         Call didCacheResponseJSON to set the cache status and clear the original response buffer.
518
519         * xml/XMLHttpRequest.cpp:
520         (WebCore::XMLHttpRequest::XMLHttpRequest): Added m_responseCacheIsValid to invalidate the cache of
521         a json response.
522         (WebCore::XMLHttpRequest::responseText):
523         (WebCore::XMLHttpRequest::didCacheResponseJSON): Added; Updates m_responseCacheIsValid and clears the
524         response buffer to save memory.
525         (WebCore::XMLHttpRequest::responseXML):
526         (WebCore::XMLHttpRequest::setResponseType):
527         (WebCore::XMLHttpRequest::responseType):
528         (WebCore::XMLHttpRequest::clearResponseBuffers):
529         (WebCore::XMLHttpRequest::didReceiveData):
530
531         * xml/XMLHttpRequest.h:
532         (WebCore::XMLHttpRequest::doneWithoutErrors): Extracted from responseXML.
533         (WebCore::XMLHttpRequest::responseTextIgnoringResponseType): Extracted from responseText.
534         (WebCore::XMLHttpRequest::responseCacheIsValid): Added.
535         (WebCore::XMLHttpRequest::shouldDecodeResponse): Extracted from didReceiveData.
536         Also modified to decode when the response type is ResponseTypeJSON.
537
538         * xml/XMLHttpRequest.idl: Added CachedAttribute IDL extention on response property. This cache is
539         used when the response type is 'json'.
540
541 2013-09-03  Commit Queue  <commit-queue@webkit.org>
542
543         Unreviewed, rolling out r154881.
544         http://trac.webkit.org/changeset/154881
545         https://bugs.webkit.org/show_bug.cgi?id=120643
546
547         Crashes on macworld.com (Requested by kling on #webkit).
548
549         * dom/Element.cpp:
550         (WebCore::Element::setAttributeInternal):
551
552 2013-09-03  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
553
554         [GStreamer] Don't set state to NULL until element is destroyed
555         https://bugs.webkit.org/show_bug.cgi?id=117354
556
557         Reviewed by Philippe Normand.
558
559         Don't set playbin to NULL until it is going to be destroyed or if we stay
560         for too long on the READY state. Instead only set the state to READY as this
561         allows much faster state changes to PAUSED/PLAYING again. playbin internally
562         caches some state that is destroyed when setting it to NULL.
563         This state is independent of the URI and it is even possible to change the
564         URI in READY state.
565
566         To avoid having resources (e.g. audio devices) open indefinitely,
567         when setting the state to READY we create a timeout and if the timeout
568         is reached we reset the pipeline state to NULL to free resources.
569
570         Also now all state changes use the changePipelineState method instead of setting
571         the playbin state directly with gst_element_set_state, so we have a better control
572         of when we are requesting state changes.
573
574         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
575         (WebCore::mediaPlayerPrivateReadyStateTimeoutCallback):
576         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
577         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
578         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
579         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
580         (WebCore::MediaPlayerPrivateGStreamer::setRate):
581         (WebCore::MediaPlayerPrivateGStreamer::handlePluginInstallerResult):
582         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
583
584 2013-09-03  peavo@outlook.com  <peavo@outlook.com>
585
586         [WinCairo] Unneeded code in method GlyphPage::fill().
587         https://bugs.webkit.org/show_bug.cgi?id=120634
588
589         Reviewed by Andreas Kling.
590
591         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
592         (WebCore::GlyphPage::fill): Remove unneeded call to GetTextMetrics() function.
593
594 2013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
595
596         [CSSRegions] Pseudo-elements as regions should not be exposed to JS
597         https://bugs.webkit.org/show_bug.cgi?id=120633
598
599         Reviewed by Andreas Kling.
600
601         Until we properly implement the Region interface (http://dev.w3.org/csswg/css-regions/#the-region-interface)
602         for pseudo-elements, we should not return these as regions in JS.
603
604         Tests: fast/regions/get-regions-by-content-pseudo.html
605                fast/regions/webkit-named-flow-get-regions-pseudo.html
606
607         * dom/WebKitNamedFlow.cpp:
608         (WebCore::WebKitNamedFlow::firstEmptyRegionIndex): Skip pseudo-elements as regions here too,
609         otherwise we may get an index that cannot be used with getRegions().
610         (WebCore::WebKitNamedFlow::getRegionsByContent):
611         (WebCore::WebKitNamedFlow::getRegions):
612
613 2013-09-03  Zan Dobersek  <zdobersek@igalia.com>
614
615         REGRESSION(r154967): http appcache tests crashing on WK1
616         https://bugs.webkit.org/show_bug.cgi?id=120620
617
618         Reviewed by Andreas Kling.
619
620         * loader/appcache/ApplicationCacheGroup.cpp:
621         (WebCore::ApplicationCacheGroup::cacheDestroyed): Reintroduce pre-r154967 behavior that returned early in
622         this method if the passed-in ApplicationCache object was not found in the ApplicationCacheGroup's HashSet
623         of all the caches. This is now done by checking that the HashSet<T>::remove(T) returns true (meaning the
624         object was found in the HashSet and removed from it) in addition to that HashSet being subsequently empty
625         before the method moves on to destroying its ApplicationCacheGroup instance.
626
627 2013-09-03  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
628
629         [gstreamer] Disable HTTP request "Accept-Encoding:" header field on gstreamer source element to avoid receiving the wrong size when retrieving data
630         https://bugs.webkit.org/show_bug.cgi?id=115354
631
632         Reviewed by Philippe Normand.
633
634         Also disable Accept-Encoding on ResourceRequest::toSoupMessage accordingly.
635
636         * platform/network/soup/ResourceRequestSoup.cpp:
637         (WebCore::ResourceRequest::toSoupMessage):
638         Call ResourceRequest::updateSoupMessage from ResourceRequest::toSoupMessage so that the
639         Accept-Encoding header is also respected.
640
641 2013-09-03  Krzysztof Czech  <k.czech@samsung.com>
642
643         [AX][ATK] Added support for sort and help attributes.
644         https://bugs.webkit.org/show_bug.cgi?id=120456
645
646         Reviewed by Chris Fleizach.
647
648         Added support for aria-sort and aria-help attributes.
649
650         Test: accessibility/aria-sort.html
651
652         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
653         (webkitAccessibleGetAttributes):
654
655 2013-09-03  Allan Sandfeld Jensen  <allan.jensen@digia.com>
656
657         [Qt] Remove dead code for QtXmlPatterns
658         https://bugs.webkit.org/show_bug.cgi?id=120624
659
660         Reviewed by Simon Hausmann.
661
662         Remove code supporting XSLT using QtXmlPatterns which has been
663         dead for some time.
664
665         * Target.pri:
666         * WebCore.pri:
667         * dom/TransformSourceQt.cpp: Removed.
668         * xml/XSLStyleSheetQt.cpp: Removed.
669         * xml/XSLTProcessorQt.cpp: Removed.
670         * xml/parser/XMLDocumentParserQt.cpp:
671         (WebCore::XMLDocumentParser::doEnd):
672         (WebCore::XMLDocumentParser::parseProcessingInstruction):
673
674 2013-09-03  Mihnea Ovidenie  <mihnea@adobe.com>
675
676         [CSS Regions] position: fixed is computed relative to the first region, not the viewport
677         https://bugs.webkit.org/show_bug.cgi?id=111176
678
679         Reviewed by David Hyatt.
680
681         Fixed positioned elements inside a named flow should be positioned and sized relative to the viewport,
682         not on the first region, as described in the spec: http://dev.w3.org/csswg/css-regions/#the-flow-into-property.
683         While the flow thread will still act as containing block for the fixed positioned elements, the painting and hit
684         testing for the fixed positioned elements is done by RenderView. The layers for the fixed positioned elements
685         are collected by the flow thread.
686  
687         Tests: fast/regions/element-in-named-flow-absolute-from-fixed.html
688                fast/regions/element-in-named-flow-fixed-from-absolute.html
689                fast/regions/element-inflow-fixed-from-outflow-static.html
690                fast/regions/element-outflow-static-from-inflow-fixed.html
691                fast/regions/fixed-element-transformed-parent.html
692                fast/regions/fixed-in-named-flow-scroll.html
693                fast/regions/fixed-inside-fixed-in-named-flow.html
694                fast/regions/fixed-inside-named-flow-zIndex.html
695                fast/regions/fixed-pos-elem-in-namedflow-noregions.html
696                fast/regions/fixed-pos-region-in-nested-flow.html
697
698         * rendering/FlowThreadController.cpp:
699         (WebCore::FlowThreadController::collectFixedPositionedLayers):
700         Return the list of layers for the fixed positioned elements with named flows as containing blocks.
701         Used in RenderLayer:: paintFixedLayersInNamedFlows and RenderLayer:: hitTestFixedLayersInNamedFlows.
702         * rendering/FlowThreadController.h:
703         * rendering/RenderBox.cpp:
704         (WebCore::RenderBox::mapLocalToContainer):
705         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
706         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
707         For fixed positioned elements, width and height are given by the view instead of the first region.
708         * rendering/RenderLayer.cpp:
709         (WebCore::accumulateOffsetTowardsAncestor):
710         Modified for the fixed positioned elements inside named flows with the named flows as containing block
711         to take into account the view scroll.
712         (WebCore::compareZIndex):
713         Moved upwards because it is used in RenderLayer::paintFixedLayersInNamedFlows.
714         (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
715         Paint the list of fixed layers directly from the RenderView instead of painting them through regions -> named flows.
716         (WebCore::RenderLayer::paintLayerContents):
717         (WebCore::RenderLayer::paintList):
718         (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
719         Hit test the layers for the fix positioned elements inside named flows from the RenderView layer
720         instead of the region -> named flow layer.
721         (WebCore::RenderLayer::hitTestLayer):
722         (WebCore::RenderLayer::calculateRects):
723         * rendering/RenderLayer.h:
724         * rendering/RenderLayerCompositor.cpp:
725         (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
726         We do not support yet the accelerated compositing for elements in named flows,
727         so bail out early here. We need to revisit fixed elements once we finish accelerated compositing for elements in named flows.
728         * rendering/RenderObject.cpp:
729         (WebCore::RenderObject::fixedPositionedWithNamedFlowContainingBlock):
730         (WebCore::hasFixedPosInNamedFlowContainingBlock):
731         (WebCore::RenderObject::containerForRepaint):
732         Changed to take into account that RenderView should be the repaintContainer for the
733         fixed positioned elements with named flow as the containing block.
734         * rendering/RenderObject.h:
735
736 2013-09-03  Arvid Nilsson  <anilsson@rim.com>
737
738         [BlackBerry] Remove LayerData::LayerProgram
739         https://bugs.webkit.org/show_bug.cgi?id=120601
740
741         Reviewed by Anders Carlsson.
742
743         JIRA 490672
744         All layer contents are RGBA now, so there's no need to support BGRA any
745         more and the LayerData::LayerProgram enum can be removed. Related dead
746         code was removed.
747
748         No new tests, no change in behavior.
749
750         * platform/graphics/blackberry/EGLImageLayerWebKitThread.cpp:
751         (WebCore::EGLImageLayerWebKitThread::EGLImageLayerWebKitThread):
752         * platform/graphics/blackberry/LayerData.h:
753         (WebCore::LayerData::LayerData):
754         * platform/graphics/blackberry/LayerRenderer.cpp:
755         (WebCore::LayerRenderer::compositeLayersRecursive):
756         (WebCore::LayerRenderer::createProgram):
757         * platform/graphics/blackberry/LayerRenderer.h:
758         * platform/graphics/blackberry/LayerWebKitThread.h:
759         * platform/graphics/blackberry/PluginLayerWebKitThread.cpp:
760         (WebCore::PluginLayerWebKitThread::setPluginView):
761
762 2013-09-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
763
764         [GStreamer] Video player sets system volume to 100%
765         https://bugs.webkit.org/show_bug.cgi?id=118974
766
767         Reviewed by Philippe Normand.
768
769         In order to preserve the system volume we need to keep track of
770         the volume being initialized in the HTMLMediaElement and then just
771         setting the volume to the sink when initializing the pipeline if
772         that volume was changed before.
773
774         * html/HTMLMediaElement.cpp:
775         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialized
776         attribute to false.
777         (WebCore::HTMLMediaElement::setVolume): Set the attribute to true
778         when volume is changed.
779         (WebCore::HTMLMediaElement::updateVolume): Set the volume only if
780         volume was initialized.
781         (WebCore::HTMLMediaElement::mediaPlayerPlatformVolumeConfigurationRequired):
782         Platform volume configuration is required only if volume was not
783         initialized before.
784         * html/HTMLMediaElement.h: Added attribute and interface method.
785         * platform/graphics/MediaPlayer.h:
786         (WebCore::MediaPlayerClient::mediaPlayerPlatformVolumeConfigurationRequired):
787         Declared and added default implementation for the interface method.
788         (WebCore::MediaPlayer::platformVolumeConfigurationRequired):
789         Asked the client, meaning the HTMLMediaElement if the platform
790         volume configuration is required.
791         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
792         (WebCore::mediaPlayerPrivateVolumeChangedCallback): Added log.
793         (WebCore::MediaPlayerPrivateGStreamerBase::setVolume): Added log.
794         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
795         Set the volume only if not platform volume is required and added log.
796
797 2013-09-02  Darin Adler  <darin@apple.com>
798
799         * inspector/InspectorProfilerAgent.cpp:
800         (WebCore::InspectorProfilerAgent::removeProfile): Fix braces here; a review
801         comment I forgot to address in my last check-in.
802
803 2013-09-02  Darin Adler  <darin@apple.com>
804
805         Cut down on double hashing and code needlessly using hash table iterators
806         https://bugs.webkit.org/show_bug.cgi?id=120611
807
808         Reviewed by Andreas Kling.
809
810         Some of these changes are primarily code cleanup, but others could provide
811         a small code size and speed improvement by avoiding extra hashing.
812
813         * Modules/geolocation/Geolocation.cpp:
814         (WebCore::Geolocation::Watchers::find): Use get instead of find.
815         (WebCore::Geolocation::Watchers::remove): Use take instead of find.
816         (WebCore::Geolocation::makeCachedPositionCallbacks): Use the return
817         value from remove to avoid hashing twice.
818
819         * Modules/webaudio/AudioContext.cpp:
820         (WebCore::AudioContext::addAutomaticPullNode): Use the return value from
821         add to avoid hashing twice.
822         (WebCore::AudioContext::removeAutomaticPullNode): Use the return value
823         from remove to avoid hashing twice.
824
825         * Modules/webaudio/AudioNodeInput.cpp:
826         (WebCore::AudioNodeInput::connect): Use the return value from add to avoid
827         hashing twice.
828         (WebCore::AudioNodeInput::disconnect): Use the return value from remove
829         to avoid hashing twice.
830
831         * Modules/webaudio/AudioParam.cpp:
832         (WebCore::AudioParam::connect): Use the return value from add to avoid
833         hashing twice.
834         (WebCore::AudioParam::disconnect): Use the return value from remove to
835         avoid hashing twice.
836
837         * bridge/NP_jsobject.cpp:
838         (ObjectMap::remove): Use remove instead of find/remove.
839
840         * dom/Node.cpp:
841         (WebCore::Node::~Node): Use the return value from remove instead of
842         find/remove.
843
844         * inspector/InspectorProfilerAgent.cpp:
845         (WebCore::InspectorProfilerAgent::removeProfile): Remove needless
846         calls to contains.
847
848         * loader/DocumentLoader.cpp:
849         (WebCore::DocumentLoader::removeSubresourceLoader): Use the return
850         value from remove instead of find/remove.
851
852         * loader/ResourceLoadScheduler.cpp:
853         (WebCore::ResourceLoadScheduler::HostInformation::remove): Use the
854         return value from remove to avoid hashing twice.
855
856         * loader/appcache/ApplicationCacheGroup.cpp:
857         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Use
858         remove instead of find/remove.
859         (WebCore::ApplicationCacheGroup::cacheDestroyed): Removed a needless
860         call to contains to avoid hashing twice. It's fine to do the check
861         for an empty hash table unconditionally.
862
863         * page/DOMWindow.cpp:
864         (WebCore::addUnloadEventListener): Eliminated a local variable for clarity.
865         (WebCore::removeUnloadEventListener): Ditto. Also use remove instead
866         of find/remove.
867         (WebCore::removeAllUnloadEventListeners): Ditto. Also use removeAll instead
868         of find/removeAll.
869         (WebCore::addBeforeUnloadEventListener): Ditto.
870         (WebCore::removeBeforeUnloadEventListener): Ditto.
871         (WebCore::removeAllBeforeUnloadEventListeners): Ditto.
872
873         * page/FrameView.cpp:
874         (WebCore::FrameView::removeViewportConstrainedObject): Use the return
875         value from remove to avoid hashing twice.
876         (WebCore::FrameView::removeScrollableArea): Use the return value from
877         remove instead of find/remove.
878         (WebCore::FrameView::containsScrollableArea): Use && instead of an if
879         statement in a way that is idiomatic for this kind of function.
880
881         * page/Page.cpp:
882         (WebCore::Page::addRelevantRepaintedObject): Use the return value from
883         remove instead of find/remove.
884
885         * page/PageGroup.cpp:
886         (WebCore::PageGroup::removeUserScriptsFromWorld): Use remove instead
887         of find/remove.
888         (WebCore::PageGroup::removeUserStyleSheetsFromWorld): Use the return
889         value from remove instead of find/remove.
890
891         * page/PerformanceUserTiming.cpp:
892         (WebCore::clearPeformanceEntries): Removed a needless call to contains.
893
894         * platform/graphics/DisplayRefreshMonitor.cpp:
895         (WebCore::DisplayRefreshMonitor::removeClient): Use the return value
896         from remove instead of find/remove.
897         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh): Use remove
898         instead of find/remove.
899
900         * platform/graphics/blackberry/LayerRenderer.cpp:
901         (WebCore::LayerRenderer::removeLayer): Use the return value from remove
902         instead of find/remove.
903
904         * platform/win/WindowMessageBroadcaster.cpp:
905         (WebCore::WindowMessageBroadcaster::removeListener): Use remove instead
906         of find/remove. It's fine to do the check for an empty hash table unconditionally.
907
908         * plugins/PluginDatabase.cpp:
909         (WebCore::PluginDatabase::removeDisabledPluginFile): Use the return value
910         from remove instead of find/remove.
911
912         * rendering/style/StyleCustomFilterProgramCache.cpp:
913         (WebCore::StyleCustomFilterProgramCache::lookup): Use get instead of find.
914         (WebCore::StyleCustomFilterProgramCache::add): Use contains instead of find
915         in an assertion.
916         (WebCore::StyleCustomFilterProgramCache::remove): Use remove instead of
917         find/remove.
918
919         * svg/SVGCursorElement.cpp:
920         (WebCore::SVGCursorElement::removeClient): Use the return value from remove
921         instead of find/remove.
922
923         * svg/SVGDocumentExtensions.cpp:
924         (WebCore::SVGDocumentExtensions::removeResource): Removed an unneeded call
925         to contains.
926         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Use
927         remove instead of find/remove. It's fine to do the check for an empty hash
928         table unconditionally.
929         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Use
930         remove instead of find/remove. Also removed unhelpful assertions. One is
931         already done by HashMap, and the other is just checking a basic invariant
932         of every HashMap that doesn't need to be checked.
933
934         * svg/graphics/SVGImageCache.cpp:
935         (WebCore::SVGImageCache::removeClientFromCache): Removed an unneeded call
936         to contains.
937
938         * svg/properties/SVGAnimatedProperty.cpp:
939         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Use the version of
940         remove that takes an iterator rather than the one that takes a key, so
941         we don't need to redo the hashing.
942
943 2013-09-02  Andreas Kling  <akling@apple.com>
944
945         Generate isFooElement() functions from tagname data.
946         <https://webkit.org/b/120584>
947
948         Reviewed by Antti Koivisto.
949
950         Add a "generateTypeChecks" attribute that can be used in HTMLTagNames.in & friends.
951         If present, isFooElement() style helpers will be added to HTMLElementTypeChecks.h.
952         This also outputs an isElementOfType<T> check for the Element iterators.
953
954         Removed all the hand-written isFooElement() functions that only checked tag name.
955
956         * html/HTMLTagNames.in:
957         * svg/svgtags.in:
958
959             Added "generateTypeChecks" attribute as appropriate.
960
961         * GNUmakefile.am:
962         * GNUmakefile.list.am:
963         * WebCore.vcxproj/WebCore.vcxproj:
964         * WebCore.xcodeproj/project.pbxproj:
965
966             Added to build systems based on how HTMLNames.h was done.
967             We're just outputting an additional header file in the generated code directory
968             so I suspect most ports will just pick this up automagically.
969
970         * dom/make_names.pl:
971         (defaultTagPropertyHash):
972         (printLicenseHeader):
973         (printTypeChecks):
974         (printTypeChecksHeaderFile):
975
976             Generate a separate file for each namespace with isFooElement() helpers for
977             elements with "generateTypeChecks" attribute set.
978
979 2013-09-02  Darin Adler  <darin@apple.com>
980
981         [Mac] No need for HardAutorelease, which is same as CFBridgingRelease
982         https://bugs.webkit.org/show_bug.cgi?id=120569
983
984         Reviewed by Andy Estes.
985
986         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
987         (AXTextMarkerRange):
988         (AXTextMarkerRangeStart):
989         (AXTextMarkerRangeEnd):
990         (textMarkerForVisiblePosition):
991         Use CFBridgingRelease.
992
993         * platform/mac/KURLMac.mm:
994         (WebCore::KURL::operator NSURL *): Use CFBridgingRelease.
995         (WebCore::KURL::createCFURL): Get rid of needless local variable.
996
997         * platform/mac/WebCoreNSURLExtras.mm:
998         (WebCore::mapHostNameWithRange):
999         (WebCore::URLWithData):
1000         (WebCore::userVisibleString):
1001         * platform/text/mac/StringImplMac.mm:
1002         (WTF::StringImpl::operator NSString *):
1003         Use CFBridgingRelease.
1004
1005 2013-09-01  Andreas Kling  <akling@apple.com>
1006
1007         Ref: A smart pointer for the reference age.
1008         <https://webkit.org/b/120570>
1009
1010         Reviewed by Antti Koivisto.
1011
1012         Use Ref<T> for various stack guards where null checking isn't needed.
1013
1014 2013-09-02  Andreas Kling  <akling@apple.com>
1015
1016         Simplify DocumentType handling.
1017         <https://webkit.org/b/120529>
1018
1019         Reviewed by Antti Koivisto.
1020
1021         Removed the insertedInto()/removedFrom() handlers from DocumentType.
1022
1023         Document no longer keeps a pointer to its doctype node, it was only used for the
1024         document.doctype DOM API, which now just looks through the list of (<=2) children.
1025
1026         The ENABLE(LEGACY_VIEWPORT_ADAPTION) hunk from Document::setDocType() was moved
1027         into Document::childrenChanged().
1028
1029         We no longer clear the style resolver on doctype insertion/removal since it
1030         doesn't actually affect style anyway.
1031
1032         Also made doctype() return a PassRefPtr<DocumentType> instead of a raw pointer.
1033
1034         * dom/Document.cpp:
1035         (WebCore::Document::dispose):
1036         (WebCore::Document::doctype):
1037         (WebCore::Document::childrenChanged):
1038         * dom/Document.h:
1039         * dom/DocumentType.cpp:
1040         * dom/DocumentType.h:
1041         * editing/markup.cpp:
1042         (WebCore::documentTypeString):
1043
1044 2013-09-02  Anton Obzhirov  <a.obzhirov@samsung.com>
1045
1046         <https://webkit.org/b/98350> [GTK] accessibility/aria-invalid.html times out
1047
1048         Reviewed by Mario Sanchez Prada.
1049
1050         The patch exposes aria-invalid attribute to ATK.
1051
1052         * accessibility/atk/AXObjectCacheAtk.cpp:
1053         (WebCore::AXObjectCache::postPlatformNotification):
1054         Added emitting state-change signal for aria-invalid event.
1055         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1056         (webkitAccessibleGetAttributes):
1057         Added aria-invalid attribute.
1058
1059 2013-09-02  Commit Queue  <commit-queue@webkit.org>
1060
1061         Unreviewed, rolling out r154955.
1062         http://trac.webkit.org/changeset/154955
1063         https://bugs.webkit.org/show_bug.cgi?id=120605
1064
1065         broke xcode4 build :| (Requested by kling on #webkit).
1066
1067         * GNUmakefile.am:
1068         * GNUmakefile.list.am:
1069         * WebCore.vcxproj/WebCore.vcxproj:
1070         * WebCore.xcodeproj/project.pbxproj:
1071         * dom/make_names.pl:
1072         (defaultTagPropertyHash):
1073         (printLicenseHeader):
1074         * html/HTMLAnchorElement.h:
1075         (WebCore::isHTMLAnchorElement):
1076         (WebCore::HTMLAnchorElement):
1077         * html/HTMLAreaElement.h:
1078         (WebCore::isHTMLAreaElement):
1079         (WebCore::HTMLAreaElement):
1080         * html/HTMLAudioElement.h:
1081         (WebCore::isHTMLAudioElement):
1082         * html/HTMLBaseElement.h:
1083         (WebCore::isHTMLBaseElement):
1084         (WebCore::HTMLBaseElement):
1085         * html/HTMLCanvasElement.h:
1086         (WebCore::isHTMLCanvasElement):
1087         * html/HTMLElement.h:
1088         * html/HTMLFieldSetElement.h:
1089         (WebCore::isHTMLFieldSetElement):
1090         (WebCore::HTMLFieldSetElement):
1091         * html/HTMLFormElement.h:
1092         (WebCore::isHTMLFormElement):
1093         * html/HTMLFrameSetElement.h:
1094         (WebCore::isHTMLFrameSetElement):
1095         (WebCore::HTMLFrameSetElement):
1096         * html/HTMLImageElement.h:
1097         (WebCore::isHTMLImageElement):
1098         * html/HTMLInputElement.h:
1099         (WebCore::isHTMLInputElement):
1100         * html/HTMLLabelElement.h:
1101         (WebCore::isHTMLLabelElement):
1102         (WebCore::HTMLLabelElement):
1103         * html/HTMLLegendElement.h:
1104         (WebCore::isHTMLLegendElement):
1105         (WebCore::HTMLLegendElement):
1106         * html/HTMLMapElement.h:
1107         (WebCore::isHTMLMapElement):
1108         * html/HTMLMeterElement.h:
1109         (WebCore::isHTMLMeterElement):
1110         * html/HTMLOptGroupElement.h:
1111         (WebCore::isHTMLOptGroupElement):
1112         * html/HTMLOptionElement.h:
1113         (WebCore::isHTMLOptionElement):
1114         * html/HTMLParamElement.h:
1115         (WebCore::isHTMLParamElement):
1116         (WebCore::HTMLParamElement):
1117         * html/HTMLProgressElement.h:
1118         (WebCore::isHTMLProgressElement):
1119         * html/HTMLScriptElement.h:
1120         (WebCore::isHTMLScriptElement):
1121         * html/HTMLSourceElement.h:
1122         (WebCore::isHTMLSourceElement):
1123         (WebCore::HTMLSourceElement):
1124         * html/HTMLStyleElement.h:
1125         (WebCore::isHTMLStyleElement):
1126         (WebCore::HTMLStyleElement):
1127         * html/HTMLTableElement.h:
1128         (WebCore::isHTMLTableElement):
1129         * html/HTMLTableRowElement.h:
1130         (WebCore::isHTMLTableRowElement):
1131         (WebCore::HTMLTableRowElement):
1132         * html/HTMLTagNames.in:
1133         * html/HTMLTextAreaElement.h:
1134         (WebCore::isHTMLTextAreaElement):
1135         * html/HTMLTitleElement.h:
1136         (WebCore::isHTMLTitleElement):
1137         (WebCore::HTMLTitleElement):
1138         * html/HTMLTrackElement.h:
1139         (WebCore::isHTMLTrackElement):
1140         (WebCore::HTMLTrackElement):
1141         * svg/SVGElement.h:
1142         * svg/SVGFontElement.h:
1143         (WebCore::isSVGFontElement):
1144         * svg/SVGFontFaceElement.h:
1145         (WebCore::isSVGFontFaceElement):
1146         (WebCore::SVGFontFaceElement):
1147         * svg/SVGForeignObjectElement.h:
1148         (WebCore::isSVGForeignObjectElement):
1149         (WebCore::SVGForeignObjectElement):
1150         * svg/SVGImageElement.h:
1151         (WebCore::isSVGImageElement):
1152         * svg/SVGScriptElement.h:
1153         (WebCore::isSVGScriptElement):
1154         * svg/svgtags.in:
1155
1156 2013-09-02  Antti Koivisto  <antti@apple.com>
1157
1158         Clean up ContainerNode::childrenChanged
1159         https://bugs.webkit.org/show_bug.cgi?id=120599
1160
1161         Reviewed by Andreas Kling.
1162
1163         - Make childrenChanged take a single struct argument instead of a long list of arguments.
1164         - Use enum instead of childCountDelta. It was always -1, 0, 1 or the total number of children (in case of removing them all).
1165         - Remove use of Node*, give the change range as Elements.
1166         - Related cleanups.
1167
1168         * dom/Attr.cpp:
1169         (WebCore::Attr::childrenChanged):
1170         * dom/Attr.h:
1171         * dom/CharacterData.cpp:
1172         (WebCore::CharacterData::parserAppendData):
1173         (WebCore::CharacterData::dispatchModifiedEvent):
1174         * dom/ContainerNode.cpp:
1175         (WebCore::ContainerNode::insertBefore):
1176         (WebCore::ContainerNode::notifyChildInserted):
1177         (WebCore::ContainerNode::notifyChildRemoved):
1178         
1179             Add private helpers for setting up the struct.
1180
1181         (WebCore::ContainerNode::parserInsertBefore):
1182         (WebCore::ContainerNode::replaceChild):
1183         (WebCore::ContainerNode::removeChild):
1184         (WebCore::ContainerNode::parserRemoveChild):
1185         (WebCore::ContainerNode::removeChildren):
1186         (WebCore::ContainerNode::appendChild):
1187         (WebCore::ContainerNode::parserAppendChild):
1188         (WebCore::ContainerNode::childrenChanged):
1189         (WebCore::ContainerNode::updateTreeAfterInsertion):
1190         * dom/ContainerNode.h:
1191         * dom/Document.cpp:
1192         (WebCore::Document::childrenChanged):
1193         * dom/Document.h:
1194         * dom/Element.cpp:
1195         (WebCore::checkForSiblingStyleChanges):
1196         
1197             Clean up and simplify. Since we now get element range automatically we don't need to compute it.
1198
1199         (WebCore::Element::childrenChanged):
1200         (WebCore::Element::finishParsingChildren):
1201         * dom/Element.h:
1202         * dom/ShadowRoot.cpp:
1203         (WebCore::ShadowRoot::childrenChanged):
1204         * dom/ShadowRoot.h:
1205         * html/HTMLElement.cpp:
1206         (WebCore::HTMLElement::childrenChanged):
1207         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
1208         
1209             Try to keep the existing behavior. This code needs  more cleanup to be sane. It shouldn't operate on Nodes
1210             as it only really cares about Elements.
1211
1212         * html/HTMLElement.h:
1213         * html/HTMLFieldSetElement.cpp:
1214         (WebCore::HTMLFieldSetElement::childrenChanged):
1215         * html/HTMLFieldSetElement.h:
1216         * html/HTMLObjectElement.cpp:
1217         (WebCore::HTMLObjectElement::childrenChanged):
1218         * html/HTMLObjectElement.h:
1219         * html/HTMLOptGroupElement.cpp:
1220         (WebCore::HTMLOptGroupElement::childrenChanged):
1221         * html/HTMLOptGroupElement.h:
1222         * html/HTMLOptionElement.cpp:
1223         (WebCore::HTMLOptionElement::childrenChanged):
1224         * html/HTMLOptionElement.h:
1225         * html/HTMLOutputElement.cpp:
1226         (WebCore::HTMLOutputElement::childrenChanged):
1227         * html/HTMLOutputElement.h:
1228         * html/HTMLScriptElement.cpp:
1229         (WebCore::HTMLScriptElement::childrenChanged):
1230         * html/HTMLScriptElement.h:
1231         * html/HTMLSelectElement.cpp:
1232         (WebCore::HTMLSelectElement::childrenChanged):
1233         * html/HTMLSelectElement.h:
1234         * html/HTMLStyleElement.cpp:
1235         (WebCore::HTMLStyleElement::childrenChanged):
1236         * html/HTMLStyleElement.h:
1237         * html/HTMLTextAreaElement.cpp:
1238         (WebCore::HTMLTextAreaElement::childrenChanged):
1239         * html/HTMLTextAreaElement.h:
1240         * html/HTMLTitleElement.cpp:
1241         (WebCore::HTMLTitleElement::childrenChanged):
1242         * html/HTMLTitleElement.h:
1243         * html/shadow/InsertionPoint.cpp:
1244         (WebCore::InsertionPoint::childrenChanged):
1245         * html/shadow/InsertionPoint.h:
1246         * svg/SVGClipPathElement.cpp:
1247         (WebCore::SVGClipPathElement::childrenChanged):
1248         * svg/SVGClipPathElement.h:
1249         * svg/SVGElement.cpp:
1250         (WebCore::SVGElement::childrenChanged):
1251         * svg/SVGElement.h:
1252         * svg/SVGFELightElement.cpp:
1253         (WebCore::SVGFELightElement::childrenChanged):
1254         * svg/SVGFELightElement.h:
1255         * svg/SVGFilterElement.cpp:
1256         (WebCore::SVGFilterElement::childrenChanged):
1257         * svg/SVGFilterElement.h:
1258         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1259         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
1260         * svg/SVGFilterPrimitiveStandardAttributes.h:
1261         * svg/SVGFontFaceElement.cpp:
1262         (WebCore::SVGFontFaceElement::childrenChanged):
1263         * svg/SVGFontFaceElement.h:
1264         * svg/SVGFontFaceFormatElement.cpp:
1265         (WebCore::SVGFontFaceFormatElement::childrenChanged):
1266         * svg/SVGFontFaceFormatElement.h:
1267         * svg/SVGFontFaceSrcElement.cpp:
1268         (WebCore::SVGFontFaceSrcElement::childrenChanged):
1269         * svg/SVGFontFaceSrcElement.h:
1270         * svg/SVGFontFaceUriElement.cpp:
1271         (WebCore::SVGFontFaceUriElement::childrenChanged):
1272         * svg/SVGFontFaceUriElement.h:
1273         * svg/SVGGradientElement.cpp:
1274         (WebCore::SVGGradientElement::childrenChanged):
1275         * svg/SVGGradientElement.h:
1276         * svg/SVGMarkerElement.cpp:
1277         (WebCore::SVGMarkerElement::childrenChanged):
1278         * svg/SVGMarkerElement.h:
1279         * svg/SVGMaskElement.cpp:
1280         (WebCore::SVGMaskElement::childrenChanged):
1281         * svg/SVGMaskElement.h:
1282         * svg/SVGPatternElement.cpp:
1283         (WebCore::SVGPatternElement::childrenChanged):
1284         * svg/SVGPatternElement.h:
1285         * svg/SVGScriptElement.cpp:
1286         (WebCore::SVGScriptElement::childrenChanged):
1287         * svg/SVGScriptElement.h:
1288         * svg/SVGStyleElement.cpp:
1289         (WebCore::SVGStyleElement::childrenChanged):
1290         * svg/SVGStyleElement.h:
1291         * svg/SVGTitleElement.cpp:
1292         (WebCore::SVGTitleElement::childrenChanged):
1293         * svg/SVGTitleElement.h:
1294
1295 2013-09-02  Andreas Kling  <akling@apple.com>
1296
1297         Generate isFooElement() functions from tagname data.
1298         <https://webkit.org/b/120584>
1299
1300         Reviewed by Antti Koivisto.
1301
1302         Add a "generateTypeChecks" attribute that can be used in HTMLTagNames.in & friends.
1303         If present, isFooElement() style helpers will be added to HTMLElementTypeChecks.h.
1304         This also outputs an isElementOfType<T> check for the Element iterators.
1305
1306         Removed all the hand-written isFooElement() functions that only checked tag name.
1307
1308         * html/HTMLTagNames.in:
1309         * svg/svgtags.in:
1310
1311             Added "generateTypeChecks" attribute as appropriate.
1312
1313         * GNUmakefile.am:
1314         * GNUmakefile.list.am:
1315         * WebCore.vcxproj/WebCore.vcxproj:
1316         * WebCore.xcodeproj/project.pbxproj:
1317
1318             Added to build systems based on how HTMLNames.h was done.
1319             We're just outputting an additional header file in the generated code directory
1320             so I suspect most ports will just pick this up automagically.
1321
1322         * dom/make_names.pl:
1323         (defaultTagPropertyHash):
1324         (printLicenseHeader):
1325         (printTypeChecks):
1326         (printTypeChecksHeaderFile):
1327
1328             Generate a separate file for each namespace with isFooElement() helpers for
1329             elements with "generateTypeChecks" attribute set.
1330
1331 2013-09-02  Dirk Schulze  <krit@webkit.org>
1332
1333         Use edgeMode=duplicate for blurring on filter() function
1334         https://bugs.webkit.org/show_bug.cgi?id=120590
1335
1336         Reviewed by Antti Koivisto.
1337
1338         Filters on the CSS Image function filter() are not allowed to extend the
1339         dimension of the input image. This causes weird results on blurring an image,
1340         where the fading on the edges is clipped at the half of the fading.
1341         We shouldn't fade edges at all and use the edgeMode=duplicate instead.
1342         This will duplicate the pixel value on the nearest edge of the input image
1343         instead of taking transparent black and results in nice blurred images with
1344         sharp edges.
1345
1346         Spec: http://dev.w3.org/fxtf/filters/#blurEquivalent
1347
1348         Test: fast/filter-image/filter-image-blur.html
1349
1350         * css/CSSFilterImageValue.cpp: Pass consumer information to the renderer.
1351         (WebCore::CSSFilterImageValue::image):
1352         * rendering/FilterEffectRenderer.cpp: Set edgeMode for feGaussianBlur to
1353             'duplicate' or 'none' depending on the consumer.
1354         (WebCore::FilterEffectRenderer::build):
1355         * rendering/FilterEffectRenderer.h: Add enumeration to differ between the 
1356             different consumers of the renderer.
1357         * rendering/RenderLayer.cpp:
1358         (WebCore::RenderLayer::updateOrRemoveFilterEffectRenderer):  Pass consumer
1359             information to the renderer.
1360
1361 2013-09-01  Dirk Schulze  <krit@webkit.org>
1362
1363         Add 'edgeMode' attribute to SVGFEGaussianBlur
1364         https://bugs.webkit.org/show_bug.cgi?id=120582
1365
1366         Add 'edgeMode' attribute to the SVGFEGaussianBlur element. This attribute
1367         allows users to define the behavior on edges with the values 'none' where
1368         pixel values outside the input image are treated as transparent black. (The
1369         current blurring behavior.) 'duplicate' which repeats the values on the
1370         nearest edge and 'warp', which takes the pixel of the opposite site of
1371         the input image.
1372         Beside the attribute, this patch implements the behavior of 'duplicate'.
1373
1374         http://dev.w3.org/fxtf/filters/#feGaussianBlurEdgeModeAttribute
1375
1376         Reviewed by Rob Buis.
1377
1378         Tests: svg/dynamic-updates/SVGFEGaussianBlurElement-dom-edgeMode-attr.html
1379                svg/dynamic-updates/SVGFEGaussianBlurElement-svgdom-edgeMode-prop.html
1380                svg/filters/svg-gaussianblur-edgeMode-duplicate-expected.svg
1381                svg/filters/svg-gaussianblur-edgeMode-duplicate.svg
1382
1383         * platform/graphics/filters/FEGaussianBlur.cpp:
1384         (WebCore::FEGaussianBlur::FEGaussianBlur):
1385         (WebCore::FEGaussianBlur::create):
1386         (WebCore::FEGaussianBlur::edgeMode):
1387         (WebCore::FEGaussianBlur::setEdgeMode):
1388         (WebCore::boxBlur):
1389         (WebCore::FEGaussianBlur::platformApplyGeneric):
1390         (WebCore::FEGaussianBlur::determineAbsolutePaintRect):
1391         * platform/graphics/filters/FEGaussianBlur.h:
1392         * rendering/FilterEffectRenderer.cpp:
1393         (WebCore::FilterEffectRenderer::build):
1394         * svg/SVGFEGaussianBlurElement.cpp:
1395         (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
1396         (WebCore::SVGFEGaussianBlurElement::isSupportedAttribute):
1397         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
1398         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
1399         (WebCore::SVGFEGaussianBlurElement::build):
1400         * svg/SVGFEGaussianBlurElement.h:
1401         * svg/SVGFEGaussianBlurElement.idl:
1402
1403 2013-09-01  Andreas Kling  <akling@apple.com>
1404
1405         EventHandler::m_frame should be a Frame&.
1406         <https://webkit.org/b/120580>
1407
1408         Reviewed by Darin Adler.
1409
1410         EventHandler is tied to the lifetime of its frame, so let m_frame be a Frame&.
1411         A handful of null checks and assertions removed.
1412
1413 2013-09-01  Darin Adler  <darin@apple.com>
1414
1415         Fix a mistake in my recent pasteboard/editor refactoring that was causing tests to fail.
1416
1417         * editing/mac/EditorMac.mm:
1418         (WebCore::getImage): One place this said cachedImage but it should have said tentativeCachedImage.
1419
1420 2013-09-01  Darin Adler  <darin@apple.com>
1421
1422         HitTestResult should have innerNonSharedElement
1423         https://bugs.webkit.org/show_bug.cgi?id=120579
1424
1425         Reviewed by Andreas Kling.
1426
1427         * editing/Editor.cpp:
1428         (WebCore::Editor::copyImage): Call HitTestResult member function version of
1429         innerNonSharedElement instead of a local function that does it.
1430
1431         * page/Chrome.cpp:
1432         (WebCore::Chrome::setToolTip): Use innerNonSharedElement instead of getting
1433         the node and checking if it's an input element. Also added some missing braces.
1434
1435         * page/EventHandler.cpp:
1436         (WebCore::EventHandler::selectClosestWordFromHitTestResult): Use targetNode for
1437         local variables instead of innerNode to match the HitTestResult function name.
1438         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Ditto.
1439         (WebCore::EventHandler::handleMousePressEventTripleClick): Ditto.
1440         (WebCore::EventHandler::handleMousePressEventSingleClick): Ditto.
1441         (WebCore::EventHandler::handleMousePressEvent): Ditto.
1442
1443         * rendering/HitTestResult.cpp:
1444         (WebCore::HitTestResult::innerElement): Rewrote so there there is no loop.
1445         (WebCore::HitTestResult::innerNonSharedElement): Ditto.
1446
1447         * rendering/HitTestResult.h: Added innerNonSharedElement. Generally speaking,
1448         we'd like to avoid using Node unless there is some real need.
1449
1450 2013-09-01  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1451
1452         Volume slider value should be 0 when audio is muted
1453         https://bugs.webkit.org/show_bug.cgi?id=120553
1454
1455         Reviewed by Eric Carlson.
1456
1457         Fixed the problem of showing a non empty slider when audio is
1458         muted.
1459
1460         Test: media/volume-bar-empty-when-muted.html.
1461
1462         * html/shadow/MediaControls.cpp:
1463         (WebCore::MediaControls::reset): Use setSliderVolume.
1464         (WebCore::MediaControls::changedVolume): Use setSliderVolume.
1465         (WebCore::MediaControls::setSliderVolume): Added to set the volume
1466         to 0 when muted and to its value otherwise.
1467         * html/shadow/MediaControls.h: Added setSliderVolume.
1468         * html/shadow/MediaControlsApple.cpp:
1469         (WebCore::MediaControlsApple::reset): Used setSliderVolume and
1470         setFullscreenSliderVolume.
1471         (WebCore::MediaControlsApple::changedVolume): Used
1472         setFullscreenSliderVolume.
1473         (WebCore::MediaControlsApple::setFullscreenSliderVolume): Added to
1474         set the volume to 0 when muted and to its value otherwise.
1475         * html/shadow/MediaControlsApple.h: Added setFullscreenSliderVolume
1476         * html/shadow/MediaControlsBlackBerry.cpp:
1477         (WebCore::MediaControlsBlackBerry::reset): Used setSliderVolume.
1478
1479 2013-09-01  Andreas Kling  <akling@apple.com>
1480
1481         Give EditCommand a protected Frame& getter.
1482         <https://webkit.org/b/120574>
1483
1484         Reviewed by Darin Adler.
1485
1486         EditCommand is only created for documents that are attached to a Frame,
1487         we already ASSERTed as much in the EditCommand constructor.
1488
1489         This patch adds a "Frame& EditCommand::frame()" helper, so EditCommand
1490         and its subclasses don't have to fumble around with pointers.
1491
1492 2013-08-31  Antti Koivisto  <antti@apple.com>
1493
1494         Add element ancestor iterator
1495         https://bugs.webkit.org/show_bug.cgi?id=120563
1496
1497         Reviewed by Andreas Kling.
1498
1499         This patch adds ancestor iterators. They iterate over elements parent chain up to the root.
1500         
1501         To iterate over Element ancestors:
1502         
1503         auto ancestors = elementAncestors(this);
1504         for (auto it = ancestors.begin(), end = ancestors.end(); it != end; ++it) {
1505             Element& element = *it;
1506             ...
1507
1508         To iterate over Element ancestors including the current element:
1509         
1510         auto lineage = elementLineage(this);
1511         for (auto it = lineage.begin(), end = lineage.end(); it != end; ++it) {
1512             Element& element = *it;
1513             ...
1514             
1515         To iterate over ancestors of a specific Element subclass:
1516
1517         auto htmlAncestors = ancestorsOfType<HTMLElement>(this);
1518         for (auto it = htmlAncestors.begin(), end = htmlAncestors.end(); it != end; ++it) {
1519             HTMLElement& htmlElement = *it;
1520             ...
1521             
1522         To iterate over ancestors of a specific Element subclass including the current element:
1523
1524         auto htmlLineage = lineageOfType<HTMLElement>(this);
1525         for (auto it = htmlLineage.begin(), end = htmlLineage.end(); it != end; ++it) {
1526             HTMLElement& htmlElement = *it;
1527             ...
1528             
1529         The patch also uses the new types in a few places.
1530
1531         * WebCore.xcodeproj/project.pbxproj:
1532         * accessibility/AccessibilityNodeObject.cpp:
1533         (WebCore::AccessibilityNodeObject::mouseButtonListener):
1534         (WebCore::AccessibilityNodeObject::labelForElement):
1535         * dom/ElementAncestorIterator.h: Added.
1536         (WebCore::::ElementAncestorIterator):
1537         (WebCore::::operator):
1538         (WebCore::::ElementAncestorConstIterator):
1539         (WebCore::::ElementAncestorIteratorAdapter):
1540         (WebCore::::begin):
1541         (WebCore::::end):
1542         (WebCore::::ElementAncestorConstIteratorAdapter):
1543         (WebCore::elementLineage):
1544         (WebCore::elementAncestors):
1545         (WebCore::ancestorsOfType):
1546         * dom/ElementIterator.h:
1547         (WebCore::findElementAncestorOfType):
1548         (WebCore::::traverseAncestor):
1549         (WebCore::=):
1550         * html/HTMLElement.cpp:
1551         (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
1552         * html/HTMLFieldSetElement.h:
1553         (WebCore::isHTMLFieldSetElement):
1554         (WebCore::HTMLFieldSetElement):
1555         * html/HTMLFrameSetElement.cpp:
1556         (WebCore::HTMLFrameSetElement::findContaining):
1557         * html/HTMLFrameSetElement.h:
1558         (WebCore::HTMLFrameSetElement):
1559         * html/HTMLInputElement.h:
1560         (WebCore::isHTMLInputElement):
1561         (WebCore::toHTMLInputElement):
1562         * html/HTMLLegendElement.cpp:
1563         (WebCore::HTMLLegendElement::associatedControl):
1564
1565 2013-08-31  Darin Adler  <darin@apple.com>
1566
1567         Refactor URL and image writing so layer-violating parts are in Editor, not Pasteboard (Mac-only at first)
1568         https://bugs.webkit.org/show_bug.cgi?id=120573
1569
1570         Reviewed by Andreas Kling.
1571
1572         * editing/Editor.cpp:
1573         (WebCore::Editor::copy): Use writeImageToPasteboard instead of Pasteboard::writeImage on Mac.
1574         (WebCore::Editor::copyURL): Use writeURLToPasteboard instead of Pasteboard::writeURL on Mac.
1575         (WebCore::innerNonSharedElement): Added. Used in copyImage.
1576         (WebCore::Editor::copyImage): Use innerNonSharedElement instead of innerNonSharedNode.
1577         Use writeImageToPasteboard instead of Pasteboard::writeImage on Mac.
1578
1579         * editing/Editor.h: Add new functions, writeURLToPasteboard and writeImageToPasteboard,
1580         both Mac-only for now.
1581
1582         * editing/mac/EditorMac.mm:
1583         (WebCore::Editor::pasteWithPasteboard): Removed unneeded "m_frame.editor()" round trip that
1584         was left behind in this function.
1585         (WebCore::getImage): Added. Helper used by writeImageToPasteboard.
1586         (WebCore::Editor::writeURLToPasteboard): Added. Sets up PasteboardURL and then calls
1587         Pasteboard::write with it.
1588         (WebCore::Editor::writeImageToPasteboard): Added. Sets up PasteboardImage and then calls
1589         Pasteboard::write with it.
1590         * page/DragController.cpp:
1591         (WebCore::DragController::startDrag): Use Editor::writeURLToPasteboard instead of
1592         Pasteboard::writeURL on Mac.
1593
1594         * platform/Pasteboard.h: Added PasteboardURL and PasteboardImage structures.
1595         Declare write functions for PasteboardWebContent, PasteboardURL, and PasteboardImage.
1596         Guard writeURL and writeImage with !PLATFORM(MAC).
1597
1598         * platform/mac/PasteboardMac.mm:
1599         (WebCore::writeURLForTypes): Changed this to take a PasteboardURL.
1600         (WebCore::Pasteboard::write): Renamed writeURL and writeImage to this. Refactor both
1601         to take PasteboardURL and PasteboardImage arguments.
1602         (WebCore::fileWrapper): Renamed from fileWrapperForImage since the fact that this is
1603         for an image is now clear from its argument, a PasteboardImage.
1604         (WebCore::writeFileWrapperAsRTFDAttachment): Changed this function to use early return.
1605
1606 2013-08-31  Andreas Kling  <akling@apple.com>
1607
1608         EditCommand constructors should take Document&.
1609         <https://webkit.org/b/120566>
1610
1611         Reviewed by Darin Adler.
1612
1613         Let EditCommand's and all subclass constructors take Document& instead of Document*.
1614         EditCommand::document() now returns a Document&.
1615
1616         Added Editor::document() which returns Editor::frame().document() after asserting
1617         that it's non-null, to make passing a Document& from Editor functions easier.
1618
1619 2013-08-31  Andreas Kling  <akling@apple.com>
1620
1621         Make more use of toRenderFoo(RenderObject&) cast helpers.
1622         <https://webkit.org/b/120565>
1623
1624         Reviewed by Darin Adler.
1625
1626         To make amends for putting ugly toRenderFoo(&renderer) casts everywhere,
1627         here's a patch that switches a bunch of code over to using reference-based casts.
1628
1629         I removed pointer-based casts altogether for these renderers:
1630
1631             - RenderBR
1632             - RenderCombineText
1633             - RenderListMarker
1634             - RenderVideo
1635             - RenderView
1636
1637 2013-08-31  Santosh Mahto  <santosh.ma@samsung.com>
1638
1639         warning: unused parameter ‘renderingMode'  in ImageBufferCairo.cpp:94
1640         https://bugs.webkit.org/show_bug.cgi?id=120543
1641
1642         Reviewed by Darin Adler.
1643
1644         Fixing warning by adding ASSERT_UNUSED.
1645
1646         * platform/graphics/cairo/ImageBufferCairo.cpp:
1647         (WebCore::ImageBuffer::ImageBuffer):
1648
1649 2013-08-31  Andreas Kling  <akling@apple.com>
1650
1651         Fix typo in r154931 that caused assertions in continuation tests.
1652
1653         * rendering/InlineFlowBox.cpp:
1654         (WebCore::InlineFlowBox::paint):
1655
1656 2013-08-31  Rob Buis  <rwlbuis@webkit.org>
1657
1658         XMLSerializer-attribute-namespace-prefix-conflicts can't produce reliable results
1659         https://bugs.webkit.org/show_bug.cgi?id=120490
1660
1661         Reviewed by Ryosuke Niwa.
1662
1663         Retain the key of the namespaces map by using AtomicString as key instead of AtomicStringImpl*.
1664
1665         * editing/MarkupAccumulator.h:
1666
1667 2013-08-31  Andreas Kling  <akling@apple.com>
1668
1669         InlineBox::renderer() and pals should return references.
1670         <https://webkit.org/b/120562>
1671
1672         Reviewed by Antti Koivisto.
1673
1674         Make InlineBox::renderer() and its friends return references instead of pointers.
1675         Every box always has a renderer, so this clears up any ambiguity, and a number of
1676         weird assertions in SVG code.
1677
1678         Made InlineBox::m_renderer private so subclasses have to go through renderer().
1679         The next step will be to replace renderer() with tightly-typed accessors where
1680         applicable (e.g InlineTextBox's renderer is always a RenderText.)
1681
1682         Also added reference versions of these RenderObject casts:
1683
1684             - toRenderBox()
1685             - toRenderBlock()
1686             - toRenderInline()
1687             - toRenderSVGInlineText()
1688
1689 2013-08-31  Andreas Kling  <akling@apple.com>
1690
1691         PostAttachCallbackDisabler should take a ContainerNode&.
1692         <https://webkit.org/b/120560>
1693
1694         Reviewed by Antti Koivisto.
1695
1696         Let PostAttachCallbackDisabler take a reference and remove an ugly assertion.
1697
1698         * dom/ContainerNode.h:
1699         (WebCore::PostAttachCallbackDisabler::PostAttachCallbackDisabler):
1700         (WebCore::PostAttachCallbackDisabler::~PostAttachCallbackDisabler):
1701         * dom/Document.cpp:
1702         (WebCore::Document::recalcStyle):
1703         * style/StyleResolveTree.cpp:
1704         (WebCore::Style::attachRenderTree):
1705
1706 2013-08-31  Antti Koivisto  <antti@apple.com>
1707
1708         Rename ChildIterator -> ElementChildIterator, DescendantIterator -> ElementDescendantIterator
1709         https://bugs.webkit.org/show_bug.cgi?id=120561
1710
1711         Reviewed by Andreas Kling.
1712
1713         New names are more descriptive and consistent. They also put related iterator files close by in file lists.
1714         The types are always used with auto so longer names don't make them any clumsier to use.
1715
1716         For simplicity included all Element iterator types from ElementIterator.h so it is the only file that has
1717         to be included by the clients.
1718
1719         * GNUmakefile.list.am:
1720         * Target.pri:
1721         * WebCore.vcxproj/WebCore.vcxproj:
1722         * WebCore.xcodeproj/project.pbxproj:
1723         * accessibility/AccessibilityNodeObject.cpp:
1724         * accessibility/AccessibilityRenderObject.cpp:
1725         * accessibility/AccessibilityTable.cpp:
1726         * css/CSSFontFaceSource.cpp:
1727         * dom/ChildIterator.h: Removed.
1728         * dom/DescendantIterator.h: Removed.
1729         * dom/Document.cpp:
1730         * dom/ElementChildIterator.h: Copied from Source/WebCore/dom/ChildIterator.h.
1731         (WebCore::::ElementChildIterator):
1732         (WebCore::::operator):
1733         (WebCore::::ElementChildConstIterator):
1734         (WebCore::::ElementChildIteratorAdapter):
1735         (WebCore::::begin):
1736         (WebCore::::end):
1737         (WebCore::::ElementChildConstIteratorAdapter):
1738         (WebCore::elementChildren):
1739         (WebCore::childrenOfType):
1740         * dom/ElementDescendantIterator.h: Copied from Source/WebCore/dom/DescendantIterator.h.
1741         (WebCore::::ElementDescendantIterator):
1742         (WebCore::::operator):
1743         (WebCore::::ElementDescendantConstIterator):
1744         (WebCore::::ElementDescendantIteratorAdapter):
1745         (WebCore::::begin):
1746         (WebCore::::end):
1747         (WebCore::::ElementDescendantConstIteratorAdapter):
1748         (WebCore::elementDescendants):
1749         (WebCore::descendantsOfType):
1750         * dom/ElementIterator.h:
1751         * dom/Node.cpp:
1752         * dom/TreeScope.cpp:
1753         * editing/ApplyStyleCommand.cpp:
1754         * editing/markup.cpp:
1755         * html/HTMLAppletElement.cpp:
1756         * html/HTMLFieldSetElement.cpp:
1757         * html/HTMLLabelElement.cpp:
1758         * html/HTMLMapElement.cpp:
1759         * html/HTMLMediaElement.cpp:
1760         * html/HTMLObjectElement.cpp:
1761         * loader/PlaceholderDocument.cpp:
1762         * rendering/FilterEffectRenderer.cpp:
1763         * style/StyleResolveTree.cpp:
1764         * svg/SVGElement.cpp:
1765         * svg/SVGSVGElement.cpp:
1766         * svg/animation/SMILTimeContainer.cpp:
1767         * svg/graphics/SVGImage.cpp:
1768
1769 2013-08-31  Andreas Kling  <akling@apple.com>
1770
1771         Don't do document style recalc unless there's a RenderView.
1772         <https://webkit.org/b/120558>
1773
1774         Reviewed by Antti Koivisto.
1775
1776         There's no sense in computing style for a Document that has no RenderView.
1777         Checking this before continuing also lets us know that there's a Frame & FrameView
1778         present, simplifying some things later on.
1779
1780         * dom/Document.cpp:
1781         (WebCore::Document::recalcStyle):
1782         * style/StyleResolveForDocument.cpp:
1783         (WebCore::Style::resolveForDocument):
1784
1785 2013-08-31  Antti Koivisto  <antti@apple.com>
1786
1787         Add common base for element iterators
1788         https://bugs.webkit.org/show_bug.cgi?id=120557
1789
1790         Reviewed by Andreas Kling.
1791
1792         Add ElementIterator and use it as the base for child and descendant iterators. The only difference is the definition of operator++.
1793         
1794         Also renamed DescendantIteratorAssertions to ElementIteratorAssertions.
1795
1796         * GNUmakefile.list.am:
1797         * Target.pri:
1798         * WebCore.vcxproj/WebCore.vcxproj:
1799         * WebCore.xcodeproj/project.pbxproj:
1800         * dom/ChildIterator.h:
1801         (WebCore::::ChildIterator):
1802         (WebCore::::operator):
1803         (WebCore::::ChildConstIterator):
1804         (WebCore::::begin):
1805         (WebCore::::end):
1806         * dom/DescendantIterator.h:
1807         (WebCore::::DescendantIterator):
1808         (WebCore::::operator):
1809         (WebCore::::DescendantConstIterator):
1810         * dom/DescendantIteratorAssertions.h: Removed.
1811         * dom/ElementIterator.h: Added.
1812         (WebCore::::ElementIterator):
1813         (WebCore::::traverseNext):
1814         (WebCore::::traversePrevious):
1815         (WebCore::::traverseNextSibling):
1816         (WebCore::::traversePreviousSibling):
1817         (WebCore::::operator):
1818         (WebCore::=):
1819         (WebCore::::ElementConstIterator):
1820         * dom/ElementIteratorAssertions.h: Copied from Source/WebCore/dom/DescendantIteratorAssertions.h.
1821         (WebCore::ElementIteratorAssertions::ElementIteratorAssertions):
1822         (WebCore::ElementIteratorAssertions::domTreeHasMutated):
1823         (WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
1824
1825 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
1826
1827         [Windows] Build fix after r154921.
1828
1829         AVFoundationCF uses an internal wrapper object around the C-API. The call point
1830         in the original patch was inside the wrapper, which did not (yet) provide
1831         a method implementation.
1832
1833         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1834         (WebCore::MediaPlayerPrivateAVFoundationCF::updateVideoLayerGravity):
1835         (WebCore::AVFWrapper::updateVideoLayerGravity):
1836
1837 2013-08-30  Simon Fraser  <simon.fraser@apple.com>
1838
1839         Video with object-fit: cover can spill outside the box
1840         https://bugs.webkit.org/show_bug.cgi?id=52103
1841
1842         Reviewed by Dean Jackson.
1843         
1844         object-fit on renderers which use accelerated compositing needs special
1845         treatment.
1846         
1847         For directly composited images, and video, GraphicsLayer needs to know
1848         both the size of the content layer, and also a rectangle at which this
1849         should be clipped (because, for the first time, that content layer can be
1850         larger than the renderer's content box).
1851         
1852         AVFoundation would always aspect-ratio fit video by default, so plumb
1853         through MediaPlayer a way to override that when object-fit requires it.
1854         
1855         Added a LAYER_TREE_INCLUDES_CONTENT_LAYERS enum to the layerTreeAsText()
1856         flags so we can dump content layers for testing.
1857
1858         Tests: compositing/images/direct-image-object-fit.html
1859                compositing/reflections/direct-image-object-fit-reflected.html
1860                compositing/video/video-object-fit.html
1861
1862         * page/Frame.h: New LayerTreeFlagsIncludeContentLayers flag.
1863         * platform/graphics/GraphicsLayer.h: New flag.
1864         * platform/graphics/MediaPlayer.cpp:
1865         (WebCore::MediaPlayer::shouldMaintainAspectRatio):
1866         (WebCore::MediaPlayer::setShouldMaintainAspectRatio):
1867         * platform/graphics/MediaPlayer.h:
1868         * platform/graphics/MediaPlayerPrivate.h:
1869         (WebCore::MediaPlayerPrivateInterface::shouldMaintainAspectRatio):
1870         (WebCore::MediaPlayerPrivateInterface::setShouldMaintainAspectRatio):
1871         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1872         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1873         (WebCore::MediaPlayerPrivateAVFoundation::setShouldMaintainAspectRatio):
1874         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1875         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1876         (WebCore::MediaPlayerPrivateAVFoundationCF::updateVideoLayerGravity):
1877         (WebCore::AVFWrapper::platformLayer):
1878         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1879         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1880         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1881         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1882         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
1883         * platform/graphics/ca/GraphicsLayerCA.cpp: We need a new m_contentsClippingLayer to
1884         clip the contents layer, which only gets created when necessary. It has to be cloned
1885         for reflections.
1886         (WebCore::GraphicsLayerCA::willBeDestroyed):
1887         (WebCore::GraphicsLayerCA::setContentsRect):
1888         (WebCore::GraphicsLayerCA::setContentsClippingRect):
1889         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1890         (WebCore::GraphicsLayerCA::updateSublayerList):
1891         (WebCore::GraphicsLayerCA::updateContentsImage):
1892         (WebCore::GraphicsLayerCA::updateContentsMediaLayer):
1893         (WebCore::GraphicsLayerCA::updateContentsCanvasLayer):
1894         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
1895         (WebCore::GraphicsLayerCA::updateContentsRects):
1896         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
1897         (WebCore::GraphicsLayerCA::ensureCloneLayers):
1898         (WebCore::GraphicsLayerCA::removeCloneLayers):
1899         (WebCore::GraphicsLayerCA::fetchCloneLayers):
1900         * platform/graphics/ca/GraphicsLayerCA.h:
1901         * rendering/RenderLayerBacking.cpp: Need to push both the contentsRect and
1902         the contentsClippingRect down to the GraphicsLayers. Most of the time they
1903         are the same, unless object-fit makes them different.
1904         (WebCore::RenderLayerBacking::resetContentsRect):
1905         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
1906         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
1907         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
1908         (WebCore::RenderLayerBacking::updateImageContents):
1909         (WebCore::RenderLayerBacking::contentsBox):
1910         * rendering/RenderLayerCompositor.cpp:
1911         (WebCore::RenderLayerCompositor::layerTreeAsText):
1912         * rendering/RenderVideo.cpp:
1913         (WebCore::RenderVideo::updatePlayer):
1914         * testing/Internals.cpp:
1915         (WebCore::Internals::layerTreeAsText):
1916         * testing/Internals.h:
1917         * testing/Internals.idl:
1918
1919 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
1920
1921         [Windows] Update to incorporate additional suggestions
1922         https://bugs.webkit.org/show_bug.cgi?id=120448
1923
1924         Reviewed by Darin Adler
1925
1926         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Add
1927         notes as to why AVFoundationCF needs this extra method call.
1928         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Use OVERRIDE
1929         * rendering/RenderVideo.cpp: Replace ternary operator with logical &&.
1930
1931 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
1932
1933         [Windows] Vide element in page always uses non-hw accelerated mode.
1934         https://bugs.webkit.org/show_bug.cgi?id=120448
1935
1936         Reviewed by Darin Adler
1937
1938         This patch is unfortunately larger than my original idea, but seems to make the
1939         layout system happier. Instead of switching into composited mode when building
1940         the media player, we now build the original layout tree with compositing active
1941         if the underlying media element requires it. The AVFoundationCF player needs to
1942         have the compositor available at construction time so it can attach to the
1943         rendering device. Otherwise it falls back to CPU-only mode.
1944
1945         * platform/graphics/MediaPlayer.cpp:
1946         (WebCore::MediaPlayer::requiresImmediateCompositing): Added
1947         * platform/graphics/MediaPlayer.h:
1948         * platform/graphics/MediaPlayerPrivate.h:
1949         (WebCore::MediaPlayerPrivateInterface::requiresImmediateCompositing): Added
1950         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1951         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Added
1952         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1953         (WebCore::MediaPlayerPrivateAVFoundationCF::requiresImmediateCompositing):
1954         * rendering/RenderLayerCompositor.cpp:
1955         (WebCore::RenderLayerCompositor::requiresCompositingForVideo): Uses new
1956         'requiresImmediateCompositing' to short-circuit check for whether a
1957         compositor is required.
1958         * rendering/RenderVideo.cpp:
1959         (WebCore::RenderVideo::requiresImmediateCompositing):
1960         * rendering/RenderVideo.h:
1961
1962 2013-08-30  Joseph Pecoraro  <pecoraro@apple.com>
1963
1964         Web Inspector: Breakpoints should have Automatically Continue Option
1965         https://bugs.webkit.org/show_bug.cgi?id=120187
1966
1967         Reviewed by Timothy Hatcher.
1968
1969         Tests: inspector-protocol/debugger/removeBreakpoint.html
1970                inspector-protocol/debugger/setBreakpoint-autoContinue.html
1971                inspector-protocol/debugger/setBreakpoint-column.html
1972                inspector-protocol/debugger/setBreakpoint-condition.html
1973                inspector-protocol/debugger/setBreakpoint.html
1974
1975         * inspector/Inspector.json:
1976         Convert the "condition" argument of setBreakpoint and setBreakpointByUrl
1977         to a BreakpointOptions object with optional properties. One of which
1978         is "condition" and a new option "autoContinue".
1979
1980         * bindings/js/ScriptDebugServer.h:
1981         * bindings/js/ScriptDebugServer.cpp:
1982         (WebCore::ScriptDebugServer::hasBreakpoint):
1983         (WebCore::ScriptDebugServer::pauseIfNeeded):
1984         Automatically continue if the breakpoint was hit and has autoContinue.
1985
1986         * inspector/InspectorDebuggerAgent.h:
1987         * inspector/InspectorDebuggerAgent.cpp:
1988         (WebCore::buildObjectForBreakpointCookie):
1989         (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
1990         (WebCore::InspectorDebuggerAgent::setBreakpoint):
1991         (WebCore::InspectorDebuggerAgent::continueToLocation):
1992         (WebCore::InspectorDebuggerAgent::didParseSource):
1993         * inspector/ScriptBreakpoint.h:
1994         (WebCore::ScriptBreakpoint::ScriptBreakpoint):
1995         Handle the new incoming BreakpointOptions type, and set the
1996         autoContinue state on ScriptBreakpoints.
1997
1998         * inspector/front-end/DebuggerModel.js:
1999         (WebInspector.DebuggerModel.prototype.setBreakpointByURL):
2000         (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
2001         Update old front-end to be compatible with the new API.
2002
2003 2013-08-30  Dean Jackson  <dino@apple.com>
2004
2005         Animations should use double for key values, not floats
2006         https://bugs.webkit.org/show_bug.cgi?id=120547
2007
2008         Reviewed by Simon Fraser.
2009
2010         Merge https://chromium.googlesource.com/chromium/blink/+/71de046541c77120874b9bff82958ee9e0e20c7c
2011
2012         Some files have been renamed in the Blink port, and they have made some
2013         improvements, but I took what applied to us.
2014
2015         All our existing tests passed.
2016
2017         * css/StyleResolver.cpp:
2018         (WebCore::StyleResolver::keyframeStylesForAnimation):
2019         * css/WebKitCSSKeyframeRule.cpp:
2020         (WebCore::StyleKeyframe::parseKeyString):
2021         * css/WebKitCSSKeyframeRule.h:
2022         (WebCore::StyleKeyframe::getKeys):
2023         * platform/graphics/GraphicsLayer.h:
2024         (WebCore::AnimationValue::keyTime):
2025         (WebCore::AnimationValue::AnimationValue):
2026         (WebCore::FloatAnimationValue::create):
2027         (WebCore::FloatAnimationValue::FloatAnimationValue):
2028         (WebCore::TransformAnimationValue::create):
2029         (WebCore::TransformAnimationValue::TransformAnimationValue):
2030         (WebCore::FilterAnimationValue::create):
2031         (WebCore::FilterAnimationValue::FilterAnimationValue):
2032         * rendering/RenderLayerBacking.cpp:
2033         (WebCore::RenderLayerBacking::startAnimation):
2034         * rendering/style/KeyframeList.h:
2035         (WebCore::KeyframeValue::KeyframeValue):
2036         (WebCore::KeyframeValue::key):
2037         (WebCore::KeyframeValue::setKey):
2038
2039 2013-08-30  Brendan Long  <b.long@cablelabs.com>
2040
2041         [GStreamer] support in-band text tracks
2042         https://bugs.webkit.org/show_bug.cgi?id=103771
2043
2044         Reviewed by Eric Carlson.
2045
2046         Tests: New tests added because existing tests were too specific.
2047            media/track/in-band/track-in-band-kate-ogg-cues-added-once.html
2048            media/track/in-band/track-in-band-kate-ogg-kind.html
2049            media/track/in-band/track-in-band-kate-ogg-language.html
2050            media/track/in-band/track-in-band-kate-ogg-mode.html
2051            media/track/in-band/track-in-band-kate-ogg-style.html
2052            media/track/in-band/track-in-band-kate-ogg-track-order.html
2053            media/track/in-band/track-in-band-srt-mkv-cues-added-once.html
2054            media/track/in-band/track-in-band-srt-mkv-kind.html
2055            media/track/in-band/track-in-band-srt-mkv-language.html
2056            media/track/in-band/track-in-band-srt-mkv-mode.html
2057            media/track/in-band/track-in-band-srt-mkv-style.html
2058            media/track/in-band/track-in-band-srt-mkv-track-order.html
2059
2060         * CMakeLists.txt: Add InbandTextTrackPrivateGStreamer, InbandGenericTextTrack, InbandWebVTTTextTrack, and TextCombinerGStreamer files.
2061         * GNUmakefile.list.am: Same.
2062         * PlatformEfl.cmake: Same.
2063         * Target.pri: Same.
2064         * WebCore.vcxproj/WebCore.vcxproj: Same.
2065         * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
2066         * WebCore.xcodeproj/project.pbxproj: Same.
2067         * html/track/InbandGenericTextTrack.cpp: Split out code for handling generic cues.
2068         (WebCore::GenericTextTrackCueMap::GenericTextTrackCueMap): Move from InbandTextTrack.
2069         (WebCore::GenericTextTrackCueMap::~GenericTextTrackCueMap): Same.
2070         (WebCore::GenericTextTrackCueMap::add): Same.
2071         (WebCore::GenericTextTrackCueMap::find): Same.
2072         (WebCore::GenericTextTrackCueMap::remove): Same.
2073         (WebCore::InbandGenericTextTrack::create): Same.
2074         (WebCore::InbandGenericTextTrack::updateCueFromCueData): Same.
2075         (WebCore::InbandGenericTextTrack::addGenericCue): Same.
2076         (WebCore::InbandGenericTextTrack::updateGenericCue): Same.
2077         (WebCore::InbandGenericTextTrack::removeGenericCue): Same.
2078         (WebCore::InbandGenericTextTrack::removeCue): Same.
2079         (WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Empty.
2080         (WebCore::InbandGenericTextTrack::~InbandGenericTextTrack): Empty.
2081         * html/track/InbandGenericTextTrack.h: Copied from Source/WebCore/html/track/InbandTextTrack.h.
2082         The only addition is the ASSERT_NOT_REACHED() for WebVTT cues.
2083         * html/track/InbandTextTrack.cpp: Add label and language changed callbacks.
2084         (WebCore::InbandTextTrack::create): Return a generic or WebVTT text track based on the private CueFormat.
2085         (WebCore::InbandTextTrack::labelChanged): Added.
2086         (WebCore::InbandTextTrack::languageChanged): Added.
2087         * html/track/InbandTextTrack.h: Add label and language changed callbacks.
2088         * html/track/InbandWebVTTTextTrack.cpp: Added, based on InbandTextTrack.
2089         (WebCore::InbandWebVTTTextTrack::create): Same.
2090         (WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Empty.
2091         (WebCore::InbandWebVTTTextTrack::~InbandWebVTTTextTrack): Empty.
2092         (WebCore::InbandWebVTTTextTrack::parseWebVTTCueData): Sends data to a WebVTTParser.
2093         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Adds cues when WebVTTParser parses them.
2094         (WebCore::InbandWebVTTTextTrack::fileFailedToParse): Prints a warning when WebVTTParser has a problem.
2095         * html/track/InbandWebVTTTextTrack.h: Added.
2096         * platform/graphics/InbandTextTrackPrivate.h:
2097         (WebCore::InbandTextTrackPrivate::cueFormat): For determining if the track will have generic or WebVTT cues.
2098         (WebCore::InbandTextTrackPrivate::InbandTextTrackPrivate): Pass CueFormat in the constructor.
2099         * platform/graphics/InbandTextTrackPrivateClient.h: Same.
2100         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2101         (WebCore::InbandTextTrackPrivateAVF::InbandTextTrackPrivateAVF): Pass CueFormat (Generic) to InbandTextTrackPrivate.
2102         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: Add GRefPtr specializations for GstSample and GstEvent.
2103         * platform/graphics/gstreamer/GRefPtrGStreamer.h: Same.
2104         * platform/graphics/gstreamer/GStreamerUtilities.h: Add WARN_MEDIA_MESSAGE.
2105         * platform/graphics/gstreamer/GStreamerVersioning.h: Add a function to check GStreamer version at runtime.
2106         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp: Added.
2107         (WebCore::textTrackPrivateEventCallback): Watches for tag and stream start events.
2108         (WebCore::textTrackPrivateSampleTimeoutCallback): See notifyTrackOfSample();
2109         (WebCore::textTrackPrivateStreamTimeoutCallback): See notifyTrackOfStreamChanged();
2110         (WebCore::textTrackPrivateTagsChangeTimeoutCallback): See notifyTrackOfTagsChanged();
2111         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): Initializes tags and stream and sets up event callback.
2112         (WebCore::InbandTextTrackPrivateGStreamer::~InbandTextTrackPrivateGStreamer): Calls disconnect:
2113         (WebCore::InbandTextTrackPrivateGStreamer::disconnect): Removes signal handlers and frees some memory.
2114         (WebCore::InbandTextTrackPrivateGStreamer::handleSample): Adds samples to a list and sets up callback.
2115         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged): Sets up callback.
2116         (WebCore::InbandTextTrackPrivateGStreamer::tagsChanged): Same.
2117         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): Parses all queued samples with WebVTTParser.
2118         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfStreamChanged): Keeps track of current stream.
2119         (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfTagsChanged): Sets label and language from tags.
2120         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Added.
2121         (WebCore::InbandTextTrackPrivateGStreamer::create): Basic RefPtr create function.
2122         (WebCore::InbandTextTrackPrivateGStreamer::pad): Returns the pad this track is associated with (used
2123         to determine if a playbin text stream has already been associated with a text track).
2124         (WebCore::InbandTextTrackPrivateGStreamer::setIndex): Sets the track index (used for sorting).
2125         (WebCore::InbandTextTrackPrivateGStreamer::streamId): Returns the stream ID (used to handle new samples).
2126         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2127         (WebCore::mediaPlayerPrivateTextChangedCallback): Called for playbin "text-changed" event. See textChanged().
2128         (WebCore::mediaPlayerPrivateTextChangeTimeoutCallback): See notifyPlayerOfText().
2129         (WebCore::mediaPlayerPrivateNewTextSampleCallback): See newTextSample().
2130         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Initialize m_textTimerHandler.
2131         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Disconnect text tracks (they don't necessarily
2132         get freed here, since a script could hold a reference).
2133         (WebCore::MediaPlayerPrivateGStreamer::textChanged): Setup callback for notifyPlayerOfText.
2134         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Create text tracks.
2135         (WebCore::MediaPlayerPrivateGStreamer::newTextSample): Handle new samples by giving them to a text track
2136         with a matching stream. This method is syncryonous because we need to get the stream start sticky event
2137         immediately.
2138         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2139         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp: Added. This element forwards buffers from all
2140         of its input pads, but also converts plain text to WebVTT as needed.
2141         (webkit_text_combiner_init): Setup internal funnel.
2142         (webkitTextCombinerPadEvent): If the caps are plain text make sure we have a webvttenv, otherwise connect
2143         directly to the funnel.
2144         (webkitTextCombinerRequestNewPad): Setup ghostpad and event callback.
2145         (webkitTextCombinerReleasePad): Release pad and optional associated webvttenc.
2146         (webkit_text_combiner_class_init): Setup pad templates and request/release pad functions.
2147         (webkitTextCombinerNew): Returns a new WebKitTextCombiner.
2148         * platform/graphics/gstreamer/TextCombinerGStreamer.h: Added.
2149         * platform/graphics/gstreamer/TextSinkGStreamer.cpp: Added.
2150         (webkit_text_sink_init): Set sync=false.
2151         (webkitTextSinkGetProperty): Ignore sync property.
2152         (webkitTextSinkSetProperty): Same.
2153         (webkitTextSinkQuery): Ignore position and duration queries, forward everything else to appsink.
2154         (webkit_text_sink_class_init): Setup property and query functions.
2155         (webkitTextSinkNew): Return a new WebKitTextSink.
2156         * platform/graphics/gstreamer/TextSinkGStreamer.h: Added.
2157
2158 2013-08-30  Dirk Schulze  <krit@webkit.org>
2159
2160         Animate CSS Image filter() function
2161         https://bugs.webkit.org/show_bug.cgi?id=119938
2162
2163         Reviewed by Simon Fraser.
2164
2165         With this patch, the new introduced CSS Image function filter() can be
2166         animated. According to the spec, just filter functions can be
2167         interpolated.
2168
2169         The patch also prepares StyleImage blending for interpolation of other
2170         generated images like gradients or cross-fade().
2171
2172         http://dev.w3.org/fxtf/filters/#interpolating-filter-image
2173
2174         Test: fast/filter-image/filter-image-animation.html
2175
2176         * css/CSSComputedStyleDeclaration.cpp: Reuse the code that creates a
2177             CSSValueList from ComputeStyle logic.
2178         (WebCore::valueForPixel):
2179             For StyleRules we want to have not-adjusted length values.
2180         (WebCore::ComputedStyleExtractor::valueForShadow):
2181             Add argument to switch between adjusted and not-adjusted length.
2182         (WebCore::ComputedStyleExtractor::valueForFilter):
2183             Ditto.
2184         (WebCore::ComputedStyleExtractor::propertyValue):
2185         * css/CSSComputedStyleDeclaration.h:
2186         * css/CSSFilterImageValue.h: Add helper functions
2187             for animating filters. We need to pass the FilterOperations for
2188             the image generation and the CSSValueList for StyleRule.
2189         (WebCore::CSSFilterImageValue::filterOperations):
2190         (WebCore::CSSFilterImageValue::setFilterOperations):
2191         (WebCore::CSSFilterImageValue::cachedImage):
2192         * page/animation/CSSPropertyAnimation.cpp:
2193             Add animation code to support animations between two filter()
2194             function values.
2195         (WebCore::blendFilterOperations):
2196         (WebCore::blendFunc):
2197         (WebCore::filterBlend):
2198         * rendering/style/StyleGeneratedImage.h: Add helper functions.
2199         (WebCore::CSSFilterImageValue::imageValue):
2200
2201
2202 2013-08-30  Leo Yang  <leoyang@blackberry.com>
2203
2204         Make sure remove CachedResourceClient when destructing IconLoader
2205         https://bugs.webkit.org/show_bug.cgi?id=120541
2206
2207         Reviewed by Darin Adler.
2208
2209         It's a good practice to call CachedResource::removeClient(client)
2210         when the client is being destructed. We need to do this for InconLoader
2211         to prevent m_resource from keeping dangling client in case m_resource
2212         is referenced by someone else in the future.
2213
2214         Found by code inspection. Just a defensive enhancement no new tests.
2215
2216         * loader/icon/IconLoader.cpp:
2217         (WebCore::IconLoader::~IconLoader):
2218
2219 2013-08-30  Hans Muller  <hmuller@adobe.com>
2220
2221         [CSS Shapes] Redefine the ShapeIntervals class as a template
2222         https://bugs.webkit.org/show_bug.cgi?id=120381
2223
2224         Reviewed by Alexandru Chiculita.
2225
2226         No new tests, this was just an internal refactoring.
2227
2228         The existing ShapeIntervals class has been converted into a template whose
2229         type specifies the type of the interval's x1 and x2 horizontal endpoints
2230         (formerly float). There were several other minor changes, all in the realm
2231         of refactoring:
2232
2233         - The original type was a struct with public x1 and x2 fields. It's now a class
2234         with x1 and x2 accessors. ASSERTS are now used to maintain the x2 >= x1 invariant.
2235         In the original code the invariant was not checked.
2236
2237         - The logical comparison operators have been overloaded for ShapeInterval.
2238         This obviates the IntervalX1Comparator class which has been removed.
2239
2240         - The names of the global ShapeInterval Vector set operation methods have been
2241         changed to reflect the fact that they're now members of the template class,
2242         rather than globals.
2243
2244         PolygonShape.cpp depended on the ShapeInterval class. In the one or two places
2245         where an interval's x1 or x1 fields had been set explicitly, ShapeInterval::set()
2246         is now used to set both fields. This also enables the invariant check mentioned
2247         earlier. The other changes to this class are syntatic, to account for the ShapeInterval
2248         class's changes.
2249
2250         * CMakeLists.txt:
2251         * GNUmakefile.list.am:
2252         * WebCore.vcxproj/WebCore.vcxproj:
2253         * WebCore.xcodeproj/project.pbxproj:
2254         * rendering/shapes/PolygonShape.cpp:
2255         (WebCore::appendIntervalX):
2256         (WebCore::computeXIntersections):
2257         (WebCore::computeOverlappingEdgeXProjections):
2258         (WebCore::PolygonShape::getExcludedIntervals):
2259         (WebCore::PolygonShape::getIncludedIntervals):
2260         * rendering/shapes/PolygonShape.h:
2261         * rendering/shapes/ShapeInterval.cpp: Removed.
2262         * rendering/shapes/ShapeInterval.h: The entire implementation is now here. 
2263         (WebCore::ShapeInterval::ShapeInterval):
2264         (WebCore::ShapeInterval::x1):
2265         (WebCore::ShapeInterval::x2):
2266         (WebCore::ShapeInterval::set):
2267         (WebCore::ShapeInterval::overlaps):
2268         (WebCore::ShapeInterval::intersect):
2269         (WebCore::ShapeInterval::sortVector):
2270         (WebCore::ShapeInterval::uniteVectors):
2271         (WebCore::ShapeInterval::intersectVectors):
2272         (WebCore::ShapeInterval::subtractVectors):
2273         (WebCore::operator==):
2274         (WebCore::operator!=):
2275         (WebCore::operator< ):
2276         (WebCore::operator> ):
2277         (WebCore::operator<=):
2278         (WebCore::operator>=):
2279
2280 2013-08-30  Antti Koivisto  <antti@apple.com>
2281
2282         Use Element& in StyleResolveTree
2283         https://bugs.webkit.org/show_bug.cgi?id=120540
2284
2285         Reviewed by Andreas Kling.
2286
2287         * dom/ContainerNode.cpp:
2288         (WebCore::attachChild):
2289         (WebCore::detachChild):
2290         * dom/Document.cpp:
2291         (WebCore::Document::recalcStyle):
2292         (WebCore::Document::createRenderTree):
2293         (WebCore::Document::detach):
2294         * dom/Element.cpp:
2295         (WebCore::Element::lazyReattach):
2296         (WebCore::Element::updateExistingPseudoElement):
2297         (WebCore::Element::createPseudoElementIfNeeded):
2298         (WebCore::disconnectPseudoElement):
2299         * dom/ShadowRoot.cpp:
2300         (WebCore::ShadowRoot::setResetStyleInheritance):
2301         * html/HTMLDetailsElement.cpp:
2302         (WebCore::HTMLDetailsElement::parseAttribute):
2303         * html/HTMLInputElement.cpp:
2304         (WebCore::HTMLInputElement::updateType):
2305         (WebCore::HTMLInputElement::parseAttribute):
2306         * html/HTMLObjectElement.cpp:
2307         (WebCore::HTMLObjectElement::renderFallbackContent):
2308         * html/HTMLPlugInImageElement.cpp:
2309         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2310         (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
2311         (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
2312         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
2313         * html/HTMLSelectElement.cpp:
2314         (WebCore::HTMLSelectElement::parseAttribute):
2315         (WebCore::HTMLSelectElement::parseMultipleAttribute):
2316         * html/HTMLViewSourceDocument.cpp:
2317         (WebCore::HTMLViewSourceDocument::createContainingTable):
2318         (WebCore::HTMLViewSourceDocument::addSpanWithClassName):
2319         (WebCore::HTMLViewSourceDocument::addLine):
2320         (WebCore::HTMLViewSourceDocument::finishLine):
2321         (WebCore::HTMLViewSourceDocument::addBase):
2322         (WebCore::HTMLViewSourceDocument::addLink):
2323         * html/parser/HTMLConstructionSite.cpp:
2324         (WebCore::executeTask):
2325         * html/parser/HTMLTreeBuilder.cpp:
2326         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
2327         * html/shadow/InsertionPoint.cpp:
2328         (WebCore::InsertionPoint::willAttachRenderers):
2329         (WebCore::InsertionPoint::willDetachRenderers):
2330         * loader/PlaceholderDocument.cpp:
2331         (WebCore::PlaceholderDocument::createRenderTree):
2332         * style/StyleResolveTree.cpp:
2333         (WebCore::Style::attachChildren):
2334         (WebCore::Style::attachRenderTree):
2335         (WebCore::Style::detachChildren):
2336         (WebCore::Style::detachRenderTree):
2337         (WebCore::Style::resolveLocal):
2338         (WebCore::Style::updateTextStyle):
2339         (WebCore::Style::resolveShadowTree):
2340         (WebCore::Style::resolveTree):
2341         
2342             Documents only ever have one child element. Remove the loop.
2343
2344         (WebCore::Style::detachRenderTreeInReattachMode):
2345         (WebCore::Style::reattachRenderTree):
2346         * style/StyleResolveTree.h:
2347         * svg/SVGTests.cpp:
2348         (WebCore::SVGTests::handleAttributeChange):
2349         * xml/XMLErrors.cpp:
2350         (WebCore::XMLErrors::insertErrorMessageBlock):
2351         * xml/parser/XMLDocumentParserLibxml2.cpp:
2352         (WebCore::XMLDocumentParser::startElementNs):
2353
2354 2013-08-30  Andreas Kling  <akling@apple.com>
2355
2356         Document style resolve should take Document&.
2357         <https://webkit.org/b/120534>
2358
2359         Reviewed by Darin Adler.
2360
2361         Tweak Style::resolveTree(Document*) and Style::resolveForDocument(Document*) to take Document& instead.
2362
2363         * dom/Document.cpp:
2364         (WebCore::Document::recalcStyle):
2365         * html/HTMLLinkElement.cpp:
2366         (WebCore::HTMLLinkElement::process):
2367         * style/StyleResolveForDocument.cpp:
2368         (WebCore::Style::resolveForDocument):
2369         * style/StyleResolveForDocument.h:
2370         * style/StyleResolveTree.cpp:
2371         (WebCore::Style::resolveTree):
2372         * style/StyleResolveTree.h:
2373
2374 2013-08-30  Darin Adler  <darin@apple.com>
2375
2376         [Mac] No need for Pasteboard::getDataSelection
2377         https://bugs.webkit.org/show_bug.cgi?id=120536
2378
2379         Reviewed by Anders Carlsson.
2380
2381         * editing/Editor.h: Added some Mac-only private member functions.
2382
2383         * editing/mac/EditorMac.mm:
2384         (WebCore::Editor::selectionInWebArchiveFormat): Added.
2385         (WebCore::Editor::adjustedSelectionRange): Added.
2386         (WebCore::attributedStringForRange): Added.
2387         (WebCore::dataInRTFDFormat): Added.
2388         (WebCore::dataInRTFFormat): Added.
2389         (WebCore::Editor::dataSelectionForPasteboard): Moved the implementation
2390         of Pasteboard::getDataSelection here, refactoring to share code with the
2391         writeSelectionToPasteboard function.
2392         (WebCore::Editor::writeSelectionToPasteboard): Refactored to share code
2393         with the new function above.
2394
2395         * platform/Pasteboard.h: Removed getDataSelection. One less layering violation.
2396         * platform/mac/PasteboardMac.mm: Ditto.
2397
2398 2013-08-30  Rob Buis  <rwlbuis@webkit.org>
2399
2400         SVG error parsing empty path
2401         https://bugs.webkit.org/show_bug.cgi?id=78980
2402
2403         Reviewed by Darin Adler.
2404
2405         According to the spec (http://www.w3.org/TR/SVG/paths.html#PathData), path 'd' attribute can be empty.
2406         No error should be reported in this case.
2407
2408         * svg/SVGPathParser.cpp:
2409         (WebCore::SVGPathParser::parsePathDataFromSource):
2410         * svg/SVGPathUtilities.cpp:
2411         (WebCore::buildPathFromString):
2412         (WebCore::buildSVGPathByteStreamFromSVGPathSegList):
2413         (WebCore::buildPathFromByteStream):
2414         (WebCore::buildSVGPathSegListFromByteStream):
2415         (WebCore::buildStringFromByteStream):
2416         (WebCore::buildStringFromSVGPathSegList):
2417         (WebCore::buildSVGPathByteStreamFromString):
2418         (WebCore::buildAnimatedSVGPathByteStream):
2419         (WebCore::addToSVGPathByteStream):
2420
2421 2013-08-30  Andreas Kling  <akling@apple.com>
2422
2423         Try to fix CSS_VARIABLES and CSS_DEVICE_ADAPTATION builds.
2424
2425         * css/StyleResolver.cpp:
2426         (WebCore::StyleResolver::StyleResolver):
2427         (WebCore::StyleResolver::resolveVariables):
2428
2429 2013-08-30  Commit Queue  <commit-queue@webkit.org>
2430
2431         Unreviewed, rolling out r154891.
2432         http://trac.webkit.org/changeset/154891
2433         https://bugs.webkit.org/show_bug.cgi?id=120539
2434
2435         broke the mac build (Requested by Ossy on #webkit).
2436
2437         * platform/network/SynchronousLoaderClient.h:
2438
2439 2013-08-30  Csaba Osztrogonác  <ossy@webkit.org>
2440
2441         Add USE(CFNETWORK) guard to SynchronousLoaderClient::didReceiveAuthenticationChallengedidReceiveAuthenticationChallenge()
2442         https://bugs.webkit.org/show_bug.cgi?id=120532
2443
2444         Reviewed by Darin Adler.
2445
2446         * platform/network/SynchronousLoaderClient.h:
2447
2448 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
2449
2450         [Windows] Video inside page always uses non-hardware accelerated playback
2451         https://bugs.webkit.org/show_bug.cgi?id=120448
2452
2453         Reviewed by Eric Carlson.
2454
2455         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2456         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Check for
2457         D3D device. If it doesn't exist, switch to compositing mode and try again.
2458
2459 2013-08-30  Leo Yang  <leoyang@blackberry.com>
2460
2461         Possible dangling CachedResourceClient of StyleRuleImport and XSLImportRule
2462         https://bugs.webkit.org/show_bug.cgi?id=120479
2463
2464         Reviewed by Darin Adler.
2465
2466         In StyleRuleImport::requestStyleSheet() and XSLImportRule::loadSheet() we
2467         didn't call removeClient() for m_cachedSheet before assigning m_cachedSheet
2468         a new value. This could leave the client as a client of the old cached
2469         sheet and dangling after the client is deleted. Fix them by calling removeClient()
2470         before assigning m_cacheSheet a new value.
2471
2472         Found by code inspection. Seems no way to test it automatically.
2473
2474         * css/StyleRuleImport.cpp:
2475         (WebCore::StyleRuleImport::requestStyleSheet):
2476         * xml/XSLImportRule.cpp:
2477         (WebCore::XSLImportRule::loadSheet):
2478
2479 2013-08-30  Gabor Abraham  <abrhm@inf.u-szeged.hu>
2480
2481         Fix unused parameter warning in graphics/cairo/GraphicsContextCairo.cpp file.
2482         https://bugs.webkit.org/show_bug.cgi?id=120524
2483
2484         Reviewed by Darin Adler.
2485
2486         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2487         (WebCore::GraphicsContext::fillRectWithRoundedHole):
2488
2489 2013-08-30  Andreas Kling  <akling@apple.com>
2490
2491         StyleResolver & friends should use Document&.
2492         <https://webkit.org/b/120527>
2493
2494         Reviewed by Antti Koivisto.
2495
2496         Document&-ify StyleResolver, ElementRuleCollector and SelectorChecker.
2497
2498 2013-08-30  Brent Fulgham  <bfulgham@apple.com>
2499
2500         [Windows] Unreviewed build correction after r154835. Only seen when doing a
2501         full (clean) rebuild.
2502
2503         * DerivedSources.cpp: Remove reference to deleted JSHTMLDialogElement.cpp
2504
2505 2013-08-30  Tamas Czene  <tczene@inf.u-szeged.hu>
2506
2507         Resolve unused parameter warning in FindController.cpp
2508         https://bugs.webkit.org/show_bug.cgi?id=120407
2509
2510         Reviewed by Darin Adler.
2511
2512         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2513         (wordAtPositionForAtkBoundary):
2514
2515 2013-08-30  Arpita Bahuguna  <a.bah@samsung.com>
2516
2517         setAttributeNode() does not set the new value to an existing attribute if specified attribute is in a different case.
2518         https://bugs.webkit.org/show_bug.cgi?id=120293
2519
2520         Reviewed by Darin Adler.
2521
2522         setAttributeNode() performs a case-insensitive search for an existing
2523         attribute. If an existing attribute is found, it retrieves the index of
2524         such an attribute. For setting the attribute's new value, we call upon
2525         setAttributeInternal() to which both the index as well as the name of
2526         the attribute is passed.
2527         The name passed to this method is the same as the one passed to the
2528         setAttributeNode() API from the webpage and thus can be in any case.
2529
2530         However, setAttributeInternal() uses this name to get the corresponding
2531         existing attribute node. Since this retrieval is not case-insensitive,
2532         the existing node is not returned and thus the new value is not set on
2533         the existing node.
2534         We should instead use the passed index and use that to retrieve the
2535         existing node.
2536
2537         Note that obtaining the attribute's value using getAttributeNode() would
2538         still return the correct value, i.e. the new one.
2539
2540         Also, this change shall make our behavior similar to that of FF and IE.
2541
2542         Test: fast/dom/Element/setAttributeNode-for-existing-attribute.html
2543
2544         * dom/Element.cpp:
2545         (WebCore::Element::setAttributeInternal):
2546         If the passed index is not equal to attributeNotFound, we use that index
2547         to retrieve the existing attribute.
2548
2549 2013-08-30  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
2550
2551         SimpleClassVectorTraits shall be used for RuleData
2552         https://bugs.webkit.org/show_bug.cgi?id=120526
2553
2554         Reviewed by Andreas Kling.
2555
2556         Whereas RuleData is POD type and whereas there are quite a lot of Vector<RuleData> occurrences in the code,
2557         it makes sense to use SimpleClassVectorTraits for RuleData and hence to allow using more efficient mem functions
2558         in vectors.
2559
2560         * css/RuleSet.h:
2561
2562 2013-08-30  Andreas Kling  <akling@apple.com>
2563
2564         Node::document() should return a reference.
2565         <https://webkit.org/b/120496>
2566
2567         Reviewed by Antti Koivisto.
2568
2569         Now that orphan DocumentType nodes also have document pointers, it's no longer
2570         possible to have a null Node::document().
2571
2572         Cement this by making document() return a reference, and remove the various
2573         null checks exposed by this.
2574
2575 2013-08-30  Andrei Parvu  <parvu@adobe.com>
2576
2577         [CSS Masking] -webkit-mask-repeat: space does not work
2578         Added the space option to background-repeat and -webkit-mask-repeat.
2579         With the property value 'space', the background or mask image gets repeated as often as it fits within the background positioning
2580         area. The repeated images are spaced equally to fill the unused area.
2581         https://bugs.webkit.org/show_bug.cgi?id=119324
2582
2583         Reviewed by Dirk Schulze.
2584
2585         Tests: css3/background/background-repeat-space-border.html
2586                css3/background/background-repeat-space-content.html
2587                css3/background/background-repeat-space-padding.html
2588                css3/masking/mask-repeat-space-border.html
2589                css3/masking/mask-repeat-space-content.html
2590                css3/masking/mask-repeat-space-padding.html
2591
2592         * platform/graphics/GeneratorGeneratedImage.cpp:
2593         (WebCore::GeneratorGeneratedImage::drawPattern): Passed the space values to the image buffer.
2594         * platform/graphics/Image.cpp:
2595         (WebCore::Image::drawTiled): Added the space values when computing the location of the tile.
2596         * platform/graphics/Image.h: Added the space property.
2597         (WebCore::Image::spaceSize):
2598         (WebCore::Image::setSpaceSize):
2599         * platform/graphics/ImageBuffer.h: Added the space property.
2600         (WebCore::ImageBuffer::spaceSize):
2601         (WebCore::ImageBuffer::setSpaceSize):
2602         * platform/graphics/cg/ImageBufferCG.cpp: Passed the space values when copying an image.
2603         (WebCore::ImageBuffer::copyImage):
2604         * platform/graphics/cg/ImageCG.cpp: Added the space values when creating a platform pattern.
2605         (WebCore::Image::drawPattern):
2606         * rendering/RenderBoxModelObject.cpp:
2607         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Computed the space values on x and y axis.
2608         (WebCore::getSpace):
2609         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Pass the space values to the Image class.
2610         * rendering/RenderBoxModelObject.h: Added the space property.
2611         (WebCore::RenderBoxModelObject::BackgroundImageGeometry::spaceSize):
2612         (WebCore::RenderBoxModelObject::BackgroundImageGeometry::setSpaceSize):
2613         * svg/graphics/SVGImage.cpp: Passed the space property to the created image.
2614         (WebCore::SVGImage::drawPatternForContainer):
2615         * svg/graphics/SVGImageForContainer.cpp: Passed the space property to the image property.
2616         (WebCore::SVGImageForContainer::drawPattern):
2617
2618 2013-08-30  Antti Koivisto  <antti@apple.com>
2619
2620         Remove AttachContext
2621         https://bugs.webkit.org/show_bug.cgi?id=120518
2622
2623         Reviewed by Andreas Kling.
2624
2625         This type is not useful anymore. Just pass the precomputed style to attachRenderTree and reattach-or-not flag to detachRenderTree.
2626
2627         * style/StyleResolveTree.cpp:
2628         (WebCore::Style::createRendererIfNeeded):
2629         (WebCore::Style::attachChildren):
2630         (WebCore::Style::attachShadowRoot):
2631         (WebCore::Style::attachRenderTree):
2632         (WebCore::Style::detachChildren):
2633         (WebCore::Style::detachShadowRoot):
2634         (WebCore::Style::detachRenderTree):
2635         (WebCore::Style::reattachRenderTree):
2636         (WebCore::Style::resolveLocal):
2637         * style/StyleResolveTree.h:
2638
2639 2013-08-30  Commit Queue  <commit-queue@webkit.org>
2640
2641         Unreviewed, rolling out r154826.
2642         http://trac.webkit.org/changeset/154826
2643         https://bugs.webkit.org/show_bug.cgi?id=120517
2644
2645         Still breaks icloud.com (Requested by mwenge_ on #webkit).
2646
2647         * rendering/RenderBox.cpp:
2648         (WebCore::RenderBox::computePositionedLogicalWidth):
2649         (WebCore::RenderBox::computePositionedLogicalHeight):
2650         * rendering/RenderBox.h:
2651         (WebCore::RenderBox::intrinsicSize):
2652         * rendering/RenderButton.h:
2653         * rendering/RenderFileUploadControl.cpp:
2654         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
2655         * rendering/RenderListBox.cpp:
2656         (WebCore::RenderListBox::RenderListBox):
2657         (WebCore::RenderListBox::computePreferredLogicalWidths):
2658         (WebCore::RenderListBox::computeLogicalHeight):
2659         * rendering/RenderListBox.h:
2660         * rendering/RenderMenuList.h:
2661         * rendering/RenderSlider.cpp:
2662         (WebCore::RenderSlider::computePreferredLogicalWidths):
2663         * rendering/RenderTextControl.cpp:
2664         (WebCore::RenderTextControl::RenderTextControl):
2665         (WebCore::RenderTextControl::computeLogicalHeight):
2666         * rendering/RenderTextControl.h:
2667
2668 2013-08-29  Ryosuke Niwa  <rniwa@webkit.org>
2669
2670         Unduplicate the code to convert between VisiblePosition and index
2671         https://bugs.webkit.org/show_bug.cgi?id=120506
2672
2673         Reviewed by Darin Adler.
2674
2675         Encapsulate the conversion between VisiblePosition and index into indexForVisiblePosition
2676         and visiblePositionForIndexUsingCharacterIterator. It's unfortunate that these two functions
2677         are different from the two other existing functions of similar names but we've at least
2678         confined problems into a single cpp file now.
2679
2680         * accessibility/AccessibilityRenderObject.cpp:
2681         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
2682         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
2683         * editing/Editor.cpp:
2684         (WebCore::findFirstMarkable):
2685         * editing/htmlediting.cpp:
2686         (WebCore::indexForVisiblePosition):
2687         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2688         * editing/htmlediting.h:
2689         * html/HTMLTextFormControlElement.cpp:
2690         (WebCore::hasVisibleTextArea):
2691         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2692         (WebCore::HTMLTextFormControlElement::indexForVisiblePosition):
2693         (WebCore::HTMLTextFormControlElement::visiblePositionForIndex):
2694         * html/HTMLTextFormControlElement.h:
2695         * rendering/RenderTextControl.cpp:
2696         * rendering/RenderTextControl.h:
2697
2698 2013-08-29  Ryosuke Niwa  <rniwa@webkit.org>
2699
2700         Avoid Node references from AXObjectCache from leaking
2701         https://bugs.webkit.org/show_bug.cgi?id=120501
2702
2703         Reviewed by Darin Adler.
2704
2705         Merge https://chromium.googlesource.com/chromium/blink/+/454f31497613b6d0fbcfb0df757254b64a177c06
2706         without any tests since we don't have the same infrastructure to detect leaks in WebKit.
2707
2708         A real world example of this would be selecting an <option> item inside frame by keyboard. The node will not be deref()-ed until the topDocument() is detached. 
2709
2710         The issue was that AccessibilityMenuListOption is created in childrenChanged()
2711         hook called when its RenderObject is being destroyed. This patch modifies AccessibilityMenuListPopup so it won't create AccessibilityMenuListOption if its
2712         element is already detached.
2713
2714         * accessibility/AccessibilityMenuListPopup.cpp:
2715         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
2716         * rendering/RenderMenuList.cpp:
2717         (WebCore::RenderMenuList::didUpdateActiveOption):
2718
2719 2013-08-26  Simon Fraser  <simon.fraser@apple.com>
2720
2721         Implement object-fit CSS property
2722         https://bugs.webkit.org/show_bug.cgi?id=52040
2723
2724         Reviewed by Antti Koivisto, Sam Weinig.
2725         
2726         Merge object-fit patch from Blink r156535, which started as a patch
2727         by me.
2728
2729         Since then, the spec has gone to CR. This patch is an
2730         implementation of object-fit as described in
2731         http://www.w3.org/TR/2012/CR-css3-images-20120417/#object-fit
2732
2733         Object-fit is used to maintain the aspect ratio of replaced content
2734         within its content box. All object-fit values but the initial one
2735         ('fill') will always ensure that the aspect ratio is retained, in
2736         different ways (fit inside the content box, cover the content box, or
2737         use intrinsic size). Painting is always clipped against the content
2738         box, regardless of the 'overflow' property.
2739
2740         Tests: fast/css/object-fit/object-fit-canvas.html
2741                fast/css/object-fit/object-fit-embed.html
2742                fast/css/object-fit/object-fit-grow-landscape.html
2743                fast/css/object-fit/object-fit-grow-portrait.html
2744                fast/css/object-fit/object-fit-img-svg.html
2745                fast/css/object-fit/object-fit-img-svg2.html
2746                fast/css/object-fit/object-fit-img.html
2747                fast/css/object-fit/object-fit-input-image.html
2748                fast/css/object-fit/object-fit-object.html
2749                fast/css/object-fit/object-fit-shrink.html
2750                fast/css/object-fit/object-fit-video-poster.html
2751                fast/css/parsing-object-fit.html
2752                http/tests/css/object-fit-delayed-img-svg.html
2753                media/video-object-fit-change.html
2754                media/video-object-fit.html
2755
2756         * css/CSSComputedStyleDeclaration.cpp:
2757         (WebCore::ComputedStyleExtractor::propertyValue):
2758         * css/CSSParser.cpp:
2759         (WebCore::isValidKeywordPropertyAndValue):
2760         (WebCore::isKeywordPropertyID):
2761         (WebCore::CSSParser::parseValue):
2762         * css/CSSPrimitiveValueMappings.h:
2763         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2764         (WebCore::CSSPrimitiveValue::operator EObjectFit):
2765         * css/CSSProperty.cpp:
2766         (WebCore::CSSProperty::isInheritedProperty):
2767         * css/CSSPropertyNames.in:
2768         * css/CSSValueKeywords.in:
2769         * css/DeprecatedStyleBuilder.cpp:
2770         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2771         * css/StyleResolver.cpp:
2772         (WebCore::StyleResolver::applyProperty):
2773         * css/html.css:
2774         (video): Set object-fit to 'contain'. This is how VIDEO elements
2775         work, apparently.
2776         * loader/cache/CachedImage.cpp:
2777         (WebCore::CachedImage::imageSizeForRenderer):
2778         * loader/cache/CachedImage.h:
2779         * platform/graphics/LayoutSize.h:
2780         (WebCore::fitLayoutSizeToAspectRatio): New function to grow or shrink
2781         in one dimension to fit to the aspect ratio.
2782         * rendering/RenderHTMLCanvas.cpp:
2783         (WebCore::RenderHTMLCanvas::paintReplaced): Apply object-fit and
2784         clip if necessary.
2785         * rendering/RenderImage.cpp:
2786         (WebCore::RenderImage::updateInnerContentRect):
2787         (WebCore::RenderImage::imageDimensionsChanged): Update intrinsic
2788         size properly, and recalculate the inner content rectangle (the
2789         exact area occupied by the replaced content) again if appropriate.
2790         (WebCore::RenderImage::paintReplaced): Apply object-fit and clip
2791         if necessary.
2792         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
2793         object-fit may leave parts of the content box empty, in which case
2794         it won't be fully obscured.
2795         (WebCore::RenderImage::layout):
2796         * rendering/RenderImage.h:
2797         * rendering/RenderImageResource.cpp:
2798         (WebCore::RenderImageResource::intrinsicSize): Need this to
2799         differentiate between intrinsic and extrinsic size for SVG images.
2800         * rendering/RenderImageResource.h:
2801         * rendering/RenderImageResourceStyleImage.h:
2802         * rendering/RenderReplaced.cpp:
2803         (WebCore::RenderReplaced::replacedContentRect): Return the
2804         rectangle occupied by the replaced content. This will be identical
2805         to the content box if object-fit is 'fill', but will typically be
2806         something else for other values.
2807         * rendering/RenderReplaced.h:
2808         * rendering/RenderVideo.cpp:
2809         (WebCore::RenderVideo::videoBox): Not much left to do here, with
2810         the new RenderReplaced::replacedContentRect() method in place.
2811         (WebCore::RenderVideo::paintReplaced): Apply object-fit and clip
2812         if necessary.
2813         * rendering/style/RenderStyle.cpp:
2814         (WebCore::RenderStyle::changeRequiresRepaint):
2815         * rendering/style/RenderStyle.h:
2816         * rendering/style/RenderStyleConstants.h:
2817         * rendering/style/StyleRareNonInheritedData.cpp:
2818         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2819         (WebCore::StyleRareNonInheritedData::operator==):
2820         * rendering/style/StyleRareNonInheritedData.h:
2821
2822 2013-08-29  Tim Horton  <timothy_horton@apple.com>
2823
2824         SVG clipping, masking, and gradients-on-text do not respect the device scale factor
2825         https://bugs.webkit.org/show_bug.cgi?id=120377
2826         <rdar://problem/14777944>
2827
2828         Reviewed by Simon Fraser.
2829
2830         Tests: svg/custom/masking-clipping-hidpi.svg
2831
2832         calculateTransformationToOutermostCoordinateSystem should include the page's
2833         device scale factor in its transform.
2834
2835         * rendering/svg/SVGRenderingContext.cpp:
2836         (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
2837
2838 2013-08-29  Chris Fleizach  <cfleizach@apple.com>
2839
2840         AX: Crash when VoiceOver reference a TextMarker from an iframe that has been removed
2841         https://bugs.webkit.org/show_bug.cgi?id=120318
2842
2843         Reviewed by Darin Adler.
2844
2845         These crashes occur because an AXTextMarker is retrieved that reference a Node in an iframe.
2846         The iframe goes away, but when it tries to clean up and remove that Node from the InUse cache,
2847         the document() tree has already been detached, so it never clears the actual InUse cache.
2848
2849         The fix here is to pre-emptively clean up any nodes in the document going away when the frame is about to disconnect.
2850
2851         I'm removing the clearAXObjectCache() at the disconnectOwnerElement because it 
2852            1) Cleared the AXObjectCache for the iframe document (which is always empty -- only the top level doc maintains the cache), because
2853                 the document() tree had already been detached... so it essentially did nothing.
2854            2) And if it did work, we wouldn't want this behavior -- that is to say, when an iframe goes away, we don't want to clear the entire cache for all
2855                the other documents (there's even an existing layout test to verify this behavior).
2856
2857         Test: platform/mac/accessibility/stale-textmarker-crash.html
2858
2859         * accessibility/AXObjectCache.cpp:
2860         (WebCore::AXObjectCache::clearTextMarkerNodesInUse):
2861         * accessibility/AXObjectCache.h:
2862         * page/Frame.cpp:
2863         (WebCore::Frame::disconnectOwnerElement):
2864
2865 2013-08-29  Brent Fulgham  <bfulgham@apple.com>
2866
2867         [Windows] More unreviewed gardening of project file.
2868         Move css files inline with related source code.
2869
2870         * WebCore.vcxproj/WebCore.vcxproj:
2871         * WebCore.vcxproj/WebCore.vcxproj.filters:
2872
2873 2013-08-29  Sam Weinig  <sam@webkit.org>
2874
2875         Add ENABLE guards for Promises
2876         https://bugs.webkit.org/show_bug.cgi?id=120488
2877
2878         Reviewed by Andreas Kling.
2879
2880         * Configurations/FeatureDefines.xcconfig:
2881
2882 2013-08-29  Andreas Kling  <akling@apple.com>
2883
2884         Inspector: Use a bit of RefPtr::release() in generated code.
2885         <https://webkit.org/b/120485>
2886
2887         Reviewed by Darin Adler.
2888
2889         Just something I spotted while reading InspectorBackendDispatcher.cpp.
2890         Avoid 3 cases of reference count churnery.
2891
2892         * inspector/CodeGeneratorInspectorStrings.py:
2893
2894 2013-08-29  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2895
2896         According to DOM4, all DocType nodes should have a document
2897         https://bugs.webkit.org/show_bug.cgi?id=99244
2898
2899         Reviewed by Darin Adler.
2900
2901         Doctypes now always have a node document and can be moved across document boundaries as per
2902         the latest DOM4 specification:
2903         http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype
2904         http://dom.spec.whatwg.org/#dom-node-ownerdocument
2905
2906         This means that DOMImplementation.createDocumentType() now sets the ownerDocument of the
2907         new DocumentType Node to the associated document of the current "context" object. In
2908         DOM4, all nodes have a document at all times. DocumentType nodes can now be moved across
2909         document boundaries so that the node can be added to a Document after being created.
2910
2911         This means we will no longer need to special case DocumentType nodes in the code and
2912         Node::document() can no longer return NULL, which means that we'll be able to remove
2913         NULL checks in call sites.
2914
2915         Firefox stable and since recently Blink already follow DOM4 here while IE10 does not (yet).
2916
2917         Test: fast/dom/createDocumentType-ownerDocument.html
2918
2919         * dom/ContainerNode.cpp:
2920         (WebCore::checkAcceptChild):
2921         * dom/DOMImplementation.cpp:
2922         (WebCore::DOMImplementation::createDocumentType):
2923         (WebCore::DOMImplementation::createDocument):
2924         * dom/Node.h:
2925         (WebCore::Node::document):
2926
2927 2013-08-29  Darin Adler  <darin@apple.com>
2928
2929         Pasteboard::writeSelection violates layering (first step, fixes it for Mac platform only)
2930         https://bugs.webkit.org/show_bug.cgi?id=120483
2931
2932         Reviewed by Anders Carlsson.
2933
2934         * editing/Editor.cpp:
2935         (WebCore::Editor::cut): Added some comments. Use the new writeSelectionToPasteboard
2936         function on Mac instead of Pasteboard::writeSelection.
2937         (WebCore::Editor::copy): Ditto.
2938
2939         * editing/Editor.h: Removed an old unused Mac-only writeSelectionToPasteboard function
2940         that was a cover that called through to Pasteboard::writeSelectionForTypes. Added a new
2941         Mac-only writeSelectionToPasteboard function that is destined to become cross-platform soon.
2942
2943         * editing/mac/EditorMac.mm:
2944         (WebCore::Editor::writeSelectionToPasteboard): Added. Uses a new pattern where the Editor
2945         puts all the data into a structure called PasteboardWebContent then calls the Pasteboard to
2946         do the work. The platform-specific aspect of PasteboardWebContent is what formats are needed
2947         for each platform.
2948
2949         * page/DragController.cpp:
2950         (WebCore::DragController::startDrag): Added some comments. Use the new writeSelectionToPasteboard
2951         function on Mac instead of Pasteboard::writeSelection.
2952
2953         * platform/Pasteboard.h: Remove some unneeded forward declarations. Added comments for all functions
2954         that don't belong in this class because they are layering violations; this becomes the to do list for
2955         the project we are beginning here. Added the new PasteboardWebContent structure, empty on all platforms
2956         except for Mac for now. Removed writeSelectionForTypes, a Mac-only function that is no longer used.
2957         Added setTypes and writeAfterSettingTypes, the two halves of the future function named writeWebContent.
2958         Put the writeSelection function inside a "not Mac" if statement. Later to be deleted entirely.
2959
2960         * platform/mac/PasteboardMac.mm: Removed now-unneeded selectionPasteboardTypes,
2961         Pasteboard::writeSelectionForTypes, and writeSelection functions.
2962         (WebCore::Pasteboard::setTypes): Added. First half of writing web content to the pasteboard.
2963         (WebCore::Pasteboard::writeAfterSettingTypes): Added. Second half of writing web content to the pasteboard.
2964
2965 2013-08-29  Antti Koivisto  <antti@apple.com>
2966
2967         Remove code behind ENABLE(DIALOG_ELEMENT)
2968         https://bugs.webkit.org/show_bug.cgi?id=120467
2969
2970         Reviewed by Darin Adler.
2971
2972         It is incomplete and no one is building it.
2973
2974         * CMakeLists.txt:
2975         * Configurations/FeatureDefines.xcconfig:
2976         * DerivedSources.make:
2977         * DerivedSources.pri:
2978         * GNUmakefile.list.am:
2979         * Target.pri:
2980         * WebCore.exp.in:
2981         * WebCore.xcodeproj/project.pbxproj:
2982         * bindings/generic/RuntimeEnabledFeatures.cpp:
2983         * bindings/generic/RuntimeEnabledFeatures.h:
2984         * css/StyleResolver.cpp:
2985         (WebCore::StyleResolver::adjustRenderStyle):
2986         * css/html.css:
2987         * dom/ContextFeatures.cpp:
2988         * dom/ContextFeatures.h:
2989         * dom/Document.cpp:
2990         * dom/Document.h:
2991         * dom/Element.cpp:
2992         (WebCore::Element::removedFrom):
2993         (WebCore::Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries):
2994         * dom/Element.h:
2995         (WebCore::Element::isDisabledFormControl):
2996         * dom/ElementRareData.h:
2997         (WebCore::ElementRareData::ElementRareData):
2998         * html/HTMLDialogElement.cpp: Removed.
2999         * html/HTMLDialogElement.h: Removed.
3000         * html/HTMLDialogElement.idl: Removed.
3001         * html/HTMLElementsAllInOne.cpp:
3002         * html/HTMLTagNames.in:
3003         * rendering/RenderDialog.cpp: Removed.
3004         * rendering/RenderDialog.h: Removed.
3005         * rendering/RenderLayer.cpp:
3006         (WebCore::RenderLayer::rebuildZOrderLists):
3007         (WebCore::RenderLayer::collectLayers):
3008         * rendering/RenderLayer.h:
3009         * rendering/RenderObject.h:
3010         (WebCore::RenderObject::isCounter):
3011         * rendering/RenderingAllInOne.cpp:
3012         * testing/InternalSettings.cpp:
3013         (WebCore::InternalSettings::Backup::Backup):
3014         (WebCore::InternalSettings::Backup::restoreTo):
3015         * testing/InternalSettings.h:
3016
3017 2013-08-29  Simon Fraser  <simon.fraser@apple.com>
3018
3019         Fix slider thumb event handling to use local, not absolute coordinates
3020         https://bugs.webkit.org/show_bug.cgi?id=120480
3021
3022         Reviewed by Darin Adler.
3023         
3024         SliderThumbElement::setPositionFromPoint() did all of its coordinate
3025         math by mapping renderer rects into absolute coordinates, which was
3026         unnecessary and expensive.
3027         
3028         Fix by doing all the math in the coordinate space of the input's
3029         renderer. This simplified the code. Also, currentPosition
3030         was computed but unused, so was removed.
3031
3032         No behavior change. Tested by fast/forms/range/slider-transformed.html
3033
3034         * html/shadow/SliderThumbElement.cpp:
3035         (WebCore::SliderThumbElement::setPositionFromPoint):
3036
3037 2013-08-29  Zan Dobersek  <zdobersek@igalia.com>
3038
3039         [Automake] libWebCoreDOM.la could use a better name
3040         https://bugs.webkit.org/show_bug.cgi?id=120232
3041
3042         Reviewed by Martin Robinson.
3043
3044         * bindings/gobject/GNUmakefile.am: Rename the libWebCoreDOM library to libGObjectDOMBindings.
3045
3046 2013-08-29  Joseph Pecoraro  <pecoraro@apple.com>
3047
3048         Web Inspector: Download Web Archive of Inspected Page
3049         https://bugs.webkit.org/show_bug.cgi?id=119774
3050
3051         Reviewed by Timothy Hatcher.
3052
3053         Add PageAgent.archive which will return a Base-64 encoded web archive
3054         when successful. In order to then allow saving non-string files, extend
3055         InspectorFrontendHost.save to allow for Base-64 encoded data.
3056
3057         * inspector/Inspector.json:
3058         * inspector/InspectorPageAgent.cpp:
3059         (WebCore::InspectorPageAgent::archive):
3060         * inspector/InspectorPageAgent.h:
3061         Introduce and implement PageAgent.archive. Create a Web Archive of the
3062         page's main frame.
3063
3064         * inspector/InspectorFrontendClient.h:
3065         * inspector/InspectorFrontendClientLocal.h:
3066         (WebCore::InspectorFrontendClientLocal::save):
3067         * inspector/InspectorFrontendHost.cpp:
3068         (WebCore::InspectorFrontendHost::save):
3069         * inspector/InspectorFrontendHost.h:
3070         * inspector/InspectorFrontendHost.idl:
3071         Extend InspectorFrontendHost.save to include a base64Encoded param.
3072
3073         * inspector/front-end/FileManager.js:
3074         * inspector/front-end/InspectorFrontendHostStub.js:
3075         (.WebInspector.InspectorFrontendHostStub.prototype.save):
3076         Misc. updates to the old inspector for function changes.
3077
3078 2013-08-29  Robert Hogan  <robert@webkit.org>
3079
3080         Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width
3081         https://bugs.webkit.org/show_bug.cgi?id=93735
3082
3083         Reviewed by David Hyatt.
3084
3085         Replaced elements that aren't RenderReplaced aren't |isReplaced| and don't have an 
3086         intrinsic height or width. This causes them to go down the wrong height and width computation
3087         path in RenderBox when they are absolute positioned. 
3088         
3089         The notion of |isReplaced| is entwined with the notion of being |isInline| so it isn't really 
3090         possible to make them isReplaced without re-wiring a lot of code. So instead use an ad-hoc definition
3091         of isReplacedElement in RenderBox to bring all replaced elements into the height and width calculation.
3092         To make sure we get the right height and width in there, give non-RenderReplaced replaced renderers
3093         the helpers for returning their approximation of intrinsic height and width.
3094
3095         The initial attempt at landing this patch had to be rolled out because it used LayoutUnit() for default
3096         intrinsic height of some replaced elements and this made the layout of the elements unstable in some sites.
3097         The fix for this issue is captured in intrinsic-button-and-input-height.html.
3098
3099         Tests: fast/replaced/intrinsic-button-and-input-height.html
3100                fast/replaced/width-and-height-of-positioned-replaced-elements.html
3101
3102         * rendering/RenderBox.cpp:
3103         (WebCore::isReplacedElement):
3104         (WebCore::RenderBox::computePositionedLogicalWidth):
3105         (WebCore::RenderBox::computePositionedLogicalHeight):
3106         * rendering/RenderBox.h:
3107         (WebCore::RenderBox::intrinsicSize):
3108         * rendering/RenderButton.h:
3109         * rendering/RenderFileUploadControl.cpp:
3110         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
3111         * rendering/RenderListBox.cpp:
3112         (WebCore::RenderListBox::RenderListBox):
3113         (WebCore::RenderListBox::computePreferredLogicalWidths):
3114         (WebCore::RenderListBox::computeLogicalHeight):
3115         * rendering/RenderListBox.h:
3116         * rendering/RenderMenuList.h:
3117         * rendering/RenderReplaced.h:
3118         * rendering/RenderSlider.cpp:
3119         (WebCore::RenderSlider::computePreferredLogicalWidths):
3120         * rendering/RenderTextControl.cpp:
3121         (WebCore::RenderTextControl::RenderTextControl):
3122         (WebCore::RenderTextControl::computeLogicalHeight):
3123         * rendering/RenderTextControl.h:
3124
3125 2013-08-29  Brent Fulgham  <bfulgham@apple.com>
3126
3127         [Windows] Unreviewed gardening. Add missing *.css files from project.
3128
3129         * WebCore.vcxproj/WebCore.vcxproj:
3130         * WebCore.vcxproj/WebCore.vcxproj.filters:
3131
3132 2013-08-29  Pratik Solanki  <pratik.solanki@gmail.com>
3133
3134         SharedBuffer m_segments and m_dataArray must be exclusive
3135         https://bugs.webkit.org/show_bug.cgi?id=77715
3136
3137         Reviewed by Benjamin Poulain.
3138
3139         When USE(NETWORK_CFDATA_ARRAY_CALLBACK) is enabled, we use m_dataArray to hold the incoming
3140         data. We do not use m_segments. Since they are exclusive in practice, do not define or use
3141         m_segments when NETWORK_CFDATA_ARRAY_CALLBACK is enabled.
3142
3143         No new tests because no functional changes.
3144
3145         * platform/SharedBuffer.cpp:
3146         (WebCore::SharedBuffer::append):
3147         (WebCore::SharedBuffer::clear):
3148         (WebCore::SharedBuffer::copy):
3149         (WebCore::SharedBuffer::buffer):
3150         (WebCore::SharedBuffer::getSomeData):
3151         * platform/SharedBuffer.h:
3152
3153 2013-08-29  Daniel Bates  <dabates@apple.com>
3154
3155         [iOS] Upstream changes to WebCore/style
3156         https://bugs.webkit.org/show_bug.cgi?id=120173
3157
3158         Reviewed by Darin Adler.
3159
3160         * style/StyleResolveTree.cpp:
3161         (WebCore::Style::elementImplicitVisibility): Added; specific to iOS.
3162         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Added; specific to iOS.
3163         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Added; specific to iOS.
3164         (WebCore::Style::resolveTree): Modified to instantiate CheckForVisibilityChangeOnRecalcStyle when building on iOS.
3165
3166 2013-08-29  Arnaud Renevier  <a.renevier@samsung.com>
3167
3168         [cairo] canvas drawing on itself doesn't work with accelerated canvas
3169         https://bugs.webkit.org/show_bug.cgi?id=118808
3170
3171         Reviewed by Martin Robinson.
3172
3173         When copying an accelerated image, we try to get its dimensions with
3174         cairo_image_surface_get_width/cairo_image_surface_get_height. As
3175         surface is not an image, this returns width and height of 0.
3176
3177         Many other places use cairo_image_surface_get although the surface may
3178         be a gl surface. 
3179         
3180         This patch fixes those issues by implementing a cairoSurfaceSize
3181         helper that returns the surface size whatever type it is.
3182
3183         It use cairo_surface_create_similar instead of
3184         cairo_image_surface_create in copyCairoImageSurface. It also calls
3185         cairo_paint in encodeImage when a drawing over a black background is
3186         needed.
3187
3188         It copies the surface to an image surface if needed in extractImage.
3189
3190         No new tests. Covered by existing tests.
3191
3192         * platform/graphics/cairo/BitmapImageCairo.cpp:
3193         (WebCore::BitmapImage::BitmapImage):
3194         (WebCore::BitmapImage::draw):
3195         (WebCore::BitmapImage::checkForSolidColor):
3196         * platform/graphics/cairo/CairoUtilities.cpp:
3197         (WebCore::copyCairoImageSurface):
3198         (WebCore::cairoSurfaceSize):
3199         * platform/graphics/cairo/CairoUtilities.h:
3200         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3201         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3202         * platform/graphics/gtk/GdkCairoUtilities.cpp:
3203         (cairoSurfaceToGdkPixbuf):
3204         * platform/graphics/gtk/GdkCairoUtilities.h:
3205         * platform/graphics/gtk/ImageBufferGtk.cpp:
3206         (WebCore::encodeImage):
3207         * platform/graphics/gtk/ImageGtk.cpp:
3208         (WebCore::BitmapImage::getGdkPixbuf):
3209         * platform/gtk/DragIcon.cpp:
3210         (WebCore::DragIcon::setImage):
3211
3212 2013-08-29  Tamas Czene  <tczene@inf.u-szeged.hu>
3213
3214         Buildfix after r154806 for !ENABLE(CSS_REGIONS) platforms.
3215         https://bugs.webkit.org/show_bug.cgi?id=120461
3216
3217         Reviewed by Csaba Osztrogonác.
3218
3219         moveToFlowThreadIfNeeded() is used only inside of ENABLE(CSS_REGIONS)
3220         block (and only once), so it should be guarded too.
3221
3222         * style/StyleResolveTree.cpp:
3223
3224 2013-08-29  David Kilzer  <ddkilzer@apple.com>
3225
3226         BUILD FIX (r154778): AXSearchFieldCancelButtonText() is not defined on iOS
3227
3228         See: AX: Cancel button in search field not accessible.
3229         <https://webkit.org/b/120322>
3230
3231         Fixes the following build error:
3232
3233             In file included from Source/WebCore/accessibility/AccessibilityAllInOne.cpp:44:
3234             Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp:46:12: error: use of undeclared identifier 'AXSearchFieldCancelButtonText'
3235                 return AXSearchFieldCancelButtonText();
3236                        ^
3237             1 error generated.
3238
3239         * accessibility/AccessibilitySearchFieldButtons.cpp:
3240         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityDescription):
3241         Return String() instead of calling AXSearchFieldCancelButtonText() on iOS.
3242
3243 2013-08-29  Antti Koivisto  <antti@apple.com>
3244
3245         Remove NodeRenderingContext
3246         https://bugs.webkit.org/show_bug.cgi?id=120466
3247
3248         Reviewed by Andreas Kling.
3249
3250         Switch the few remaining clients of this class to call the underlying code directly.
3251
3252         * CMakeLists.txt:
3253         * GNUmakefile.list.am:
3254         * Target.pri:
3255         * WebCore.exp.in:
3256         * WebCore.vcxproj/WebCore.vcxproj:
3257         * WebCore.xcodeproj/project.pbxproj:
3258         * css/StyleResolver.cpp:
3259         (WebCore::StyleResolver::State::initForStyleResolve):
3260         * dom/DOMAllInOne.cpp:
3261         * dom/Node.cpp:
3262         * dom/Node.h:
3263         
3264             Remove Node::parentNodeForRenderingAndStyle(). Make clients invoke NodeRenderingTraversal::parent() directly.
3265
3266         * dom/NodeRenderingContext.cpp: Removed.
3267         * dom/NodeRenderingContext.h: Removed.
3268         * dom/ShadowRoot.h:
3269         * dom/Text.cpp:
3270         * dom/Text.h:
3271         * dom/TreeScope.cpp:
3272         * dom/TreeScope.h:
3273             
3274             Remove virtual TreeScope::resetStyleInheritance. Make clients cast to ShadowRoot when needed.
3275
3276         * html/HTMLSummaryElement.cpp:
3277         (WebCore::HTMLSummaryElement::detailsElement):
3278         * style/StyleResolveTree.cpp:
3279         (WebCore::Style::createTextRendererIfNeeded):
3280         
3281             For consistency switch resetStyleInheritance check to use parentNode() instead of renderingParentNode. This matches the NodeRenderingTraversal implementation.
3282             This difference is probably not testable in current trunk.
3283
3284         (WebCore::Style::resolveTree):
3285
3286 2013-08-29  Antti Koivisto  <antti@apple.com>
3287
3288         Move element renderer creation out of NodeRenderingContext
3289         https://bugs.webkit.org/show_bug.cgi?id=120461
3290
3291         Reviewed by Andreas Kling.
3292
3293         Move NodeRenderingContext::createRendererIfNeeded() and the related utility functions to StyleResolveTree.
3294         
3295         Tighten typing and constness. Refactor sligthly to be more understandable.
3296
3297         * dom/Element.cpp:
3298         (WebCore::Element::shouldMoveToFlowThread):
3299         * dom/Element.h:
3300         * dom/NodeRenderingContext.cpp:
3301         (WebCore::NodeRenderingContext::NodeRenderingContext):
3302         (WebCore::NodeRenderingContext::nextRenderer):
3303         (WebCore::NodeRenderingContext::previousRenderer):
3304         (WebCore::NodeRenderingContext::parentRenderer):
3305         * dom/NodeRenderingContext.h:
3306         * dom/PseudoElement.h:
3307         * style/StyleResolveTree.cpp:
3308         (WebCore::Style::nextSiblingRenderer):
3309         (WebCore::Style::shouldCreateRenderer):
3310         (WebCore::Style::elementInsideRegionNeedsRenderer):
3311         (WebCore::Style::moveToFlowThreadIfNeeded):
3312         (WebCore::Style::createRendererIfNeeded):
3313         (WebCore::Style::attachRenderTree):
3314         * svg/SVGElement.cpp:
3315         (WebCore::SVGElement::shouldMoveToFlowThread):
3316         * svg/SVGElement.h:
3317
3318 2013-08-28  Chris Fleizach  <cfleizach@apple.com>
3319
3320         AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 27
3321         https://bugs.webkit.org/show_bug.cgi?id=120434
3322
3323         Reviewed by Darin Adler.
3324
3325         Crash logs indicate that there's a null pointer access in rootObject. That seems like it could only
3326         happen in Document was null. 
3327
3328         Unfortunately, there are no reproducible steps and no other information to construct a test case.
3329
3330         * accessibility/AXObjectCache.cpp:
3331         (WebCore::AXObjectCache::rootObject):
3332
3333 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
3334
3335         The code to look for an ancestor form element is duplicated in three different places
3336         https://bugs.webkit.org/show_bug.cgi?id=120391
3337
3338         Reviewed by Darin Adler.
3339
3340         Unduplicated the code by putting a single implementation in HTMLFormElement.cpp.
3341
3342         * WebCore.order:
3343         * html/FormAssociatedElement.cpp:
3344         (WebCore::FormAssociatedElement::findAssociatedForm):
3345         (WebCore::FormAssociatedElement::formAttributeChanged):
3346         * html/HTMLElement.cpp:
3347         (WebCore::HTMLElement::virtualForm):
3348         * html/HTMLElement.h:
3349         * html/HTMLFormControlElement.cpp:
3350         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
3351         * html/HTMLFormElement.cpp:
3352         (WebCore::HTMLFormElement::findClosestFormAncestor):
3353         * html/HTMLFormElement.h:
3354         * html/HTMLImageElement.cpp:
3355         (WebCore::HTMLImageElement::insertedInto):
3356         * html/HTMLObjectElement.cpp:
3357         (WebCore::HTMLObjectElement::HTMLObjectElement):
3358         * html/parser/HTMLTreeBuilder.cpp:
3359         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
3360
3361 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
3362
3363         Stop throwing DOM exceptions in internal 'XMLHttpRequest' response getters
3364         https://bugs.webkit.org/show_bug.cgi?id=120446
3365
3366         Reviewed by Alexey Proskuryakov.
3367
3368         Merge https://chromium.googlesource.com/chromium/blink/+/c8188c21452501b68950a9fcc1f5cbc7b4de4df5
3369
3370         Unlike 'responseText' and 'responseXML', 'responseBlob' and
3371         'responseArrayBuffer' are not exposed to JavaScript (they don't
3372         appear in the IDL or in the specification). As they are only called from
3373         custom bindings in response to a JavaScript call to the 'response' getter,
3374         we can safely replace the exception-throwing code in the implementation
3375         with an ASSERT that the request type is correct.
3376
3377         * bindings/js/JSXMLHttpRequestCustom.cpp:
3378         (WebCore::JSXMLHttpRequest::response):
3379         * xml/XMLHttpRequest.cpp:
3380         (WebCore::XMLHttpRequest::responseBlob):
3381         (WebCore::XMLHttpRequest::responseArrayBuffer):
3382         * xml/XMLHttpRequest.h:
3383
3384 2013-08-28  Chris Curtis  <chris_curtis@apple.com>
3385
3386         https://bugs.webkit.org/show_bug.cgi?id=119548
3387         Refactoring Exception throws.
3388         
3389         Reviewed by Geoffrey Garen.
3390         
3391         Gets column information from the error object for reporting exceptions.
3392         * bindings/js/JSDOMBinding.cpp:
3393         (WebCore::reportException): 
3394         * bindings/js/ScriptCallStackFactory.cpp: 
3395         (WebCore::createScriptCallStackFromException):
3396  
3397         Moved setting an exception into the vm, These functions changed to use the new functionality.
3398  
3399         * bindings/js/JSAudioBufferSourceNodeCustom.cpp:
3400         (WebCore::JSAudioBufferSourceNode::setBuffer):
3401         * bindings/js/JSBiquadFilterNodeCustom.cpp:
3402         (WebCore::JSBiquadFilterNode::setType):
3403         * bindings/js/JSCryptoCustom.cpp:
3404         (WebCore::JSCrypto::getRandomValues):
3405         * bindings/js/JSDOMBinding.cpp:
3406         (WebCore::setDOMException):
3407         * bindings/js/JSInjectedScriptHostCustom.cpp:
3408         (WebCore::JSInjectedScriptHost::setFunctionVariableValue):
3409         * bindings/js/JSJavaScriptCallFrameCustom.cpp:
3410         (WebCore::JSJavaScriptCallFrame::evaluate):
3411         (WebCore::JSJavaScriptCallFrame::setVariableValue):
3412         * bindings/js/JSNodeFilterCondition.cpp:
3413         (WebCore::JSNodeFilterCondition::acceptNode):
3414         * bindings/js/JSOscillatorNodeCustom.cpp:
3415         (WebCore::JSOscillatorNode::setType):
3416         * bindings/js/JSPannerNodeCustom.cpp:
3417         (WebCore::JSPannerNode::setPanningModel):
3418         (WebCore::JSPannerNode::setDistanceModel):
3419         * bindings/js/JSSVGLengthCustom.cpp: