Implement object-fit CSS property
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-08-26  Simon Fraser  <simon.fraser@apple.com>
2
3         Implement object-fit CSS property
4         https://bugs.webkit.org/show_bug.cgi?id=52040
5
6         Reviewed by Antti Koivisto, Sam Weinig.
7         
8         Merge object-fit patch from Blink r156535, which started as a patch
9         by me.
10
11         Since then, the spec has gone to CR. This patch is an
12         implementation of object-fit as described in
13         http://www.w3.org/TR/2012/CR-css3-images-20120417/#object-fit
14
15         Object-fit is used to maintain the aspect ratio of replaced content
16         within its content box. All object-fit values but the initial one
17         ('fill') will always ensure that the aspect ratio is retained, in
18         different ways (fit inside the content box, cover the content box, or
19         use intrinsic size). Painting is always clipped against the content
20         box, regardless of the 'overflow' property.
21
22         Tests: fast/css/object-fit/object-fit-canvas.html
23                fast/css/object-fit/object-fit-embed.html
24                fast/css/object-fit/object-fit-grow-landscape.html
25                fast/css/object-fit/object-fit-grow-portrait.html
26                fast/css/object-fit/object-fit-img-svg.html
27                fast/css/object-fit/object-fit-img-svg2.html
28                fast/css/object-fit/object-fit-img.html
29                fast/css/object-fit/object-fit-input-image.html
30                fast/css/object-fit/object-fit-object.html
31                fast/css/object-fit/object-fit-shrink.html
32                fast/css/object-fit/object-fit-video-poster.html
33                fast/css/parsing-object-fit.html
34                http/tests/css/object-fit-delayed-img-svg.html
35                media/video-object-fit-change.html
36                media/video-object-fit.html
37
38         * css/CSSComputedStyleDeclaration.cpp:
39         (WebCore::ComputedStyleExtractor::propertyValue):
40         * css/CSSParser.cpp:
41         (WebCore::isValidKeywordPropertyAndValue):
42         (WebCore::isKeywordPropertyID):
43         (WebCore::CSSParser::parseValue):
44         * css/CSSPrimitiveValueMappings.h:
45         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
46         (WebCore::CSSPrimitiveValue::operator EObjectFit):
47         * css/CSSProperty.cpp:
48         (WebCore::CSSProperty::isInheritedProperty):
49         * css/CSSPropertyNames.in:
50         * css/CSSValueKeywords.in:
51         * css/DeprecatedStyleBuilder.cpp:
52         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
53         * css/StyleResolver.cpp:
54         (WebCore::StyleResolver::applyProperty):
55         * css/html.css:
56         (video): Set object-fit to 'contain'. This is how VIDEO elements
57         work, apparently.
58         * loader/cache/CachedImage.cpp:
59         (WebCore::CachedImage::imageSizeForRenderer):
60         * loader/cache/CachedImage.h:
61         * platform/graphics/LayoutSize.h:
62         (WebCore::fitLayoutSizeToAspectRatio): New function to grow or shrink
63         in one dimension to fit to the aspect ratio.
64         * rendering/RenderHTMLCanvas.cpp:
65         (WebCore::RenderHTMLCanvas::paintReplaced): Apply object-fit and
66         clip if necessary.
67         * rendering/RenderImage.cpp:
68         (WebCore::RenderImage::updateInnerContentRect):
69         (WebCore::RenderImage::imageDimensionsChanged): Update intrinsic
70         size properly, and recalculate the inner content rectangle (the
71         exact area occupied by the replaced content) again if appropriate.
72         (WebCore::RenderImage::paintReplaced): Apply object-fit and clip
73         if necessary.
74         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
75         object-fit may leave parts of the content box empty, in which case
76         it won't be fully obscured.
77         (WebCore::RenderImage::layout):
78         * rendering/RenderImage.h:
79         * rendering/RenderImageResource.cpp:
80         (WebCore::RenderImageResource::intrinsicSize): Need this to
81         differentiate between intrinsic and extrinsic size for SVG images.
82         * rendering/RenderImageResource.h:
83         * rendering/RenderImageResourceStyleImage.h:
84         * rendering/RenderReplaced.cpp:
85         (WebCore::RenderReplaced::replacedContentRect): Return the
86         rectangle occupied by the replaced content. This will be identical
87         to the content box if object-fit is 'fill', but will typically be
88         something else for other values.
89         * rendering/RenderReplaced.h:
90         * rendering/RenderVideo.cpp:
91         (WebCore::RenderVideo::videoBox): Not much left to do here, with
92         the new RenderReplaced::replacedContentRect() method in place.
93         (WebCore::RenderVideo::paintReplaced): Apply object-fit and clip
94         if necessary.
95         * rendering/style/RenderStyle.cpp:
96         (WebCore::RenderStyle::changeRequiresRepaint):
97         * rendering/style/RenderStyle.h:
98         * rendering/style/RenderStyleConstants.h:
99         * rendering/style/StyleRareNonInheritedData.cpp:
100         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
101         (WebCore::StyleRareNonInheritedData::operator==):
102         * rendering/style/StyleRareNonInheritedData.h:
103
104 2013-08-29  Tim Horton  <timothy_horton@apple.com>
105
106         SVG clipping, masking, and gradients-on-text do not respect the device scale factor
107         https://bugs.webkit.org/show_bug.cgi?id=120377
108         <rdar://problem/14777944>
109
110         Reviewed by Simon Fraser.
111
112         Tests: svg/custom/masking-clipping-hidpi.svg
113
114         calculateTransformationToOutermostCoordinateSystem should include the page's
115         device scale factor in its transform.
116
117         * rendering/svg/SVGRenderingContext.cpp:
118         (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
119
120 2013-08-29  Chris Fleizach  <cfleizach@apple.com>
121
122         AX: Crash when VoiceOver reference a TextMarker from an iframe that has been removed
123         https://bugs.webkit.org/show_bug.cgi?id=120318
124
125         Reviewed by Darin Adler.
126
127         These crashes occur because an AXTextMarker is retrieved that reference a Node in an iframe.
128         The iframe goes away, but when it tries to clean up and remove that Node from the InUse cache,
129         the document() tree has already been detached, so it never clears the actual InUse cache.
130
131         The fix here is to pre-emptively clean up any nodes in the document going away when the frame is about to disconnect.
132
133         I'm removing the clearAXObjectCache() at the disconnectOwnerElement because it 
134            1) Cleared the AXObjectCache for the iframe document (which is always empty -- only the top level doc maintains the cache), because
135                 the document() tree had already been detached... so it essentially did nothing.
136            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
137                the other documents (there's even an existing layout test to verify this behavior).
138
139         Test: platform/mac/accessibility/stale-textmarker-crash.html
140
141         * accessibility/AXObjectCache.cpp:
142         (WebCore::AXObjectCache::clearTextMarkerNodesInUse):
143         * accessibility/AXObjectCache.h:
144         * page/Frame.cpp:
145         (WebCore::Frame::disconnectOwnerElement):
146
147 2013-08-29  Brent Fulgham  <bfulgham@apple.com>
148
149         [Windows] More unreviewed gardening of project file.
150         Move css files inline with related source code.
151
152         * WebCore.vcxproj/WebCore.vcxproj:
153         * WebCore.vcxproj/WebCore.vcxproj.filters:
154
155 2013-08-29  Sam Weinig  <sam@webkit.org>
156
157         Add ENABLE guards for Promises
158         https://bugs.webkit.org/show_bug.cgi?id=120488
159
160         Reviewed by Andreas Kling.
161
162         * Configurations/FeatureDefines.xcconfig:
163
164 2013-08-29  Andreas Kling  <akling@apple.com>
165
166         Inspector: Use a bit of RefPtr::release() in generated code.
167         <https://webkit.org/b/120485>
168
169         Reviewed by Darin Adler.
170
171         Just something I spotted while reading InspectorBackendDispatcher.cpp.
172         Avoid 3 cases of reference count churnery.
173
174         * inspector/CodeGeneratorInspectorStrings.py:
175
176 2013-08-29  Christophe Dumez  <ch.dumez@sisa.samsung.com>
177
178         According to DOM4, all DocType nodes should have a document
179         https://bugs.webkit.org/show_bug.cgi?id=99244
180
181         Reviewed by Darin Adler.
182
183         Doctypes now always have a node document and can be moved across document boundaries as per
184         the latest DOM4 specification:
185         http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype
186         http://dom.spec.whatwg.org/#dom-node-ownerdocument
187
188         This means that DOMImplementation.createDocumentType() now sets the ownerDocument of the
189         new DocumentType Node to the associated document of the current "context" object. In
190         DOM4, all nodes have a document at all times. DocumentType nodes can now be moved across
191         document boundaries so that the node can be added to a Document after being created.
192
193         This means we will no longer need to special case DocumentType nodes in the code and
194         Node::document() can no longer return NULL, which means that we'll be able to remove
195         NULL checks in call sites.
196
197         Firefox stable and since recently Blink already follow DOM4 here while IE10 does not (yet).
198
199         Test: fast/dom/createDocumentType-ownerDocument.html
200
201         * dom/ContainerNode.cpp:
202         (WebCore::checkAcceptChild):
203         * dom/DOMImplementation.cpp:
204         (WebCore::DOMImplementation::createDocumentType):
205         (WebCore::DOMImplementation::createDocument):
206         * dom/Node.h:
207         (WebCore::Node::document):
208
209 2013-08-29  Darin Adler  <darin@apple.com>
210
211         Pasteboard::writeSelection violates layering (first step, fixes it for Mac platform only)
212         https://bugs.webkit.org/show_bug.cgi?id=120483
213
214         Reviewed by Anders Carlsson.
215
216         * editing/Editor.cpp:
217         (WebCore::Editor::cut): Added some comments. Use the new writeSelectionToPasteboard
218         function on Mac instead of Pasteboard::writeSelection.
219         (WebCore::Editor::copy): Ditto.
220
221         * editing/Editor.h: Removed an old unused Mac-only writeSelectionToPasteboard function
222         that was a cover that called through to Pasteboard::writeSelectionForTypes. Added a new
223         Mac-only writeSelectionToPasteboard function that is destined to become cross-platform soon.
224
225         * editing/mac/EditorMac.mm:
226         (WebCore::Editor::writeSelectionToPasteboard): Added. Uses a new pattern where the Editor
227         puts all the data into a structure called PasteboardWebContent then calls the Pasteboard to
228         do the work. The platform-specific aspect of PasteboardWebContent is what formats are needed
229         for each platform.
230
231         * page/DragController.cpp:
232         (WebCore::DragController::startDrag): Added some comments. Use the new writeSelectionToPasteboard
233         function on Mac instead of Pasteboard::writeSelection.
234
235         * platform/Pasteboard.h: Remove some unneeded forward declarations. Added comments for all functions
236         that don't belong in this class because they are layering violations; this becomes the to do list for
237         the project we are beginning here. Added the new PasteboardWebContent structure, empty on all platforms
238         except for Mac for now. Removed writeSelectionForTypes, a Mac-only function that is no longer used.
239         Added setTypes and writeAfterSettingTypes, the two halves of the future function named writeWebContent.
240         Put the writeSelection function inside a "not Mac" if statement. Later to be deleted entirely.
241
242         * platform/mac/PasteboardMac.mm: Removed now-unneeded selectionPasteboardTypes,
243         Pasteboard::writeSelectionForTypes, and writeSelection functions.
244         (WebCore::Pasteboard::setTypes): Added. First half of writing web content to the pasteboard.
245         (WebCore::Pasteboard::writeAfterSettingTypes): Added. Second half of writing web content to the pasteboard.
246
247 2013-08-29  Antti Koivisto  <antti@apple.com>
248
249         Remove code behind ENABLE(DIALOG_ELEMENT)
250         https://bugs.webkit.org/show_bug.cgi?id=120467
251
252         Reviewed by Darin Adler.
253
254         It is incomplete and no one is building it.
255
256         * CMakeLists.txt:
257         * Configurations/FeatureDefines.xcconfig:
258         * DerivedSources.make:
259         * DerivedSources.pri:
260         * GNUmakefile.list.am:
261         * Target.pri:
262         * WebCore.exp.in:
263         * WebCore.xcodeproj/project.pbxproj:
264         * bindings/generic/RuntimeEnabledFeatures.cpp:
265         * bindings/generic/RuntimeEnabledFeatures.h:
266         * css/StyleResolver.cpp:
267         (WebCore::StyleResolver::adjustRenderStyle):
268         * css/html.css:
269         * dom/ContextFeatures.cpp:
270         * dom/ContextFeatures.h:
271         * dom/Document.cpp:
272         * dom/Document.h:
273         * dom/Element.cpp:
274         (WebCore::Element::removedFrom):
275         (WebCore::Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries):
276         * dom/Element.h:
277         (WebCore::Element::isDisabledFormControl):
278         * dom/ElementRareData.h:
279         (WebCore::ElementRareData::ElementRareData):
280         * html/HTMLDialogElement.cpp: Removed.
281         * html/HTMLDialogElement.h: Removed.
282         * html/HTMLDialogElement.idl: Removed.
283         * html/HTMLElementsAllInOne.cpp:
284         * html/HTMLTagNames.in:
285         * rendering/RenderDialog.cpp: Removed.
286         * rendering/RenderDialog.h: Removed.
287         * rendering/RenderLayer.cpp:
288         (WebCore::RenderLayer::rebuildZOrderLists):
289         (WebCore::RenderLayer::collectLayers):
290         * rendering/RenderLayer.h:
291         * rendering/RenderObject.h:
292         (WebCore::RenderObject::isCounter):
293         * rendering/RenderingAllInOne.cpp:
294         * testing/InternalSettings.cpp:
295         (WebCore::InternalSettings::Backup::Backup):
296         (WebCore::InternalSettings::Backup::restoreTo):
297         * testing/InternalSettings.h:
298
299 2013-08-29  Simon Fraser  <simon.fraser@apple.com>
300
301         Fix slider thumb event handling to use local, not absolute coordinates
302         https://bugs.webkit.org/show_bug.cgi?id=120480
303
304         Reviewed by Darin Adler.
305         
306         SliderThumbElement::setPositionFromPoint() did all of its coordinate
307         math by mapping renderer rects into absolute coordinates, which was
308         unnecessary and expensive.
309         
310         Fix by doing all the math in the coordinate space of the input's
311         renderer. This simplified the code. Also, currentPosition
312         was computed but unused, so was removed.
313
314         No behavior change. Tested by fast/forms/range/slider-transformed.html
315
316         * html/shadow/SliderThumbElement.cpp:
317         (WebCore::SliderThumbElement::setPositionFromPoint):
318
319 2013-08-29  Zan Dobersek  <zdobersek@igalia.com>
320
321         [Automake] libWebCoreDOM.la could use a better name
322         https://bugs.webkit.org/show_bug.cgi?id=120232
323
324         Reviewed by Martin Robinson.
325
326         * bindings/gobject/GNUmakefile.am: Rename the libWebCoreDOM library to libGObjectDOMBindings.
327
328 2013-08-29  Joseph Pecoraro  <pecoraro@apple.com>
329
330         Web Inspector: Download Web Archive of Inspected Page
331         https://bugs.webkit.org/show_bug.cgi?id=119774
332
333         Reviewed by Timothy Hatcher.
334
335         Add PageAgent.archive which will return a Base-64 encoded web archive
336         when successful. In order to then allow saving non-string files, extend
337         InspectorFrontendHost.save to allow for Base-64 encoded data.
338
339         * inspector/Inspector.json:
340         * inspector/InspectorPageAgent.cpp:
341         (WebCore::InspectorPageAgent::archive):
342         * inspector/InspectorPageAgent.h:
343         Introduce and implement PageAgent.archive. Create a Web Archive of the
344         page's main frame.
345
346         * inspector/InspectorFrontendClient.h:
347         * inspector/InspectorFrontendClientLocal.h:
348         (WebCore::InspectorFrontendClientLocal::save):
349         * inspector/InspectorFrontendHost.cpp:
350         (WebCore::InspectorFrontendHost::save):
351         * inspector/InspectorFrontendHost.h:
352         * inspector/InspectorFrontendHost.idl:
353         Extend InspectorFrontendHost.save to include a base64Encoded param.
354
355         * inspector/front-end/FileManager.js:
356         * inspector/front-end/InspectorFrontendHostStub.js:
357         (.WebInspector.InspectorFrontendHostStub.prototype.save):
358         Misc. updates to the old inspector for function changes.
359
360 2013-08-29  Robert Hogan  <robert@webkit.org>
361
362         Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width
363         https://bugs.webkit.org/show_bug.cgi?id=93735
364
365         Reviewed by David Hyatt.
366
367         Replaced elements that aren't RenderReplaced aren't |isReplaced| and don't have an 
368         intrinsic height or width. This causes them to go down the wrong height and width computation
369         path in RenderBox when they are absolute positioned. 
370         
371         The notion of |isReplaced| is entwined with the notion of being |isInline| so it isn't really 
372         possible to make them isReplaced without re-wiring a lot of code. So instead use an ad-hoc definition
373         of isReplacedElement in RenderBox to bring all replaced elements into the height and width calculation.
374         To make sure we get the right height and width in there, give non-RenderReplaced replaced renderers
375         the helpers for returning their approximation of intrinsic height and width.
376
377         The initial attempt at landing this patch had to be rolled out because it used LayoutUnit() for default
378         intrinsic height of some replaced elements and this made the layout of the elements unstable in some sites.
379         The fix for this issue is captured in intrinsic-button-and-input-height.html.
380
381         Tests: fast/replaced/intrinsic-button-and-input-height.html
382                fast/replaced/width-and-height-of-positioned-replaced-elements.html
383
384         * rendering/RenderBox.cpp:
385         (WebCore::isReplacedElement):
386         (WebCore::RenderBox::computePositionedLogicalWidth):
387         (WebCore::RenderBox::computePositionedLogicalHeight):
388         * rendering/RenderBox.h:
389         (WebCore::RenderBox::intrinsicSize):
390         * rendering/RenderButton.h:
391         * rendering/RenderFileUploadControl.cpp:
392         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
393         * rendering/RenderListBox.cpp:
394         (WebCore::RenderListBox::RenderListBox):
395         (WebCore::RenderListBox::computePreferredLogicalWidths):
396         (WebCore::RenderListBox::computeLogicalHeight):
397         * rendering/RenderListBox.h:
398         * rendering/RenderMenuList.h:
399         * rendering/RenderReplaced.h:
400         * rendering/RenderSlider.cpp:
401         (WebCore::RenderSlider::computePreferredLogicalWidths):
402         * rendering/RenderTextControl.cpp:
403         (WebCore::RenderTextControl::RenderTextControl):
404         (WebCore::RenderTextControl::computeLogicalHeight):
405         * rendering/RenderTextControl.h:
406
407 2013-08-29  Brent Fulgham  <bfulgham@apple.com>
408
409         [Windows] Unreviewed gardening. Add missing *.css files from project.
410
411         * WebCore.vcxproj/WebCore.vcxproj:
412         * WebCore.vcxproj/WebCore.vcxproj.filters:
413
414 2013-08-29  Pratik Solanki  <pratik.solanki@gmail.com>
415
416         SharedBuffer m_segments and m_dataArray must be exclusive
417         https://bugs.webkit.org/show_bug.cgi?id=77715
418
419         Reviewed by Benjamin Poulain.
420
421         When USE(NETWORK_CFDATA_ARRAY_CALLBACK) is enabled, we use m_dataArray to hold the incoming
422         data. We do not use m_segments. Since they are exclusive in practice, do not define or use
423         m_segments when NETWORK_CFDATA_ARRAY_CALLBACK is enabled.
424
425         No new tests because no functional changes.
426
427         * platform/SharedBuffer.cpp:
428         (WebCore::SharedBuffer::append):
429         (WebCore::SharedBuffer::clear):
430         (WebCore::SharedBuffer::copy):
431         (WebCore::SharedBuffer::buffer):
432         (WebCore::SharedBuffer::getSomeData):
433         * platform/SharedBuffer.h:
434
435 2013-08-29  Daniel Bates  <dabates@apple.com>
436
437         [iOS] Upstream changes to WebCore/style
438         https://bugs.webkit.org/show_bug.cgi?id=120173
439
440         Reviewed by Darin Adler.
441
442         * style/StyleResolveTree.cpp:
443         (WebCore::Style::elementImplicitVisibility): Added; specific to iOS.
444         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Added; specific to iOS.
445         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Added; specific to iOS.
446         (WebCore::Style::resolveTree): Modified to instantiate CheckForVisibilityChangeOnRecalcStyle when building on iOS.
447
448 2013-08-29  Arnaud Renevier  <a.renevier@samsung.com>
449
450         [cairo] canvas drawing on itself doesn't work with accelerated canvas
451         https://bugs.webkit.org/show_bug.cgi?id=118808
452
453         Reviewed by Martin Robinson.
454
455         When copying an accelerated image, we try to get its dimensions with
456         cairo_image_surface_get_width/cairo_image_surface_get_height. As
457         surface is not an image, this returns width and height of 0.
458
459         Many other places use cairo_image_surface_get although the surface may
460         be a gl surface. 
461         
462         This patch fixes those issues by implementing a cairoSurfaceSize
463         helper that returns the surface size whatever type it is.
464
465         It use cairo_surface_create_similar instead of
466         cairo_image_surface_create in copyCairoImageSurface. It also calls
467         cairo_paint in encodeImage when a drawing over a black background is
468         needed.
469
470         It copies the surface to an image surface if needed in extractImage.
471
472         No new tests. Covered by existing tests.
473
474         * platform/graphics/cairo/BitmapImageCairo.cpp:
475         (WebCore::BitmapImage::BitmapImage):
476         (WebCore::BitmapImage::draw):
477         (WebCore::BitmapImage::checkForSolidColor):
478         * platform/graphics/cairo/CairoUtilities.cpp:
479         (WebCore::copyCairoImageSurface):
480         (WebCore::cairoSurfaceSize):
481         * platform/graphics/cairo/CairoUtilities.h:
482         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
483         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
484         * platform/graphics/gtk/GdkCairoUtilities.cpp:
485         (cairoSurfaceToGdkPixbuf):
486         * platform/graphics/gtk/GdkCairoUtilities.h:
487         * platform/graphics/gtk/ImageBufferGtk.cpp:
488         (WebCore::encodeImage):
489         * platform/graphics/gtk/ImageGtk.cpp:
490         (WebCore::BitmapImage::getGdkPixbuf):
491         * platform/gtk/DragIcon.cpp:
492         (WebCore::DragIcon::setImage):
493
494 2013-08-29  Tamas Czene  <tczene@inf.u-szeged.hu>
495
496         Buildfix after r154806 for !ENABLE(CSS_REGIONS) platforms.
497         https://bugs.webkit.org/show_bug.cgi?id=120461
498
499         Reviewed by Csaba Osztrogon√°c.
500
501         moveToFlowThreadIfNeeded() is used only inside of ENABLE(CSS_REGIONS)
502         block (and only once), so it should be guarded too.
503
504         * style/StyleResolveTree.cpp:
505
506 2013-08-29  David Kilzer  <ddkilzer@apple.com>
507
508         BUILD FIX (r154778): AXSearchFieldCancelButtonText() is not defined on iOS
509
510         See: AX: Cancel button in search field not accessible.
511         <https://webkit.org/b/120322>
512
513         Fixes the following build error:
514
515             In file included from Source/WebCore/accessibility/AccessibilityAllInOne.cpp:44:
516             Source/WebCore/accessibility/AccessibilitySearchFieldButtons.cpp:46:12: error: use of undeclared identifier 'AXSearchFieldCancelButtonText'
517                 return AXSearchFieldCancelButtonText();
518                        ^
519             1 error generated.
520
521         * accessibility/AccessibilitySearchFieldButtons.cpp:
522         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityDescription):
523         Return String() instead of calling AXSearchFieldCancelButtonText() on iOS.
524
525 2013-08-29  Antti Koivisto  <antti@apple.com>
526
527         Remove NodeRenderingContext
528         https://bugs.webkit.org/show_bug.cgi?id=120466
529
530         Reviewed by Andreas Kling.
531
532         Switch the few remaining clients of this class to call the underlying code directly.
533
534         * CMakeLists.txt:
535         * GNUmakefile.list.am:
536         * Target.pri:
537         * WebCore.exp.in:
538         * WebCore.vcxproj/WebCore.vcxproj:
539         * WebCore.xcodeproj/project.pbxproj:
540         * css/StyleResolver.cpp:
541         (WebCore::StyleResolver::State::initForStyleResolve):
542         * dom/DOMAllInOne.cpp:
543         * dom/Node.cpp:
544         * dom/Node.h:
545         
546             Remove Node::parentNodeForRenderingAndStyle(). Make clients invoke NodeRenderingTraversal::parent() directly.
547
548         * dom/NodeRenderingContext.cpp: Removed.
549         * dom/NodeRenderingContext.h: Removed.
550         * dom/ShadowRoot.h:
551         * dom/Text.cpp:
552         * dom/Text.h:
553         * dom/TreeScope.cpp:
554         * dom/TreeScope.h:
555             
556             Remove virtual TreeScope::resetStyleInheritance. Make clients cast to ShadowRoot when needed.
557
558         * html/HTMLSummaryElement.cpp:
559         (WebCore::HTMLSummaryElement::detailsElement):
560         * style/StyleResolveTree.cpp:
561         (WebCore::Style::createTextRendererIfNeeded):
562         
563             For consistency switch resetStyleInheritance check to use parentNode() instead of renderingParentNode. This matches the NodeRenderingTraversal implementation.
564             This difference is probably not testable in current trunk.
565
566         (WebCore::Style::resolveTree):
567
568 2013-08-29  Antti Koivisto  <antti@apple.com>
569
570         Move element renderer creation out of NodeRenderingContext
571         https://bugs.webkit.org/show_bug.cgi?id=120461
572
573         Reviewed by Andreas Kling.
574
575         Move NodeRenderingContext::createRendererIfNeeded() and the related utility functions to StyleResolveTree.
576         
577         Tighten typing and constness. Refactor sligthly to be more understandable.
578
579         * dom/Element.cpp:
580         (WebCore::Element::shouldMoveToFlowThread):
581         * dom/Element.h:
582         * dom/NodeRenderingContext.cpp:
583         (WebCore::NodeRenderingContext::NodeRenderingContext):
584         (WebCore::NodeRenderingContext::nextRenderer):
585         (WebCore::NodeRenderingContext::previousRenderer):
586         (WebCore::NodeRenderingContext::parentRenderer):
587         * dom/NodeRenderingContext.h:
588         * dom/PseudoElement.h:
589         * style/StyleResolveTree.cpp:
590         (WebCore::Style::nextSiblingRenderer):
591         (WebCore::Style::shouldCreateRenderer):
592         (WebCore::Style::elementInsideRegionNeedsRenderer):
593         (WebCore::Style::moveToFlowThreadIfNeeded):
594         (WebCore::Style::createRendererIfNeeded):
595         (WebCore::Style::attachRenderTree):
596         * svg/SVGElement.cpp:
597         (WebCore::SVGElement::shouldMoveToFlowThread):
598         * svg/SVGElement.h:
599
600 2013-08-28  Chris Fleizach  <cfleizach@apple.com>
601
602         AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 27
603         https://bugs.webkit.org/show_bug.cgi?id=120434
604
605         Reviewed by Darin Adler.
606
607         Crash logs indicate that there's a null pointer access in rootObject. That seems like it could only
608         happen in Document was null. 
609
610         Unfortunately, there are no reproducible steps and no other information to construct a test case.
611
612         * accessibility/AXObjectCache.cpp:
613         (WebCore::AXObjectCache::rootObject):
614
615 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
616
617         The code to look for an ancestor form element is duplicated in three different places
618         https://bugs.webkit.org/show_bug.cgi?id=120391
619
620         Reviewed by Darin Adler.
621
622         Unduplicated the code by putting a single implementation in HTMLFormElement.cpp.
623
624         * WebCore.order:
625         * html/FormAssociatedElement.cpp:
626         (WebCore::FormAssociatedElement::findAssociatedForm):
627         (WebCore::FormAssociatedElement::formAttributeChanged):
628         * html/HTMLElement.cpp:
629         (WebCore::HTMLElement::virtualForm):
630         * html/HTMLElement.h:
631         * html/HTMLFormControlElement.cpp:
632         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
633         * html/HTMLFormElement.cpp:
634         (WebCore::HTMLFormElement::findClosestFormAncestor):
635         * html/HTMLFormElement.h:
636         * html/HTMLImageElement.cpp:
637         (WebCore::HTMLImageElement::insertedInto):
638         * html/HTMLObjectElement.cpp:
639         (WebCore::HTMLObjectElement::HTMLObjectElement):
640         * html/parser/HTMLTreeBuilder.cpp:
641         (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
642
643 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
644
645         Stop throwing DOM exceptions in internal 'XMLHttpRequest' response getters
646         https://bugs.webkit.org/show_bug.cgi?id=120446
647
648         Reviewed by Alexey Proskuryakov.
649
650         Merge https://chromium.googlesource.com/chromium/blink/+/c8188c21452501b68950a9fcc1f5cbc7b4de4df5
651
652         Unlike 'responseText' and 'responseXML', 'responseBlob' and
653         'responseArrayBuffer' are not exposed to JavaScript (they don't
654         appear in the IDL or in the specification). As they are only called from
655         custom bindings in response to a JavaScript call to the 'response' getter,
656         we can safely replace the exception-throwing code in the implementation
657         with an ASSERT that the request type is correct.
658
659         * bindings/js/JSXMLHttpRequestCustom.cpp:
660         (WebCore::JSXMLHttpRequest::response):
661         * xml/XMLHttpRequest.cpp:
662         (WebCore::XMLHttpRequest::responseBlob):
663         (WebCore::XMLHttpRequest::responseArrayBuffer):
664         * xml/XMLHttpRequest.h:
665
666 2013-08-28  Chris Curtis  <chris_curtis@apple.com>
667
668         https://bugs.webkit.org/show_bug.cgi?id=119548
669         Refactoring Exception throws.
670         
671         Reviewed by Geoffrey Garen.
672         
673         Gets column information from the error object for reporting exceptions.
674         * bindings/js/JSDOMBinding.cpp:
675         (WebCore::reportException): 
676         * bindings/js/ScriptCallStackFactory.cpp: 
677         (WebCore::createScriptCallStackFromException):
678  
679         Moved setting an exception into the vm, These functions changed to use the new functionality.
680  
681         * bindings/js/JSAudioBufferSourceNodeCustom.cpp:
682         (WebCore::JSAudioBufferSourceNode::setBuffer):
683         * bindings/js/JSBiquadFilterNodeCustom.cpp:
684         (WebCore::JSBiquadFilterNode::setType):
685         * bindings/js/JSCryptoCustom.cpp:
686         (WebCore::JSCrypto::getRandomValues):
687         * bindings/js/JSDOMBinding.cpp:
688         (WebCore::setDOMException):
689         * bindings/js/JSInjectedScriptHostCustom.cpp:
690         (WebCore::JSInjectedScriptHost::setFunctionVariableValue):
691         * bindings/js/JSJavaScriptCallFrameCustom.cpp:
692         (WebCore::JSJavaScriptCallFrame::evaluate):
693         (WebCore::JSJavaScriptCallFrame::setVariableValue):
694         * bindings/js/JSNodeFilterCondition.cpp:
695         (WebCore::JSNodeFilterCondition::acceptNode):
696         * bindings/js/JSOscillatorNodeCustom.cpp:
697         (WebCore::JSOscillatorNode::setType):
698         * bindings/js/JSPannerNodeCustom.cpp:
699         (WebCore::JSPannerNode::setPanningModel):
700         (WebCore::JSPannerNode::setDistanceModel):
701         * bindings/js/JSSVGLengthCustom.cpp:
702         (WebCore::JSSVGLength::convertToSpecifiedUnits):
703         * bindings/js/JSWebGLRenderingContextCustom.cpp:
704         (WebCore::getObjectParameter):
705         (WebCore::JSWebGLRenderingContext::getAttachedShaders):
706         (WebCore::JSWebGLRenderingContext::getExtension):
707         (WebCore::JSWebGLRenderingContext::getFramebufferAttachmentParameter):
708         (WebCore::JSWebGLRenderingContext::getParameter):
709         (WebCore::JSWebGLRenderingContext::getProgramParameter):
710         (WebCore::JSWebGLRenderingContext::getShaderParameter):
711         (WebCore::JSWebGLRenderingContext::getUniform):
712         (WebCore::dataFunctionf):
713         (WebCore::dataFunctioni):
714         (WebCore::dataFunctionMatrix):
715         * bindings/js/JSXMLHttpRequestCustom.cpp:
716         (WebCore::JSXMLHttpRequest::open):
717         * bindings/js/SerializedScriptValue.cpp:
718         (WebCore::CloneBase::throwStackOverflow):
719         (WebCore::CloneDeserializer::throwValidationError):
720         (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
721         * bindings/js/WorkerScriptController.cpp:
722         (WebCore::WorkerScriptController::evaluate):
723         (WebCore::WorkerScriptController::setException):
724         * bridge/c/c_instance.cpp:
725         (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
726         (JSC::Bindings::CInstance::invokeMethod):
727         (JSC::Bindings::CInstance::invokeDefaultMethod):
728         (JSC::Bindings::CInstance::invokeConstruct):
729         (JSC::Bindings::CInstance::toJSPrimitive):
730         * bridge/objc/objc_instance.mm:
731         (ObjcInstance::invokeMethod):
732         * bridge/objc/objc_runtime.mm:
733         (JSC::Bindings::ObjcArray::setValueAt):
734         (JSC::Bindings::ObjcArray::valueAt):
735         * bridge/objc/objc_utility.mm:
736         (JSC::Bindings::throwError):
737         * bridge/qt/qt_instance.cpp:
738         (JSC::Bindings::QtField::valueFromInstance):
739         (JSC::Bindings::QtField::setValueToInstance):
740         * bridge/runtime_array.cpp:
741         (JSC::RuntimeArray::put):
742         (JSC::RuntimeArray::putByIndex):
743         * bridge/runtime_object.cpp:
744         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
745
746 2013-08-28  Alexey Proskuryakov  <ap@apple.com>
747
748         Remove an unused data member from Page.
749
750         Rubber-stamped by Brady Eidson.
751
752         * page/Page.cpp:
753         * page/Page.h:
754         Removed m_cookieEnabled. This was completely dead code, long obsoleted by PageSettings.
755
756 2013-08-28  Gustavo Noronha Silva  <gns@gnome.org>
757
758         Unreviewed build fix - copy/paste failure, copied too much.
759
760         * bindings/gobject/WebKitDOMCustom.h:
761
762 2013-08-28  Dean Jackson  <dino@apple.com>
763
764         [WebGL] CoreGraphics can provide greyscale image data
765         https://webkit.org/b/120443
766
767         Reviewed by Simon Fraser.
768
769         CoreGraphics can decode greyscale or greyscale+alpha images
770         while preserving the format. Our WebGL texture unpacker
771         was seeing this and assuming it meant the data did not come
772         from an <img> element. Since that method already special cased
773         CoreGraphics, the fix was to simply return true for these
774         extra types.
775
776         I also renamed srcFormatComeFromDOMElementOrImageData
777         to srcFormatComesFromDOMElementOrImageData.
778
779         Test: fast/canvas/webgl/tex-image-with-greyscale-image.html
780
781         * platform/graphics/GraphicsContext3D.cpp: Call new name.
782         * platform/graphics/GraphicsContext3D.h:
783         (WebCore::GraphicsContext3D::srcFormatComesFromDOMElementOrImageData):
784         Add support for R8, AR8, A8, and RA8 data formats.
785
786 2013-08-28  Gustavo Noronha Silva  <gns@gnome.org>
787
788         [GTK] HTMLElement lost setID and getID - need to add compatibility symbols
789         https://bugs.webkit.org/show_bug.cgi?id=120440
790
791         Reviewed by Martin Robinson.
792
793         No tests, just adding compatibility symbols.
794
795         setID and getID were removed, and the parent class (Element) ones should be used instead.
796         We need to keep our ABI compatible, though, so add compatibility symbols.
797
798         * bindings/gobject/WebKitDOMCustom.cpp:
799         (webkit_dom_html_element_get_id):
800         (webkit_dom_html_element_set_id):
801         * bindings/gobject/WebKitDOMCustom.h:
802
803 2013-08-28  Simon Fraser  <simon.fraser@apple.com>
804
805         Fix compositing layers in columns
806         https://bugs.webkit.org/show_bug.cgi?id=120436
807
808         Reviewed by Dave Hyatt.
809         
810         Remove the old hack in RenderLayer::updateLayerPosition() for placing
811         layers in columns, which changed the layer position for composited
812         layers; this broke hit-testing.
813         
814         Fix a better way by moving compositing layers to the correct
815         positions that take column offsets into account, by fixing
816         RenderLayer::convertToLayerCoords() to optionally apply column
817         adjustment, and using this in the code which positions compositing layers.
818
819         Tests: compositing/columns/ancestor-clipped-in-paginated.html
820                compositing/columns/clipped-in-paginated.html
821                compositing/columns/composited-columns-vertical-rl.html
822                compositing/columns/composited-columns.html
823                compositing/columns/composited-in-paginated-rl.html
824                compositing/columns/composited-in-paginated-writing-mode-rl.html
825                compositing/columns/composited-lr-paginated-repaint.html
826                compositing/columns/composited-rl-paginated-repaint.html
827                compositing/columns/hittest-composited-in-paginated.html
828                compositing/columns/rotated-in-paginated.html
829                compositing/columns/untransformed-composited-in-paginated.html
830
831         * rendering/RenderLayer.cpp:
832         (WebCore::RenderLayer::updateLayerPosition):
833         (WebCore::RenderLayer::convertToPixelSnappedLayerCoords):
834         (WebCore::accumulateOffsetTowardsAncestor):
835         (WebCore::RenderLayer::convertToLayerCoords):
836         * rendering/RenderLayer.h:
837         * rendering/RenderLayerBacking.cpp:
838         (WebCore::RenderLayerBacking::updateCompositedBounds):
839         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
840
841 2013-08-28  Brent Fulgham  <bfulgham@webkit.org>
842
843         [WinCairo] Unreviewed build fix.
844
845         * WebCore.vcxproj/WebCore.vcxproj: Don't exclude the full screen
846         window from the build.
847         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
848
849 2013-08-28  Benjamin Poulain  <benjamin@webkit.org>
850
851         Fix the build after r154780
852
853         * dom/SpaceSplitString.cpp:
854         (WebCore::SpaceSplitStringData::create):
855
856 2013-08-27  Benjamin Poulain  <bpoulain@apple.com>
857
858         Simplify and clean SpaceSplitString
859         https://bugs.webkit.org/show_bug.cgi?id=120385
860
861         Reviewed by Ryosuke Niwa.
862
863         Clean up of SpaceSplitString following the cleaning of the DOMTokenList hierarchy.
864         This brings the following:
865         - Fix the coding style of the header.
866         - Remove the concepts of empty and null. The list can now be empty or have something.
867           There is no null state.
868         - Put the tokens directly following SpaceSplitStringData instead of using a Vector in between.
869
870         * WebCore.exp.in:
871         * dom/ElementData.h:
872         (WebCore::ElementData::hasClass):
873         * dom/SpaceSplitString.cpp:
874         (WebCore::tokenizeSpaceSplitString):
875         (WebCore::SpaceSplitStringData::containsAll):
876         (WebCore::SpaceSplitString::set):
877         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
878         (WebCore::TokenCounterProcessor::TokenCounterProcessor):
879         (WebCore::TokenCounterProcessor::processToken):
880         (WebCore::TokenCounterProcessor::tokenCount):
881         (WebCore::TokenInitializerProcessor::TokenInitializerProcessor):
882         (WebCore::TokenInitializerProcessor::processToken):
883         (WebCore::TokenInitializerProcessor::nextMemoryBucket):
884         (WebCore::SpaceSplitStringData::create):
885         (WebCore::SpaceSplitStringData::destroy):
886         * dom/SpaceSplitString.h:
887         (WebCore::SpaceSplitStringData::contains):
888         (WebCore::SpaceSplitStringData::size):
889         (WebCore::SpaceSplitStringData::operator[]):
890         (WebCore::SpaceSplitStringData::ref):
891         (WebCore::SpaceSplitStringData::deref):
892         (WebCore::SpaceSplitStringData::SpaceSplitStringData):
893         (WebCore::SpaceSplitStringData::~SpaceSplitStringData):
894         (WebCore::SpaceSplitStringData::tokenArrayStart):
895         (WebCore::SpaceSplitString::SpaceSplitString):
896         (WebCore::SpaceSplitString::operator!=):
897         (WebCore::SpaceSplitString::clear):
898         (WebCore::SpaceSplitString::contains):
899         (WebCore::SpaceSplitString::containsAll):
900         (WebCore::SpaceSplitString::size):
901         (WebCore::SpaceSplitString::isEmpty):
902         (WebCore::SpaceSplitString::operator[]):
903         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
904         * html/ClassList.cpp:
905         (WebCore::ClassList::classNames):
906         * page/EventHandler.cpp:
907         (WebCore::findDropZone):
908
909 <<<<<<< .mine
910 2013-08-28  Benjamin Poulain  <benjamin@webkit.org>
911
912         Simplify and clean SpaceSplitString
913         https://bugs.webkit.org/show_bug.cgi?id=120385
914
915         Reviewed by Ryosuke Niwa.
916
917         Clean up of SpaceSplitString following the cleaning of the DOMTokenList hierarchy.
918         - Remove the concepts of empty and null. The list can now be empty or have something.
919           There is no null state.
920         - Put the tokens directly following SpaceSplitStringData instead of using a Vector in between.
921
922         * WebCore.exp.in:
923         * dom/ElementData.h:
924         (WebCore::ElementData::hasClass):
925         * dom/SpaceSplitString.cpp:
926         (WebCore::tokenizeSpaceSplitString):
927         (WebCore::SpaceSplitStringData::containsAll):
928         (WebCore::SpaceSplitString::set):
929         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
930         (WebCore::TokenCounter::TokenCounter):
931         (WebCore::TokenCounter::processToken):
932         (WebCore::TokenCounter::tokenCount):
933         (WebCore::TokenAtomicStringInitializer::TokenAtomicStringInitializer):
934         (WebCore::TokenAtomicStringInitializer::processToken):
935         (WebCore::TokenAtomicStringInitializer::nextMemoryBucket):
936         (WebCore::SpaceSplitStringData::create):
937         (WebCore::SpaceSplitStringData::destroy):
938         * dom/SpaceSplitString.h:
939         (WebCore::SpaceSplitStringData::contains):
940         (WebCore::SpaceSplitStringData::size):
941         (WebCore::SpaceSplitStringData::operator[]):
942         (WebCore::SpaceSplitStringData::ref):
943         (WebCore::SpaceSplitStringData::deref):
944         (WebCore::SpaceSplitStringData::SpaceSplitStringData):
945         (WebCore::SpaceSplitStringData::~SpaceSplitStringData):
946         (WebCore::SpaceSplitStringData::tokenArrayStart):
947         (WebCore::SpaceSplitString::containsAll):
948         (WebCore::SpaceSplitString::isEmpty):
949         (WebCore::SpaceSplitString::operator[]):
950         * html/ClassList.cpp:
951         (WebCore::ClassList::classNames):
952         * page/EventHandler.cpp:
953         (WebCore::findDropZone):
954
955 =======
956 2013-08-28  Rob Buis  <rwlbuis@webkit.org>
957
958         Namespace prefix is blindly followed when serializing
959         https://bugs.webkit.org/show_bug.cgi?id=19121
960         Serializer doesn't handling inconsistent prefixes properly
961         https://bugs.webkit.org/show_bug.cgi?id=117764
962         Attribute namespaces are serialized as if they were element ones
963         https://bugs.webkit.org/show_bug.cgi?id=22958
964
965         Reviewed by Ryosuke Niwa.
966
967         Add code to make sure unique prefixes and namespace declarations are generated.
968         Unique prefix generation happens when:
969         - the same prefix is used to map to different namespaces or
970         - no prefix is given but the attribute is in a namespace.
971
972         This is done in order to not violate constraints listed in http://www.w3.org/TR/xml-names11/. In general
973         the pseudo code listed in http://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#normalizeDocumentAlgo
974         is used, doing the following for attributes:
975         if the attribute has a namespace then
976           if the attribute has no prefix OR prefix is not declared OR conflicts with existing prefix mapping to different NS then
977             try to find the matching in-scope declaration by looking up the prefix in the namespace -> prefix mapping, if found use that prefix
978             else if the attribute prefix is not null AND not mapped in-scope, declare the prefix
979             else generate a unique prefix for the namespace
980
981         To keep track of in-scope namespaces a prefix to namespace mapping is used. 
982
983         Tests: fast/dom/XMLSerializer-attribute-namespace-prefix-conflicts.html
984                fast/dom/XMLSerializer-same-prefix-different-namespaces-conflict.html
985                fast/dom/XMLSerializer-setAttributeNS-namespace-no-prefix.html
986                svg/custom/xlink-prefix-generation-in-attributes.html
987
988         * editing/MarkupAccumulator.cpp:
989         (WebCore::MarkupAccumulator::MarkupAccumulator):
990         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
991         (WebCore::MarkupAccumulator::appendNamespace):
992         (WebCore::MarkupAccumulator::generateUniquePrefix):
993         (WebCore::MarkupAccumulator::appendAttribute):
994         * editing/MarkupAccumulator.h:
995
996 2013-08-28  Sam White  <samuel_white@apple.com>
997
998         AX: Cancel button in search field not accessible.
999         <https://webkit.org/b/120322>
1000
1001         Expose the cancel button that shows in an input element of
1002         type search to accessibility.
1003
1004         Reviewed by Chris Fleizach.
1005
1006         Test: platform/mac/accessibility/search-field-cancel-button.html
1007
1008         * CMakeLists.txt:
1009         * English.lproj/Localizable.strings:
1010         * GNUmakefile.list.am:
1011         * Target.pri:
1012         * WebCore.vcxproj/WebCore.vcxproj:
1013         * WebCore.xcodeproj/project.pbxproj:
1014         * accessibility/AXObjectCache.cpp:
1015         (WebCore::createFromRenderer):
1016         * accessibility/AccessibilityAllInOne.cpp:
1017         * accessibility/AccessibilitySearchFieldButtons.cpp: Added.
1018         (WebCore::AccessibilitySearchFieldCancelButton::create):
1019         (WebCore::AccessibilitySearchFieldCancelButton::AccessibilitySearchFieldCancelButton):
1020         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityDescription):
1021         (WebCore::AccessibilitySearchFieldCancelButton::accessibilityText):
1022         (WebCore::AccessibilitySearchFieldCancelButton::press):
1023         (WebCore::AccessibilitySearchFieldCancelButton::computeAccessibilityIsIgnored):
1024         * accessibility/AccessibilitySearchFieldButtons.h: Added.
1025         * dom/Element.h:
1026         (WebCore::Element::isSearchFieldCancelButtonElement):
1027         * html/shadow/TextControlInnerElements.h:
1028         * platform/LocalizedStrings.cpp:
1029         (WebCore::AXSearchFieldCancelButtonText):
1030         * platform/LocalizedStrings.h:
1031         * platform/efl/LocalizedStringsEfl.cpp:
1032         (WebCore::AXSearchFieldCancelButtonText):
1033         * platform/gtk/LocalizedStringsGtk.cpp:
1034         (WebCore::AXSearchFieldCancelButtonText):
1035         * platform/qt/LocalizedStringsQt.cpp:
1036         (WebCore::AXSearchFieldCancelButtonText):
1037
1038 >>>>>>> .r154779
1039 2013-08-28  Eric Carlson  <eric.carlson@apple.com>
1040
1041         MediaPlayerPrivateAVFoundationObjC is painting video frames under the video layer
1042         https://bugs.webkit.org/show_bug.cgi?id=120170
1043
1044         Reviewed by Simon Fraser.
1045
1046         No new tests, it is only possible to test in the debugger.
1047
1048         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1049         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame): Drive by optimization.
1050         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext): Move logic from paint here.
1051         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Do nothing if we already have a video layer,
1052             otherwise call paint().
1053
1054 2013-08-28  Antti Koivisto  <antti@apple.com>
1055
1056         Add child and descendant const iterators
1057         https://bugs.webkit.org/show_bug.cgi?id=120430
1058
1059         Reviewed by Andreas Kling
1060
1061         This patch adds const-correct DOM tree traversal iterators. It also uses them in a few places.
1062         
1063         Some const_casts have been applied where constness breaks.
1064
1065         * dom/ChildIterator.h:
1066         (WebCore::::ChildConstIterator):
1067         (WebCore::::operator):
1068         (WebCore::=):
1069         (WebCore::::ChildConstIteratorAdapter):
1070         (WebCore::::begin):
1071         (WebCore::::end):
1072         (WebCore::elementChildren):
1073         (WebCore::childrenOfType):
1074         * dom/DescendantIterator.h:
1075         (WebCore::::DescendantConstIterator):
1076         (WebCore::::operator):
1077         (WebCore::=):
1078         (WebCore::::DescendantConstIteratorAdapter):
1079         (WebCore::::begin):
1080         (WebCore::::end):
1081         (WebCore::elementDescendants):
1082         (WebCore::descendantsOfType):
1083         * dom/Node.cpp:
1084         (WebCore::Node::numberOfScopedHTMLStyleChildren):
1085         * html/HTMLFieldSetElement.cpp:
1086         (WebCore::HTMLFieldSetElement::legend):
1087         * html/HTMLFieldSetElement.h:
1088         * html/HTMLMediaElement.cpp:
1089         (WebCore::HTMLMediaElement::finishParsingChildren):
1090         * html/HTMLObjectElement.cpp:
1091         (WebCore::HTMLObjectElement::containsJavaApplet):
1092         * svg/SVGElement.cpp:
1093         (WebCore::SVGElement::title):
1094         * svg/SVGSVGElement.cpp:
1095         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1096         (WebCore::SVGSVGElement::checkIntersection):
1097         (WebCore::SVGSVGElement::checkEnclosure):
1098         (WebCore::SVGSVGElement::getElementById):
1099         * svg/SVGSVGElement.h:
1100
1101 2013-08-28  Lukasz Gajowy  <l.gajowy@samsung.com>
1102
1103         AX:Null pointer may be dereferenced.
1104         https://bugs.webkit.org/show_bug.cgi?id=120300
1105
1106         Reviewed by Chris Fleizach.
1107
1108         Added a check if newObj is not null and an assert in order to avoid dereferecing null pointer.
1109
1110         * accessibility/AXObjectCache.cpp:
1111         (WebCore::AXObjectCache::getOrCreate):
1112
1113 2013-08-28  Pratik Solanki  <psolanki@apple.com>
1114
1115         Document::elementSheet() should return a reference
1116         https://bugs.webkit.org/show_bug.cgi?id=120433
1117
1118         Reviewed by Andreas Kling.
1119
1120         Since elementSheet() always retruns a valid pointer, we can simply return a reference
1121         instead. Also rename m_elemSheet to m_elementSheet.
1122
1123         * css/CSSParser.cpp:
1124         (WebCore::CSSParser::parseInlineStyleDeclaration):
1125         * css/PropertySetCSSStyleDeclaration.cpp:
1126         (WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
1127         * dom/Document.cpp:
1128         (WebCore::Document::~Document):
1129         (WebCore::Document::recalcStyle):
1130         (WebCore::Document::updateBaseURL):
1131         (WebCore::Document::elementSheet):
1132         * dom/Document.h:
1133         * dom/StyledElement.cpp:
1134         (WebCore::StyledElement::setInlineStyleFromString):
1135         (WebCore::StyledElement::setInlineStyleProperty):
1136         (WebCore::StyledElement::addSubresourceAttributeURLs):
1137         (WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
1138         * inspector/InspectorStyleSheet.cpp:
1139         (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
1140
1141 2013-08-28  Ryosuke Niwa  <rniwa@webkit.org>
1142
1143         REGRESSION(r154586): Past names map should only be used when named item is empty
1144         https://bugs.webkit.org/show_bug.cgi?id=120432
1145
1146         Reviewed by Anders Carlsson.
1147
1148         Don't add the element from the past names map if we've found elements of the given name.
1149
1150         Test: fast/forms/past-names-map-should-be-used-only-when-named-item-is-empty.html
1151
1152         * html/HTMLFormElement.cpp:
1153         (WebCore::HTMLFormElement::getNamedElements):
1154
1155 2013-08-27  Ryosuke Niwa  <rniwa@webkit.org>
1156
1157         Don't keep unassociated elements in the past names map
1158         https://bugs.webkit.org/show_bug.cgi?id=120328
1159
1160         Reviewed by Darin Adler.
1161
1162         Remove elements from the past names map of a form element when they are disassociated with the form to match
1163         the behaviors of Firefox 24 and Internet Explorer 10. The specification feedback has been submitted to WHATWG
1164         in http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-August/040586.html
1165
1166         Also fix a memory leak via the past names map when the elements in the map becomes an ancestor of the form
1167         element by storing a raw pointer in the map. This is safe because the form associated elements are kept alive
1168         by another mechanism.
1169
1170         Because ~FormAssociatedElement removes entries from the past names map, we could no longer store HTMLElement*
1171         in HTMLFormElement::m_pastNamesMap as that requires casting FormAssociatedElement* to HTMLElement*, which is
1172         not possible in ~FormAssociatedElement. We instead store pointers to FormNamedItem, new base class of
1173         FormAssociatedElement and HTMLImageElement.
1174
1175         Test: fast/forms/past-names-map-should-not-contained-disassociated-elements.html
1176
1177         * Target.pri:
1178         * WebCore.exp.in:
1179         * WebCore.vcxproj/WebCore.vcxproj:
1180         * WebCore.vcxproj/WebCore.vcxproj.filters:
1181         * WebCore.xcodeproj/project.pbxproj:
1182         * html/FormAssociatedElement.cpp:
1183         * html/FormAssociatedElement.h:
1184         (WebCore::toHTMLElement):
1185
1186         * html/FormNamedItem.h: Added.
1187         (WebCore::FormNamedItem::~FormNamedItem):
1188
1189         * html/HTMLElement.h:
1190         (WebCore::HTMLElement::asFormNamedItem): Added. This allows the conversion from a HTMLFormControlElement,
1191         HTMLObjectElement, HTMLImageElement to FormNamedItem in getNamedElements to update the past names map.
1192
1193         * html/HTMLFormControlElement.h:
1194         * html/HTMLFormElement.cpp:
1195         (WebCore::HTMLFormElement::removeFormElement):
1196         (WebCore::HTMLFormElement::removeImgElement):
1197         (WebCore::HTMLFormElement::assertItemCanBeInPastNamesMap): Asserts that FormNamedItem added to or obtained
1198         from the past names map is either a form associated element or an image element; the condition guarantees
1199         that the item will be removed from the map before its element gets destructed.
1200
1201         (WebCore::HTMLFormElement::elementFromPastNamesMap):
1202         (WebCore::HTMLFormElement::addToPastNamesMap):
1203         (WebCore::HTMLFormElement::removeFromPastNamesMap): Finds and removes the obsolete item from the map in O(n).
1204         Note that removeFromVector, which is called on m_associatedElements or m_imageElements before this function is called,
1205         is already O(n).
1206
1207         (WebCore::HTMLFormElement::getNamedElements):
1208
1209         * html/HTMLFormElement.h:
1210         * html/HTMLImageElement.h:
1211         * html/HTMLObjectElement.h:
1212
1213 2013-08-28  Brendan Long  <b.long@cablelabs.com>
1214
1215         Duplicate in-band tracks when switching <source> elements
1216         https://bugs.webkit.org/show_bug.cgi?id=120369
1217
1218         Reviewed by Eric Carlson.
1219
1220         Test: media/track/track-in-band-duplicate-tracks-when-source-changes.html
1221
1222         * html/HTMLMediaElement.cpp:
1223         (WebCore::HTMLMediaElement::createMediaPlayer):
1224         Delete existing in-band tracks before creating a new media player.
1225
1226 2013-08-28  Bem Jones-Bey  <bjonesbe@adobe.com>
1227
1228         Code cleanup: rename FloatIntervalSearchAdapter and remove unnecessary inlines
1229         https://bugs.webkit.org/show_bug.cgi?id=120378
1230
1231         Reviewed by Darin Adler.
1232
1233         Rename FloatIntervalSearchAdapter to ComputeFloatOffsetAdapter. The
1234         naming of this adapter has caused much confusion in reading the code,
1235         as it wasn't apparent that calls to it were actually doing anything
1236         other than searching the interval tree. The new name is a much better
1237         description of what it actually does.
1238
1239         Also, rename m_lowValue and m_highValue member variables to make it
1240         easier to read the code that uses them.
1241
1242         Removed the inlines based on a change by eseidel in Blink.
1243
1244         No new tests, no behavior change.
1245
1246         * rendering/RenderBlock.cpp:
1247         (WebCore::::updateOffsetIfNeeded): Update for renames.
1248         (WebCore::::collectIfNeeded): Ditto.
1249         (WebCore::::getHeightRemaining): Ditto.
1250         (WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
1251         (WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
1252         * rendering/RenderBlock.h:
1253         (WebCore::RenderBlock::FloatingObject::x): Remove unnecessary inline.
1254         (WebCore::RenderBlock::FloatingObject::maxX): Ditto.
1255         (WebCore::RenderBlock::FloatingObject::y): Ditto.
1256         (WebCore::RenderBlock::FloatingObject::maxY): Ditto.
1257         (WebCore::RenderBlock::FloatingObject::width): Ditto.
1258         (WebCore::RenderBlock::FloatingObject::height): Ditto.
1259         (WebCore::RenderBlock::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter): Rename.
1260         (WebCore::RenderBlock::ComputeFloatOffsetAdapter::lowValue): Rename m_lowValue.
1261         (WebCore::RenderBlock::ComputeFloatOffsetAdapter::highValue): Rename m_highValue.
1262
1263 2013-08-28  Tamas Czene  <tczene@inf.u-szeged.hu>
1264
1265         Resolve unused parameter warning in ScriptedAnimationController.cpp.
1266         https://bugs.webkit.org/show_bug.cgi?id=120408
1267
1268         Reviewed by Darin Adler.
1269
1270         * dom/ScriptedAnimationController.cpp:
1271         (WebCore::ScriptedAnimationController::setThrottled):
1272
1273 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
1274
1275         [CSS Grid Layout] Handle 'span' positions during layout
1276         https://bugs.webkit.org/show_bug.cgi?id=119756
1277
1278         Reviewed by Andreas Kling.
1279
1280         From Blink r149133 by <jchaffraix@chromium.org>
1281
1282         Properly handle the 'span' keyword during layout. We only had
1283         parsing support so far but with this change we are able to
1284         recognize these positions and act accordingly.
1285
1286         * rendering/RenderGrid.cpp:
1287         (WebCore::RenderGrid::resolveGridPositionsFromStyle):
1288         (WebCore::RenderGrid::resolveGridPositionAgainstOppositePosition):
1289         * rendering/RenderGrid.h:
1290         * rendering/style/GridPosition.h:
1291         (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
1292
1293 2013-08-28  Antti Koivisto  <antti@apple.com>
1294
1295         Factor descendant iterator assertions into a class.
1296         https://bugs.webkit.org/show_bug.cgi?id=120422
1297
1298         Reviewed by Darin Adler.
1299
1300         Share the assertions between ChildIterator and DescendantIterator. We can use it for future const iterators too.
1301
1302         * GNUmakefile.list.am:
1303         * Target.pri:
1304         * WebCore.vcxproj/WebCore.vcxproj:
1305         * WebCore.xcodeproj/project.pbxproj:
1306         * dom/ChildIterator.h:
1307         (WebCore::::ChildIterator):
1308         (WebCore::::operator):
1309         (WebCore::=):
1310         * dom/DescendantIterator.h:
1311         (WebCore::::DescendantIterator):
1312         (WebCore::::operator):
1313         (WebCore::=):
1314         * dom/DescendantIteratorAssertions.h: Added.
1315         (WebCore::DescendantIteratorAssertions::DescendantIteratorAssertions):
1316         (WebCore::DescendantIteratorAssertions::domTreeHasMutated):
1317         (WebCore::DescendantIteratorAssertions::dropEventDispatchAssertion):
1318
1319 2013-08-28  Darin Adler  <darin@apple.com>
1320
1321         Eliminate Pasteboard::generalPasteboard
1322         https://bugs.webkit.org/show_bug.cgi?id=120392
1323
1324         Reviewed by Anders Carlsson.
1325
1326         * WebCore.exp.in: Removed the generalPasteboard function.
1327         It didn't need to be exported, because no one was using it.
1328
1329         * editing/Editor.cpp:
1330         (WebCore::Editor::paste): Added an overload that takes a Pasteboard.
1331         (WebCore::Editor::copyURL): Ditto.
1332         * editing/Editor.h: Added overloads.
1333
1334         * editing/EditorCommand.cpp:
1335         (WebCore::executePasteGlobalSelection): Put this function inside the same
1336         platform #if that the global selection code in the Pasteboard class was in.
1337         Changed to use Pasteboard::createForGlobalSelection instead of using the
1338         Pasteboard::setSelectionMode approach.
1339         (WebCore::createCommandMap): Put PasteGlobalSelection inside the platform #if.
1340
1341         * inspector/InjectedScriptHost.cpp:
1342         (WebCore::InjectedScriptHost::copyText): Use Pasteboard::createForCopyAndPaste()
1343         instead of Pasteboard::generalPasteboard().
1344         * inspector/InspectorFrontendHost.cpp:
1345         (WebCore::InspectorFrontendHost::copyText): Ditto.
1346
1347         * platform/Pasteboard.h: Removed generalPasteboard. Replaced isSelectionMode
1348         and setSelectionMode with createForGlobalSelection.
1349
1350         * platform/blackberry/PasteboardBlackBerry.cpp: Deleted generalPasteboard.
1351         * platform/efl/PasteboardEfl.cpp: Deleted generalPasteboard.
1352
1353         * platform/gtk/PasteboardGtk.cpp: Deleted selectionClipboard, primaryClipboard,
1354         generalPasteboard, isSelectionMode, and setSelectionMode.
1355         (WebCore::Pasteboard::createForGlobalSelection): Added.
1356         * platform/gtk/PasteboardHelper.cpp: Deleted m_usePrimarySelectionClipboard,
1357         getCurrentClipboard, and getClipboard.
1358         * platform/gtk/PasteboardHelper.h: Deleted the above, plus
1359         setUsePrimarySelectionClipboard and usePrimarySelectionClipboard.
1360
1361         * platform/ios/PasteboardIOS.mm: Deleted generalPasteboard.
1362         * platform/mac/PasteboardMac.mm: Deleted generalPasteboard.
1363
1364         * platform/qt/PasteboardQt.cpp: Deleted generalPasteboard, isSelectionMode,
1365         and setSelectionMode.
1366         (WebCore::Pasteboard::createForGlobalSelection): Added.
1367
1368         * platform/win/PasteboardWin.cpp: Deleted generalPasteboard.
1369
1370 2013-08-28  Antti Koivisto  <antti@apple.com>
1371
1372         Share attach loops between Elements and ShadowRoots
1373         https://bugs.webkit.org/show_bug.cgi?id=120414
1374
1375         Reviewed Andreas Kling.
1376
1377         * style/StyleResolveTree.cpp:
1378         (WebCore::Style::attachChildren):
1379         (WebCore::Style::attachShadowRoot):
1380         (WebCore::Style::detachChildren):
1381         (WebCore::Style::detachShadowRoot):
1382
1383 2013-08-28  Anders Carlsson  <andersca@apple.com>
1384
1385         Clean up XPathExpressionNode and XPath::Function
1386         https://bugs.webkit.org/show_bug.cgi?id=120411
1387
1388         Reviewed by Antti Koivisto.
1389
1390         Rename the subexpression and function argument getters to be more descriptive,
1391         remove the non-const overloads (they were never used) and change the getters to return
1392         references since they can never be null.
1393
1394         * xml/XPathExpressionNode.cpp:
1395         * xml/XPathExpressionNode.h:
1396         (WebCore::XPath::ParseNode::~ParseNode):
1397         (WebCore::XPath::Expression::addSubExpression):
1398         (WebCore::XPath::Expression::isContextNodeSensitive):
1399         (WebCore::XPath::Expression::setIsContextNodeSensitive):
1400         (WebCore::XPath::Expression::isContextPositionSensitive):
1401         (WebCore::XPath::Expression::setIsContextPositionSensitive):
1402         (WebCore::XPath::Expression::isContextSizeSensitive):
1403         (WebCore::XPath::Expression::setIsContextSizeSensitive):
1404         (WebCore::XPath::Expression::subExpressionCount):
1405         (WebCore::XPath::Expression::subExpression):
1406         * xml/XPathFunctions.cpp:
1407         (WebCore::XPath::Function::setArguments):
1408         (WebCore::XPath::FunId::evaluate):
1409         (WebCore::XPath::FunLocalName::evaluate):
1410         (WebCore::XPath::FunNamespaceURI::evaluate):
1411         (WebCore::XPath::FunName::evaluate):
1412         (WebCore::XPath::FunCount::evaluate):
1413         (WebCore::XPath::FunString::evaluate):
1414         (WebCore::XPath::FunConcat::evaluate):
1415         (WebCore::XPath::FunStartsWith::evaluate):
1416         (WebCore::XPath::FunContains::evaluate):
1417         (WebCore::XPath::FunSubstringBefore::evaluate):
1418         (WebCore::XPath::FunSubstringAfter::evaluate):
1419         (WebCore::XPath::FunSubstring::evaluate):
1420         (WebCore::XPath::FunStringLength::evaluate):
1421         (WebCore::XPath::FunNormalizeSpace::evaluate):
1422         (WebCore::XPath::FunTranslate::evaluate):
1423         (WebCore::XPath::FunBoolean::evaluate):
1424         (WebCore::XPath::FunNot::evaluate):
1425         (WebCore::XPath::FunLang::evaluate):
1426         (WebCore::XPath::FunNumber::evaluate):
1427         (WebCore::XPath::FunSum::evaluate):
1428         (WebCore::XPath::FunFloor::evaluate):
1429         (WebCore::XPath::FunCeiling::evaluate):
1430         (WebCore::XPath::FunRound::evaluate):
1431         * xml/XPathFunctions.h:
1432         (WebCore::XPath::Function::setName):
1433         (WebCore::XPath::Function::argumentCount):
1434         (WebCore::XPath::Function::argument):
1435         (WebCore::XPath::Function::name):
1436         * xml/XPathPredicate.cpp:
1437         (WebCore::XPath::Negative::evaluate):
1438         (WebCore::XPath::NumericOp::evaluate):
1439         (WebCore::XPath::EqTestOp::evaluate):
1440         (WebCore::XPath::LogicalOp::evaluate):
1441         (WebCore::XPath::Union::evaluate):
1442
1443 2013-08-28  Andreas Kling  <akling@apple.com>
1444
1445         Page::pluginData() should return a reference.
1446         <https://webkit.org/b/120386>
1447
1448         Reviewed by Darin Adler.
1449
1450         The PluginData is lazily constructed by pluginData(); it never returns null.
1451         A small number of null checks were harmed in the making of this patch.
1452
1453 2013-08-28  Andrei Parvu  <parvu@adobe.com>
1454
1455         <https://webkit.org/b/120002> [CSS Masking] Add -webkit-mask-source-type shorthand property
1456
1457         Added the -webkit-mask-source-type property to the -webkit-mask shorthand property.
1458
1459         Reviewed by Dirk Schulze.
1460
1461         Test cases added in LayoutTests/fast/masking/parsing-mask.html
1462
1463         * css/CSSParser.cpp: Added the CSSPropertyWebkitMaskSourceType property to the array of shorthand properties.
1464         (WebCore::CSSParser::parseValue):
1465         * css/StylePropertyShorthand.cpp: Added the CSSPropertyWebkitMaskSourceType to the list of shorthands.
1466         (WebCore::webkitMaskShorthand):
1467         (WebCore::matchingShorthandsForLonghand):
1468
1469 2013-08-28  Zan Dobersek  <zdobersek@igalia.com>
1470
1471         REGRESSION(r154708): It broke all plugin tests on GTK and Qt WK1
1472         https://bugs.webkit.org/show_bug.cgi?id=120398
1473
1474         Reviewed by Anders Carlsson.
1475
1476         * bridge/c/c_class.cpp:
1477         (JSC::Bindings::CClass::methodNamed): Keep the pointer of the new CMethod object
1478         to return it after it's adopted by the new HashMap entry.
1479         (JSC::Bindings::CClass::fieldNamed): The pointer to the newly created CField object
1480         should be returned in this branch, matching the behavior before r154708.
1481
1482 2013-08-28  Antti Koivisto  <antti@apple.com>
1483
1484         Fix Qt no-libxml2 build.
1485         
1486         Not reviewed.
1487
1488         * xml/parser/XMLDocumentParserQt.cpp:
1489         (WebCore::XMLDocumentParser::parseCdata):
1490
1491 2013-08-28  Antti Koivisto  <antti@apple.com>
1492
1493         Don't use NodeRenderingContext when attaching text renderers
1494         https://bugs.webkit.org/show_bug.cgi?id=120402
1495
1496         Reviewed by Andreas Kling.
1497
1498         This patch moves various functions for creating text renderers from NodeRenderingContext and Text to StyleResolveTree.
1499         It also tightens the logic and combines some functions.
1500
1501         * dom/CharacterData.cpp:
1502         (WebCore::CharacterData::parserAppendData):
1503         (WebCore::CharacterData::setDataAndUpdate):
1504         * dom/ContainerNode.cpp:
1505         (WebCore::attachChild):
1506         (WebCore::detachChild):
1507         * dom/NodeRenderingContext.cpp:
1508         * dom/NodeRenderingContext.h:
1509         * dom/Text.cpp:
1510         (WebCore::Text::~Text):
1511         * dom/Text.h:
1512         * html/HTMLViewSourceDocument.cpp:
1513         (WebCore::HTMLViewSourceDocument::addText):
1514         * html/parser/HTMLConstructionSite.cpp:
1515         (WebCore::executeTask):
1516         * html/shadow/InsertionPoint.cpp:
1517         (WebCore::InsertionPoint::willAttachRenderers):
1518         (WebCore::InsertionPoint::willDetachRenderers):
1519         * style/StyleResolveTree.cpp:
1520         (WebCore::Style::isRendererReparented):
1521         (WebCore::Style::previousSiblingRenderer):
1522         (WebCore::Style::nextSiblingRenderer):
1523         
1524             From NodeRenderingContext::next/previousRenderer
1525
1526         (WebCore::Style::createTextRenderersForSiblingsAfterAttachIfNeeded):
1527         
1528             From Text::createTextRenderersForSiblingsAfterAttachIfNeeded()
1529
1530         (WebCore::Style::textRendererIsNeeded):
1531         
1532             From Text::textRendererIsNeeded
1533
1534         (WebCore::Style::createTextRendererIfNeeded):
1535         
1536             Combines code from Text::createTextRendererIfNeeded, NodeRenderingContext::createRendererForTextIfNeeded,
1537             NodeRenderingContext constructor and text node relevant code NodeRenderingContext::shouldCreateRenderer.
1538
1539         (WebCore::Style::attachTextRenderer):
1540         (WebCore::Style::detachTextRenderer):
1541         
1542             New functions of attaching text renderers. From Text::attach/detachText()
1543
1544         (WebCore::Style::updateTextRendererAfterContentChange):
1545         
1546             From Text::updateTextRenderer.
1547
1548         (WebCore::Style::attachShadowRoot):
1549         (WebCore::Style::attachChildren):
1550         (WebCore::Style::attachRenderTree):
1551         (WebCore::Style::detachShadowRoot):
1552         (WebCore::Style::detachChildren):
1553         (WebCore::Style::updateTextStyle):
1554         * style/StyleResolveTree.h:
1555         * xml/parser/XMLDocumentParser.cpp:
1556         (WebCore::XMLDocumentParser::exitText):
1557         * xml/parser/XMLDocumentParserLibxml2.cpp:
1558         (WebCore::XMLDocumentParser::cdataBlock):
1559
1560 2013-08-28  Antti Koivisto  <antti@apple.com>
1561
1562         Make descendant iterators always require ContainerNode root
1563         https://bugs.webkit.org/show_bug.cgi?id=120393
1564
1565         Reviewed by Andreas Kling.
1566
1567         Remove Node* root versions of the iterators. 
1568         Fix the few call sites that required them to have tighter typing.
1569
1570         * accessibility/AccessibilityNodeObject.cpp:
1571         (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
1572         (WebCore::siblingWithAriaRole):
1573         * dom/ChildIterator.h:
1574         (WebCore::::ChildIteratorAdapter):
1575         (WebCore::::begin):
1576         (WebCore::::end):
1577         (WebCore::elementChildren):
1578         (WebCore::childrenOfType):
1579         * dom/DescendantIterator.h:
1580         (WebCore::::DescendantIterator):
1581         (WebCore::::DescendantIteratorAdapter):
1582         (WebCore::::begin):
1583         (WebCore::::end):
1584         (WebCore::elementDescendants):
1585         (WebCore::descendantsOfType):
1586         * editing/ApplyStyleCommand.cpp:
1587         (WebCore::dummySpanAncestorForNode):
1588         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
1589         (WebCore::ApplyStyleCommand::applyInlineStyle):
1590         * editing/ApplyStyleCommand.h:
1591
1592 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
1593
1594         WorkerGlobalScopeWebDatabase requires ENABLE(WORKERS)
1595         https://bugs.webkit.org/show_bug.cgi?id=120395
1596
1597         Reviewed by Christophe Dumez.
1598
1599         WorkerGlobalScopeDatabase uses the WorkerGlobalScope object which is
1600         defined only when WORKERS are enabled. We should guard that code.
1601
1602         * Modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp:
1603         * Modules/webdatabase/WorkerGlobalScopeWebDatabase.h:
1604         * Modules/webdatabase/WorkerGlobalScopeWebDatabase.idl:
1605
1606 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
1607
1608         [CSS Grid Layout] Fix grid position resolution
1609         https://bugs.webkit.org/show_bug.cgi?id=119801
1610
1611         Reviewed by Andreas Kling.
1612
1613         From Blink r148833, r148878, r150403 by <jchaffraix@chromium.org>
1614
1615         Both grid-{column|row}-end and negative positions were not
1616         properly handled in our grid position resolution code. We were
1617         using the same code to resolve all the grid positions without
1618         considering the edges of the grid.
1619
1620         Also refactored the grid size estimation in
1621         resolveGridPositionsFromStyle() so we can use it for the grid size
1622         estimation. The code no longer requires the grid to be filled at
1623         that moment as the specs changed to use the "explicit grid" which
1624         is independent of grid items (only depends on style).
1625
1626         Test: fast/css-grid-layout/grid-item-negative-position-resolution.html
1627
1628         * rendering/RenderGrid.cpp:
1629         (WebCore::RenderGrid::maximumIndexInDirection):
1630         (WebCore::RenderGrid::resolveGridPositionsFromStyle):
1631         (WebCore::adjustGridPositionForSide):
1632         (WebCore::RenderGrid::resolveGridPositionFromStyle):
1633         * rendering/RenderGrid.h:
1634
1635 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
1636
1637         [CSS Grid Layout] infinity should be defined as a negative value
1638         https://bugs.webkit.org/show_bug.cgi?id=107053
1639
1640         Reviewed by Andreas Kling.
1641
1642         From Blink r154805 by <jchaffraix@chromium.org>
1643
1644         Reject negative values for track-breadth at parse time as
1645         mentioned in the latest versions of the spec.
1646
1647         Added some extra checks to the existing tests.
1648
1649         * css/CSSParser.cpp:
1650         (WebCore::CSSParser::parseGridBreadth):
1651         * rendering/RenderGrid.cpp:
1652         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
1653
1654 2013-08-28  Sergio Villar Senin  <svillar@igalia.com>
1655
1656         [Soup] WebTiming information not shown in the inspector
1657         https://bugs.webkit.org/show_bug.cgi?id=118395
1658
1659         Reviewed by Martin Robinson.
1660
1661         WebTiming information was not correctly provided to WebCore
1662         because the gotHeadersCallback was incorrectly resetting the
1663         original ResourceResponse (which had the ResourceLoadTiming
1664         object) instead of simply updating their contents using the
1665         SoupMessage.
1666
1667         No new test required as this feature is already covered by the
1668         existing webtiming tests. In any case this change includes a fix
1669         for the http/tests/misc/webtiming-ssl.php test which was not
1670         failing even if it should because it was not correct.
1671
1672         * platform/network/soup/ResourceHandleSoup.cpp:
1673         (WebCore::gotHeadersCallback):
1674         (WebCore::restartedCallback): restartedCallback should be
1675         available only if WEB_TIMING is defined.
1676         (WebCore::createSoupMessageForHandleAndRequest): Ditto.
1677
1678 2013-08-26  Antonio Gomes  <a1.gomes@sisa.samsung.com>
1679
1680         Scrolling allowed when overflow:hidden (seen on Acid2)
1681         https://bugs.webkit.org/show_bug.cgi?id=22769
1682
1683         Reviewed by Darin Adler.
1684
1685         Autoscroll, as well as other user-driven scroll actions,
1686         has to respect the scrollability styled into the web page.
1687         More specifically, if a html or body tags are styled with
1688         overflow:hidden, autoscroll should not scroll the containing document.
1689
1690         In order to fix this, patch hardens RenderBox::canAutoscroll as
1691         following: previously, ::canAutoscroll was relying solemnly in
1692         ::canBeScrolledAndHasScrollableArea to determine the scrollability
1693         of #document node, which was unconditionally returned as 'true'.
1694         Patch extends ::canAutoscroll to handle the #document case for
1695         main and inner frames, and now it asks through ::isScrollable if
1696         the corresponding document's FrameView is actually user-scrollable.
1697
1698         Note, that the patch change ::canAutoscroll to cover the non-mainFrame
1699         #document case, so the comment specific to Apple's Mail app can be omited
1700         now.
1701
1702         Test: fast/events/autoscroll-in-overflow-hidden-html.html
1703
1704         * rendering/RenderBox.cpp:
1705         (WebCore::RenderBox::canAutoscroll):
1706
1707 2013-08-27  Santosh Mahto  <santosh.ma@samsung.com>
1708
1709         Adding  "explicit" keyword in  forms related classes constructor
1710         https://bugs.webkit.org/show_bug.cgi?id=120366
1711
1712         Reviewed by Darin Adler.
1713
1714         Adding "explicit" keyword in constructors.
1715
1716         * html/BaseButtonInputType.h:
1717         (WebCore::BaseButtonInputType::BaseButtonInputType):
1718         * html/BaseCheckableInputType.h:
1719         (WebCore::BaseCheckableInputType::BaseCheckableInputType):
1720         * html/BaseChooserOnlyDateAndTimeInputType.h:
1721         (WebCore::BaseChooserOnlyDateAndTimeInputType::BaseChooserOnlyDateAndTimeInputType):
1722         * html/BaseClickableWithKeyInputType.h:
1723         (WebCore::BaseClickableWithKeyInputType::BaseClickableWithKeyInputType):
1724         * html/BaseTextInputType.h:
1725         (WebCore::BaseTextInputType::BaseTextInputType):
1726         * html/ColorInputType.h:
1727         (WebCore::ColorInputType::ColorInputType):
1728         * html/DateInputType.h:
1729         * html/DateTimeInputType.h:
1730         (WebCore::DateTimeInputType::DateTimeInputType):
1731         * html/DateTimeLocalInputType.h:
1732         (WebCore::DateTimeLocalInputType::DateTimeLocalInputType):
1733         * html/EmailInputType.h:
1734         (WebCore::EmailInputType::EmailInputType):
1735         * html/FileInputType.h:
1736         * html/HiddenInputType.h:
1737         (WebCore::HiddenInputType::HiddenInputType):
1738         * html/ImageData.h:
1739         * html/ImageInputType.h:
1740         * html/InputType.h:
1741         (WebCore::InputType::InputType):
1742         * html/MediaController.h:
1743         * html/MonthInputType.h:
1744         (WebCore::MonthInputType::MonthInputType):
1745         * html/RadioInputType.h:
1746         (WebCore::RadioInputType::RadioInputType):
1747         * html/RangeInputType.h:
1748         * html/ResetInputType.h:
1749         (WebCore::ResetInputType::ResetInputType):
1750         * html/SearchInputType.h:
1751         * html/SubmitInputType.h:
1752         (WebCore::SubmitInputType::SubmitInputType):
1753         * html/TelephoneInputType.h:
1754         (WebCore::TelephoneInputType::TelephoneInputType):
1755         * html/TextFieldInputType.h:
1756         * html/TextInputType.h:
1757         (WebCore::TextInputType::TextInputType):
1758         * html/TimeInputType.h:
1759         * html/URLInputType.h:
1760         (WebCore::URLInputType::URLInputType):
1761         * html/ValidationMessage.h:
1762         * html/WeekInputType.h:
1763         (WebCore::WeekInputType::WeekInputType):
1764
1765 2013-08-27  Benjamin Poulain  <benjamin@webkit.org>
1766
1767         Fix the indentation of SpaceSplitString
1768         https://bugs.webkit.org/show_bug.cgi?id=120390
1769
1770         Reviewed by Ryosuke Niwa.
1771
1772         * dom/SpaceSplitString.h:
1773         (WebCore::SpaceSplitStringData::contains):
1774         (WebCore::SpaceSplitStringData::isUnique):
1775         (WebCore::SpaceSplitStringData::size):
1776         (WebCore::SpaceSplitStringData::operator[]):
1777         (WebCore::SpaceSplitString::SpaceSplitString):
1778         (WebCore::SpaceSplitString::operator!=):
1779         (WebCore::SpaceSplitString::clear):
1780         (WebCore::SpaceSplitString::contains):
1781         (WebCore::SpaceSplitString::containsAll):
1782         (WebCore::SpaceSplitString::size):
1783         (WebCore::SpaceSplitString::isNull):
1784         (WebCore::SpaceSplitString::operator[]):
1785         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
1786         (WebCore::SpaceSplitString::ensureUnique):
1787
1788 2013-08-27  Andreas Kling  <akling@apple.com>
1789
1790         Make it less awkward to check if a Frame is the main Frame.
1791         <https://webkit.org/b/120382>
1792
1793         Reviewed by Anders Carlsson.
1794
1795         Added Page::frameIsMainFrame(const Frame*) so code that wants to find out if a given
1796         Frame is a Page's main frame doesn't have to do a manual pointer compare.
1797
1798         * page/Page.h:
1799         (WebCore::Page::frameIsMainFrame):
1800
1801             Added. Replaces (frame == &page->mainFrame()) idiom.
1802
1803 2013-08-27  Morten Stenshorne  <mstensho@opera.com>
1804
1805         Improve multicol intrinsic width calculation
1806         https://bugs.webkit.org/show_bug.cgi?id=116677
1807
1808         Reviewed by David Hyatt.
1809
1810         Test: fast/css-intrinsic-dimensions/multicol.html
1811
1812         * rendering/RenderBlock.cpp:
1813         (WebCore::RenderBlock::computeIntrinsicLogicalWidths):
1814         (WebCore::RenderBlock::adjustIntrinsicLogicalWidthsForColumns):
1815         * rendering/RenderBlock.h:
1816
1817 2013-08-27  Rob Buis  <rwlbuis@webkit.org>
1818
1819         feImage fails if referenced node contains radialGradient declaration
1820         https://bugs.webkit.org/show_bug.cgi?id=118735
1821
1822         Reviewed by Darin Adler.
1823
1824         Only call parent's updateRelativeLengthsInformation for graphics elements.
1825
1826         Tests: svg/custom/feImage-pserver-with-percentage-expected.svg
1827                svg/custom/feImage-pserver-with-percentage.svg
1828
1829         * svg/SVGElement.cpp:
1830         (WebCore::SVGElement::updateRelativeLengthsInformation):
1831
1832 2013-08-27  Darin Adler  <darin@apple.com>
1833
1834         No need for generalPasteboard (aside from "global selection mode")
1835         https://bugs.webkit.org/show_bug.cgi?id=120367
1836
1837         Reviewed by Alexey Proskuryakov.
1838
1839         * editing/Editor.cpp:
1840         (WebCore::Editor::pasteAsPlainTextBypassingDHTML):
1841         (WebCore::Editor::dispatchCPPEvent):
1842         (WebCore::Editor::cut):
1843         (WebCore::Editor::copy):
1844         (WebCore::Editor::paste):
1845         (WebCore::Editor::pasteAsPlainText):
1846         (WebCore::Editor::copyURL):
1847         (WebCore::Editor::copyImage):
1848         Use Pasteboard::createForCopyAndPaste rather than the single general pasteboard
1849         for editing operations.
1850
1851 2013-08-27  Chris Fleizach  <cfleizach@apple.com>
1852
1853         <https://webkit.org/b/120117> AX: <noscript> contents are exposed as static text
1854
1855         Reviewed by Tim Horton.
1856
1857         If <noscript> is not being used (because there is script) then we need to ignore its contents for AX.
1858
1859         Test: accessibility/noscript-ignored.html
1860
1861         * accessibility/AccessibilityRenderObject.cpp:
1862         (WebCore::AccessibilityRenderObject::addCanvasChildren):
1863         * accessibility/AccessibilityNodeObject.cpp:
1864         (WebCore::AccessibilityNodeObject::canHaveChildren):
1865
1866 2013-08-27  Anders Carlsson  <andersca@apple.com>
1867
1868         Stop using deleteAllValues in CClass
1869         https://bugs.webkit.org/show_bug.cgi?id=120376
1870
1871         Reviewed by Andreas Kling.
1872
1873         * bridge/c/c_class.cpp:
1874         (JSC::Bindings::CClass::CClass):
1875         (JSC::Bindings::CClass::~CClass):
1876         (JSC::Bindings::CClass::methodNamed):
1877         (JSC::Bindings::CClass::fieldNamed):
1878         * bridge/c/c_class.h:
1879         * bridge/jsc/BridgeJSC.h:
1880
1881 2013-08-27  Benjamin Poulain  <benjamin@webkit.org>
1882
1883         Clean ClassList and DOMSettableTokenList
1884         https://bugs.webkit.org/show_bug.cgi?id=120344
1885
1886         Reviewed by Ryosuke Niwa.
1887
1888         This patch cleans ClassList and DOMSettableTokenList to make it simpler to update
1889         SpaceSplitString:
1890         - Move the implementation of virtual functions to the cpp file.
1891         - Clean the #includes.
1892         - Make the implemented pure virtual methods final.
1893         - Make the element() accessor const.
1894
1895         * html/ClassList.cpp:
1896         (WebCore::ClassList::create):
1897         (WebCore::ClassList::element):
1898         (WebCore::ClassList::value):
1899         (WebCore::ClassList::setValue):
1900         (WebCore::ClassList::classNames):
1901         * html/ClassList.h:
1902         * html/DOMSettableTokenList.cpp:
1903         (WebCore::DOMSettableTokenList::create):
1904         (WebCore::DOMSettableTokenList::ref):
1905         (WebCore::DOMSettableTokenList::deref):
1906         (WebCore::DOMSettableTokenList::length):
1907         (WebCore::DOMSettableTokenList::value):
1908         * html/DOMSettableTokenList.h:
1909         * html/DOMTokenList.h:
1910         (WebCore::DOMTokenList::element):
1911
1912 2013-08-27  Arunprasad Rajkumar  <arurajku@cisco.com>
1913
1914         Replace currentTime() with monotonicallyIncreasingTime() in WebCore
1915         https://bugs.webkit.org/show_bug.cgi?id=119958
1916
1917         Reviewed by Alexey Proskuryakov.
1918
1919         WTF::currentTime() is prone to NTP and manual adjustments, so use
1920         WTF::monotonicallyIncreasingTime() to measure elapsed time.
1921
1922         It is a continuation of r154201.
1923
1924         * history/CachedPage.cpp:
1925         (WebCore::CachedPage::CachedPage):
1926         (WebCore::CachedPage::hasExpired):
1927         * html/parser/HTMLParserScheduler.h:
1928         (WebCore::HTMLParserScheduler::checkForYieldBeforeToken):
1929         * loader/CrossOriginPreflightResultCache.cpp:
1930         (WebCore::CrossOriginPreflightResultCacheItem::parse):
1931         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest):
1932         * loader/FrameLoader.cpp:
1933         (WebCore::FrameLoader::setState):
1934         * loader/ProgressTracker.cpp:
1935         (WebCore::ProgressTracker::incrementProgress):
1936         * loader/cache/CachedCSSStyleSheet.cpp:
1937         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
1938         * loader/cache/CachedImage.cpp:
1939         (WebCore::CachedImage::didDraw):
1940         * loader/cache/MemoryCache.cpp:
1941         (WebCore::MemoryCache::pruneLiveResourcesToSize):
1942         * loader/icon/IconDatabase.cpp:
1943         (WebCore::IconDatabase::iconDatabaseSyncThread):
1944         (WebCore::IconDatabase::syncThreadMainLoop):
1945         (WebCore::IconDatabase::readFromDatabase):
1946         (WebCore::IconDatabase::writeToDatabase):
1947         (WebCore::IconDatabase::cleanupSyncThread):
1948         * page/animation/AnimationBase.cpp:
1949         (WebCore::AnimationBase::freezeAtTime):
1950         * page/animation/AnimationController.cpp:
1951         (WebCore::AnimationControllerPrivate::beginAnimationUpdateTime):
1952         * platform/graphics/GraphicsLayerAnimation.cpp:
1953         (WebCore::GraphicsLayerAnimation::computeTotalRunningTime):
1954         (WebCore::GraphicsLayerAnimation::resume):
1955         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1956         (WebCore::AVFWrapper::createImageForTimeInRect):
1957         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1958         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
1959         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer):
1960         * platform/graphics/ca/GraphicsLayerCA.cpp:
1961         (WebCore::GraphicsLayerCA::suspendAnimations):
1962         * platform/graphics/ca/PlatformCALayer.h:
1963         (WebCore::PlatformCALayer::currentTimeToMediaTime):
1964         * platform/graphics/ca/mac/LayerPool.mm:
1965         (WebCore::LayerPool::addLayer):
1966         (WebCore::LayerPool::decayedCapacity):
1967         (WebCore::LayerPool::pruneTimerFired):
1968         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1969         (mediaTimeToCurrentTime):
1970         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1971         (WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
1972         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1973         (PlatformCALayer::printTree):
1974         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1975         (WebCore::GraphicsLayerTextureMapper::addAnimation):
1976         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
1977         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
1978         (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
1979         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1980         (WebCore::CoordinatedGraphicsLayer::addAnimation):
1981         * platform/network/DNSResolveQueue.cpp:
1982         (WebCore::DNSResolveQueue::isUsingProxy):
1983         * plugins/win/PluginMessageThrottlerWin.cpp:
1984         (WebCore::PluginMessageThrottlerWin::appendMessage):
1985         * rendering/RenderLayerCompositor.cpp:
1986         (WebCore::RenderLayerCompositor::didPaintBacking):
1987         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1988         * rendering/RenderProgress.cpp:
1989         (WebCore::RenderProgress::animationProgress):
1990         (WebCore::RenderProgress::updateAnimationState):
1991         * svg/animation/SMILTimeContainer.cpp:
1992         (WebCore::SMILTimeContainer::elapsed):
1993         (WebCore::SMILTimeContainer::begin):
1994         (WebCore::SMILTimeContainer::pause):
1995         (WebCore::SMILTimeContainer::resume):
1996         (WebCore::SMILTimeContainer::setElapsed):
1997
1998 2013-08-27  Robert Hogan  <robert@webkit.org>
1999
2000         cell width / offsetTop incorrect
2001         https://bugs.webkit.org/show_bug.cgi?id=11582
2002
2003         Reviewed by David Hyatt.
2004
2005         The offsetTop and offsetLeft of sections, rows and cells should include the table's border. There are separate
2006         problems with the offset[Top|Left] of table sections and the offsetLeft of rows which are covered under bugs 119020
2007         and 119021 respectively - here we stick to just fixing the inclusion of the border as it doesn't require rebaselining
2008         a lot of tests.
2009
2010         Test: fast/table/offset-top-includes-border.html
2011
2012         * rendering/RenderBoxModelObject.cpp:
2013         (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
2014         * rendering/RenderTableSection.cpp:
2015         (WebCore::RenderTableSection::layoutRows):
2016
2017 2013-08-27  Jacky Jiang  <zhajiang@blackberry.com>
2018
2019         [BlackBerry] Rotate device from landscape to portrait during youtube streaming will cause device screen flash with video list page
2020         https://bugs.webkit.org/show_bug.cgi?id=120364
2021
2022         Reviewed by Rob Buis.
2023         Internally reviewed by Arvid Nilsson.
2024
2025         JIRA 461232
2026         When rotating device from landscape mode to portrait mode, we updated
2027         texture contents based on landscape mode front visibility and back
2028         visibility on WebKit thread at the very beginning and the landscape mode
2029         tiles wouldn't be able to cover the portrait mode screen which resulted
2030         in the screen flash.
2031         It's hard to compute front visibility information on WebKit thread because
2032         it doesn't know where the layers will be on the screen. Therefore, the
2033         front visibility won't be updated until the first time we draw textures
2034         on compositing thread.
2035         The patch traverses through LayerWebKitThread and LayerCompositingThread
2036         and discards back visibility and front visibility respectively if there
2037         is a pending orientation. In this way, we can pick up layerTilerPrefillRect
2038         as visibleRect instead of the visibleRect from the stale visibilities
2039         and add more tiles for uncovered screen when updating texture contents
2040         on WebKit thread.
2041         The patch also fixes a bug that we prune tiles based on the stale
2042         m_requiredTextureSize in pruneTextures(). We should prune tiles based
2043         on the updated pendingTextureSize instead.
2044
2045         * platform/graphics/blackberry/LayerCompositingThread.cpp:
2046         (WebCore::LayerCompositingThread::discardFrontVisibility):
2047         * platform/graphics/blackberry/LayerCompositingThread.h:
2048         * platform/graphics/blackberry/LayerCompositingThreadClient.h:
2049         (WebCore::LayerCompositingThreadClient::discardFrontVisibility):
2050         * platform/graphics/blackberry/LayerRenderer.cpp:
2051         (WebCore::LayerRenderer::discardFrontVisibility):
2052         * platform/graphics/blackberry/LayerRenderer.h:
2053         * platform/graphics/blackberry/LayerTiler.cpp:
2054         (WebCore::LayerTiler::discardFrontVisibility):
2055         (WebCore::LayerTiler::processTextureJob):
2056         (WebCore::LayerTiler::pruneTextures):
2057         (WebCore::LayerTiler::discardBackVisibility):
2058         * platform/graphics/blackberry/LayerTiler.h:
2059         * platform/graphics/blackberry/LayerWebKitThread.cpp:
2060         (WebCore::LayerWebKitThread::discardBackVisibility):
2061         * platform/graphics/blackberry/LayerWebKitThread.h:
2062
2063 2013-08-27  Antti Koivisto  <antti@apple.com>
2064
2065         Better mutation and event assertions for descendant iterators
2066         https://bugs.webkit.org/show_bug.cgi?id=120368
2067
2068         Reviewed by Andreas Kling.
2069
2070         Add mutation assertions to all functions.
2071         Drop the no-event-dispatch assertion when the iterator reaches the end. This reduces need for iterator scoping
2072         just to avoid assertions.
2073
2074         * dom/ChildIterator.h:
2075         (WebCore::::domTreeHasMutated):
2076         (WebCore::::operator):
2077         (WebCore::=):
2078         * dom/DescendantIterator.h:
2079         (WebCore::::domTreeHasMutated):
2080         (WebCore::::operator):
2081         (WebCore::=):
2082         * dom/Document.cpp:
2083         (WebCore::Document::childrenChanged):
2084         
2085             Make idiomatic.
2086
2087 2013-08-27  Renata Hodovan  <reni@webkit.org>
2088
2089         Missing null-check of parent renderer in WebCore::HTMLEmbedElement::rendererIsNeeded()
2090         https://bugs.webkit.org/show_bug.cgi?id=120343
2091
2092         Reviewed by Darin Adler.
2093
2094         Null-check the parent renderer of HTMLEmbedElement in WebCore::HTMLEmbedElement::rendererIsNeeded()
2095         and early return.
2096
2097         Test: fast/html/HTMLEmbedElement_without_parent_renderer_assert_crash.html
2098
2099         * html/HTMLEmbedElement.cpp:
2100         (WebCore::HTMLEmbedElement::rendererIsNeeded):
2101
2102 2013-08-27  Brent Fulgham  <bfulgham@apple.com>
2103
2104         [Windows] Correct method call for characteristic update.
2105
2106         Reviewed by Eric Carlson.
2107
2108         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2109         (WebCore::MediaPlayerPrivateAVFoundationCF::tracksChanged):
2110         [Windows] Correct method call (should have been "characteristicsChanged", not
2111         "player()->characteristicChanged()"
2112
2113 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
2114
2115         [Windows] some track language tags are not recognized
2116         https://bugs.webkit.org/show_bug.cgi?id=120335
2117
2118         Reviewed by Eric Carlson.
2119
2120         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Revise implementation
2121         to match logic in platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjc.mm
2122
2123 2013-08-27  Andreas Kling  <akling@apple.com>
2124
2125         Clumsily fix Gtk+ build. Not my proudest moment.
2126
2127         * rendering/svg/RenderSVGResourceFilter.cpp:
2128
2129 2013-08-27  Andreas Kling  <akling@apple.com>
2130
2131         Fix Qt build.
2132
2133         * rendering/svg/RenderSVGResourceFilter.cpp:
2134
2135 2013-08-27  Andreas Kling  <akling@apple.com>
2136
2137         RenderView::availableLogicalHeight() should be self-contained.
2138         <https://webkit.org/b/120356>
2139
2140         Reviewed by Antti Koivisto.
2141
2142         Instead of checking isRenderView() in RenderBox::availableLogicalHeightUsing()
2143         and doing an early return, do everything needed without leaving RenderView instead.
2144         Document style never has min-/max-height so there's no need to apply constraints.
2145
2146         * rendering/RenderBox.cpp:
2147         (WebCore::RenderBox::availableLogicalHeightUsing):
2148         * rendering/RenderView.cpp:
2149         (WebCore::RenderView::availableLogicalHeight):
2150
2151 2013-08-27  Andreas Kling  <akling@apple.com>
2152
2153         Simplify some more Settings access where we have a Frame in reach.
2154         <https://webkit.org/b/120256>
2155
2156         Reviewed by Darin Adler.
2157
2158         RenderObjects can always find Settings through the Frame.
2159
2160         * rendering/InlineTextBox.cpp:
2161         (WebCore::InlineTextBox::paint):
2162         * rendering/RenderBoxModelObject.cpp:
2163         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2164         * rendering/svg/RenderSVGResourceFilter.cpp:
2165         (WebCore::RenderSVGResourceFilter::applyResource):
2166
2167 2013-08-27  Andreas Kling  <akling@apple.com>
2168
2169         RenderView::flowThreadController() should return a reference.
2170         <https://webkit.org/b/120363>
2171
2172         Reviewed by Antti Koivisto.
2173
2174         This function does lazy construction and always returns an object.
2175
2176 2013-08-27  Andreas Kling  <akling@apple.com>
2177
2178         HTMLAppletElement: Use child iterator to walk <param> children.
2179         <https://webkit.org/b/120361>
2180
2181         Reviewed by Antti Koivisto.
2182
2183         Take Antti's fancy new child iterator for a quick spin.
2184
2185         * html/HTMLAppletElement.cpp:
2186         (WebCore::HTMLAppletElement::updateWidget):
2187
2188 2013-08-27  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
2189
2190         [gstreamer] Make sure gstreamer source element is thread-safe
2191         https://bugs.webkit.org/show_bug.cgi?id=115352
2192
2193         Reviewed by Philippe Normand.
2194
2195         GStreamer source element may be created by any gstreamer element on any thread by calling
2196         gst_element_make_from_uri with the URIs handled by the source element.
2197         This patch makes sure the gstreamer source element is thread-safe to avoid issues with it
2198         being created outside the main thread.
2199
2200         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2201         (webkit_web_src_init):
2202         (webKitWebSrcDispose):
2203         (webKitWebSrcFinalize):
2204         (webKitWebSrcSetProperty):
2205         (webKitWebSrcGetProperty):
2206         (removeTimeoutSources):
2207         (webKitWebSrcStop):
2208         (webKitWebSrcStart):
2209         (webKitWebSrcChangeState):
2210         (webKitWebSrcQueryWithParent):
2211         (webKitWebSrcGetUri):
2212         (webKitWebSrcSetUri):
2213         (webKitWebSrcNeedDataMainCb):
2214         (webKitWebSrcNeedDataCb):
2215         (webKitWebSrcEnoughDataMainCb):
2216         (webKitWebSrcEnoughDataCb):
2217         (webKitWebSrcSeekMainCb):
2218         (webKitWebSrcSeekDataCb):
2219         (webKitWebSrcSetMediaPlayer):
2220         (StreamingClient::StreamingClient):
2221         (StreamingClient::~StreamingClient):
2222         (StreamingClient::createReadBuffer):
2223         (StreamingClient::handleResponseReceived):
2224         (StreamingClient::handleDataReceived):
2225         (StreamingClient::handleNotifyFinished):
2226         (CachedResourceStreamingClient::CachedResourceStreamingClient):
2227         (CachedResourceStreamingClient::~CachedResourceStreamingClient):
2228         (CachedResourceStreamingClient::loadFailed):
2229         (CachedResourceStreamingClient::setDefersLoading):
2230         (CachedResourceStreamingClient::getOrCreateReadBuffer):
2231         (CachedResourceStreamingClient::responseReceived):
2232         (CachedResourceStreamingClient::dataReceived):
2233         (CachedResourceStreamingClient::notifyFinished):
2234         (ResourceHandleStreamingClient::ResourceHandleStreamingClient):
2235         (ResourceHandleStreamingClient::~ResourceHandleStreamingClient):
2236         (ResourceHandleStreamingClient::loadFailed):
2237         (ResourceHandleStreamingClient::setDefersLoading):
2238         (ResourceHandleStreamingClient::getOrCreateReadBuffer):
2239         (ResourceHandleStreamingClient::willSendRequest):
2240         (ResourceHandleStreamingClient::didReceiveResponse):
2241         (ResourceHandleStreamingClient::didReceiveData):
2242         (ResourceHandleStreamingClient::didFinishLoading):
2243         (ResourceHandleStreamingClient::didFail):
2244         (ResourceHandleStreamingClient::wasBlocked):
2245         (ResourceHandleStreamingClient::cannotShowURL):
2246         Make element thread-safe, add support to use the element without a player associated (e.g.
2247         the DASH plugin using the webkitsrc to download fragments), use GMutexLocker to simplify
2248         locks and other general improvements.
2249
2250 2013-08-27  Antti Koivisto  <antti@apple.com>
2251
2252         Remove branch from DescendantIteratorAdapter::begin() when invoking for ContainerNode
2253         https://bugs.webkit.org/show_bug.cgi?id=120358
2254
2255         Reviewed by Andreas Kling.
2256
2257         * dom/ContainerNode.h:
2258         
2259             Delete isContainerNode() so it can't be called if there is static knowledge that the object is a ContainerNode.
2260
2261         * dom/DescendantIterator.h:
2262         (WebCore::::DescendantIterator):
2263
2264             Make DescendantIterator use Node* as root instead of ContainerNode*. It is only used for equality comparison.
2265
2266         (WebCore::::begin):
2267         
2268             Remove branch. Rely on ElementTraversal specialization for ContainerNodes.
2269
2270 2013-08-27  Joseph Pecoraro  <pecoraro@apple.com>
2271
2272         Web Inspector: Column Breakpoint not working, may be off by 1
2273         https://bugs.webkit.org/show_bug.cgi?id=120334
2274
2275         Reviewed by David Kilzer.
2276
2277         JavaScriptCore changed to 1-based column numbers at some point. We
2278         need to update the ScriptDebugger assumption that they were 0-based.
2279
2280         Test: inspector-protocol/debugger/column-breakpoint.html
2281
2282         * bindings/js/ScriptDebugServer.cpp:
2283         (WebCore::ScriptDebugServer::createCallFrame):
2284         (WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):
2285
2286 2013-08-27  Antti Koivisto  <antti@apple.com>
2287
2288         Switch some more code to element child/descendant iterators
2289         https://bugs.webkit.org/show_bug.cgi?id=120355
2290
2291         Reviewed by Andreas Kling.
2292
2293         Move from Traversal<ElementType>::next() and Traversal<ElementType>::nextSibling() to iterators.
2294
2295         * css/CSSFontFaceSource.cpp:
2296         (WebCore::CSSFontFaceSource::getFontData):
2297         * dom/Document.cpp:
2298         (WebCore::Document::removeTitle):
2299         (WebCore::Document::updateBaseURL):
2300         (WebCore::Document::processBaseElement):
2301         * dom/TreeScope.cpp:
2302         (WebCore::TreeScope::labelElementForId):
2303         (WebCore::TreeScope::findAnchor):
2304         * html/HTMLFieldSetElement.cpp:
2305         (WebCore::HTMLFieldSetElement::invalidateDisabledStateUnder):
2306         (WebCore::HTMLFieldSetElement::childrenChanged):
2307         * html/HTMLLabelElement.cpp:
2308         (WebCore::HTMLLabelElement::control):
2309         * html/HTMLMediaElement.cpp:
2310         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
2311         * html/HTMLObjectElement.cpp:
2312         (WebCore::HTMLObjectElement::parametersForPlugin):
2313         * rendering/FilterEffectRenderer.cpp:
2314         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2315         * svg/SVGFilterPrimitiveStandardAttributes.h:
2316         (WebCore::isSVGFilterPrimitiveStandardAttributes):
2317         (WebCore::SVGFilterPrimitiveStandardAttributes):
2318         * svg/animation/SMILTimeContainer.cpp:
2319         (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
2320         * svg/graphics/SVGImage.cpp:
2321         (WebCore::SVGImage::hasSingleSecurityOrigin):
2322
2323 2013-08-26  Andreas Kling  <akling@apple.com>
2324
2325         FocusController::focusedOrMainFrame() should return a reference.
2326         <https://webkit.org/b/120339>
2327
2328         Reviewed by Antti Koivisto.
2329
2330         Now that Page::mainFrame() returns a reference, we can make this return a reference
2331         too, since there's always either a focused or a main frame.
2332
2333         One hectogram of null checks removed as a result.
2334
2335 2013-08-26  Andreas Kling  <akling@apple.com>
2336
2337         Document's renderer is always a RenderView.
2338         <https://webkit.org/b/120304>
2339
2340         Reviewed by Darin Adler.
2341
2342         Let's enforce this better by storing a RenderView* instead of a plain RenderObject*.
2343         We should switch callers that grab at Document::renderer() to calling renderView()
2344         instead, but that's better done separately.
2345
2346         * dom/Document.cpp:
2347         (WebCore::Document::Document):
2348         (WebCore::Document::~Document):
2349         (WebCore::Document::setRenderView):
2350         (WebCore::Document::createRenderTree):
2351         (WebCore::Document::detach):
2352         (WebCore::Document::setInPageCache):
2353         * dom/Document.h:
2354         (WebCore::Document::renderView):
2355         (WebCore::Document::renderer):
2356         * html/parser/HTMLResourcePreloader.cpp:
2357         * rendering/RenderObject.cpp:
2358         (WebCore::RenderObject::setStyle):
2359         * rendering/RenderView.h:
2360         * svg/SVGSVGElement.cpp:
2361         (WebCore::SVGSVGElement::updateCurrentTranslate):
2362
2363 2013-08-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2364
2365         Font's fast code path doesn't handle partial runs correctly when kerning or ligatures are enabled
2366         https://bugs.webkit.org/show_bug.cgi?id=100050
2367
2368         Reviewed by Darin Adler.
2369
2370         Renamed m_characterIndex to m_characterIndexOfGlyph and gave it an inline size of 10,
2371         which covers around 66% of all cases. The rest of the cases are now preallocated to the
2372         upper limit which is length of the original TextRun.
2373
2374         * platform/graphics/FontFastPath.cpp:
2375         (WebCore::Font::getGlyphsAndAdvancesForSimpleText):
2376         (WebCore::Font::selectionRectForSimpleText):
2377         (WebCore::Font::offsetForPositionForSimpleText):
2378         * platform/graphics/WidthIterator.cpp:
2379         (WebCore::WidthIterator::WidthIterator):
2380         (WebCore::WidthIterator::advanceInternal):
2381         * platform/graphics/WidthIterator.h:
2382
2383 2013-08-27  Christophe Dumez  <ch.dumez@sisa.samsung.com>
2384
2385         Implement DOM3 wheel event
2386         https://bugs.webkit.org/show_bug.cgi?id=94081
2387
2388         Reviewed by Darin Adler.
2389
2390         Add support for DOM Level 3 WheelEvent:
2391         http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent
2392
2393         Firefox, IE10 and since recently Blink already support it so
2394         it increases our cross-browser compatibility.
2395
2396         The non-standard 'mousewheel' event is still supported for backward
2397         compatibility. Note that the deltas returned by the mousewheel and
2398         the wheel events are not identical:
2399         - They have opposite signs.
2400         - The wheel event reports the actual amount of pixels that should be
2401         scrolled while the legacy mousewheel event reports a factor of the
2402         number of mouse wheel ticks (using a constant multiplier).
2403
2404         Tests: fast/events/wheelevent-basic.html
2405                fast/events/wheelevent-constructor.html
2406                fast/events/wheelevent-mousewheel-interaction.html
2407
2408         * dom/Document.h:
2409         * dom/Document.idl:
2410         * dom/Element.h:
2411         * dom/Element.idl:
2412         * dom/EventNames.h:
2413         * dom/EventTarget.cpp:
2414         (WebCore::legacyType):
2415         (WebCore::EventTarget::shouldObserveLegacyType):
2416         (WebCore::EventTarget::setupLegacyTypeObserverIfNeeded):
2417         (WebCore::EventTarget::fireEventListeners):
2418         * dom/EventTarget.h:
2419         * dom/Node.cpp:
2420         (WebCore::Node::didMoveToNewDocument):
2421         (WebCore::tryAddEventListener):
2422         (WebCore::tryRemoveEventListener):
2423         (WebCore::Node::defaultEventHandler):
2424         * dom/WheelEvent.cpp:
2425         (WebCore::WheelEventInit::WheelEventInit):
2426         (WebCore::WheelEvent::WheelEvent):
2427         (WebCore::WheelEvent::initWheelEvent):
2428         * dom/WheelEvent.h:
2429         (WebCore::WheelEvent::deltaX):
2430         (WebCore::WheelEvent::deltaY):
2431         (WebCore::WheelEvent::deltaZ):
2432         (WebCore::WheelEvent::wheelDelta):
2433         (WebCore::WheelEvent::wheelDeltaX):
2434         (WebCore::WheelEvent::wheelDeltaY):
2435         * dom/WheelEvent.idl:
2436         * html/HTMLAttributeNames.in:
2437         * html/HTMLElement.cpp:
2438         (WebCore::HTMLElement::eventNameForAttributeName):
2439         * page/DOMWindow.cpp:
2440         (WebCore::DOMWindow::addEventListener):
2441         (WebCore::DOMWindow::removeEventListener):
2442         * page/DOMWindow.h:
2443         * page/DOMWindow.idl:
2444         * page/EventHandler.cpp:
2445         (WebCore::EventHandler::defaultWheelEventHandler):
2446         * plugins/blackberry/PluginViewBlackBerry.cpp:
2447         (WebCore::PluginView::handleWheelEvent):
2448         * svg/SVGElementInstance.cpp:
2449         * svg/SVGElementInstance.h:
2450         * svg/SVGElementInstance.idl:
2451
2452 2013-08-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2453
2454         Assertion while scrolling news.google.com
2455         https://bugs.webkit.org/show_bug.cgi?id=115303
2456
2457         Reviewed by Anders Carlsson.
2458
2459         Do not relayout when accessing script elements during painting.
2460
2461         * html/HTMLEmbedElement.cpp:
2462         (WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
2463
2464 2013-08-27  Benjamin Poulain  <benjamin@webkit.org>
2465
2466         Remove DOMSettableTokenList's overload of add() and remove()
2467         https://bugs.webkit.org/show_bug.cgi?id=120341
2468
2469         Reviewed by Ryosuke Niwa.
2470
2471         Little refactoring to make other cleanups easier. Instead of modifying
2472         SpaceSplitString directly, rely on DOMTokenList ultimately changing
2473         the value, which in turn updates the tokens.
2474
2475         * html/DOMSettableTokenList.cpp:
2476         * html/DOMSettableTokenList.h:
2477         * html/DOMTokenList.h:
2478
2479 2013-08-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2480
2481         [GTK] Volume slider shows incorrect track when muted
2482         https://bugs.webkit.org/show_bug.cgi?id=120253
2483
2484         Reviewed by Philippe Normand.
2485
2486         When painting the volume bar, consider that it could be muted even
2487         then volume is different than zero.
2488
2489         * platform/gtk/RenderThemeGtk.cpp:
2490         (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack): Asign
2491         painted volume as 0 when media is muted.
2492
2493 2013-08-26  Sam Weinig  <sam@webkit.org>
2494
2495         EditorInternalCommand should use Frame& where possible
2496         https://bugs.webkit.org/show_bug.cgi?id=120340
2497
2498         Reviewed by Andreas Kling.
2499
2500         Only isSupportedFromDOM still takes a Frame*, as it still has callers that expect null to work.
2501
2502         * dom/UserTypingGestureIndicator.cpp:
2503         * dom/UserTypingGestureIndicator.h:
2504         * editing/Editor.cpp:
2505         * editing/EditorCommand.cpp:
2506         * page/EventHandler.cpp:
2507
2508 2013-08-26  Ryosuke Niwa  <rniwa@webkit.org>
2509
2510         Elements in a node list of the form element's name getter should not be added to the past names map
2511         https://bugs.webkit.org/show_bug.cgi?id=120279
2512
2513         Reviewed by Darin Adler.
2514
2515         Don't add the element in the named items to the past names map when there are multiple elements.
2516         This matches IE10's behavior and the specified behavior in HTML5:
2517         http://www.w3.org/TR/2013/WD-html51-20130528/forms.html#dom-form-nameditem
2518
2519         Test: fast/forms/past-names-map-should-not-contain-nodelist-item.html
2520
2521         * html/HTMLFormElement.cpp:
2522         (WebCore::HTMLFormElement::getNamedElements):
2523
2524 2013-08-26  Ryosuke Niwa  <rniwa@webkit.org>
2525
2526         Windows build fix after r154658.
2527
2528         * page/AutoscrollController.cpp:
2529         (WebCore::getMainFrame):
2530
2531 2013-08-26  Andreas Kling  <akling@apple.com>
2532
2533         Page::mainFrame() should return a reference.
2534         <http://webkit.org/b/119677>
2535
2536         Reviewed by Antti Koivisto.
2537
2538         Page always creates the main Frame by itself now, so it will never be null during the Page's lifetime.
2539
2540         Let Page::mainFrame() return Frame& and remove a sea of null checks.
2541
2542 2013-08-26  Sam Weinig  <sam@webkit.org>
2543
2544         Remove two unnecessary .get()s.
2545
2546         Reviewed by Anders Carlsson.
2547
2548         * editing/Editor.h:
2549         (WebCore::Editor::killRing):
2550         (WebCore::Editor::spellChecker):
2551
2552 2013-08-26  Joseph Pecoraro  <pecoraro@apple.com>
2553
2554         Web Inspector: We should regenerate InspectorBackendCommands.js for Legacy Inspector.json versions
2555         https://bugs.webkit.org/show_bug.cgi?id=120242
2556
2557         Reviewed by Timothy Hatcher.
2558
2559         - Update the Inspector.json CodeGenerator to include an output_js_dir.
2560         - Cleanup multiple trailing newlines in some of the generated files.
2561         - Provide a way to not verify runtime casts, needed for Legacy inputs.
2562
2563         * CMakeLists.txt:
2564         * DerivedSources.make:
2565         * DerivedSources.pri:
2566         * GNUmakefile.am:
2567         * inspector/CodeGeneratorInspector.py:
2568         (resolve_all_types):
2569         (SmartOutput.close):
2570
2571 2013-08-26  Sam Weinig  <sam@webkit.org>
2572
2573         AlternativeTextController should hold onto Frame as a reference
2574         https://bugs.webkit.org/show_bug.cgi?id=120327
2575
2576         Reviewed by Andreas Kling.
2577
2578         While in the area I also:
2579           - Reference-ified Editor::killRing().
2580           - Const-ified Editor::m_killRing, Editor::m_spellChecker, and Editor::m_alternativeTextController.
2581
2582         * editing/AlternativeTextController.cpp:
2583         (WebCore::AlternativeTextController::AlternativeTextController):
2584         (WebCore::AlternativeTextController::stopPendingCorrection):
2585         (WebCore::AlternativeTextController::isSpellingMarkerAllowed):
2586         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2587         (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
2588         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2589         (WebCore::AlternativeTextController::timerFired):
2590         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
2591         (WebCore::AlternativeTextController::rootViewRectForRange):
2592         (WebCore::AlternativeTextController::respondToChangedSelection):
2593         (WebCore::AlternativeTextController::respondToAppliedEditing):
2594         (WebCore::AlternativeTextController::respondToUnappliedEditing):
2595         (WebCore::AlternativeTextController::alternativeTextClient):
2596         (WebCore::AlternativeTextController::editorClient):
2597         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
2598         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
2599         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
2600         (WebCore::AlternativeTextController::insertDictatedText):
2601         (WebCore::AlternativeTextController::applyDictationAlternative):
2602         * editing/AlternativeTextController.h:
2603         (WebCore::AlternativeTextController::UNLESS_ENABLED):
2604         * editing/Editor.cpp:
2605         (WebCore::Editor::Editor):
2606         (WebCore::Editor::addToKillRing):
2607         * editing/Editor.h:
2608         (WebCore::Editor::killRing):
2609         * editing/EditorCommand.cpp:
2610         (WebCore::executeYank):
2611         (WebCore::executeYankAndSelect):
2612
2613 2013-08-23  Andy Estes  <aestes@apple.com>
2614
2615         Fix issues found by the Clang Static Analyzer
2616         https://bugs.webkit.org/show_bug.cgi?id=120230
2617
2618         Reviewed by Darin Adler.
2619
2620         * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h.
2621         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper().
2622         (AXTextMarkerRange): Used HardAutorelease() instead of
2623         CFAutoreleaseHelper().
2624         (AXTextMarkerRangeStart): Ditto.
2625         (AXTextMarkerRangeEnd): Ditto.
2626         (textMarkerForVisiblePosition): Ditto.
2627         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2628         (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init]
2629         first so that we don't later use ivars from the wrong self.
2630         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto.
2631         * platform/mac/FoundationExtras.h: Removed.
2632         * platform/mac/KURLMac.mm:
2633         (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease().
2634         * platform/mac/WebCoreNSURLExtras.mm:
2635         (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of
2636         WebCoreCFAutorelease().
2637         (WebCore::URLWithData): Ditto.
2638         (WebCore::userVisibleString): Ditto.
2639         (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<>
2640         with an inline capacity rather than heap-allocating a buffer.
2641         * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of
2642         WebCoreCFAutorelease().
2643         * platform/text/mac/StringImplMac.mm:
2644         (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease().
2645
2646 2013-08-26  Pratik Solanki  <psolanki@apple.com>
2647
2648         Page::console() should return a reference
2649         https://bugs.webkit.org/show_bug.cgi?id=120320
2650
2651         Reviewed by Darin Adler.
2652
2653         Page::m_console is never NULL so console() can just return a reference.
2654
2655         * css/CSSParser.cpp:
2656         (WebCore::CSSParser::logError):
2657         * dom/Document.cpp:
2658         (WebCore::Document::addConsoleMessage):
2659         (WebCore::Document::addMessage):
2660         * page/DOMWindow.cpp:
2661         (WebCore::DOMWindow::pageConsole):
2662         * page/Page.h:
2663         (WebCore::Page::console):
2664         * xml/XSLStyleSheetLibxslt.cpp:
2665         (WebCore::XSLStyleSheet::parseString):
2666         * xml/XSLTProcessorLibxslt.cpp:
2667         (WebCore::docLoaderFunc):
2668
2669 2013-08-26  Rob Buis  <rwlbuis@webkit.org>
2670
2671         Lonely stop crashes
2672         https://bugs.webkit.org/show_bug.cgi?id=87964
2673
2674         Reviewed by Darin Adler.
2675
2676         Provide a nodeAtFloatPoint implementation for RenderSVGGradientStop to avoid hitting the assert in RenderObject::nodeAtFloatPoint.
2677
2678         Test: svg/custom/stop-crash-hittest.svg
2679
2680         * rendering/svg/RenderSVGGradientStop.h:
2681
2682 2013-08-26  Sam Weinig  <sam@webkit.org>
2683
2684         Editor::spellChecker() should return a reference
2685         https://bugs.webkit.org/show_bug.cgi?id=120325
2686
2687         Reviewed by Anders Carlsson.
2688
2689         * editing/Editor.cpp:
2690         (WebCore::Editor::Editor):
2691         * editing/Editor.h:
2692         (WebCore::Editor::spellChecker):
2693         * editing/SpellChecker.cpp:
2694         (WebCore::SpellChecker::SpellChecker):
2695         (WebCore::SpellChecker::client):
2696         (WebCore::SpellChecker::isAsynchronousEnabled):
2697         (WebCore::SpellChecker::didCheck):
2698         (WebCore::SpellChecker::didCheckSucceed):
2699         * editing/SpellChecker.h:
2700         * page/EditorClient.h:
2701         * testing/Internals.cpp:
2702         (WebCore::Internals::lastSpellCheckRequestSequence):
2703         (WebCore::Internals::lastSpellCheckProcessedSequence):
2704
2705 2013-08-26  Bem Jones-Bey  <bjonesbe@adobe.com>
2706
2707         Optimize FloatIntervalSearchAdapter::collectIfNeeded
2708         https://bugs.webkit.org/show_bug.cgi?id=120237
2709
2710         Reviewed by David Hyatt.
2711
2712         This is a port of 3 Blink patches:
2713         https://codereview.chromium.org/22463002 (By shatch@chromium.org)
2714         https://chromiumcodereview.appspot.com/22909005 (By me)
2715         https://chromiumcodereview.appspot.com/23084002 (By me)
2716
2717         shatch optimized FloatIntervalSearchAdapter by having it store the
2718         outermost float instead of making a bunch of calls to
2719         logical(Left/Right/Bottom)ForFloat, and then only making that call
2720         once when heightRemaining needs to be computed.
2721
2722         I noticed that now we were storing both the last float encountered and
2723         the outermost float, and that the behavior for shape-outside wasn't
2724         significantly changed by using the outermost float instead of the last
2725         float encountered (and in most cases, using the outermost float gives
2726         more reasonable behavior). Since this isn't covered in the spec yet, I
2727         changed shape-outside to use the outermost float, making it so that we
2728         only need to store one float pointer when walking the placed floats
2729         tree, and keeping the performance win.
2730
2731         Also while changing updateOffsetIfNeeded, removed const, since that is
2732         a lie. Nothing about that method is const.
2733
2734         Test: fast/shapes/shape-outside-floats/shape-outside-floats-outermost.html
2735
2736         * rendering/RenderBlock.cpp:
2737         (WebCore::::updateOffsetIfNeeded):
2738         (WebCore::::collectIfNeeded):
2739         (WebCore::::getHeightRemaining):
2740         (WebCore::RenderBlock::logicalLeftFloatOffsetForLine):
2741         (WebCore::RenderBlock::logicalRightFloatOffsetForLine):
2742         * rendering/RenderBlock.h:
2743         (WebCore::RenderBlock::FloatIntervalSearchAdapter::FloatIntervalSearchAdapter):
2744         (WebCore::RenderBlock::FloatIntervalSearchAdapter::outermostFloat):
2745
2746 2013-08-26  Alexey Proskuryakov  <ap@apple.com>
2747
2748         [Mac] can-read-in-dragstart-event.html and can-read-in-copy-and-cut-events.html fail
2749         https://bugs.webkit.org/show_bug.cgi?id=113094
2750
2751         Reviewed by Darin Adler.
2752
2753         Mac platform implementation has checks for pasteboard change count, but it
2754         didn't use to update the count when writing to pasteboad from JavaScript.
2755
2756         * platform/PasteboardStrategy.h: Changed changeCount function to return a long
2757         instead of an int, as the underlying Mac type is NSInteger. Changed all methods
2758         that modify the pasteboard to return a new change count.
2759
2760         * platform/PlatformPasteboard.h: Changed all methods that modify the pasteboard
2761         to return a new change count.
2762
2763         * platform/mac/PasteboardMac.mm:
2764         (WebCore::Pasteboard::clear): Update m_changeCount.
2765         (WebCore::Pasteboard::writeSelectionForTypes): Ditto.
2766         (WebCore::Pasteboard::writePlainText): Ditto.
2767         (WebCore::writeURLForTypes): Ditto.
2768         (WebCore::Pasteboard::writeURL): Ditto.
2769         (WebCore::writeFileWrapperAsRTFDAttachment): Ditto.
2770         (WebCore::Pasteboard::writeImage): Ditto.
2771         (WebCore::Pasteboard::writePasteboard): Ditto.
2772         (WebCore::addHTMLClipboardTypesForCocoaType): Ditto.
2773         (WebCore::Pasteboard::writeString): Ditto.
2774
2775         * platform/mac/PlatformPasteboardMac.mm:
2776         (WebCore::PlatformPasteboard::changeCount): Changed returned type to long to avoid
2777         data loss.
2778         (WebCore::PlatformPasteboard::copy): Return new change count.
2779         (WebCore::PlatformPasteboard::addTypes): Ditto.
2780         (WebCore::PlatformPasteboard::setTypes): Ditto.
2781         (WebCore::PlatformPasteboard::setBufferForType): Ditto.
2782         (WebCore::PlatformPasteboard::setPathnamesForType): Ditto.
2783         (WebCore::PlatformPasteboard::setStringForType): Ditto. Replaced -[NSURL writeToPasteboard:]
2784         with an equivalent implemnentation that tells use whether writing was successful.
2785         There is difference with invalid URL string handling - we used to silently ignore
2786         such requets, but set pasteboard content to empty URL now.
2787
2788 2013-08-24  Sam Weinig  <sam@webkit.org>
2789
2790         Add support for Promises
2791         https://bugs.webkit.org/show_bug.cgi?id=120260
2792
2793         Reviewed by Darin Adler.
2794
2795         Add an initial implementation of Promises - http://dom.spec.whatwg.org/#promises.
2796         - Despite Promises being defined in the DOM, the implementation is being put in JSC
2797           in preparation for the Promises eventually being defined in ECMAScript.
2798
2799         Tests: fast/js/Promise-already-fulfilled.html
2800                fast/js/Promise-already-rejected.html
2801                fast/js/Promise-already-resolved.html
2802                fast/js/Promise-catch-in-workers.html
2803                fast/js/Promise-catch.html
2804                fast/js/Promise-chain.html
2805                fast/js/Promise-exception.html
2806                fast/js/Promise-fulfill-in-workers.html
2807                fast/js/Promise-fulfill.html
2808                fast/js/Promise-init-in-workers.html
2809                fast/js/Promise-init.html
2810                fast/js/Promise-reject-in-workers.html
2811                fast/js/Promise-reject.html
2812                fast/js/Promise-resolve-chain.html
2813                fast/js/Promise-resolve-in-workers.html
2814                fast/js/Promise-resolve-with-then-exception.html
2815                fast/js/Promise-resolve-with-then-fulfill.html
2816                fast/js/Promise-resolve-with-then-reject.html
2817                fast/js/Promise-resolve.html
2818                fast/js/Promise-simple-fulfill-inside-callback.html
2819                fast/js/Promise-simple-fulfill.html
2820                fast/js/Promise-simple-in-workers.html
2821                fast/js/Promise-simple.html
2822                fast/js/Promise-static-fulfill.html
2823                fast/js/Promise-static-reject.html
2824                fast/js/Promise-static-resolve.html
2825                fast/js/Promise-then-in-workers.html
2826                fast/js/Promise-then-without-callbacks-in-workers.html
2827                fast/js/Promise-then-without-callbacks.html
2828                fast/js/Promise-then.html
2829                fast/js/Promise-types.html
2830                fast/js/Promise.html
2831
2832         * GNUmakefile.list.am:
2833         * Target.pri:
2834         * UseJSC.cmake:
2835         * WebCore.vcxproj/WebCore.vcxproj:
2836         * WebCore.vcxproj/WebCore.vcxproj.filters:
2837         * WebCore.xcodeproj/project.pbxproj:
2838         * bindings/js/JSBindingsAllInOne.cpp:
2839         Add new files.
2840
2841         * bindings/js/JSDOMGlobalObjectTask.cpp: Added.
2842         (WebCore::JSGlobalObjectCallback::create):
2843         (WebCore::JSGlobalObjectCallback::~JSGlobalObjectCallback):
2844         (WebCore::JSGlobalObjectCallback::call):
2845         (WebCore::JSGlobalObjectCallback::JSGlobalObjectCallback):
2846         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
2847         (WebCore::JSGlobalObjectTask::~JSGlobalObjectTask):
2848         (WebCore::JSGlobalObjectTask::performTask):
2849         * bindings/js/JSDOMGlobalObjectTask.h: Added.
2850         (WebCore::JSGlobalObjectTask::create):
2851         Add a new task type to be used with the GlobalObjectMethodTable's new QueueTaskToEventLoop callback.
2852
2853         * bindings/js/JSDOMWindowBase.cpp:
2854         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
2855         * bindings/js/JSDOMWindowBase.h:
2856         Implement the GlobalObjectMethodTable callback, QueueTaskToEventLoop. 
2857
2858         * bindings/js/JSMainThreadExecState.h:
2859         All using JSMainThreadExecState as a simple RAII object.
2860
2861         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2862         (WebCore::JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase):
2863         (WebCore::JSWorkerGlobalScopeBase::allowsAccessFrom):
2864         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling):
2865         (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo):
2866         (WebCore::JSWorkerGlobalScopeBase::shouldInterruptScript):
2867         (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled):
2868         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
2869         * bindings/js/JSWorkerGlobalScopeBase.h:
2870         Add a GlobalObjectMethodTable and implement QueueTaskToEventLoop. Forward the other callbacks
2871         to JSGlobalObject so they retain their existing behavior.
2872
2873 2013-08-26  Rob Buis  <rwlbuis@webkit.org>
2874
2875         Computed style of fill/stroke properties incorrect on references
2876         https://bugs.webkit.org/show_bug.cgi?id=114761
2877
2878         Reviewed by Darin Adler.
2879
2880         The computed style of the fill and stroke properties did not include
2881         the url() function. Added the url() string to output.
2882
2883         Updated existing tests to cover the issue.
2884
2885         * css/CSSPrimitiveValue.cpp: Cleanup.
2886         (WebCore::CSSPrimitiveValue::customCssText):
2887         * svg/SVGPaint.cpp: Added "url("
2888         (WebCore::SVGPaint::customCssText):
2889
2890 2013-08-26  Zan Dobersek  <zdobersek@igalia.com>
2891
2892         Prettify generated build guards in HTMLElementFactory.cpp
2893         https://bugs.webkit.org/show_bug.cgi?id=120310
2894
2895         Reviewed by Darin Adler.
2896
2897         Build guards should wrap the constructor definitions without empty lines between
2898         the guards and the constructor code. Similarly, build guards for addTag calls
2899         shouldn't put an empty line after the build guard closure.
2900
2901         * dom/make_names.pl:
2902         (printConstructorInterior):
2903         (printConstructors):
2904         (printFunctionInits):
2905
2906 2013-08-26  Robert Hogan  <robert@webkit.org>
2907
2908         Avoid painting every non-edge collapsed border twice over
2909         https://bugs.webkit.org/show_bug.cgi?id=119759
2910
2911         Reviewed by David Hyatt.
2912
2913         Every collapsed border that isn't on the edge of a table gets painted at least twice, once by each 
2914         adjacent cell. The joins are painted four times. This is unnecessary and results in tables with semi-transparent
2915         borders getting rendered incorrectly - each border adjoing two cells is painted twice and ends up darker than it should be. 
2916
2917         Fixing the overpainting at joins is another day's work. This patch ensures each collapsed border inside a table is only
2918         painted once. It does this by only allowing cells at the top and left edge of the table to paint their top and left collapsed borders.
2919         All the others can only paint their right and bottom collapsed border. This works because the borders are painted from bottom right to top left.
2920
2921         Tests: fast/table/border-collapsing/collapsed-borders-adjoining-sections-vertical-rl.html
2922                fast/table/border-collapsing/collapsed-borders-adjoining-sections.html
2923
2924         * rendering/RenderTableCell.cpp:
2925         (WebCore::RenderTableCell::paintCollapsedBorders):
2926
2927 2013-08-26  Andreas Kling  <akling@apple.com>
2928
2929         Unreviewed build fix.
2930
2931         * page/Page.cpp:
2932         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
2933
2934 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
2935
2936         Unreviewed buid fix.
2937
2938         * page/Page.cpp: 
2939         (WebCore::Page::setNeedsRecalcStyleInAllFrames): Remove extra '{' character.
2940
2941 2013-08-26  Pratik Solanki  <psolanki@apple.com>
2942
2943         PageGroup::groupSettings() should return a reference
2944         https://bugs.webkit.org/show_bug.cgi?id=120319
2945
2946         Reviewed by Andreas Kling.
2947
2948         PageGroup::m_groupSettings is never NULL so we can just return a reference from groupSettings().
2949
2950         * Modules/indexeddb/IDBFactory.cpp:
2951         * page/PageGroup.h:
2952         (WebCore::PageGroup::groupSettings):
2953         * storage/StorageNamespaceImpl.cpp:
2954         (WebCore::StorageNamespaceImpl::localStorageNamespace):
2955         * workers/DefaultSharedWorkerRepository.cpp:
2956         (WebCore::SharedWorkerProxy::groupSettings):
2957         * workers/WorkerMessagingProxy.cpp:
2958         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2959
2960 2013-08-26  Andreas Kling  <akling@apple.com>
2961
2962         WebCore: Let Page create the main Frame.
2963         <https://webkit.org/b/119964>
2964
2965         Reviewed by Anders Carlsson.
2966
2967         Previously, Frame::create() would call Page::setMainFrame() when constructing the
2968         main Frame for a Page. Up until that point, Page had a null mainFrame().
2969
2970         To guarantee that Page::mainFrame() is never null, we re-order things so that
2971         Page is responsible for creating its own main Frame. We do this at the earliest
2972         possible point; in the Page constructor initializer list.
2973
2974         Constructing a Frame requires a FrameLoaderClient*, so I've added such a field to
2975         the PageClients struct.
2976
2977         When creating a WebKit-layer frame, we now wrap the already-instantiated
2978         Page::mainFrame() instead of creating a new Frame.
2979
2980         * loader/EmptyClients.cpp:
2981         (WebCore::fillWithEmptyClients):
2982
2983             Add an EmptyFrameLoaderClient to the PageClients constructed here.
2984
2985         * inspector/InspectorOverlay.cpp:
2986         (WebCore::InspectorOverlay::overlayPage):
2987         * svg/graphics/SVGImage.cpp:
2988         (WebCore::SVGImage::dataChanged):
2989
2990             Updated to wrap Page::mainFrame() in a FrameView instead of creating their
2991             own Frame manually.
2992
2993         * page/Frame.cpp:
2994         (WebCore::Frame::create):
2995         * page/Page.h:
2996
2997             Remove Page::setMainFrame() and the only call site.
2998
2999         * page/Page.cpp:
3000         (WebCore::Page::Page):
3001
3002             Construct Page::m_mainFrame in the initializer list.
3003
3004         (WebCore::Page::PageClients::PageClients):
3005
3006             Add "FrameLoaderClient* loaderClientForMainFrame" to PageClients.
3007
3008         (WebCore::Page::setNeedsRecalcStyleInAllFrames):
3009
3010             Null-check the Frame::document() before calling through on it. This would
3011             otherwise crash when changing font-related Settings before calling init() on
3012             the Frame (like InspectorOverlay does.)
3013
3014 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
3015
3016         [Windows] Unreviewed build fix.
3017
3018         * rendering/RenderMediaControls.cpp: Remove references to QuickTime controls
3019         that are no longer part of WKSI.
3020         (wkHitTestMediaUIPart): 
3021         (wkMeasureMediaUIPart):
3022         (wkDrawMediaUIPart):
3023         (wkDrawMediaSliderTrack):
3024
3025 2013-08-26  Gurpreet Kaur  <gur.trio@gmail.com>
3026
3027         <https://webkit.org/b/106133> document.body.scrollTop & document.documentElement.scrollTop differ cross-browser
3028
3029         Reviewed by Darin Adler.
3030
3031         Webkit always uses document.body.scrollTop whether quirks or
3032         standard mode. Similiar behaviour is for document.body.scrollLeft.
3033         As per the specification webkit should return document.body.scrollTop
3034         for quirks mode and document.documentElement.scrollTop for standard mode.
3035         Same for document.body.scrollLeft and document.documentElement.scrollLeft.
3036
3037         Tests: fast/dom/Element/scrollLeft-Quirks.html
3038                fast/dom/Element/scrollLeft.html
3039                fast/dom/Element/scrollTop-Quirks.html
3040                fast/dom/Element/scrollTop.html
3041
3042         * dom/Element.cpp:
3043         (WebCore::Element::scrollLeft):
3044         (WebCore::Element::scrollTop): 
3045         If the element does not have any associated CSS layout box or the element
3046         is the root element and the Document is in quirks mode return zero.
3047         Else If the element is the root element return the value of scrollY
3048         for scrollTop and scrollX for scrollLeft.
3049         * html/HTMLBodyElement.cpp:
3050         (WebCore::HTMLBodyElement::scrollLeft):
3051         (WebCore::HTMLBodyElement::scrollTop):
3052         If the element is the HTML body element, the Document is in quirks mode,
3053         return the value of scrollY for scrollTop and scrollX for scrollLeft.
3054
3055 2013-08-26  Antti Koivisto  <antti@apple.com>
3056
3057         REGRESSION (r154581): Some plugin tests failing in debug bots
3058         https://bugs.webkit.org/show_bug.cgi?id=120315
3059
3060         Reviewed by Darin Adler.
3061         
3062         We are hitting the new no-event-dispatch-while-iterating assertion.
3063
3064         Detaching deletes a plugin which modifies DOM while it dies.
3065
3066         * dom/Document.cpp:
3067         (WebCore::Document::createRenderTree):
3068         (WebCore::Document::detach):
3069         
3070             Don't iterate at all. Document never has more than one Element child anyway.
3071
3072 2013-08-26  David Kilzer  <ddkilzer@apple.com>
3073
3074         BUILD FIX (r154580): RenderObject::document() returns a reference
3075
3076         See: <https://webkit.org/b/120272>
3077
3078         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3079         (-[WebAccessibilityObjectWrapper _accessibilityParentForSubview:]):
3080         (AXAttributeStringSetHeadingLevel):
3081
3082 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
3083
3084         [Windows] Build fix after r154578.  Return Vector<String>() instead
3085         of ListHashSet<String>().
3086
3087         * platform/win/PasteboardWin.cpp:
3088         (WebCore::Pasteboard::types):
3089
3090 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
3091
3092         [Windows] Build fix after r154580.
3093
3094         * rendering/RenderThemeWin.cpp: Mirror changes made for other ports now that
3095         Frame is known to always be valid when in a render tree. This allows us to
3096         get rid of some unneeded null checks.
3097         (WebCore::RenderThemeWin::getThemeData):
3098         (WebCore::RenderThemeWin::paintMenuList):
3099
3100 2013-08-26  Brent Fulgham  <bfulgham@apple.com>
3101
3102         [Windows] Build fix after r154554.
3103
3104         * page/AutoscrollController.cpp: Correct various places where pointers are now
3105         references.
3106         (WebCore::AutoscrollController::stopAutoscrollTimer):
3107         (WebCore::AutoscrollController::startPanScrolling):
3108         (WebCore::AutoscrollController::autoscrollTimerFired):
3109
3110 2013-08-26  Andreas Kling  <akling@apple.com>
3111
3112         Move DocumentTiming inside ENABLE(WEB_TIMING) guards.
3113         <https://webkit.org/b/120281>
3114
3115         Reviewed by Anders Carlsson.
3116
3117         Looks like this struct is only used by other ENABLE(WEB_TIMING) code, so don't bother
3118         filling it in if we're not building like that.
3119
3120         * dom/Document.cpp:
3121         (WebCore::Document::setReadyState):
3122         (WebCore::Document::finishedParsing):
3123         * dom/Document.h:
3124         * dom/DocumentTiming.h:
3125
3126 2013-08-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3127
3128         [GTK] Fix compile warning in WebKitDOMCustom
3129         https://bugs.webkit.org/show_bug.cgi?id=120286
3130
3131         Reviewed by Philippe Normand.
3132
3133         * bindings/gobject/WebKitDOMCustom.cpp:
3134         (webkit_dom_html_element_get_item_type): Add return 0.
3135
3136 2013-08-25  Ryosuke Niwa  <rniwa@webkit.org>
3137
3138         JSHTMLFormElement::canGetItemsForName needlessly allocates a Vector
3139         https://bugs.webkit.org/show_bug.cgi?id=120277
3140
3141         Reviewed by Sam Weinig.
3142
3143         Added HTMLFormElement::hasNamedElement and used it in JSHTMLFormElement::canGetItemsForName.
3144
3145         This required fixing a bug in HTMLFormElement::getNamedElements that the first call to getNamedElements
3146         after replacing an element A with another element B of the same name caused it to erroneously append A
3147         to namedItems via the aliases mapping. Because getNamedElements used to be always called in pairs, this
3148         wrong behavior was never visible to the Web. Fixed the bug by not adding the old element to namedItem
3149         when namedItem's size is 1.
3150
3151         Also renamed m_elementAliases to m_pastNamesMap along with related member functions.
3152
3153         No new tests are added since there should be no Web exposed behavioral change.
3154
3155         * bindings/js/JSHTMLFormElementCustom.cpp:
3156         (WebCore::JSHTMLFormElement::canGetItemsForName):
3157         * html/HTMLFormElement.cpp:
3158         (WebCore::HTMLFormElement::elementFromPastNamesMap):
3159         (WebCore::HTMLFormElement::addElementToPastNamesMap):
3160         (WebCore::HTMLFormElement::hasNamedElement):
3161         (WebCore::HTMLFormElement::getNamedElements):
3162         * html/HTMLFormElement.h:
3163
3164 2013-08-25  Andreas Kling  <akling@apple.com>
3165
3166         RenderLayerBacking::renderer() should return a reference.
3167         <https://webkit.org/b/120280>
3168
3169         Reviewed by Anders Carlsson.
3170
3171         It's just a forwarding call to RenderLayer::renderer() which already returns a reference.
3172
3173 2013-08-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3174
3175         Add toSVGMissingGlyphElement(), and use it.
3176         https://bugs.webkit.org/show_bug.cgi?id=120197
3177
3178         Reviewed by Andreas Kling.
3179
3180         As a step to clean-up static_cast<SVGXXX>, toSVGMissingGlyphElement() is added to clean-up
3181         static_cast<SVGMissingGlyphElement*>.
3182
3183         * svg/SVGFontElement.cpp:
3184         (WebCore::SVGFontElement::firstMissingGlyphElement):
3185         (WebCore::SVGFontElement::ensureGlyphCache):
3186         * svg/SVGMissingGlyphElement.h:
3187         (WebCore::toSVGMissingGlyphElement):
3188
3189 2013-08-25  Andreas Kling  <akling@apple.com>
3190
3191         RenderLayer::renderer() should return a reference.
3192         <https://webkit.org/b/120276>
3193
3194         Reviewed by Anders Carlsson.
3195
3196         RenderLayer is always created with a renderer, so make renderer() (and m_renderer) references.
3197         Nuked an assortment of useless null checks.
3198
3199 2013-08-25  Antti Koivisto  <antti@apple.com>
3200
3201         Element child and descendant iterators
3202         https://bugs.webkit.org/show_bug.cgi?id=120248
3203
3204         Reviewed by Sam Weinig and Andreas Kling.
3205
3206         Add iterators for Element children and descendants.
3207         
3208         To iterate over element children:
3209         
3210         #include "ChildIterator.h"
3211         
3212         for (auto it = elementChildren(this).begin(), end = elementChildren(this).end(); it != end; ++it) {
3213             Element& element = *it;
3214             ...
3215
3216         for (auto it = childrenOfType<HTMLAreaElement>(this).begin(), end = childrenOfType<HTMLAreaElement>(this).end(); it != end; ++it) {
3217             HTMLAreaElement& area = *it;
3218             ...
3219
3220         To iteratate over element descendants in pre-order:
3221         
3222         #include "DescendantIterator.h"
3223         
3224         for (auto it = elementDescendants(this).begin(), end = elementDescendants(this).end(); it != end; ++it) {
3225             Element& element = *it;
3226             ...
3227
3228         for (auto it = descendantsOfType<HTMLAreaElement>(this).begin(), end = descendantsOfType<HTMLAreaElement>(this).end(); it != end; ++it) {
3229             HTMLAreaElement& area = *it;
3230             ...
3231             
3232         The iterators assert against DOM mutations and event dispatch while iterating in debug builds.
3233             
3234         They are compatible with C++11 range-based for loops. In the future we can use
3235         
3236         for (auto& element : elementChildren(this))
3237             ...
3238
3239         etc.
3240         
3241         The patch all uses the new iterators in a few places.
3242
3243         * WebCore.xcodeproj/project.pbxproj:
3244         * accessibility/AccessibilityNodeObject.cpp:
3245         (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
3246         (WebCore::siblingWithAriaRole):
3247         * accessibility/AccessibilityRenderObject.cpp:
3248         * accessibility/AccessibilityTable.cpp:
3249         (WebCore::AccessibilityTable::isDataTable):
3250         * dom/ChildIterator.h: Added.
3251         (WebCore::ChildIterator::operator*):
3252         (WebCore::ChildIterator::operator->):
3253         (WebCore::::ChildIterator):
3254         (WebCore::::operator):
3255         (WebCore::=):
3256         (WebCore::::ChildIteratorAdapter):
3257         (WebCore::::begin):
3258         (WebCore::::end):
3259         (WebCore::elementChildren):
3260         (WebCore::childrenOfType):
3261         * dom/DescendantIterator.h: Added.
3262         (WebCore::DescendantIterator::operator*):
3263         (WebCore::DescendantIterator::operator->):
3264         (WebCore::::DescendantIterator):
3265         (WebCore::::operator):
3266         (WebCore::=):
3267         (WebCore::::DescendantIteratorAdapter):
3268         (WebCore::::begin):
3269         (WebCore::::end):
3270         (WebCore::elementDescendants):
3271         (WebCore::descendantsOfType):
3272         * dom/Document.cpp:
3273         (WebCore::Document::buildAccessKeyMap):
3274         (WebCore::Document::childrenChanged):
3275         (WebCore::Document::attach):
3276         (WebCore::Document::detach):
3277         * editing/ApplyStyleCommand.cpp:
3278         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
3279         * editing/markup.cpp:
3280         (WebCore::completeURLs):
3281         * html/HTMLMapElement.cpp:
3282         (WebCore::HTMLMapElement::mapMouseEvent):
3283         * html/HTMLMediaElement.cpp:
3284         (WebCore::HTMLMediaElement::selectMediaResource):
3285         (WebCore::HTMLMediaElement::textTrackModeChanged):
3286
3287 2013-08-25  Andreas Kling  <akling@apple.com>
3288
3289         RenderObject::document() should return a reference.
3290         <https://webkit.org/b/120272>
3291
3292         Reviewed by Antti Koivisto.
3293
3294         There's always a Document. We were allocated in someone's arena, after all.
3295         Various null checks and assertions neutralized.
3296
3297 2013-08-25  David Kilzer  <ddkilzer@apple.com>
3298
3299         BUILD FIX (r154578): Return Vector<String>() from Pasteboard::types() for iOS
3300
3301         * platform/ios/PasteboardIOS.mm:
3302         (WebCore::Pasteboard::types): Return Vector<String>() instead of
3303         ListHashSet<String>() after r154578.
3304
3305 2013-08-25  Darin Adler  <darin@apple.com>
3306
3307         Make JavaScript binding for Clipboard::types more normal
3308         https://bugs.webkit.org/show_bug.cgi?id=120271
3309
3310         Reviewed by Anders Carlsson.
3311
3312         * bindings/js/JSClipboardCustom.cpp:
3313         (WebCore::JSClipboard::types): Make a simple custom binding. Only needed because
3314         there is a special value, null, this can return.
3315
3316         * dom/Clipboard.cpp:
3317         (WebCore::Clipboard::types): Return Vector<String> instead of ListHashSet<String>.
3318         * dom/Clipboard.h: Ditto.
3319         * platform/Pasteboard.h: Ditto.
3320         * platform/blackberry/PasteboardBlackBerry.cpp:
3321         (WebCore::Pasteboard::types): Ditto.
3322         * platform/efl/PasteboardEfl.cpp:
3323         (WebCore::Pasteboard::types): Ditto.
3324         * platform/gtk/PasteboardGtk.cpp:
3325         (WebCore::Pasteboard::types): Ditto.
3326         * platform/ios/PasteboardIOS.mm:
3327         (WebCore::Pasteboard::types): Ditto.
3328         * platform/mac/PasteboardMac.mm:
3329         (WebCore::Pasteboard::types): Ditto.
3330         * platform/qt/PasteboardQt.cpp:
3331         (WebCore::Pasteboard::types): Ditto.
3332         * platform/win/PasteboardWin.cpp:
3333         (WebCore::Pasteboard::types): Ditto.
3334
3335 2013-08-25  David Kilzer  <ddkilzer@apple.com>
3336
3337         Unreviewed rollout of r154571. Broke internal iOS build.
3338
3339         Reopened: No need for clearTimers function in Frame
3340         https://bugs.webkit.org/show_bug.cgi?id=120265
3341
3342         * history/CachedFrame.cpp:
3343         (WebCore::CachedFrame::CachedFrame):
3344         (WebCore::CachedFrame::destroy):
3345         * page/Frame.cpp:
3346         (WebCore::Frame::clearTimers):
3347         * page/Frame.h:
3348
3349 2013-08-25  Darin Adler  <darin@apple.com>
3350
3351         No need for hasData in Clipboard
3352         https://bugs.webkit.org/show_bug.cgi?id=120269
3353
3354         Reviewed by Andreas Kling.
3355
3356         This simple forwarder does not belong in the Clipboard class.
3357         The drag code that uses it already works directly with Pasteboard.
3358
3359         * dom/Clipboard.cpp: Removed hasData.
3360         * dom/Clipboard.h: Ditto.
3361
3362         * page/DragController.cpp:
3363         (WebCore::DragController::startDrag): Call through the pasteboard.
3364
3365 2013-08-25  Darin Adler  <darin@apple.com>
3366
3367         No need for documentTypeString function in Frame
3368         https://bugs.webkit.org/show_bug.cgi?id=120262
3369
3370         Reviewed by Andreas Kling.
3371
3372         * WebCore.exp.in: Removed export of Frame::documentTypeString.
3373
3374         * editing/markup.cpp:
3375         (WebCore::documentTypeString): Added. Replaces the old Frame member function.
3376         Makes more sense to have this here since it is both called by and calls code
3377         in this file; somehow this function was left behind.
3378         (WebCore::createFullMarkup): Changed to call the new function.
3379         * editing/markup.h: Added documentTypeString function. Has to be exported
3380         because LegacyWebArchive uses it; might be worth fixing that later.
3381         * loader/archive/cf/LegacyWebArchive.cpp:
3382         (WebCore::LegacyWebArchive::create): Changed to call the new function.
3383         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
3384
3385         * page/Frame.cpp: Removed Frame::documentTypeString.
3386         * page/Frame.h: Ditto.
3387
3388 2013-08-25  Darin Adler  <darin@apple.com>
3389
3390         Clipboard is in DOM directory, but ClipboardMac is in platform directory
3391         https://bugs.webkit.org/show_bug.cgi?id=120267
3392
3393         Reviewed by Andreas Kling.
3394
3395         This file is almost gone; has just one function in it. Move it for now, and later
3396         we can delete it entirely.
3397
3398         * WebCore.xcodeproj/project.pbxproj: Updated for new file location.
3399         * dom/ClipboardMac.mm: Moved from Source/WebCore/platform/mac/ClipboardMac.mm.
3400
3401 2013-08-25  Darin Adler  <darin@apple.com>
3402
3403         No need for notifyChromeClientWheelEventHandlerCountChanged in Frame
3404         https://bugs.webkit.org/show_bug.cgi?id=120264
3405
3406         Reviewed by Andreas Kling.
3407
3408         * dom/Document.cpp:
3409         (WebCore::Document::createRenderTree): Renamed attach to this.
3410         This made it practical to remove a comment that says the same thing and
3411         also helps make the purpose of the function considerably more clear,
3412         although the relationship to the attached and detach functions is now
3413         less clear; should fix that soon.
3414         (WebCore::pageWheelEventHandlerCountChanged): Added. Contains the code
3415         from Frame::notifyChromeClientWheelEventHandlerCountChanged, minus some
3416         assertions that were only needed because the function was passed a frame
3417         rather than a page.
3418         (WebCore::Document::didBecomeCurrentDocumentInFrame): Added. Contains
3419         most of the code from Frame::setDocument. Looking at before and after,
3420         we can see that most of the work is within the document class and matches
3421         up with other code already in this class. Added FIXMEs about many problems
3422         spotted in the code.
3423         (WebCore::Document::topDocument): Added FIXME and tweaked formatting.
3424         (WebCore::wheelEventHandlerCountChanged): Moved the call to the
3425         pageWheelEventHandlerCountChanged in here from the two call sites.
3426         Also added a FIXME.
3427         (WebCore::Document::didAddWheelEventHandler): Removed the call to
3428         notifyChromeClientWheelEventHandlerCountChanged, since that's now handled
3429         inside wheelEventHandlerCountChanged.
3430         (WebCore::Document::didRemoveWheelEventHandler): Ditto.
3431
3432         * dom/Document.h: Renamed attach to createRenderTree, made it private,
3433         and added a new didBecomeCurrentDocumentInFrame function.
3434
3435         * loader/PlaceholderDocument.cpp:
3436         (WebCore::PlaceholderDocument::createRenderTree): Renamed from attach.
3437         * loader/PlaceholderDocument.h: Did the rename and made the function a
3438         private override.
3439
3440         * page/Frame.cpp:
3441         (WebCore::Frame::setDocument): Moved most of this function out of here
3442         into the new Document::didBecomeCurrentDocumentInFrame function.
3443         Also deleted notifyChromeClientWheelEventHandlerCountChanged.
3444
3445         * page/Frame.h: Deleted notifyChromeClientWheelEventHandlerCountChanged.
3446
3447 2013-08-25  Darin Adler  <darin@apple.com>
3448
3449         No need for dispatchVisibilityStateChangeEvent function
3450         https://bugs.webkit.org/show_bug.cgi?id=120261
3451
3452         Reviewed by Andreas Kling.
3453
3454         * dom/Document.cpp: Removed dispatchVisibilityStateChangeEvent.
3455         * dom/Document.h: Ditto.
3456         * page/Frame.cpp: Ditto.
3457         * page/Frame.h: Ditto.
3458
3459         * page/Page.cpp:
3460         (WebCore::Page::setVisibilityState): Put all the logic for dispatching the
3461         visibility state change event. Nothing here requires any special information
3462         about the internals of Frame or Document.
3463
3464 2013-08-25  Darin Adler  <darin@apple.com>
3465
3466         No need for clearTimers function in Frame
3467         https://bugs.webkit.org/show_bug.cgi?id=120265
3468
3469         Reviewed by Andreas Kling.
3470
3471         * history/CachedFrame.cpp:
3472         (WebCore::clearTimers): Added. Moved here from Frame.
3473         (WebCore::CachedFrame::CachedFrame): Call above function.
3474         (WebCore::CachedFrame::destroy): Ditto.
3475
3476         * page/Frame.cpp: Removed the two clearTimers functions.
3477         * page/Frame.h: Ditto.
3478
3479 2013-08-24  Ryuan Choi  <ryuan.choi@samsung.com>
3480
3481         Unreviewed build fix after r154560