32457c0caae6bad82f745f2de52d0943adddefa7
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-08-24  Andreas Kling  <akling@apple.com>
2
3         Let Document keep its RenderView during render tree detach.
4         <https://webkit.org/b/120233>
5
6         Reviewed by Antti Koivisto.
7
8         Instead of having "Document::renderer() == NULL" signify that the render tree is being
9         torn down, give Document an explicit flag for this instead.
10
11         This way, we can keep Document's RenderView in place during tree detach.
12
13         * dom/Document.cpp:
14         (WebCore::Document::Document):
15         (WebCore::Document::detach):
16         * dom/Document.h:
17         (WebCore::Document::renderTreeBeingDestroyed):
18         * rendering/RenderObject.h:
19         (WebCore::RenderObject::documentBeingDestroyed):
20
21 2013-08-24  Antti Koivisto  <antti@apple.com>
22
23         Tighten before/after pseudo element accessors
24         https://bugs.webkit.org/show_bug.cgi?id=120204
25
26         Reviewed by Andreas Kling.
27
28         We have generic looking Element::pseudoElement(PseudoID) which only returns before/after pseudo elements.
29         
30         Switch to Element::before/afterPseudoElement(), similarly for setters.
31
32         * WebCore.exp.in:
33         * css/CSSComputedStyleDeclaration.cpp:
34         (WebCore::ComputedStyleExtractor::styledNode):
35         * dom/Element.cpp:
36         (WebCore::Element::~Element):
37         (WebCore::beforeOrAfterPseudeoElement):
38         (WebCore::Element::computedStyle):
39         (WebCore::Element::updatePseudoElement):
40         (WebCore::Element::createPseudoElementIfNeeded):
41         (WebCore::Element::updateBeforePseudoElement):
42         (WebCore::Element::updateAfterPseudoElement):
43         (WebCore::Element::beforePseudoElement):
44         (WebCore::Element::afterPseudoElement):
45         (WebCore::Element::setBeforePseudoElement):
46         (WebCore::Element::setAfterPseudoElement):
47         (WebCore::disconnectPseudoElement):
48         (WebCore::Element::clearBeforePseudoElement):
49         (WebCore::Element::clearAfterPseudoElement):
50         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
51         * dom/Element.h:
52         * dom/ElementRareData.h:
53         (WebCore::ElementRareData::beforePseudoElement):
54         (WebCore::ElementRareData::afterPseudoElement):
55         (WebCore::ElementRareData::hasPseudoElements):
56         (WebCore::ElementRareData::~ElementRareData):
57         (WebCore::ElementRareData::clearBeforePseudoElement):
58         (WebCore::ElementRareData::clearAfterPseudoElement):
59         (WebCore::ElementRareData::setBeforePseudoElement):
60         (WebCore::ElementRareData::setAfterPseudoElement):
61         
62             Move detach logic to Element. ElementRareData should not implement semantics.
63
64         * dom/Node.cpp:
65         (WebCore::Node::pseudoAwarePreviousSibling):
66         (WebCore::Node::pseudoAwareNextSibling):
67         (WebCore::Node::pseudoAwareFirstChild):
68         (WebCore::Node::pseudoAwareLastChild):
69         * dom/NodeRenderingTraversal.cpp:
70         (WebCore::NodeRenderingTraversal::nextSiblingSlow):
71         (WebCore::NodeRenderingTraversal::previousSiblingSlow):
72         * rendering/RenderTreeAsText.cpp:
73         (WebCore::writeCounterValuesFromChildren):
74         (WebCore::counterValueForElement):
75         * style/StyleResolveTree.cpp:
76         (WebCore::Style::attachRenderTree):
77         (WebCore::Style::resolveTree):
78         * testing/Internals.cpp:
79         (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
80         (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
81
82 2013-08-23  Simon Fraser  <simon.fraser@apple.com>
83
84         Improve scrolling behavior in iTunes
85         https://bugs.webkit.org/show_bug.cgi?id=120241
86         <rdar://problem/14825344>
87
88         Reviewed by Sam Weinig.
89
90         When vertically scrolling a page with horizontally scrollable overflow areas,
91         vertical scroll gestures would be interrupted when wheel events with non-zero
92         X deltas were intercepted by the overflow areas.
93         
94         Fix by storing a small history of wheel events deltas and using
95         it to determine of the scroll gesture is primarily vertical or horizontal.
96         When this is detected, avoid dispatching scroll events on the on the
97         non-dominant axis.
98         
99         Currently this behavior is conditionalized to only apply in iTunes.
100
101         * page/EventHandler.cpp:
102         (WebCore::EventHandler::EventHandler):
103         (WebCore::EventHandler::recordWheelEventDelta):
104         (WebCore::deltaIsPredominantlyVertical):
105         (WebCore::EventHandler::dominantScrollGestureDirection):
106         (WebCore::EventHandler::handleWheelEvent):
107         (WebCore::EventHandler::defaultWheelEventHandler):
108         * page/EventHandler.h:
109         * platform/RuntimeApplicationChecks.cpp:
110         (WebCore::applicationIsITunes):
111         * platform/RuntimeApplicationChecks.h:
112
113 2013-08-23  Pratik Solanki  <psolanki@apple.com>
114
115         MediaQuery::expressions() should return a reference
116         <https://webkit.org/b/120215>
117
118         Reviewed by Anders Carlsson.
119
120         m_expressions is never NULL so we can just return a reference.
121
122         * css/MediaList.cpp:
123         (WebCore::reportMediaQueryWarningIfNeeded):
124         * css/MediaQuery.cpp:
125         (WebCore::MediaQuery::MediaQuery):
126         * css/MediaQuery.h:
127         (WebCore::MediaQuery::expressions):
128         * css/MediaQueryEvaluator.cpp:
129         (WebCore::MediaQueryEvaluator::eval):
130
131 2013-08-23  Ryosuke Niwa  <rniwa@webkit.org>
132
133         Build fix after r154515.
134
135         * dom/ElementTraversal.h:
136         (WebCore::Traversal<ElementType>::firstChild):
137         (WebCore::Traversal<ElementType>::lastChild):
138
139 2013-08-23  Andreas Kling  <akling@apple.com>
140
141         Simplify some Settings access where we have a Frame in reach.
142         <http://webkit.org/b/120239>
143
144         Reviewed by Anders Carlsson.
145
146         In three cases where we can grab at a Frame, we can reach all the way to some Settings
147         without having to use pointers.
148
149         * loader/FrameLoader.cpp:
150         (WebCore::FrameLoader::didBeginDocument):
151         * rendering/RenderLayerCompositor.cpp:
152         (WebCore::RenderLayerCompositor::addToOverlapMap):
153         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
154
155 2013-08-23  Jer Noble  <jer.noble@apple.com>
156
157         REGRESSION (r150516): Media controls are messed up on right-to-left webpages
158         https://bugs.webkit.org/show_bug.cgi?id=120234
159
160         Reviewed by Dan Bernstein.
161
162         Test: media/video-rtl.html
163
164         Make the media control panel explicitly direction:ltr. The captions menu and captions
165         display are unaffected, so rtl content will continue to appear rtl there.
166
167         * css/mediaControls.css:
168         (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
169
170 2013-08-23  Beth Dakin  <bdakin@apple.com>
171
172         REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
173         Adobe Reader
174         https://bugs.webkit.org/show_bug.cgi?id=120240
175         -and corresponding-
176         <rdar://problem/14634453>
177
178         Reviewed by Anders Carlsson.
179
180         This patch makes it so that we don’t use the infinite rect for the PDF context, 
181         and it adds WebCoreSystemInterface API to find out if the current content is the 
182         PDF context. 
183
184         * WebCore.exp.in:
185         * platform/graphics/cg/GraphicsContextCG.cpp:
186         (WebCore::GraphicsContext::clipOut):
187         * platform/mac/WebCoreSystemInterface.h:
188         * platform/mac/WebCoreSystemInterface.mm:
189
190 2013-08-23  Eric Carlson  <eric.carlson@apple.com>
191
192         [Mac] some track language tags are not recognized
193         https://bugs.webkit.org/show_bug.cgi?id=119643
194
195         Reviewed by Jere Noble.
196
197         No new tests, existing tests updated.
198
199         * html/HTMLMediaElement.cpp:
200         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings
201             if possible.
202         (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences
203             say captions should be disabled. Don't disable an already visible track if we don't find
204             a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage ->
205             m_subtitleTrackLanguage.
206         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary
207             audio track changes, only kick off a text track recalc if caption preference are set to "automatic".
208         * html/HTMLMediaElement.h:
209
210         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
211         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged
212             and m_delayCharacteristicsChangedNotification.
213         (WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged.
214         (WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto.
215         (WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto.
216         (WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce 
217             calls to the media player when we know several characteristics may change.
218         (WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or
219             disable notification delay.
220         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
221
222         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
223         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
224             a track may have changed so we may have a new language.
225         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
226             if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
227             QuickTime language code.
228
229 2013-08-23  Andreas Kling  <akling@apple.com>
230
231         RenderView::compositor() should return a reference.
232         <https://webkit.org/b/120217>
233
234         Reviewed by Beth Dakin.
235
236         The RenderLayerCompositor is lazily constructed by compositor() and never returns null.
237
238 2013-08-23  Yoav Weiss  <yoav@yoav.ws>
239
240         Fix srcset's image candidate algorithm when DPR exceeds all candidates
241         https://bugs.webkit.org/show_bug.cgi?id=120168
242
243         When the DPR exceeded the 'x' qualifier of all image candidates, none was chosen.
244
245         From the srcset spec: "If there are any entries in candidates that have an associated pixel density that is less than a
246         user-agent-defined value giving the nominal pixel density of the display, then remove them, unless that would remove all the
247         entries, in which case remove only the entries whose associated pixel density is less than the greatest such pixel density."
248
249         Fixed by returning the last one in the list of candidates sorted by their qualifier, in case none of them is equal or greater than
250         DPR.
251         
252         Reviewed by Andreas Kling.
253
254         Test: fast/hidpi/image-srcset-fraction.html
255
256         * html/parser/HTMLParserIdioms.cpp:
257         (WebCore::bestFitSourceForImageAttributes):
258
259 2013-08-23  Chris Fleizach  <cfleizach@apple.com>
260
261         <https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as aria-expanded="false" (AXExpanded = NO)
262
263         Reviewed by Darin Adler.
264
265         Don't support the ARIA expanded attribute unless the value is one of the defined ARIA values (true/false).
266
267         Test: platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html
268
269         * accessibility/AccessibilityObject.cpp:
270         (WebCore::AccessibilityObject::supportsARIAExpanded):
271
272 2013-08-17  Darin Adler  <darin@apple.com>
273
274         <https://webkit.org/b/119945> Some cleanup for PasteboardIOS
275
276         Reviewed by Andreas Kling.
277
278         * platform/ios/PasteboardIOS.mm:
279         (WebCore::Pasteboard::setFrame): Moved this function up near the
280         create functions and constructors.
281         (WebCore::documentFragmentWithRTF): Tweaked formatting.
282         (WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
283         Ditto.
284         (WebCore::utiTypeFromCocoaType): Changed to use early return and removed
285         an unneeded local variable.
286         (WebCore::cocoaTypeFromHTMLClipboardType): Renamed the quaint qType and
287         pbType local variables, and tweaked formatting.
288         (WebCore::Pasteboard::clear): Tweaked comment.
289         (WebCore::Pasteboard::readString): Tweaked formatting.
290         (WebCore::addHTMLClipboardTypesForCocoaType): Tweaked formatting.
291         (WebCore::Pasteboard::writeString): Streamlined logic and tweaked formatting
292         (WebCore::Pasteboard::types): Renamed pbType to just type.
293
294 2013-08-23  Bem Jones-Bey  <bjonesbe@adobe.com>
295
296         Attempt to make it more clear what FloatIntervalSearchAdaptor::collectIfNeeded is doing
297         https://bugs.webkit.org/show_bug.cgi?id=119816
298
299         Reviewed by David Hyatt.
300
301         This is a port from Blink of
302         https://src.chromium.org/viewvc/blink?revision=155885&view=revision
303         Original Patch by Eric Seidel
304
305         Original comments:
306
307         "It seemed to me that template specifications would be clearer than an
308         if.  They also allow for compile-time error checking were a 3rd type
309         of float to come into existance in CSS4. :p
310
311         For any unfamiliar with this method, this the object used for
312         performing a search on a RedBlackTree in WTF.
313
314         We create one of these adaptors, specifying that we want to search for
315         values in a specific (logical) Y interval, and this adaptor is called
316         back for any values in the RBTree cooresponding to that interval
317         range.
318
319         The job of this adaptor is to collect the various values we care
320         about, including the left or right-most offset of the floats in that
321         Y-range as well as what the last (document order) float seen in that
322         range.
323
324         It also collects the remaining available height for the block but I'm
325         less clear on how that parameter is used."
326
327         Note that in addition to the original change, I have made the
328         updateOffsetIfNeeded and rangesIntersect methods inline, as this was
329         shown to be a performance win in
330         https://src.chromium.org/viewvc/blink?revision=156064&view=revision
331         and it seemed a rather trivial change to be subject to a separate
332         patch when porting.
333
334         No new tests, no behavior change.
335
336         * rendering/RenderBlock.cpp:
337         (WebCore::::updateOffsetIfNeeded):
338         (WebCore::::collectIfNeeded):
339         * rendering/RenderBlock.h:
340
341 2013-08-23  David Kilzer  <ddkilzer@apple.com>
342
343         WebCore fails to link due to changes in Objective-C++ ABI in trunk clang
344         <http://webkit.org/b/120183>
345         <rdar://problem/14764114>
346
347         Reviewed by Eric Carlson.
348
349         The trunk version of clang made an ABI change for Objective-C++
350         parameters that caused WebCore to fail to link.  The short-term
351         fix is to change the parameter type from id<protocol> to just id
352         and add an ASSERT that the parameter still conforms to the
353         protocol.
354
355         * platform/DragData.h:
356         (DragDataRef): Change typedef from id<NSDragInfo> to id.
357         * platform/mac/DragDataMac.mm:
358         (WebCore::DragData::DragData): Add ASSERT that checks that the
359         DragDataRef object implements the NSDragInfo protocol.
360
361 2013-08-23  Andreas Kling  <akling@apple.com>
362
363         RenderLayerCompositor::m_renderView should be a reference.
364         <https://webkit.org/b/120210>
365
366         Reviewed by Antti Koivisto.
367
368         The RenderLayerCompositor is always created by a RenderView passing itself to the constructor.
369         By making m_renderView a reference, we flush out some unnecessary null checks.
370         We also gain a pointer-free path to Settings through m_renderView.frameView().frame().settings()
371         so we don't have to make those blocks conditional anymore, reducing ambiguity.
372
373         * rendering/RenderLayerCompositor.cpp:
374         * rendering/RenderLayerCompositor.h:
375         * rendering/RenderView.cpp:
376         (WebCore::RenderView::compositor):
377
378 2013-08-23  Andreas Kling  <akling@apple.com>
379
380         RenderView::frameView() should return a reference.
381         <https://webkit.org/b/120208>
382
383         Reviewed by Antti Koivisto.
384
385         A RenderView should always have a corresponding FrameView, so make frameView()
386         return a reference. Also remove a myriad of now-impossible null checks.
387
388 2013-08-23  Allan Sandfeld Jensen  <allan.jensen@digia.com>
389
390         REGRESSION(r153939) Fix typo in Qt build-files
391
392         Reviewed by Antti Koivisto.
393
394         Fix simple typo in Target.pri introduced in r153939.
395
396         * Target.pri:
397
398 2013-08-23  Antti Koivisto  <antti@apple.com>
399
400         <https://webkit.org/b/120166> Add Traversal<ElementType> template
401
402         Reviewed by Andreas Kling.
403
404         It is common to traverse through a subtree looking for elements of specific type and then casting to the type. This pattern can be generalized.
405         
406         This patch adds a new Traversal<typename ElementType> template. It works like ElementTraversal except that the traversal is limited to the specified type.
407         The patch also uses the template in a bunch of applicable places.
408
409         * WebCore.exp.in:
410         * accessibility/AccessibilityRenderObject.cpp:
411         (WebCore::AccessibilityRenderObject::addImageMapChildren):
412         * dom/Document.cpp:
413         (WebCore::Document::removeTitle):
414         (WebCore::Document::updateBaseURL):
415         (WebCore::Document::processBaseElement):
416         * dom/Element.h:
417         * dom/ElementTraversal.h:
418         (WebCore::::firstChildTemplate):
419         (WebCore::::firstWithinTemplate):
420         (WebCore::::lastChildTemplate):
421         (WebCore::::lastWithinTemplate):
422         (WebCore::::nextTemplate):
423         (WebCore::::previousTemplate):
424         (WebCore::::nextSiblingTemplate):
425         (WebCore::::previousSiblingTemplate):
426         (WebCore::::nextSkippingChildrenTemplate):
427         (WebCore::::firstChild):
428         (WebCore::::lastChild):
429         (WebCore::::firstWithin):
430         (WebCore::::lastWithin):
431         (WebCore::::next):
432         (WebCore::::previous):
433         (WebCore::::nextSibling):
434         (WebCore::::previousSibling):
435         (WebCore::::nextSkippingChildren):
436         (WebCore::ElementTraversal::previousIncludingPseudo):
437         (WebCore::ElementTraversal::nextIncludingPseudo):
438         (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
439         (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
440         * dom/Node.cpp:
441         (WebCore::Node::numberOfScopedHTMLStyleChildren):
442         * dom/NodeIterator.cpp:
443         (WebCore::NodeIterator::NodeIterator):
444         * dom/NodeIterator.h:
445         * dom/Traversal.cpp:
446         (WebCore::NodeIteratorBase::NodeIteratorBase):
447         (WebCore::NodeIteratorBase::acceptNode):
448         * dom/Traversal.h:
449         
450             Renamed existing class called Traversal to less generic NodeIteratorBase.
451
452         * dom/TreeScope.cpp:
453         (WebCore::TreeScope::labelElementForId):
454         (WebCore::TreeScope::findAnchor):
455         * dom/TreeWalker.cpp:
456         (WebCore::TreeWalker::TreeWalker):
457         * dom/TreeWalker.h:
458         * editing/FrameSelection.cpp:
459         (WebCore::scanForForm):
460         * editing/markup.cpp:
461         (WebCore::createContextualFragment):
462         * html/HTMLAnchorElement.h:
463         (WebCore::isHTMLAnchorElement):
464         (WebCore::HTMLAnchorElement):
465         * html/HTMLAreaElement.h:
466         (WebCore::isHTMLAreaElement):
467         (WebCore::HTMLAreaElement):
468         * html/HTMLBaseElement.h:
469         (WebCore::isHTMLBaseElement):
470         (WebCore::HTMLBaseElement):
471         * html/HTMLElement.h:
472         (WebCore::HTMLElement):
473         * html/HTMLFieldSetElement.cpp:
474         (WebCore::HTMLFieldSetElement::invalidateDisabledStateUnder):
475         (WebCore::HTMLFieldSetElement::childrenChanged):
476         (WebCore::HTMLFieldSetElement::legend):
477         * html/HTMLFormControlElement.h:
478         (WebCore::toHTMLFormControlElement):
479         (WebCore::HTMLFormControlElement):
480         * html/HTMLLabelElement.cpp:
481         (WebCore::nodeAsSupportedLabelableElement):
482         (WebCore::HTMLLabelElement::control):
483         * html/HTMLLabelElement.h:
484         (WebCore::isHTMLLabelElement):
485         (WebCore::HTMLLabelElement):
486         * html/HTMLLegendElement.h:
487         (WebCore::isHTMLLegendElement):
488         (WebCore::HTMLLegendElement):
489         * html/HTMLMapElement.cpp:
490         (WebCore::HTMLMapElement::mapMouseEvent):
491         * html/HTMLMediaElement.cpp:
492         (WebCore::HTMLMediaElement::finishParsingChildren):
493         * html/HTMLStyleElement.h:
494         (WebCore::isHTMLStyleElement):
495         (WebCore::HTMLStyleElement):
496         * html/HTMLTitleElement.h:
497         (WebCore::HTMLTitleElement):
498         * html/HTMLTrackElement.h:
499         (WebCore::isHTMLTrackElement):
500         (WebCore::HTMLTrackElement):
501         * html/LabelableElement.h:
502         (WebCore::isLabelableElement):
503         (WebCore::LabelableElement):
504         * rendering/FilterEffectRenderer.cpp:
505         (WebCore::FilterEffectRenderer::buildReferenceFilter):
506         * svg/SVGElement.h:
507         (WebCore::SVGElement):
508         * svg/SVGForeignObjectElement.h:
509         (WebCore::isSVGForeignObjectElement):
510         (WebCore::SVGForeignObjectElement):
511         * svg/SVGSVGElement.cpp:
512         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
513         (WebCore::SVGSVGElement::getElementById):
514         * svg/SVGStyledElement.cpp:
515         (WebCore::SVGStyledElement::title):
516         * svg/SVGTitleElement.h:
517         (WebCore::SVGTitleElement):
518         * svg/animation/SMILTimeContainer.cpp:
519         (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
520         * svg/animation/SVGSMILElement.cpp:
521         (WebCore::SVGSMILElement::isSMILElement):
522         * svg/animation/SVGSMILElement.h:
523         (WebCore::SVGSMILElement):
524         * svg/graphics/SVGImage.cpp:
525         (WebCore::SVGImage::hasSingleSecurityOrigin):
526
527 2013-08-23  Arpita Bahuguna  <a.bah@samsung.com>
528
529         <br> does not get deleted when inlined after some non-textual content.
530         https://bugs.webkit.org/show_bug.cgi?id=120006
531
532         Reviewed by Ryosuke Niwa.
533
534         deleteSelectionCommand does not handle the case when a <br> element is
535         inlined after some non-textual content (input controls, image etc.).
536
537         When doing a back-delete at the start of a line following such a <br>
538         the two contiguous lines should merge and the <br> should get deleted.
539         Currently, even though the <br> is deleted, another placeholder <br>
540         is incorrectly inserted at the same point, thus effectively there is no
541         change.
542
543         We are incorrectly computing the inline <br> to be at the start of an
544         empty line even though the line is not empty.
545
546         Test: editing/deleting/delete-inline-br.html
547
548         * editing/DeleteSelectionCommand.cpp:
549         (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
550         Adding a check to verify that the inline <br> is not on an empty line
551         if the end node is not a <br> element itself and it's previous sibling
552         is the start <br> element.
553
554         Basically we check whether there is another node (end node) following
555         the <br>, that the node is not a <br> itself, and that the end node's
556         previous node is the start <br>.
557
558 2013-08-23  Renata Hodovan  <reni@webkit.org>
559
560         Missing null-check in HTMLFormElement::rendererIsNeeded()
561         https://bugs.webkit.org/show_bug.cgi?id=120159
562
563         Reviewed by Ryosuke Niwa.
564
565         Null-check parentRenderer in HTMLFormElement::rendererIsNeeded()
566         and early return.
567
568         Test: fast/forms/missing-parentrenderer-crash.html
569
570         * html/HTMLFormElement.cpp:
571         (WebCore::HTMLFormElement::rendererIsNeeded):
572
573 2013-08-23  Zalan Bujtas  <zalan@apple.com>
574
575         MathML: ASSERTION FAILED: !isPreferredLogicalHeightDirty() in RenderMathMLBlock::preferredLogicalHeight() const
576         https://bugs.webkit.org/show_bug.cgi?id=120157
577
578         Reviewed by Antti Koivisto.
579
580         RenderListMarker needs to be inserted to the render tree before
581         we start computing the preferred logical widths for the associated
582         RenderListItem.
583
584         Test: mathml/mn-as-list-item-assert.html
585
586         * rendering/RenderListItem.cpp:
587         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
588         (WebCore::RenderListItem::layout):
589         (WebCore::RenderListItem::computePreferredLogicalWidths):
590         * rendering/RenderListItem.h:
591
592 2013-08-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
593
594         Introduce toSVGLinearGradientElement(), and use it
595         https://bugs.webkit.org/show_bug.cgi?id=120154
596
597         Reviewed by Andreas Kling.
598
599         As a step to clean-up static_cast<SVGXXX>, toSVGLinearGradientElement() is added to clean-up
600         static_cast<SVGLinearGradientElement*>.
601
602         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
603         (WebCore::RenderSVGResourceLinearGradient::collectGradientAttributes):
604         * rendering/svg/SVGRenderTreeAsText.cpp:
605         (WebCore::writeSVGResourceContainer):
606         * svg/SVGLinearGradientElement.cpp:
607         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
608         * svg/SVGLinearGradientElement.h:
609         (WebCore::toSVGLinearGradientElement):
610
611 2013-08-22  Simon Fraser  <simon.fraser@apple.com>
612
613         compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering
614         https://bugs.webkit.org/show_bug.cgi?id=119825
615
616         Reviewed by Tim Horton.
617         
618         r137526 and some earlier commits attempted to avoid unconditionally
619         repainting layers when their size changes, because this was causing
620         TiledBacking layers to repaint when the document size changed.
621         
622         However, the approach required that we have good information about
623         whether size changes require a repaint, which in some cases is hard
624         to determine, especially when RenderLayer changes affect our
625         decisions about which layers are composited.
626         
627         Fix by pushing the decision about whether to repaint on size change
628         into GraphicsLayer. The default is to repaint on size change,
629         but GraphicsLayer provides a function that can be overridden to
630         modify this behavior; GraphicsLayerCA does so to avoid repaints
631         when layers with TiledBackings get resized.
632
633         Test: compositing/repaint/repaint-on-layer-grouping-change.html
634
635         * WebCore.exp.in: WebKit2 needs GraphicsLayer::setSize, which is no longer inline.
636         * platform/graphics/GraphicsLayer.cpp:
637         (WebCore::GraphicsLayer::setOffsetFromRenderer):
638         (WebCore::GraphicsLayer::setSize):
639         * platform/graphics/GraphicsLayer.h:
640         (WebCore::GraphicsLayer::shouldRepaintOnSizeChange):
641         * platform/graphics/ca/GraphicsLayerCA.cpp:
642         (WebCore::GraphicsLayerCA::shouldRepaintOnSizeChange):
643         * platform/graphics/ca/GraphicsLayerCA.h:
644         * rendering/RenderLayerBacking.h: No longer need m_boundsConstrainedByClipping
645         * rendering/RenderLayerBacking.cpp:
646         (WebCore::RenderLayerBacking::RenderLayerBacking):
647         (WebCore::RenderLayerBacking::updateCompositedBounds):
648         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): setSize takes
649         care of repainting for us now, so we can remove all the conditional code.
650
651 2013-08-22  Simon Fraser  <simon.fraser@apple.com>
652
653         Repaint counters are sometimes not in the corner of the compositing layer
654         https://bugs.webkit.org/show_bug.cgi?id=120176
655
656         Reviewed by Beth Dakin.
657
658         Sometimes the repaint counters are not in the corner of the compositing layer;
659         they are either inset, or partially or entirely outside the layer.
660         
661         Fix by making sure that we restore the CGContext before drawing
662         the counter, since the WebCore code may have translated the CTM.
663         
664         The counter-painting code saves and restores the context itself,
665         so this is safe.
666
667         * platform/graphics/mac/WebLayer.mm:
668         (drawLayerContents):
669
670 2013-08-22  Tim Horton  <timothy_horton@apple.com>
671
672         Unavailable plug-in indicator text is one pixel too low
673         https://bugs.webkit.org/show_bug.cgi?id=120177
674         <rdar://problem/14811951>
675
676         Reviewed by Kevin Decker.
677
678         Move the unavailable plug-in indicator text up one pixel.
679
680         * rendering/RenderEmbeddedObject.cpp:
681         (WebCore::RenderEmbeddedObject::paintReplaced):
682
683 2013-08-22  Christophe Dumez  <ch.dumez@sisa.samsung.com>
684
685         [SVG2] Merge SVGStyledElement and SVGElement
686         https://bugs.webkit.org/show_bug.cgi?id=107386
687
688         Reviewed by Andreas Kling.
689
690         Merge SVGStyledElement into SVGElement to simplify the SVG inheritance
691         model and match the SVG2 specification:
692         https://svgwg.org/svg2-draft/single-page.html#types-InterfaceSVGElement
693
694         Test: svg/dom/svg2-inheritance.html
695
696         * CMakeLists.txt:
697         * DerivedSources.cpp:
698         * DerivedSources.make:
699         * DerivedSources.pri:
700         * GNUmakefile.list.am:
701         * Target.pri:
702         * WebCore.order:
703         * WebCore.vcxproj/WebCore.vcxproj:
704         * WebCore.vcxproj/WebCore.vcxproj.filters:
705         * WebCore.xcodeproj/project.pbxproj:
706         * accessibility/AccessibilityNodeObject.cpp:
707         (WebCore::AccessibilityNodeObject::alternativeText):
708         (WebCore::AccessibilityNodeObject::accessibilityDescription):
709         * css/SVGCSSStyleSelector.cpp:
710         * rendering/style/SVGRenderStyle.cpp:
711         * rendering/svg/RenderSVGContainer.cpp:
712         (WebCore::RenderSVGContainer::RenderSVGContainer):
713         * rendering/svg/RenderSVGContainer.h:
714         * rendering/svg/RenderSVGHiddenContainer.cpp:
715         (WebCore::RenderSVGHiddenContainer::RenderSVGHiddenContainer):
716         * rendering/svg/RenderSVGHiddenContainer.h:
717         * rendering/svg/RenderSVGModelObject.cpp:
718         (WebCore::RenderSVGModelObject::RenderSVGModelObject):
719         (WebCore::getElementCTM):
720         * rendering/svg/RenderSVGModelObject.h:
721         * rendering/svg/RenderSVGResourceClipper.cpp:
722         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
723         (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
724         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
725         * rendering/svg/RenderSVGResourceContainer.cpp:
726         (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
727         * rendering/svg/RenderSVGResourceContainer.h:
728         * rendering/svg/RenderSVGResourceFilter.cpp:
729         * rendering/svg/RenderSVGResourceFilterPrimitive.h:
730         * rendering/svg/RenderSVGResourceMarker.cpp:
731         * rendering/svg/RenderSVGResourceMarker.h:
732         * rendering/svg/RenderSVGResourceMasker.cpp:
733         (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
734         (WebCore::RenderSVGResourceMasker::calculateMaskContentRepaintRect):
735         * rendering/svg/RenderSVGResourcePattern.cpp:
736         (WebCore::RenderSVGResourcePattern::createTileImage):
737         * rendering/svg/RenderSVGRoot.cpp:
738         (WebCore::RenderSVGRoot::RenderSVGRoot):
739         * rendering/svg/RenderSVGRoot.h:
740         * rendering/svg/RenderSVGViewportContainer.cpp:
741         (WebCore::RenderSVGViewportContainer::RenderSVGViewportContainer):
742         * rendering/svg/RenderSVGViewportContainer.h:
743         * rendering/svg/SVGRenderSupport.cpp:
744         (WebCore::SVGRenderSupport::layoutChildren):
745         * rendering/svg/SVGRenderTreeAsText.cpp:
746         * rendering/svg/SVGResources.cpp:
747         (WebCore::registerPendingResource):
748         * rendering/svg/SVGResourcesCache.cpp:
749         * svg/SVGAElement.cpp:
750         (WebCore::SVGAElement::title):
751         * svg/SVGAllInOne.cpp:
752         * svg/SVGAltGlyphDefElement.h:
753         * svg/SVGAltGlyphItemElement.h:
754         * svg/SVGAnimateElement.cpp:
755         * svg/SVGAnimatedType.cpp:
756         (WebCore::SVGAnimatedType::valueAsString):
757         (WebCore::SVGAnimatedType::setValueAsString):
758         * svg/SVGAnimationElement.cpp:
759         (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty):
760         (WebCore::SVGAnimationElement::computeCSSPropertyValue):
761         (WebCore::SVGAnimationElement::adjustForInheritance):
762         (WebCore::inheritsFromProperty):
763         * svg/SVGComponentTransferFunctionElement.h:
764         * svg/SVGCursorElement.h:
765         * svg/SVGDescElement.cpp:
766         (WebCore::SVGDescElement::SVGDescElement):
767         * svg/SVGDescElement.h:
768         * svg/SVGDescElement.idl:
769         * svg/SVGElement.cpp:
770         (WebCore::mapAttributeToCSSProperty):
771         (WebCore::cssPropertyToTypeMap):
772         (WebCore::SVGElement::SVGElement):
773         (WebCore::SVGElement::~SVGElement):
774         (WebCore::SVGElement::removedFrom):
775         (WebCore::SVGElement::parseAttribute):
776         (WebCore::SVGElement::animatedPropertyTypeForAttribute):
777         (WebCore::collectInstancesForSVGElement):
778         (WebCore::SVGElement::isAnimatableAttribute):
779         (WebCore::SVGElement::title):
780         (WebCore::SVGElement::rendererIsNeeded):
781         (WebCore::SVGElement::cssPropertyIdForSVGAttributeName):
782         (WebCore::SVGElement::isAnimatableCSSProperty):
783         (WebCore::SVGElement::isPresentationAttribute):
784         (WebCore::SVGElement::collectStyleForPresentationAttribute):
785         (WebCore::SVGElement::isKnownAttribute):
786         (WebCore::SVGElement::svgAttributeChanged):
787         (WebCore::SVGElement::insertedInto):
788         (WebCore::SVGElement::buildPendingResourcesIfNeeded):
789         (WebCore::SVGElement::childrenChanged):
790         (WebCore::SVGElement::getPresentationAttribute):
791         (WebCore::SVGElement::instanceUpdatesBlocked):
792         (WebCore::SVGElement::setInstanceUpdatesBlocked):
793         (WebCore::SVGElement::localCoordinateSpaceTransform):
794         (WebCore::SVGElement::updateRelativeLengthsInformation):
795         (WebCore::SVGElement::isMouseFocusable):
796         (WebCore::SVGElement::isKeyboardFocusable):
797         * svg/SVGElement.h:
798         (WebCore::SVGElement::supportsMarkers):
799         (WebCore::SVGElement::hasRelativeLengths):
800         (WebCore::SVGElement::needsPendingResourceHandling):
801         (WebCore::SVGElement::selfHasRelativeLengths):
802         (WebCore::SVGElement::updateRelativeLengthsInformation):
803         * svg/SVGElement.idl:
804         * svg/SVGElementInstance.cpp:
805         (WebCore::SVGElementInstance::invalidateAllInstancesOfElement):
806         (WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker):
807         * svg/SVGElementInstance.h:
808         * svg/SVGFEBlendElement.idl:
809         * svg/SVGFEColorMatrixElement.idl:
810         * svg/SVGFEComponentTransferElement.idl:
811         * svg/SVGFECompositeElement.idl:
812         * svg/SVGFEConvolveMatrixElement.idl:
813         * svg/SVGFEDiffuseLightingElement.idl:
814         * svg/SVGFEDisplacementMapElement.idl:
815         * svg/SVGFEDropShadowElement.idl:
816         * svg/SVGFEFloodElement.idl:
817         * svg/SVGFEGaussianBlurElement.idl:
818         * svg/SVGFEImageElement.idl:
819         * svg/SVGFELightElement.h:
820         * svg/SVGFEMergeElement.idl:
821         * svg/SVGFEMergeNodeElement.h:
822         * svg/SVGFEMorphologyElement.idl:
823         * svg/SVGFEOffsetElement.idl:
824         * svg/SVGFESpecularLightingElement.idl:
825         * svg/SVGFETileElement.idl:
826         * svg/SVGFETurbulenceElement.idl:
827         * svg/SVGFilterElement.cpp:
828         (WebCore::SVGFilterElement::SVGFilterElement):
829         (WebCore::SVGFilterElement::parseAttribute):
830         (WebCore::SVGFilterElement::svgAttributeChanged):
831         (WebCore::SVGFilterElement::childrenChanged):
832         * svg/SVGFilterElement.h:
833         * svg/SVGFilterElement.idl:
834         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
835         (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
836         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
837         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
838         (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
839         (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
840         * svg/SVGFilterPrimitiveStandardAttributes.h:
841         * svg/SVGFontElement.cpp:
842         (WebCore::SVGFontElement::SVGFontElement):
843         * svg/SVGFontElement.h:
844         * svg/SVGFontFaceElement.cpp:
845         * svg/SVGFontFaceElement.h:
846         * svg/SVGFontFaceFormatElement.h:
847         * svg/SVGFontFaceNameElement.h:
848         * svg/SVGFontFaceSrcElement.h:
849         * svg/SVGFontFaceUriElement.h:
850         * svg/SVGGElement.cpp:
851         (WebCore::SVGGElement::rendererIsNeeded):
852         * svg/SVGGlyphElement.cpp:
853         (WebCore::SVGGlyphElement::SVGGlyphElement):
854         (WebCore::SVGGlyphElement::parseAttribute):
855         (WebCore::SVGGlyphElement::insertedInto):
856         (WebCore::SVGGlyphElement::removedFrom):
857         * svg/SVGGlyphElement.h:
858         * svg/SVGGlyphRefElement.cpp:
859         (WebCore::SVGGlyphRefElement::SVGGlyphRefElement):
860         (WebCore::SVGGlyphRefElement::parseAttribute):
861         * svg/SVGGlyphRefElement.h:
862         * svg/SVGGlyphRefElement.idl:
863         * svg/SVGGradientElement.cpp:
864         (WebCore::SVGGradientElement::SVGGradientElement):
865         (WebCore::SVGGradientElement::parseAttribute):
866         (WebCore::SVGGradientElement::svgAttributeChanged):
867         (WebCore::SVGGradientElement::childrenChanged):
868         * svg/SVGGradientElement.h:
869         * svg/SVGGradientElement.idl:
870         * svg/SVGGraphicsElement.cpp:
871         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
872         (WebCore::SVGGraphicsElement::parseAttribute):
873         (WebCore::SVGGraphicsElement::svgAttributeChanged):
874         * svg/SVGGraphicsElement.h:
875         * svg/SVGGraphicsElement.idl:
876         * svg/SVGLocatable.cpp:
877         (WebCore::SVGLocatable::computeCTM):
878         * svg/SVGMPathElement.h:
879         * svg/SVGMarkerElement.cpp:
880         (WebCore::SVGMarkerElement::SVGMarkerElement):
881         (WebCore::SVGMarkerElement::parseAttribute):
882         (WebCore::SVGMarkerElement::svgAttributeChanged):
883         (WebCore::SVGMarkerElement::childrenChanged):
884         * svg/SVGMarkerElement.h:
885         * svg/SVGMarkerElement.idl:
886         * svg/SVGMaskElement.cpp:
887         (WebCore::SVGMaskElement::SVGMaskElement):
888         (WebCore::SVGMaskElement::parseAttribute):
889         (WebCore::SVGMaskElement::svgAttributeChanged):
890         (WebCore::SVGMaskElement::childrenChanged):
891         * svg/SVGMaskElement.h:
892         * svg/SVGMaskElement.idl:
893         * svg/SVGMetadataElement.h:
894         * svg/SVGMissingGlyphElement.cpp:
895         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
896         * svg/SVGMissingGlyphElement.h:
897         * svg/SVGMissingGlyphElement.idl:
898         * svg/SVGPatternElement.cpp:
899         (WebCore::SVGPatternElement::SVGPatternElement):
900         (WebCore::SVGPatternElement::parseAttribute):
901         (WebCore::SVGPatternElement::svgAttributeChanged):
902         (WebCore::SVGPatternElement::childrenChanged):
903         * svg/SVGPatternElement.h:
904         * svg/SVGPatternElement.idl:
905         * svg/SVGScriptElement.h:
906         * svg/SVGStopElement.cpp:
907         (WebCore::SVGStopElement::SVGStopElement):
908         (WebCore::SVGStopElement::parseAttribute):
909         (WebCore::SVGStopElement::svgAttributeChanged):
910         * svg/SVGStopElement.h:
911         * svg/SVGStopElement.idl:
912         * svg/SVGStyleElement.h:
913         * svg/SVGStyledElement.cpp: Removed.
914         * svg/SVGStyledElement.h: Removed.
915         * svg/SVGStyledElement.idl: Removed.
916         * svg/SVGSymbolElement.cpp:
917         (WebCore::SVGSymbolElement::SVGSymbolElement):
918         (WebCore::SVGSymbolElement::parseAttribute):
919         (WebCore::SVGSymbolElement::svgAttributeChanged):
920         * svg/SVGSymbolElement.h:
921         * svg/SVGSymbolElement.idl:
922         * svg/SVGTRefElement.cpp:
923         (WebCore::SVGTRefElement::insertedInto):
924         (WebCore::SVGTRefElement::removedFrom):
925         * svg/SVGTitleElement.cpp:
926         (WebCore::SVGTitleElement::SVGTitleElement):
927         (WebCore::SVGTitleElement::insertedInto):
928         * svg/SVGTitleElement.h:
929         * svg/SVGTitleElement.idl:
930         * svg/SVGTransformable.cpp:
931         * svg/SVGUseElement.cpp:
932         (WebCore::SVGUseElement::selfHasRelativeLengths):
933         * svg/SVGViewElement.cpp:
934         (WebCore::SVGViewElement::SVGViewElement):
935         (WebCore::SVGViewElement::parseAttribute):
936         * svg/SVGViewElement.h:
937         * svg/animation/SVGSMILElement.h:
938         * svg/graphics/filters/SVGFEImage.cpp:
939         (WebCore::FEImage::platformApplySoftware):
940
941 2013-08-22  Andreas Kling  <akling@apple.com>
942
943         FrameLoader::history() should return a reference.
944         <https://webkit.org/b/120163>
945
946         Reviewed by Anders Carlsson.
947
948         Rehued by Anders Carlsson.
949
950         FrameLoader::m_history is never null, so make history() return a reference.
951         Also made HistoryController::m_frame a reference, since HistoryController's
952         lifetime is tied to FrameLoader, which is tied to the Frame.
953
954 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
955
956         Reloading this video test shows garbage briefly
957         https://bugs.webkit.org/show_bug.cgi?id=119377
958
959         Reviewed by Anders Carlson.
960
961         RenderVideo should not claim that it's foreground is opaque
962         unless it has a video frame to display.
963
964         * rendering/RenderVideo.cpp:
965         (WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect):
966
967 2013-08-22  Andreas Kling  <akling@apple.com>
968
969         Remove accidental cruft from r154449.
970
971         * rendering/RenderWidget.cpp:
972         (WebCore::RenderWidget::destroy):
973
974 2013-08-22  Andreas Kling  <akling@apple.com>
975
976         FrameLoader: frame() and client() should return references.
977         <https://webkit.org/b/120158>
978
979         Reviewed by Anders Carlsson.
980
981         These two are never null so change them to return references.
982
983 2013-08-22  Andrei Bucur  <abucur@adobe.com>
984
985         RenderNamedFlowThread should not create NodeRenderingContext objects
986         https://bugs.webkit.org/show_bug.cgi?id=119923
987
988         Reviewed by Antti Koivisto.
989
990         Port of https://chromium.googlesource.com/chromium/blink/+/949d7d7e7b8685454742a55cf0ca912bb9a7b177.
991         Original patch by Elliott Sprehn.
992
993         RenderNamedFlowThread should not create NodeRenderingContext objects
994
995         RenderNamedFlowThread is using NodeRenderingContext to get the original
996         parent renderer, but should just be using NodeRenderingTraversal::parent
997         instead (which is what NodeRenderingContext does internally anyway).
998
999         Tests: No change in functionality. No new tests.
1000
1001         * rendering/RenderNamedFlowThread.cpp:
1002         (WebCore::RenderNamedFlowThread::isChildAllowed):
1003
1004 2013-08-22  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1005
1006         Introduce a SVGUnknownElement class for unknown SVG elements
1007         https://bugs.webkit.org/show_bug.cgi?id=120155
1008
1009         Reviewed by Andreas Kling.
1010
1011         Introduce a SVGUnknownElement class and have it override rendererIsNeeded() to return false.
1012         We now use SVGUnknownElement type (instead of SVGElement) for unknown SVG elements:
1013         - Unknown Elements in SVG namespace
1014         - Registered custom tag elements in SVG namespace:
1015           http://www.w3.org/TR/2013/WD-custom-elements-20130514/#registering-custom-elements
1016
1017         As a consequence, SVGElement::rendererIsNeeded() is not longer required to return false and
1018         it will be able to behave as SVGStyledElement::rendererIsNeeded() once we merge
1019         SVGStyledElement into SVGElement.
1020
1021         This is a pre-requirement to merging SVGStyledElement into SVGElement.
1022
1023         No new tests, no behavior change.
1024
1025         * GNUmakefile.list.am:
1026         * Target.pri:
1027         * WebCore.vcxproj/WebCore.vcxproj:
1028         * WebCore.vcxproj/WebCore.vcxproj.filters:
1029         * dom/CustomElementConstructor.cpp:
1030         (WebCore::CustomElementConstructor::createElementInternal):
1031         * dom/make_names.pl:
1032         (defaultParametersHash):
1033         (printJSElementIncludes):
1034         (printWrapperFunctions):
1035         (printWrapperFactoryCppFile):
1036         * svg/SVGElement.cpp:
1037         * svg/SVGElement.h:
1038         * svg/SVGUnknownElement.h: Added.
1039         (WebCore::SVGUnknownElement::create):
1040         (WebCore::SVGUnknownElement::SVGUnknownElement):
1041         * svg/svgtags.in:
1042
1043 2013-08-22  Rob Buis  <rwlbuis@webkit.org>
1044
1045         REGRESSION: Assertion failure !collection->hasExactlyOneItem() in WebCore::namedItemGetter
1046         https://bugs.webkit.org/show_bug.cgi?id=118056
1047
1048         Reviewed by Ryosuke Niwa.
1049
1050         The assert is hit in Debug mode because the DocumentOrderedMap in HTMLDocument::m_windowNamedItem
1051         includes matched SVG elements, but the WindowNameCollection used to collect the elements does not.
1052         This means the HTMLCollection stripped of SVG elements could end up hitting the empty or single item
1053         assertion, which the testcase verifies.
1054         To fix this change WindowNameCollection to include both SVG and HTML elements so it matches DocumentOrderedMap.
1055
1056         Tests: svg/custom/document-all-includes-svg.html
1057                svg/custom/window-named-item-lookup.html
1058
1059         * html/HTMLCollection.cpp:
1060         (WebCore::isMatchingElement):
1061         (WebCore::HTMLCollection::updateNameCache):
1062
1063 2013-08-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1064
1065         Introduce toSVGRadialGradientElement(), and use it
1066         https://bugs.webkit.org/show_bug.cgi?id=120153
1067
1068         Reviewed by Andreas Kling.
1069
1070         As a step to clean-up static_cast<SVGXXX>, toSVGRadialGradientElement() is added to clean-up
1071         static_cast<SVGRadialGradientElement*>.
1072
1073         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
1074         (WebCore::RenderSVGResourceRadialGradient::collectGradientAttributes):
1075         * rendering/svg/SVGRenderTreeAsText.cpp:
1076         (WebCore::writeSVGResourceContainer):
1077         * svg/SVGRadialGradientElement.cpp:
1078         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
1079         * svg/SVGRadialGradientElement.h:
1080         (WebCore::toSVGRadialGradientElement):
1081
1082 2013-08-22  Renata Hodovan  <reni@webkit.org>
1083
1084         ASSERTION FAILED: extractedStyle in WebCore::ApplyStyleCommand::removeInlineStyleFromElement
1085         https://bugs.webkit.org/show_bug.cgi?id=119672
1086
1087         Reviewed by Darin Adler.
1088
1089         The last extractedStyle parameter of removeInlineStyleFromElement() is not mandatory and it's set
1090         to default 0. This way we have to check its existence before the usage.
1091
1092         Test: editing/execCommand/extracted_style_assert.html
1093
1094         * editing/ApplyStyleCommand.cpp:
1095         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
1096
1097 2013-08-21  Commit Queue  <commit-queue@webkit.org>
1098
1099         Unreviewed, rolling out r154416.
1100         http://trac.webkit.org/changeset/154416
1101         https://bugs.webkit.org/show_bug.cgi?id=120147
1102
1103         Broke Windows builds (Requested by rniwa on #webkit).
1104
1105         * WebCore.vcxproj/WebCoreGenerated.make:
1106         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
1107         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props:
1108         * WebCore.vcxproj/build-generated-files.sh:
1109         * WebCore.vcxproj/copyForwardingHeaders.cmd:
1110         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
1111
1112 2013-08-21  Ryuan Choi  <ryuan.choi@samsung.com>
1113
1114         [EFL] Unreviewed build fix after r154430.
1115
1116         * rendering/style/StyleRareNonInheritedData.cpp:
1117         (WebCore::StyleRareNonInheritedData::hasFilters): Added CSS_FILTERS guard.
1118
1119 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
1120
1121         Setting -webkit-filter: in :active selector causes failure to redraw
1122         https://bugs.webkit.org/show_bug.cgi?id=120135
1123
1124         Reviewed by Jer Noble.
1125         
1126         When removing a filter on an inline child of a compositing layer,
1127         the inline loses its RenderLayer and compositing layer, but we fail to
1128         repaint the compositing layer that the inline is now painting into.
1129         
1130         This worked correctly for opacity, because opacity toggles cause
1131         layouts (which then paint the correct layer), so do the same for filters.
1132
1133         Test: css3/filters/remove-filter-repaint.html
1134
1135         * rendering/style/RenderStyle.cpp:
1136         (WebCore::RenderStyle::changeRequiresLayout): Return true if we toggled
1137         between having filters and not. Drive-by cleanup, making use of new convenience
1138         function for hasOpacity().
1139         * rendering/style/StyleRareNonInheritedData.cpp:
1140         (WebCore::StyleRareNonInheritedData::hasFilters): Returns true if we have any
1141         filters.
1142         * rendering/style/StyleRareNonInheritedData.h:
1143         (WebCore::StyleRareNonInheritedData::hasOpacity): Convenience function that
1144         returns true if opacity is < 1.
1145
1146 2013-08-21  Gavin Barraclough  <barraclough@apple.com>
1147
1148         https://bugs.webkit.org/show_bug.cgi?id=120139
1149         PropertyDescriptor argument to define methods should be const
1150
1151         Rubber stamped by Sam Weinig.
1152
1153         This should never be modified, and this way we can use rvalues.
1154
1155         * bindings/js/JSDOMWindowCustom.cpp:
1156         (WebCore::JSDOMWindow::defineOwnProperty):
1157         * bindings/js/JSLocationCustom.cpp:
1158         (WebCore::JSLocation::defineOwnProperty):
1159         (WebCore::JSLocationPrototype::defineOwnProperty):
1160         * bindings/scripts/CodeGeneratorJS.pm:
1161         (GenerateHeader):
1162             - make PropertyDescriptor const
1163
1164 2013-08-21  Jacky Jiang  <zhajiang@blackberry.com>
1165
1166         <https://webkit.org/b/120123> [BlackBerry] Incorrect origin of indexOfTile in LayerTiler can cause unnecessary texture jobs and waste memory
1167
1168         Reviewed by Yong Li.
1169         Internally reviewed by Arvid Nilsson.
1170
1171         JIRA 481356
1172         The origin of indexOfTile(origin) is incorrect in these two places. For
1173         example, if the maxXMaxYCorner of the rect is (768, 768), there can be
1174         three other redundant indexOfTile (0, 1), (1, 0), (1, 1) which can cause
1175         unnecessary texture jobs and waste memory.
1176         The origin should be the top left of the bottom right pixel of a rect.
1177
1178         * platform/graphics/blackberry/LayerTiler.cpp:
1179         (WebCore::LayerTiler::updateTextureContentsIfNeeded):
1180         (WebCore::LayerTiler::processTextureJob):
1181
1182 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
1183
1184         <https://webkit.org/b/116901> ASSERTION FAILED: !m_visibleDescendantStatusDirty on twitter
1185
1186         Reviewed by Beth Dakin.
1187         
1188         In order to make decisions about compositing, the m_hasVisibleDescendant bit on RenderLayers
1189         needs to be up-to-date when RenderLayerCompositor::computeCompositingRequirements is recursing
1190         over the RenderLayer tree.
1191         
1192         However, was possible for computeCompositingRequirements() to hit a layer whose m_visibleDescendantStatusDirty
1193         bit was set; we only clear this bit from collectLayers() (when updating z-order lists), and from styleChanged()
1194         which requires that style changed on the layer itself.
1195         
1196         Fix by always calling updateDescendantDependentFlags() from computeCompositingRequirements().
1197
1198         Wasn't able to easily get a reduced testcase.
1199
1200         * rendering/RenderLayerCompositor.cpp:
1201         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1202
1203 2013-08-21  Alex Christensen  <achristensen@apple.com>
1204
1205         <https://webkit.org/b/120137> Separating Win32 and Win64 builds.
1206
1207         Reviewed by Brent Fulgham.
1208
1209         * WebCore.vcxproj/WebCoreGenerated.make:
1210         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
1211         Pass PlatformArchitecture as a command line parameter to bash scripts
1212         and use PlatformArchitecture to determine which directory to delete
1213         while cleaning (obj32 or obj64).
1214         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props:
1215         Export PlatformArchitecture to be used by make and cmd scripts.
1216         * WebCore.vcxproj/build-generated-files.sh:
1217         Use PlatformArchitecture from command line to determine which object directory to use (obj32 or obj64).
1218         * WebCore.vcxproj/copyForwardingHeaders.cmd:
1219         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
1220         Use PlatformArchitecture to determine which directory to copy to (obj32 or obj64).
1221
1222 2013-08-21  Tim Horton  <timothy_horton@apple.com>
1223
1224         revalidateTiles and ensureTilesForRect can share a lot of code
1225         https://bugs.webkit.org/show_bug.cgi?id=119282
1226
1227         Missed the review comments, whoops.
1228
1229         * platform/graphics/ca/mac/TileController.h:
1230         * platform/graphics/ca/mac/TileController.mm:
1231         (WebCore::TileController::prepopulateRect):
1232         (WebCore::TileController::revalidateTiles):
1233         (WebCore::TileController::ensureTilesForRect):
1234
1235 2013-08-21  Andreas Kling  <akling@apple.com>
1236
1237         <https://webkit.org/b/120115> SVG elements always have custom style resolve callbacks.
1238
1239         Reviewed by Antti Koivisto.
1240
1241         Simplify SVGElement construction by making them opt in to custom style resolve callbacks
1242         by default, and removing the ability to pass a custom ConstructionType to some subclass
1243         constructors.
1244
1245         * dom/Node.h:
1246
1247             Add HasCustomStyleResolveCallbacksFlag to the CreateSVGElement mask.
1248
1249         * svg/SVGElement.cpp:
1250         (WebCore::SVGElement::SVGElement):
1251         * svg/SVGElement.h:
1252         * svg/SVGGElement.cpp:
1253         (WebCore::SVGGElement::SVGGElement):
1254         * svg/SVGGElement.h:
1255         * svg/SVGGraphicsElement.cpp:
1256         (WebCore::SVGGraphicsElement::SVGGraphicsElement):
1257         * svg/SVGGraphicsElement.h:
1258         * svg/SVGImageElement.cpp:
1259         (WebCore::SVGImageElement::SVGImageElement):
1260         * svg/SVGStyledElement.cpp:
1261         (WebCore::SVGStyledElement::SVGStyledElement):
1262         * svg/SVGStyledElement.h:
1263
1264             Remove calls to setHasCustomStyleResolveCallbacks() in SVGElement and subclasses.
1265             Also remove unnecessary ConstructionType argument from subclasses since nobody
1266             overrides it and everyone just uses CreateSVGElement.
1267
1268 2013-08-21  Tim Horton  <timothy_horton@apple.com>
1269
1270         revalidateTiles and ensureTilesForRect can share a lot of code
1271         https://bugs.webkit.org/show_bug.cgi?id=119282
1272
1273         Reviewed by Simon Fraser.
1274
1275         No new tests, just a refactoring.
1276
1277         The bodies of ensureTilesForRect and revalidateTiles are nearly equivalent.
1278
1279         * platform/graphics/ca/mac/TileController.h:
1280         Add an enum, NewTileType, to note whether the tiles created by ensureTilesForRect will
1281         be primary coverage tiles or secondary out-of-view tiles.
1282
1283         * platform/graphics/ca/mac/TileController.mm:
1284         (WebCore::TileController::prepopulateRect):
1285         Move the code to see if we already have the requisite tiles in the
1286         primary coverage rect, as well as our call to updateTileCoverageMap,
1287         out into prepopulateRect, to generalize ensureTilesForRect.
1288
1289         (WebCore::TileController::revalidateTiles):
1290         Make use of ensureTilesForRect. The platformCALayerDidCreateTiles call will happen there, now.
1291
1292         (WebCore::TileController::ensureTilesForRect):
1293         Make ensureTilesForRect return the rect that it created tiles for, and only put
1294         tiles in a cohort if we're creating secondary tiles.
1295
1296 2013-08-21  Tim Horton  <timothy_horton@apple.com>
1297
1298         isReplacementObscured is wrong when the indicator is clipped by an iframe
1299         https://bugs.webkit.org/show_bug.cgi?id=120031
1300         <rdar://problem/14606819>
1301
1302         Reviewed by Simon Fraser.
1303
1304         Hit-test for plugin obscurity in the root document. To do this, we also need
1305         to convert the indicator rectangle into root view coordinates before
1306         hit testing its edges.
1307
1308         This resolves the case where an iframe which clips its content was reporting
1309         the indicator as not obscured, despite the fact that it was obscured from the
1310         point of view of the user.
1311
1312         Updated test plugins/unavailable-plugin-indicator-obscurity.html
1313
1314         * rendering/RenderEmbeddedObject.cpp:
1315         (WebCore::RenderEmbeddedObject::isReplacementObscured):
1316
1317 2013-08-21  Andreas Kling  <akling@apple.com>
1318
1319         <https://webkit.org/b/120132> Frame::navigationScheduler() should return a reference.
1320
1321         Reviewed by Anders Carlzon.
1322
1323         Frame::m_navigationScheduler is an inline member, not a pointer.
1324
1325 2013-08-21  Tim Horton  <timothy_horton@apple.com>
1326
1327         REGRESSION(r154399): broke Mac ML debug WK1 tests > 50 crashes (Requested by thorton on #webkit).
1328         https://bugs.webkit.org/show_bug.cgi?id=120129
1329
1330         Rolling out http://trac.webkit.org/changeset/154399.
1331
1332         * rendering/RenderBlock.cpp:
1333         * rendering/RenderBlock.h:
1334         * rendering/RenderBlockLineLayout.cpp:
1335         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
1336         * rendering/RenderBox.h:
1337
1338 2013-08-21  Andreas Kling  <akling@apple.com>
1339
1340         <https://webkit.org/b/120118> Frame::animation() should return a reference.
1341
1342         Reviewed by Anders Carlsson.
1343
1344         Frame::m_animationController is never null.
1345         Also changed RenderObject::animation() to return a reference since it's just a wrapper
1346         around RenderObject::frame()->animation() with no null checking of frame().
1347
1348 2013-08-21  Simon Fraser  <simon.fraser@apple.com>
1349
1350         Allow opacity to apply to custom scrollbars
1351         https://bugs.webkit.org/show_bug.cgi?id=120104
1352
1353         Reviewed by David Hyatt.
1354         
1355         Opacity was ignored custom scrollbar pseudoelements because custom scrollbar
1356         renderers never create layers, and opacity is normally handled by the RenderLayer code.
1357         
1358         Fix by having RenderScrollbarTheme and RenderScrollbarPart do the transparency
1359         layers necessary for opacity. RenderScrollbarPart handles opacity for individual
1360         parts.
1361         
1362         Because ScrollbarThemeComposite::paint() renders the parts on after another (with
1363         no nesting), opacity handling for the entire scrollbar needs special-casing.
1364         This is done by willPaintScrollbar()/didPaintScrollbar() on the theme.
1365         RenderScrollbarTheme consults the opacity the scrollbar (which we get from
1366         the ScrollbarBGPart renderer) to decide whether to set up a transparency layer.
1367
1368         Test: scrollbars/scrollbar-parts-opacity.html
1369
1370         * platform/ScrollbarThemeComposite.cpp:
1371         (WebCore::ScrollbarThemeComposite::paint):
1372         * platform/ScrollbarThemeComposite.h:
1373         (WebCore::ScrollbarThemeComposite::willPaintScrollbar):
1374         (WebCore::ScrollbarThemeComposite::didPaintScrollbar):
1375         * rendering/RenderScrollbar.cpp:
1376         (WebCore::RenderScrollbar::opacity):
1377         * rendering/RenderScrollbar.h:
1378         * rendering/RenderScrollbarPart.cpp:
1379         (WebCore::RenderScrollbarPart::paintIntoRect):
1380         * rendering/RenderScrollbarTheme.cpp:
1381         (WebCore::RenderScrollbarTheme::willPaintScrollbar):
1382         (WebCore::RenderScrollbarTheme::didPaintScrollbar):
1383         * rendering/RenderScrollbarTheme.h:
1384
1385 2013-08-21  Robert Hogan  <robert@webkit.org>
1386
1387         REGRESSION(r127163): Respect clearance set on ancestors when placing floats
1388         https://bugs.webkit.org/show_bug.cgi?id=119979
1389
1390         Reviewed by David Hyatt.
1391
1392         If a float has a self-collapsing ancestor with clearance then it needs to respect
1393         that clearance when placing itself on the line.
1394
1395         Test: fast/block/margin-collapse/self-collapsing-block-with-float-descendant.html
1396
1397         * rendering/RenderBlock.cpp:
1398         (WebCore::RenderBlock::marginOffsetForSelfCollapsingBlock):
1399         * rendering/RenderBlock.h:
1400         * rendering/RenderBlockLineLayout.cpp:
1401         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
1402         * rendering/RenderBox.h:
1403         (WebCore::RenderBox::previousInFlowSiblingBox):
1404
1405 2013-08-21  Brent Fulgham  <bfulgham@apple.com>
1406
1407         <https://webkit.org/b/120113> [Windows] Enable CSS_IMAGE_SET
1408
1409         Reviewed by Anders Carlsson.
1410
1411         We can now activate:
1412         fast/css/image-set-parsing.html
1413         fast/css/image-set-parsing-invalid.html
1414
1415         * WebCore.vcxproj/WebCore.vcxproj: Add missing image set implementation files.
1416         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1417         * css/CSSAllInOne.cpp: Add missing CSSImageSetValue.cpp
1418         * rendering/style/StyleAllInOne.cpp: Add missing StyeCachedImageSet.cpp
1419
1420 2013-08-21  Robert Hogan  <robert@webkit.org>
1421
1422         In RenderTableCell::paintCollapsedBorders() check surrounding cells using physical rather than logical direction
1423         https://bugs.webkit.org/show_bug.cgi?id=120074
1424
1425         Reviewed by David Hyatt.
1426
1427         No new tests, covered by existing tests.
1428
1429         The functions cellAbove(), cellBelow() etc. check the logical rather than the physical direction but they're being
1430         used to decide the painting of the physical borders of the cell. As we paint all four sides of every cell, and
1431         the borders of adjoining cells twice over, this has no impact on painting currently but making the check consistent
1432         in its treatment of physical and logical direction will help with webkit.org/b/119759 and make the code less confusing
1433         to the next guy.
1434
1435         * rendering/RenderTableCell.cpp:
1436         (WebCore::RenderTableCell::cellAtLeft):
1437         (WebCore::RenderTableCell::cellAtRight):
1438         (WebCore::RenderTableCell::cellAtTop):
1439         (WebCore::RenderTableCell::cellAtBottom):
1440         (WebCore::RenderTableCell::paintCollapsedBorders):
1441         * rendering/RenderTableCell.h:
1442
1443 2013-08-21  Róbert Sipka  <sipka@inf.u-szeged.hu>
1444
1445         <https://webkit.org/b/120109> [curl] only include WebCoreBundleWin on Windows
1446
1447         Reviewed by Brent Fulgham.
1448
1449         The WebCoreBundleWin is a windows specific file, it is only needed on Windows.
1450
1451         * platform/network/curl/ResourceHandleManager.cpp:
1452
1453 2013-08-21  Jae Hyun Park  <jae.park@company100.net>
1454
1455         [Qt] Remove unused code path in PluginView
1456         https://bugs.webkit.org/show_bug.cgi?id=113173
1457
1458         Reviewed by Anders Carlsson.
1459
1460         m_platformLayer in PluginView has been removed in r121710, but there are
1461         still some leftover code path related to m_platformLayer. This patch
1462         removes unused code path.
1463
1464         No new tests, removing unused code paths.
1465
1466         * plugins/PluginView.h:
1467         (PluginView):
1468         * plugins/qt/PluginViewQt.cpp:
1469         (WebCore::PluginView::updatePluginWidget):
1470         (WebCore::PluginView::paint):
1471
1472 2013-08-21  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1473
1474         Font’s fast code path doesn’t handle partial runs correctly when kerning or ligatures are enabled 
1475         https://bugs.webkit.org/show_bug.cgi?id=100050
1476
1477         Reviewed by Antti Koivisto.
1478
1479         Always let WidthIterator iterate over an entire TextRun to avoid problems
1480         with pixel rounding or shaping on partial runs.
1481
1482         This fix is necessary for Qt because the complex font-path can not disable
1483         shaping, leading to the complex path painting slighly different from the
1484         fast path, which messes up selection painting.
1485
1486         No change in functionality, no new tests.
1487
1488         * platform/graphics/Font.cpp:
1489         (WebCore::Font::drawText):
1490         (WebCore::Font::drawEmphasisMarks):
1491         (WebCore::Font::selectionRectForText):
1492         (WebCore::Font::offsetForPosition):
1493         * platform/graphics/FontFastPath.cpp:
1494         (WebCore::Font::getGlyphsAndAdvancesForSimpleText):
1495         (WebCore::Font::selectionRectForSimpleText):
1496         (WebCore::Font::offsetForPositionForSimpleText):
1497         * platform/graphics/GlyphBuffer.h:
1498         (WebCore::GlyphBuffer::add):
1499         (GlyphBuffer):
1500         * platform/graphics/WidthIterator.cpp:
1501         (WebCore::WidthIterator::advanceInternal):
1502         * platform/graphics/WidthIterator.h:
1503         (WidthIterator): Removed now unused advanceOneCharacter method.
1504
1505 2013-08-20  Antonio Gomes  <a1.gomes@sisa.samsung.com>
1506
1507         Harden RenderBox::canBeScrolledAndHasScrollableArea logic
1508         https://bugs.webkit.org/show_bug.cgi?id=104373
1509
1510         Reviewed by Simon Fraser.
1511
1512         Previously if a say div has a overflown content on 'y' but is
1513         styled as "overflow-x: auto; overflow-y: hidden", RenderBox::canBeProgramaticallyScrolled
1514         would still return true. It interfers, among other things, with the way
1515         autoscroll works.
1516
1517         Patch fixes it by adding two helper methods to RenderBox class in order to verify a box'
1518         scrollability in a given axis (x or y); They are used when checking if a given box is in
1519         fact programatically scrollable.
1520
1521         Test: fast/events/autoscroll-overflow-hidden-longhands.html
1522
1523         WebKit autoscroll behavior now matches Firefox and Opera12 (pre-blink)
1524         in that sense.
1525
1526         * rendering/RenderBox.cpp:
1527         (WebCore::RenderBox::canBeProgramaticallyScrolled):
1528         * rendering/RenderBox.h:
1529         (WebCore::RenderBox::hasScrollableOverflowX):
1530         (WebCore::RenderBox::hasScrollableOverflowY):
1531
1532 2013-08-19  Antonio Gomes  <a1.gomes@sisa.samsung.com>
1533
1534         Text dragging can scroll overflow:hidden boxes
1535         https://bugs.webkit.org/show_bug.cgi?id=119760
1536
1537         Reviewed by Darin Adler.
1538
1539         Consider the case of the following HTML:
1540         <div style="overflow:hidden; width: 100px; height: 100px" >
1541           <input id="input" type="text" size=10 value="any text here!"/>
1542           <button style="position:relative; top: 100px; left: 100px"/>
1543         </div>
1544
1545         If ones starts a text selection by dragging the mouse from within the input
1546         field, and continues to drag beyong the outer div boundary, the latter will
1547         be scrolled no matter its overflow:hidden style.
1548         That happens because when the autoscroll has started, it gets propagated up
1549         to the current layer's parent layer, instead of the to current layer's enclosing
1550         scrollable layer.
1551
1552         Patch fixes the issue by hardening the way scrolling is
1553         propagated upwards when autoscroll is being performed.
1554
1555         RenderLayer::enclosingScrollableLayer method also got rewritten
1556         in terms of RenderLayer tree traversing, instead of RenderObject tree.
1557         The rewrite adds support for cross frame upwards traversal.
1558
1559         Test: fast/events/autoscroll-upwards-propagation.html
1560
1561         * rendering/RenderLayer.cpp:
1562         (WebCore::parentLayerCrossFrame):
1563         (WebCore::RenderLayer::enclosingScrollableLayer):
1564         (WebCore::RenderLayer::scrollRectToVisible):
1565
1566 2013-08-20  Jer Noble  <jer.noble@apple.com>
1567
1568         <https://webkit.org/b/120101> [Mac] Suspended HTMLMediaElements can still hold power assertion after playback stops.
1569
1570         Reviewed by Eric Carlson.
1571
1572         Call updateDisplaySleep() when we clear our MediaPlayer, as doing so may kill any in-flight
1573         rateChanged() notifications.
1574
1575         * html/HTMLMediaElement.cpp:
1576         (WebCore::HTMLMediaElement::clearMediaPlayer):
1577         (WebCore::HTMLMediaElement::stop):
1578
1579 2013-08-20  David Barr <davidbarr@chromium.org>, Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1580
1581         <https://webkit.org/b/92330> [CSS] Pass an image orientation data to drawImage()
1582
1583         Reviewed by Beth Dakin.
1584
1585         In support of ongoing css3-images image-orientation implementation. This patch passes
1586         an imageOrientationDescription object to drawImage() function as a argument. The drawImage()
1587         can know information of image orientation by the argument.
1588
1589         Spec: http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
1590
1591         * html/HTMLCanvasElement.cpp:
1592         (WebCore::HTMLCanvasElement::paint):
1593         * html/canvas/CanvasRenderingContext2D.cpp:
1594         (WebCore::CanvasRenderingContext2D::drawImage):
1595         (WebCore::drawImageToContext):
1596         * platform/graphics/ImageOrientation.h: Add setter functions.
1597         (WebCore::ImageOrientationDescription::setRespectImageOrientation):
1598         (WebCore::ImageOrientationDescription::setImageOrientationEnum):
1599         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
1600         (WebCore::BitmapTextureImageBuffer::updateContents):
1601         * rendering/RenderBoxModelObject.cpp:
1602         (WebCore::RenderBoxModelObject::paintNinePieceImage):
1603         * rendering/RenderImage.cpp:
1604         (WebCore::RenderImage::paintReplaced):
1605         (WebCore::RenderImage::paintIntoRect):
1606         * rendering/RenderSnapshottedPlugIn.cpp:
1607         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
1608
1609 2013-08-20  Gavin Barraclough  <barraclough@apple.com>
1610
1611         https://bugs.webkit.org/show_bug.cgi?id=120093
1612         Remove getOwnPropertyDescriptor trap
1613
1614         Reviewed by Geoff Garen.
1615
1616         All implementations of this method are now called via the method table, and equivalent in behaviour.
1617         Remove all duplicate implementations (and the method table trap), and add a single member function implementation on JSObject.
1618
1619         * WebCore.exp.in:
1620         * bindings/js/JSDOMWindowCustom.cpp:
1621         * bindings/scripts/CodeGeneratorJS.pm:
1622         (GenerateHeader):
1623         (GenerateImplementation):
1624         (GenerateConstructorDeclaration):
1625         (GenerateConstructorHelperMethods):
1626         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1627         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1628         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1629         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1630         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1631         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1632         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1633         * bindings/scripts/test/JS/JSTestEventTarget.h:
1634         * bindings/scripts/test/JS/JSTestException.cpp:
1635         * bindings/scripts/test/JS/JSTestException.h:
1636         * bindings/scripts/test/JS/JSTestInterface.cpp:
1637         * bindings/scripts/test/JS/JSTestInterface.h:
1638         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1639         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1640         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1641         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1642         * bindings/scripts/test/JS/JSTestNode.cpp:
1643         * bindings/scripts/test/JS/JSTestNode.h:
1644         * bindings/scripts/test/JS/JSTestObj.cpp:
1645         * bindings/scripts/test/JS/JSTestObj.h:
1646         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1647         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1648         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1649         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1650         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1651         * bindings/scripts/test/JS/JSTestTypedefs.h:
1652         * bridge/jsc/BridgeJSC.h:
1653         (JSC::Bindings::Instance::getOwnPropertySlot):
1654         * bridge/objc/objc_runtime.h:
1655         * bridge/objc/objc_runtime.mm:
1656         * bridge/runtime_array.cpp:
1657         * bridge/runtime_array.h:
1658         * bridge/runtime_method.cpp:
1659         * bridge/runtime_method.h:
1660         * bridge/runtime_object.cpp:
1661         * bridge/runtime_object.h:
1662             - remove getOwnPropertyDescriptor
1663
1664 2013-08-20  Antti Koivisto  <antti@apple.com>
1665
1666         <https://webkit.org/b/120071> Replace NodeRenderingContext with Node* as childShouldCreateRenderer() argument
1667
1668         Reviewed by Darin Adler.
1669
1670         This simplifies the code. NodeRenderingContext was basically only used for getting the Node.
1671
1672         * dom/ContainerNode.h:
1673         (WebCore::ContainerNode::childShouldCreateRenderer):
1674         * dom/Element.cpp:
1675         (WebCore::Element::childShouldCreateRenderer):
1676         * dom/Element.h:
1677         * dom/NodeRenderingContext.cpp:
1678         (WebCore::NodeRenderingContext::shouldCreateRenderer):
1679         * dom/NodeRenderingContext.h:
1680         
1681             Move isOnEncapsulationBoundary() to InsertionPoint.h and call it hasShadowRootOrActiveInsertionPointParent().
1682             Move isOnUpperEncapsulationBoundary() to ShadowRoot.h and call it hasShadowRootParent().
1683
1684         * dom/ShadowRoot.h:
1685         (WebCore::hasShadowRootParent):
1686         * html/HTMLDetailsElement.cpp:
1687         (WebCore::HTMLDetailsElement::childShouldCreateRenderer):
1688         * html/HTMLDetailsElement.h:
1689         * html/HTMLFormControlElement.cpp:
1690         (WebCore::HTMLFormControlElement::validationMessageShadowTreeContains):
1691         * html/HTMLFormControlElement.h:
1692         * html/HTMLMediaElement.cpp:
1693         (WebCore::HTMLMediaElement::childShouldCreateRenderer):
1694         * html/HTMLMediaElement.h:
1695         * html/HTMLMeterElement.cpp:
1696         (WebCore::HTMLMeterElement::childShouldCreateRenderer):
1697         * html/HTMLMeterElement.h:
1698         * html/HTMLOptGroupElement.h:
1699         (WebCore::isHTMLOptGroupElement):
1700         * html/HTMLOptionElement.h:
1701         (WebCore::isHTMLOptionElement):
1702         * html/HTMLProgressElement.cpp:
1703         (WebCore::HTMLProgressElement::childShouldCreateRenderer):
1704         * html/HTMLProgressElement.h:
1705         * html/HTMLSelectElement.cpp:
1706         (WebCore::HTMLSelectElement::childShouldCreateRenderer):
1707         * html/HTMLSelectElement.h:
1708         * html/HTMLSummaryElement.cpp:
1709         (WebCore::HTMLSummaryElement::childShouldCreateRenderer):
1710         * html/HTMLSummaryElement.h:
1711         * html/HTMLTextFormControlElement.cpp:
1712         (WebCore::HTMLTextFormControlElement::childShouldCreateRenderer):
1713         (WebCore::enclosingTextFormControl):
1714         * html/HTMLTextFormControlElement.h:
1715         * html/ValidationMessage.cpp:
1716         (WebCore::ValidationMessage::shadowTreeContains):
1717         * html/ValidationMessage.h:
1718         * html/shadow/InsertionPoint.cpp:
1719         (WebCore::InsertionPoint::rendererIsNeeded):
1720         * html/shadow/InsertionPoint.h:
1721         (WebCore::isActiveInsertionPoint):
1722         
1723             Remove isShadowBoundary() as it was equivalent to isActive(). 
1724             Remove isLowerEncapsulationBoundary() as it was equivalent to isActiveInsertionPoint().
1725
1726         (WebCore::hasShadowRootOrActiveInsertionPointParent):
1727         
1728             Moved and renamed from NodeRenderingContext::isOnEncapsulationBoundary().
1729
1730         * svg/SVGAElement.cpp:
1731         (WebCore::SVGAElement::childShouldCreateRenderer):
1732         * svg/SVGAElement.h:
1733         * svg/SVGAltGlyphElement.cpp:
1734         (WebCore::SVGAltGlyphElement::childShouldCreateRenderer):
1735         * svg/SVGAltGlyphElement.h:
1736         * svg/SVGDocument.cpp:
1737         (WebCore::SVGDocument::childShouldCreateRenderer):
1738         * svg/SVGDocument.h:
1739         * svg/SVGElement.cpp:
1740         (WebCore::SVGElement::childShouldCreateRenderer):
1741         * svg/SVGElement.h:
1742         * svg/SVGFilterElement.cpp:
1743         (WebCore::SVGFilterElement::childShouldCreateRenderer):
1744         * svg/SVGFilterElement.h:
1745         * svg/SVGFilterPrimitiveStandardAttributes.h:
1746         * svg/SVGForeignObjectElement.cpp:
1747         (WebCore::SVGForeignObjectElement::childShouldCreateRenderer):
1748         * svg/SVGForeignObjectElement.h:
1749         * svg/SVGSVGElement.h:
1750         (WebCore::toSVGSVGElement):
1751         * svg/SVGSwitchElement.cpp:
1752         (WebCore::SVGSwitchElement::childShouldCreateRenderer):
1753         * svg/SVGSwitchElement.h:
1754         * svg/SVGTRefElement.cpp:
1755         (WebCore::SVGTRefElement::childShouldCreateRenderer):
1756         * svg/SVGTRefElement.h:
1757         * svg/SVGTSpanElement.cpp:
1758         (WebCore::SVGTSpanElement::childShouldCreateRenderer):
1759         * svg/SVGTSpanElement.h:
1760         * svg/SVGTextElement.cpp:
1761         (WebCore::SVGTextElement::childShouldCreateRenderer):
1762         * svg/SVGTextElement.h:
1763         * svg/SVGTextPathElement.cpp:
1764         (WebCore::SVGTextPathElement::childShouldCreateRenderer):
1765         * svg/SVGTextPathElement.h:
1766
1767 2013-08-20  Benjamin Poulain  <benjamin@webkit.org>
1768
1769         <https://webkit.org/b/120050> Don't bother using a Vector for the ouput of querySelector, just return the first element found
1770
1771         Reviewed by Ryosuke Niwa.
1772
1773         Simplify the case of querySelector. Instead of using the same output type as querySelectorAll,
1774         simply use a trait to define what to do in the loop.
1775
1776         * dom/SelectorQuery.cpp:
1777         (WebCore::AllElementExtractorSelectorQueryTrait::appendOutputForElement):
1778         (WebCore::SelectorDataList::queryAll):
1779         (WebCore::SingleElementExtractorSelectorQueryTrait::appendOutputForElement):
1780         (WebCore::SelectorDataList::queryFirst):
1781         (WebCore::SelectorDataList::executeFastPathForIdSelector):
1782         (WebCore::elementsForLocalName):
1783         (WebCore::anyElement):
1784         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
1785         (WebCore::SelectorDataList::executeSingleClassNameSelectorData):
1786         (WebCore::SelectorDataList::executeSingleSelectorData):
1787         (WebCore::SelectorDataList::executeSingleMultiSelectorData):
1788         (WebCore::SelectorDataList::execute):
1789         * dom/SelectorQuery.h:
1790
1791 2013-08-20  Antti Koivisto  <antti@apple.com>
1792
1793         Rollout the previous patch for landing with the correct ChangeLog.
1794
1795 013-08-20  Jacky Jiang  <zhajiang@blackberry.com>
1796
1797         <https://webkit.org/b/120082> [BlackBerry] Remove unused previousTextureRect in LayerTiler
1798
1799         Reviewed by Rob Buis.
1800         Internally reviewed by Mike Lattanzio and Jakob Petsovits.
1801
1802         * platform/graphics/blackberry/LayerTiler.cpp:
1803         (WebCore::LayerTiler::updateTextureContentsIfNeeded):
1804
1805 2013-08-20  Antti Koivisto  <antti@apple.com>
1806
1807         <https://webkit.org/b/120078> Replace NodeRenderingContext with RenderStyle& as shouldCreateRenderer() argument
1808
1809         Reviewed by Darin Adler.
1810
1811         This simplifies the code. NodeRenderingContext was only used for getting the RenderStyle.
1812
1813         * dom/Element.cpp:
1814         (WebCore::Element::rendererIsNeeded):
1815         * dom/Element.h:
1816         * dom/NodeRenderingContext.cpp:
1817         (WebCore::NodeRenderingContext::elementInsideRegionNeedsRenderer):
1818         (WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
1819         * dom/PseudoElement.cpp:
1820         (WebCore::PseudoElement::rendererIsNeeded):
1821         * dom/PseudoElement.h:
1822         * html/HTMLAppletElement.cpp:
1823         (WebCore::HTMLAppletElement::rendererIsNeeded):
1824         * html/HTMLAppletElement.h:
1825         * html/HTMLElement.cpp:
1826         (WebCore::HTMLElement::rendererIsNeeded):
1827         * html/HTMLElement.h:
1828         * html/HTMLEmbedElement.cpp:
1829         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1830         * html/HTMLEmbedElement.h:
1831         * html/HTMLFormElement.cpp:
1832         (WebCore::HTMLFormElement::rendererIsNeeded):
1833         * html/HTMLFormElement.h:
1834         * html/HTMLFrameElement.cpp:
1835         (WebCore::HTMLFrameElement::rendererIsNeeded):
1836         * html/HTMLFrameElement.h:
1837         * html/HTMLFrameSetElement.cpp:
1838         (WebCore::HTMLFrameSetElement::rendererIsNeeded):
1839         * html/HTMLFrameSetElement.h:
1840         * html/HTMLIFrameElement.cpp:
1841         (WebCore::HTMLIFrameElement::rendererIsNeeded):
1842         * html/HTMLIFrameElement.h:
1843         * html/HTMLInputElement.cpp:
1844         (WebCore::HTMLInputElement::rendererIsNeeded):
1845         * html/HTMLInputElement.h:
1846         * html/HTMLMediaElement.cpp:
1847         (WebCore::HTMLMediaElement::rendererIsNeeded):
1848         * html/HTMLMediaElement.h:
1849         * html/HTMLObjectElement.cpp:
1850         (WebCore::HTMLObjectElement::rendererIsNeeded):
1851         * html/HTMLObjectElement.h:
1852         * html/HTMLOptGroupElement.h:
1853         * html/HTMLOptionElement.h:
1854         * html/HTMLVideoElement.cpp:
1855         (WebCore::HTMLVideoElement::rendererIsNeeded):
1856         * html/HTMLVideoElement.h:
1857         * html/shadow/DetailsMarkerControl.cpp:
1858         (WebCore::DetailsMarkerControl::rendererIsNeeded):
1859         * html/shadow/DetailsMarkerControl.h:
1860         * html/shadow/InsertionPoint.cpp:
1861         (WebCore::InsertionPoint::rendererIsNeeded):
1862         * html/shadow/InsertionPoint.h:
1863         * html/shadow/MeterShadowElement.cpp:
1864         (WebCore::MeterShadowElement::rendererIsNeeded):
1865         (WebCore::MeterInnerElement::rendererIsNeeded):
1866         * html/shadow/MeterShadowElement.h:
1867         * html/shadow/ProgressShadowElement.cpp:
1868         (WebCore::ProgressShadowElement::rendererIsNeeded):
1869         (WebCore::ProgressInnerElement::rendererIsNeeded):
1870         * html/shadow/ProgressShadowElement.h:
1871         * svg/SVGDescElement.h:
1872         * svg/SVGElement.h:
1873         (WebCore::SVGElement::rendererIsNeeded):
1874         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1875         (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
1876         * svg/SVGFilterPrimitiveStandardAttributes.h:
1877         * svg/SVGFontElement.h:
1878         * svg/SVGForeignObjectElement.cpp:
1879         (WebCore::SVGForeignObjectElement::rendererIsNeeded):
1880         * svg/SVGForeignObjectElement.h:
1881         * svg/SVGGElement.cpp:
1882         (WebCore::SVGGElement::rendererIsNeeded):
1883         * svg/SVGGElement.h:
1884         * svg/SVGGlyphElement.h:
1885         * svg/SVGGlyphRefElement.h:
1886         * svg/SVGHKernElement.h:
1887         * svg/SVGMarkerElement.h:
1888         * svg/SVGMissingGlyphElement.h:
1889         * svg/SVGSVGElement.cpp:
1890         (WebCore::SVGSVGElement::rendererIsNeeded):
1891         * svg/SVGSVGElement.h:
1892         * svg/SVGStopElement.cpp:
1893         (WebCore::SVGStopElement::rendererIsNeeded):
1894         * svg/SVGStopElement.h:
1895         * svg/SVGStyledElement.cpp:
1896         (WebCore::SVGStyledElement::rendererIsNeeded):
1897         * svg/SVGStyledElement.h:
1898         * svg/SVGTRefElement.cpp:
1899         (WebCore::SVGTRefElement::rendererIsNeeded):
1900         * svg/SVGTRefElement.h:
1901         * svg/SVGTSpanElement.cpp:
1902         (WebCore::SVGTSpanElement::rendererIsNeeded):
1903         * svg/SVGTSpanElement.h:
1904         * svg/SVGTextPathElement.cpp:
1905         (WebCore::SVGTextPathElement::rendererIsNeeded):
1906         * svg/SVGTextPathElement.h:
1907         * svg/SVGTitleElement.h:
1908         * svg/SVGVKernElement.h:
1909         * svg/SVGViewElement.h:
1910
1911 2013-08-20  Daniel Bates  <dabates@apple.com>
1912
1913         <https://webkit.org/b/120088> Define Clipboard::hasData() only when building with drag support
1914
1915         Reviewed by Darin Adler.
1916
1917         Clipboard::hasData() is specific to drag-and-drop support. We should only define it when
1918         such support is enabled.
1919
1920         * dom/Clipboard.cpp: Move hasData() to DRAG_SUPPORT section of the file.
1921         * dom/Clipboard.h: Ditto.
1922
1923 2013-08-20  Antti Koivisto  <antti@apple.com>
1924
1925         <https://webkit.org/b/120078> Replace NodeRenderingContext with RenderStyle& as shouldCreateRenderer() argument
1926
1927         Reviewed by Darin Adler.
1928
1929         This simplifies the code. NodeRenderingContext was only used for getting the RenderStyle.
1930
1931         * dom/Element.cpp:
1932         (WebCore::Element::rendererIsNeeded):
1933         * dom/Element.h:
1934         * dom/NodeRenderingContext.cpp:
1935         (WebCore::NodeRenderingContext::elementInsideRegionNeedsRenderer):
1936         (WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
1937         * dom/PseudoElement.cpp:
1938         (WebCore::PseudoElement::rendererIsNeeded):
1939         * dom/PseudoElement.h:
1940         * html/HTMLAppletElement.cpp:
1941         (WebCore::HTMLAppletElement::rendererIsNeeded):
1942         * html/HTMLAppletElement.h:
1943         * html/HTMLElement.cpp:
1944         (WebCore::HTMLElement::rendererIsNeeded):
1945         * html/HTMLElement.h:
1946         * html/HTMLEmbedElement.cpp:
1947         (WebCore::HTMLEmbedElement::rendererIsNeeded):
1948         * html/HTMLEmbedElement.h:
1949         * html/HTMLFormElement.cpp:
1950         (WebCore::HTMLFormElement::rendererIsNeeded):
1951         * html/HTMLFormElement.h:
1952         * html/HTMLFrameElement.cpp:
1953         (WebCore::HTMLFrameElement::rendererIsNeeded):
1954         * html/HTMLFrameElement.h:
1955         * html/HTMLFrameSetElement.cpp:
1956         (WebCore::HTMLFrameSetElement::rendererIsNeeded):
1957         * html/HTMLFrameSetElement.h:
1958         * html/HTMLIFrameElement.cpp:
1959         (WebCore::HTMLIFrameElement::rendererIsNeeded):
1960         * html/HTMLIFrameElement.h:
1961         * html/HTMLInputElement.cpp:
1962         (WebCore::HTMLInputElement::rendererIsNeeded):
1963         * html/HTMLInputElement.h:
1964         * html/HTMLMediaElement.cpp:
1965         (WebCore::HTMLMediaElement::rendererIsNeeded):
1966         * html/HTMLMediaElement.h:
1967         * html/HTMLObjectElement.cpp:
1968         (WebCore::HTMLObjectElement::rendererIsNeeded):
1969         * html/HTMLObjectElement.h:
1970         * html/HTMLOptGroupElement.h:
1971         * html/HTMLOptionElement.h:
1972         * html/HTMLVideoElement.cpp:
1973         (WebCore::HTMLVideoElement::rendererIsNeeded):
1974         * html/HTMLVideoElement.h:
1975         * html/shadow/DetailsMarkerControl.cpp:
1976         (WebCore::DetailsMarkerControl::rendererIsNeeded):
1977         * html/shadow/DetailsMarkerControl.h:
1978         * html/shadow/InsertionPoint.cpp:
1979         (WebCore::InsertionPoint::rendererIsNeeded):
1980         * html/shadow/InsertionPoint.h:
1981         * html/shadow/MeterShadowElement.cpp:
1982         (WebCore::MeterShadowElement::rendererIsNeeded):
1983         (WebCore::MeterInnerElement::rendererIsNeeded):
1984         * html/shadow/MeterShadowElement.h:
1985         * html/shadow/ProgressShadowElement.cpp:
1986         (WebCore::ProgressShadowElement::rendererIsNeeded):
1987         (WebCore::ProgressInnerElement::rendererIsNeeded):
1988         * html/shadow/ProgressShadowElement.h:
1989         * svg/SVGDescElement.h:
1990         * svg/SVGElement.h:
1991         (WebCore::SVGElement::rendererIsNeeded):
1992         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1993         (WebCore::SVGFilterPrimitiveStandardAttributes::rendererIsNeeded):
1994         * svg/SVGFilterPrimitiveStandardAttributes.h:
1995         * svg/SVGFontElement.h:
1996         * svg/SVGForeignObjectElement.cpp:
1997         (WebCore::SVGForeignObjectElement::rendererIsNeeded):
1998         * svg/SVGForeignObjectElement.h:
1999         * svg/SVGGElement.cpp:
2000         (WebCore::SVGGElement::rendererIsNeeded):
2001         * svg/SVGGElement.h:
2002         * svg/SVGGlyphElement.h:
2003         * svg/SVGGlyphRefElement.h:
2004         * svg/SVGHKernElement.h:
2005         * svg/SVGMarkerElement.h:
2006         * svg/SVGMissingGlyphElement.h:
2007         * svg/SVGSVGElement.cpp:
2008         (WebCore::SVGSVGElement::rendererIsNeeded):
2009         * svg/SVGSVGElement.h:
2010         * svg/SVGStopElement.cpp:
2011         (WebCore::SVGStopElement::rendererIsNeeded):
2012         * svg/SVGStopElement.h:
2013         * svg/SVGStyledElement.cpp:
2014         (WebCore::SVGStyledElement::rendererIsNeeded):
2015         * svg/SVGStyledElement.h:
2016         * svg/SVGTRefElement.cpp:
2017         (WebCore::SVGTRefElement::rendererIsNeeded):
2018         * svg/SVGTRefElement.h:
2019         * svg/SVGTSpanElement.cpp:
2020         (WebCore::SVGTSpanElement::rendererIsNeeded):
2021         * svg/SVGTSpanElement.h:
2022         * svg/SVGTextPathElement.cpp:
2023         (WebCore::SVGTextPathElement::rendererIsNeeded):
2024         * svg/SVGTextPathElement.h:
2025         * svg/SVGTitleElement.h:
2026         * svg/SVGVKernElement.h:
2027         * svg/SVGViewElement.h:
2028
2029 2013-08-20  Tim Horton  <timothy_horton@apple.com>
2030
2031         <https://webkit.org/b/105988> [Mac] Some inspector tests intermittently assert in InspectorOverlay::paint
2032         <rdar://problem/12958038>
2033
2034         Reviewed by Joseph Pecoraro.
2035
2036         Update the inspector overlay's layout before painting, if it is stale.
2037
2038         No new tests; fixes an intermittent assertion failure in some existing tests.
2039
2040         * inspector/InspectorOverlay.cpp:
2041         (WebCore::InspectorOverlay::paint):
2042
2043 2013-08-20  Daniel Bates  <dabates@apple.com>
2044
2045         Build fix after <http://trac.webkit.org/changeset/154260> (https://webkit.org/b/119949);
2046         declare Clipboard::hasData() when building with and without drag support
2047
2048         * dom/Clipboard.h:
2049
2050 2013-08-20  Hans Muller  <hmuller@adobe.com>
2051
2052         <https://webkit.org/b/119849> [CSS Shapes] Complete RasterShape::firstIncludedIntervalLogicalTop()
2053
2054         Reviewed by Alexandru Chiculita.
2055
2056         Completed the implementation of RasterShape::firstIncludedIntervalLogicalTop(). The
2057         method now computes first logical top location where a line segment can be laid
2058         out within a RasterShape, i.e. a shape derived from an image valued URL resource.
2059
2060         A detailed description of the algorithm can be found in
2061         http://hansmuller-webkit.blogspot.com/2013/08/first-fit-location-for-image-shapes.html.
2062
2063         The new tests exposed a bug in the existing getIncludedIntervals() method. A shape
2064         with a vertical gap that spans the entire line now causes the method to short circuit
2065         and return an empty interval list.
2066
2067         Tests: fast/shapes/shape-inside/shape-inside-image-003.html
2068                fast/shapes/shape-inside/shape-inside-image-004.html
2069                fast/shapes/shape-inside/shape-inside-image-005.html
2070
2071         * rendering/shapes/RasterShape.cpp:
2072         (WebCore::RasterShapeIntervals::firstIncludedIntervalY):
2073         (WebCore::RasterShapeIntervals::getIncludedIntervals):
2074         (WebCore::RasterShape::firstIncludedIntervalLogicalTop):
2075         * rendering/shapes/RasterShape.h:
2076
2077 2013-08-20  Pratik Solanki  <psolanki@apple.com>
2078
2079         <https://webkit.org/b/120029> Document::markers() should return a reference
2080
2081         Reviewed by Andreas Kling.
2082
2083         Document::m_markers is never NULL so return a reference from Document::markers(). Also mark
2084         m_markers as const and initialize it in member initialization.
2085
2086         * dom/Document.cpp:
2087         (WebCore::Document::Document):
2088         * dom/Document.h:
2089         (WebCore::Document::markers):
2090         * editing/AlternativeTextController.cpp:
2091         (WebCore::AlternativeTextController::isSpellingMarkerAllowed):
2092         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2093         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2094         (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
2095         (WebCore::AlternativeTextController::respondToChangedSelection):
2096         (WebCore::AlternativeTextController::respondToAppliedEditing):
2097         (WebCore::AlternativeTextController::respondToUnappliedEditing):
2098         (WebCore::AlternativeTextController::markReversed):
2099         (WebCore::AlternativeTextController::markCorrection):
2100         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
2101         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
2102         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
2103         (WebCore::AlternativeTextController::applyDictationAlternative):
2104         * editing/CompositeEditCommand.cpp:
2105         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2106         * editing/DeleteSelectionCommand.cpp:
2107         (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
2108         * editing/DictationCommand.cpp:
2109         (WebCore::DictationMarkerSupplier::addMarkersToTextNode):
2110         * editing/Editor.cpp:
2111         (WebCore::Editor::ignoreSpelling):
2112         (WebCore::Editor::learnSpelling):
2113         (WebCore::Editor::advanceToNextMisspelling):
2114         (WebCore::Editor::clearMisspellingsAndBadGrammar):
2115         (WebCore::Editor::markAndReplaceFor):
2116         (WebCore::Editor::changeBackToReplacedString):
2117         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
2118         (WebCore::Editor::countMatchesForText):
2119         (WebCore::Editor::setMarkedTextMatchesAreHighlighted):
2120         (WebCore::Editor::respondToChangedSelection):
2121         (WebCore::Editor::selectionStartHasMarkerFor):
2122         * editing/SpellChecker.cpp:
2123         (WebCore::SpellChecker::didCheckSucceed):
2124         * editing/SplitTextNodeCommand.cpp:
2125         (WebCore::SplitTextNodeCommand::doApply):
2126         (WebCore::SplitTextNodeCommand::doUnapply):
2127         * editing/TextCheckingHelper.cpp:
2128         (WebCore::TextCheckingHelper::findFirstMisspelling):
2129         (WebCore::TextCheckingHelper::findFirstGrammarDetail):
2130         * page/FrameView.cpp:
2131         (WebCore::FrameView::getTickmarks):
2132         (WebCore::FrameView::paintContents):
2133         * page/Page.cpp:
2134         (WebCore::Page::unmarkAllTextMatches):
2135         * rendering/HitTestResult.cpp:
2136         (WebCore::HitTestResult::spellingToolTip):
2137         (WebCore::HitTestResult::replacedString):
2138         (WebCore::HitTestResult::dictationAlternatives):
2139         * rendering/InlineTextBox.cpp:
2140         (WebCore::InlineTextBox::paintDocumentMarkers):
2141         * rendering/svg/SVGInlineFlowBox.cpp:
2142         (WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
2143         * testing/Internals.cpp:
2144         (WebCore::Internals::markerCountForNode):
2145         (WebCore::Internals::markerAt):
2146         (WebCore::Internals::addTextMatchMarker):
2147
2148 2013-08-20  Pratik Solanki  <psolanki@apple.com>
2149
2150         <https://webkit.org/b/119875> localeToScriptCodeForFontSelection should use hash tables with larger default capacity
2151
2152         Reviewed by Darin Adler.
2153
2154         The two static hash tables used in this file have 106 and 198 entries. Set a minimumTableSize for
2155         these hash tables so we don't have to expand them during initialization.
2156
2157         No new tests because no functional changes.
2158
2159         * platform/text/LocaleToScriptMappingDefault.cpp:
2160         (WebCore::scriptNameToCode):
2161         (WebCore::localeToScriptCodeForFontSelection):
2162
2163 2013-08-20  Eric Carlson  <eric.carlson@apple.com>
2164
2165         <https://webkit.org/b/120068> Media controls can be attached lazily
2166
2167         Reviewed by Jer Noble.
2168
2169         Merge https://chromium.googlesource.com/chromium/blink/+/28a995486a675992f2e72f81bfabdfff05688a31.
2170
2171         * html/HTMLMediaElement.cpp:
2172         (WebCore::HTMLMediaElement::createMediaControls): Add AttachLazily to appendChild().
2173
2174 2013-08-20  Daniel Bates  <dabates@apple.com>
2175
2176         <https://webkit.org/b/120072> Use nullAtom instead of defining static local in
2177         Accessibility{Object, RenderObject}::actionVerb()
2178
2179         Reviewed by Chris Fleizach.
2180
2181         * accessibility/AccessibilityObject.cpp:
2182         (WebCore::AccessibilityObject::actionVerb):
2183         * accessibility/AccessibilityRenderObject.cpp:
2184         (WebCore::AccessibilityRenderObject::actionVerb):
2185
2186 2013-08-20  Daniel Bates  <dabates@apple.com>
2187
2188         <https://webkit.org/b/119914> [iOS] Upstream changes to WebCore/accessibility
2189
2190         Reviewed by Darin Adler and Chris Fleizach.
2191
2192         * accessibility/AccessibilityMenuList.cpp:
2193         (WebCore::AccessibilityMenuList::press):
2194         (WebCore::AccessibilityMenuList::isCollapsed):
2195         * accessibility/AccessibilityObject.cpp:
2196         (WebCore::AccessibilityObject::headingElementForNode):
2197         (WebCore::AccessibilityObject::actionVerb):
2198         * accessibility/AccessibilityObject.h:
2199         * accessibility/AccessibilityRenderObject.cpp:
2200         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
2201         (WebCore::AccessibilityRenderObject::actionVerb):
2202         * accessibility/AccessibilityTableColumn.cpp:
2203         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
2204         * accessibility/AccessibilityTableHeaderContainer.cpp:
2205         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
2206         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2207
2208 2013-08-20  Bruno de Oliveira Abinader  <bruno.d@partner.samsung.com>
2209
2210         [css3-text] Implement CSS3 text-decoration shorthand
2211         https://bugs.webkit.org/show_bug.cgi?id=92000
2212
2213         Reviewed by Darin Adler.
2214
2215         Implements the text-decoration shorthand (with -webkit- prefix), as specified by the CSS3 Text Decoration specification:
2216         http://dev.w3.org/csswg/css-text-decor-3/#text-decoration-property
2217
2218         Backported from Blink:
2219         https://src.chromium.org/viewvc/blink?revision=156266&view=revision
2220
2221         Tests: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand-ordering.html
2222                fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-shorthand.html
2223
2224         * css/CSSComputedStyleDeclaration.cpp:
2225         (WebCore::ComputedStyleExtractor::propertyValue):
2226         * css/CSSParser.cpp:
2227         (WebCore::CSSParser::parseValue):
2228         (WebCore::CSSParser::addTextDecorationProperty):
2229         (WebCore::CSSParser::parseTextDecoration):
2230         * css/CSSProperty.cpp:
2231         (WebCore::CSSProperty::isInheritedProperty):
2232         * css/CSSPropertyNames.in:
2233         * css/StylePropertyShorthand.cpp:
2234         (WebCore::webkitTextDecorationShorthand):
2235         (WebCore::shorthandForProperty):
2236         (WebCore::matchingShorthandsForLonghand):
2237         * css/StylePropertyShorthand.h:
2238
2239 2013-08-20  Gavin Barraclough  <barraclough@apple.com>
2240
2241         https://bugs.webkit.org/show_bug.cgi?id=120054
2242         Remove some dead code following getOwnPropertyDescriptor cleanup
2243
2244         Reviewed by Oliver Hunt.
2245
2246         * bindings/js/JSPluginElementFunctions.cpp:
2247         * bindings/js/JSPluginElementFunctions.h:
2248             - remove runtimeObjectCustomGetOwnPropertyDescriptor, pluginElementCustomGetOwnPropertyDescriptor
2249
2250 2013-08-20  Alex Christensen  <achristensen@apple.com>
2251
2252         Use PlatformArchitecture to distinguish between 32-bit and 64-bit builds on Windows.
2253         https://bugs.webkit.org/show_bug.cgi?id=119512
2254
2255         Reviewed by Brent Fulgham.
2256
2257         * WebCore.vcxproj/WebCore.vcxproj:
2258         * WebCore.vcxproj/WebCore.vcxproj.filters:
2259         * WebCore.vcxproj/WebCoreCommon.props:
2260         * WebCore.vcxproj/WebCoreGeneratedCommon.props:
2261         * WebCore.vcxproj/WebCoreTestSupport.vcxproj:
2262         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters:
2263         Replaced obj32, bin32, and lib32 with macros for 64-bit build.
2264
2265 2013-08-20  Jessie Berlin  <jberlin@apple.com>
2266
2267         Remove a string no longer used after r154251.
2268
2269         Rubber-stamped by Brady Eidson.
2270
2271         * English.lproj/Localizable.strings:
2272
2273 2013-08-20  Jakob Petsovits  <jpetsovits@blackberry.com>
2274
2275         [BlackBerry] Avoid an assertion from calling releaseBufferDrawable(nullptr)
2276         https://bugs.webkit.org/show_bug.cgi?id=119862
2277         JIRA 470760
2278
2279         Reviewed by Antonio Gomes.
2280
2281         destroyBuffer() finds a null pointer valid but
2282         releaseBufferDrawable() does not. Fix by adding a
2283         null pointer check.
2284
2285         No new tests, caught by existing layout test runs.
2286
2287         * platform/graphics/blackberry/ImageBufferBlackBerry.cpp:
2288         (WebCore::ImageBuffer::~ImageBuffer):
2289
2290 2013-08-19  Gustavo Noronha Silva  <gns@gnome.org>
2291
2292         <https://webkit.org/b/120048> [GTK] Add stubs for APIs that went missing in the DOM bindings
2293
2294         Reviewed by Martin Robinson.
2295
2296         No new tests, these are just stubs for the DOM bindings API.
2297
2298         * bindings/gobject/WebKitDOMCustom.cpp:
2299         (webkit_dom_bar_info_get_property):
2300         (webkit_dom_bar_info_class_init):
2301         (webkit_dom_bar_info_init):
2302         (webkit_dom_bar_info_get_visible):
2303         (webkit_dom_console_get_memory):
2304         (webkit_dom_css_style_declaration_get_property_css_value):
2305         (webkit_dom_document_get_webkit_hidden):
2306         (webkit_dom_document_get_webkit_visibility_state):
2307         (webkit_dom_html_document_open):
2308         (webkit_dom_html_element_set_item_id):
2309         (webkit_dom_html_element_get_item_id):
2310         (webkit_dom_html_element_get_item_ref):
2311         (webkit_dom_html_element_get_item_prop):
2312         (webkit_dom_html_element_set_item_scope):
2313         (webkit_dom_html_element_get_item_scope):
2314         (webkit_dom_html_element_get_item_type):
2315         (webkit_dom_html_properties_collection_get_property):
2316         (webkit_dom_html_properties_collection_class_init):
2317         (webkit_dom_html_properties_collection_init):
2318         (webkit_dom_html_properties_collection_item):
2319         (webkit_dom_html_properties_collection_named_item):
2320         (webkit_dom_html_properties_collection_get_length):
2321         (webkit_dom_html_properties_collection_get_names):
2322         (webkit_dom_node_get_attributes):
2323         (webkit_dom_node_has_attributes):
2324         (webkit_dom_memory_info_get_property):
2325         (webkit_dom_memory_info_class_init):
2326         (webkit_dom_memory_info_init):
2327         (webkit_dom_memory_info_get_total_js_heap_size):
2328         (webkit_dom_memory_info_get_used_js_heap_size):
2329         (webkit_dom_memory_info_get_js_heap_size_limit):
2330         (webkit_dom_micro_data_item_value_class_init):
2331         (webkit_dom_micro_data_item_value_init):
2332         (webkit_dom_performance_get_memory):
2333         (webkit_dom_property_node_list_get_property):
2334         (webkit_dom_property_node_list_class_init):
2335         (webkit_dom_property_node_list_init):
2336         (webkit_dom_property_node_list_item):
2337         (webkit_dom_property_node_list_get_length):
2338         * bindings/gobject/WebKitDOMCustom.h:
2339
2340 2013-08-20  Antti Koivisto  <antti@apple.com>
2341
2342         <https://webkit.org/b/120017> Remove NodeRenderingTraversal::ParentDetails
2343
2344         Reviewed by Andreas Kling.
2345
2346         Remove this oddly factored type that is used to optionally collect some data during ComposedShadowTreeWalker parent traversal.
2347         
2348         Also removed support for reset-style-inheritance attribute in InsertionPoint. We don't use or expose it.
2349
2350         * css/StyleResolver.cpp:
2351         (WebCore::StyleResolver::State::initForStyleResolve):
2352         (WebCore::StyleResolver::styleForElement):
2353         * css/StyleResolver.h:
2354         (WebCore::StyleResolver::State::State):
2355         (WebCore::StyleResolver::State::elementLinkState):
2356         
2357             Remove m_distributedToInsertionPoint State field. We never hit the cases where it was used.
2358
2359         * dom/ComposedShadowTreeWalker.cpp:
2360         (WebCore::ComposedShadowTreeWalker::traverseSiblingOrBackToInsertionPoint):
2361         (WebCore::ComposedShadowTreeWalker::traverseNodeEscapingFallbackContents):
2362         (WebCore::ComposedShadowTreeWalker::traverseParent):
2363         
2364             Return null instead of setting childWasOutOfComposition to details object. That's what would happen anyway in the caller.
2365
2366         (WebCore::ComposedShadowTreeWalker::traverseParentInCurrentTree):
2367         (WebCore::ComposedShadowTreeWalker::traverseParentBackToShadowRootOrHost):
2368         * dom/ComposedShadowTreeWalker.h:
2369         * dom/Node.cpp:
2370         (WebCore::Node::insertionParentForBinding):
2371         * dom/NodeRenderingContext.cpp:
2372         (WebCore::NodeRenderingContext::NodeRenderingContext):
2373         (WebCore::NodeRenderingContext::isOnEncapsulationBoundary):
2374         
2375             Make this look up InsertionPoint directly intead of relying it being populated in m_parentDetails. The function is used only in
2376             a few non-performance critical places.
2377
2378         (WebCore::NodeRenderingContext::resetStyleInheritance):
2379         
2380             Return parent ShadowRoots resetStyleInheritance() flag instead of using m_parentDetails.
2381
2382         * dom/NodeRenderingContext.h:
2383         * dom/NodeRenderingTraversal.cpp:
2384         (WebCore::NodeRenderingTraversal::parentSlow):
2385         * dom/NodeRenderingTraversal.h:
2386         (WebCore::NodeRenderingTraversal::parent):
2387         
2388             Remove ParentDetails.
2389
2390         * html/HTMLAttributeNames.in:
2391         * html/shadow/InsertionPoint.cpp:
2392         
2393             Remove unused resetStyleInheritance attribute.
2394
2395         (WebCore::InsertionPoint::removedFrom):
2396         (WebCore::findInsertionPointOf):
2397         
2398             Renamed for clarity.
2399
2400         * html/shadow/InsertionPoint.h:
2401         * testing/Internals.cpp:
2402         (WebCore::Internals::includerFor):
2403
2404 2013-08-20  Antti Koivisto  <antti@apple.com>
2405
2406         <https://webkit.org/b/120025> REGRESSION (r154254): fast/frames/frameset-frameborder-inheritance.html failing on Apple MountainLion Debug WK1 (Tests)
2407
2408         Reviewed by Anders Carlsson.
2409
2410         * html/HTMLDocument.cpp:
2411         (WebCore::HTMLDocument::isFrameSet):
2412         * html/HTMLFrameElement.cpp:
2413         (WebCore::HTMLFrameElement::didAttachRenderers):
2414         
2415             Make helper public in HTMLFrameSetElement.
2416
2417         * html/HTMLFrameSetElement.cpp:
2418         (WebCore::HTMLFrameSetElement::findContaining):
2419         
2420             Static function for finding containing frameset, if any.
2421
2422         (WebCore::HTMLFrameSetElement::willAttachRenderers):
2423         
2424             This broke in refactoring. We should exit the loop when the first containing frameset is found. Fix by refactoring more.
2425
2426         * html/HTMLFrameSetElement.h:
2427         (WebCore::isHTMLFrameSetElement):
2428         (WebCore::toHTMLFrameSetElement):
2429         
2430             Add casting functions.
2431
2432         * rendering/RenderFrameSet.cpp:
2433         (WebCore::RenderFrameSet::frameSet):
2434
2435 2013-08-20  Antti Koivisto  <antti@apple.com>
2436
2437         <https://webkit.org/b/120023> REGRESSION(r154257): svg/custom/bug78807.svg and svg/custom/use-invalid-style.svg failing
2438
2439         Reviewed by Andreas Kling.
2440
2441         * xml/XMLErrors.cpp:
2442         (WebCore::XMLErrors::insertErrorMessageBlock): "reattach" had accidentally turned into "detach" in refactoring.
2443
2444 2013-08-20  Antti Koivisto  <antti@apple.com>
2445
2446         <https://webkit.org/b/119969> REGRESSION (r154232): Crash on the japantimes.co.jp
2447
2448         Reviewed by Andreas Kling.
2449         
2450         PseudoElement no longer has parent and calling Element::insertedInto for them crashes as it tries to access it.
2451
2452         Normally there are no pseudo elements when Element::insertedInto() is invoked as they get detached and attached
2453         along with rendering. However in this case the page inserts a <style> that uses ::before along with an element
2454         that it applies to. Stylesheet insertion triggers synchronous style recalc that attaches rendering to all newly
2455         insered elements. Later Element::insertedInto gets called for the element that has pseudo element and we crash.
2456
2457         Test: fast/css-generated-content/insert-stylesheet-and-pseudo-crash.html
2458
2459         * dom/Element.cpp:
2460         (WebCore::Element::insertedInto):
2461         (WebCore::Element::removedFrom):
2462         
2463             Remove calls to insertedInto/removedFrom for pseudo elements. They are not considered to be in document.
2464             When they are added normally during render tree attach these calls don't happen either.
2465
2466 2013-08-20  Ryosuke Niwa  <rniwa@webkit.org>
2467
2468         Windows build fix after r154314.
2469
2470         * platform/graphics/cg/PathCG.cpp:
2471         (WebCore::Path::platformAddPathForRoundedRect):
2472
2473 2013-08-19  Hurnjoo Lee  <hurnjoo.lee@samsung.com>
2474
2475         [Cairo] Canvas putImageData is not working as expected
2476         https://bugs.webkit.org/show_bug.cgi?id=119992
2477
2478         Reviewed by Darin Adler.
2479
2480         ImageBufferCairo::putImageArray didn't perform pre-multiply in case of zero alpha value.
2481         If the alpha value is not 255, image data should always be pre-multiplied.
2482
2483         Test: fast/canvas/canvas-putImageData-zero-alpha.html
2484
2485         * platform/graphics/cairo/ImageBufferCairo.cpp:
2486         (WebCore::ImageBuffer::putByteArray):
2487
2488 2013-08-19  Santosh Mahto  <santosh.ma@samsung.com>
2489
2490         <https://webkit.org/b/119991> change usage of calculateUTCOffset()/calculateDSTOffset  to calculateLocalTimeOffset
2491
2492         Reviewed by Darin Adler.
2493
2494         Resolving code error.
2495
2496         * html/BaseDateAndTimeInputType.cpp:
2497         (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp):
2498         * html/MonthInputType.cpp:
2499         (WebCore::MonthInputType::defaultValueForStepUp):
2500         * html/TimeInputType.cpp:
2501         (WebCore::TimeInputType::defaultValueForStepUp):
2502
2503 2013-08-19  Ryosuke Niwa  <rniwa@webkit.org>
2504
2505         <https://webkit.org/b/120049> Delete code for Snow Leopard
2506
2507         Reviewed by Benjamin Poulain.
2508
2509         Delete all the code for Mac OS 10.6. Nobody builds on Snow Leopard at this point.
2510
2511         * WebCore.exp.in:
2512         * WebCore.xcodeproj/project.pbxproj:
2513         * editing/mac/EditorMac.mm:
2514         (WebCore::Editor::pasteWithPasteboard):
2515         * page/ContextMenuController.cpp:
2516         (WebCore::ContextMenuController::populate):
2517         * platform/LocalizedStrings.cpp:
2518         (WebCore::truncatedStringForLookupMenuItem):
2519         (WebCore::contextMenuItemTagSearchWeb):
2520         (WebCore::contextMenuItemTagLookUpInDictionary):
2521         * platform/MemoryPressureHandler.cpp:
2522         * platform/audio/mac/AudioBusMac.mm:
2523         (WebCore::AudioBus::loadPlatformResource):
2524         * platform/graphics/ca/GraphicsLayerCA.cpp:
2525         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2526         * platform/graphics/ca/PlatformCALayer.h:
2527         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2528         (PlatformCALayer::acceleratesDrawing):
2529         (PlatformCALayer::setAcceleratesDrawing):
2530         (PlatformCALayer::contentsScale):
2531         (PlatformCALayer::setContentsScale):
2532         (PlatformCALayer::synchronouslyDisplayTilesInRect):
2533         * platform/graphics/ca/mac/TileController.mm:
2534         (WebCore::TileController::setScale):
2535         (WebCore::TileController::setAcceleratesDrawing):
2536         (WebCore::TileController::createTileLayer):
2537         * platform/graphics/cg/ImageBufferDataCG.cpp:
2538         (WebCore::ImageBufferData::getData):
2539         (WebCore::ImageBufferData::putData):
2540         * platform/graphics/cg/ImageBufferDataCG.h:
2541         * platform/graphics/cg/PathCG.cpp:
2542         (WebCore::Path::platformAddPathForRoundedRect):
2543         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2544         (WebCore::FontPlatformData::FontPlatformData):
2545         (WebCore::FontPlatformData::setFont):
2546         * platform/graphics/mac/FontMac.mm:
2547         (WebCore::showGlyphsWithAdvances):
2548         * platform/graphics/mac/GraphicsContextMac.mm:
2549         (WebCore::GraphicsContext::drawLineForDocumentMarker):
2550         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2551         (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
2552         (WebCore::MediaPlayerPrivateQTKit::layerHostChanged):
2553         * platform/graphics/mac/WebLayer.mm:
2554         (drawLayerContents):
2555         * platform/mac/CursorMac.mm:
2556         (WebCore::Cursor::ensurePlatformCursor):
2557         * platform/mac/EmptyProtocolDefinitions.h: Removed.
2558         * platform/mac/MemoryPressureHandlerMac.mm:
2559         (WebCore::MemoryPressureHandler::releaseMemory):
2560         * platform/mac/NSScrollerImpDetails.h:
2561         * platform/mac/PlatformEventFactoryMac.mm:
2562         (WebCore::momentumPhaseForEvent):
2563         (WebCore::phaseForEvent):
2564         * platform/mac/ScrollAnimatorMac.mm:
2565         * platform/mac/SharedTimerMac.mm:
2566         * platform/mac/WebCoreSystemInterface.h:
2567         * platform/mac/WebCoreSystemInterface.mm:
2568         * platform/network/mac/ResourceHandleMac.mm:
2569         * platform/network/mac/ResourceRequestMac.mm:
2570         (WebCore::ResourceRequest::doUpdateResourceRequest):
2571         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2572         * platform/text/cf/HyphenationCF.cpp:
2573         * platform/text/mac/HyphenationMac.mm: Removed.
2574         * rendering/RenderLayerBacking.cpp:
2575         (WebCore::RenderLayerBacking::containsPaintedContent):
2576         * rendering/RenderThemeMac.mm:
2577         (WebCore::RenderThemeMac::shouldShowPlaceholderWhenFocused):
2578
2579 2013-08-19  Ryosuke Niwa  <rniwa@webkit.org>
2580
2581         <https://webkit.org/b/120041> Remove superfluous min calls in RenderBlock::computeOverflow
2582
2583         Reviewed by Simon Fraser.
2584
2585         Merge https://chromium.googlesource.com/chromium/blink/+/29cad35d6b4642804e6b7c1a30f0b4435dd7a71d
2586
2587         They are contained in an "if" statement that ensures that textIndent < 0 and so the min will never be 0.
2588
2589         * rendering/RenderBlock.cpp:
2590         (WebCore::RenderBlock::computeOverflow):
2591
2592 2013-08-19  Ryosuke Niwa  <rniwa@webkit.org>
2593
2594         <https://webkit.org/b/119930> input[type=range]: Fix a crash by changing input type in 'input' event handler
2595
2596         Reviewed by Kent Tamura.
2597
2598         Merge https://chromium.googlesource.com/chromium/blink/+/99afc9b55ce176b4f5fe053070e19dbebc1891a5
2599
2600         In SliderThumbElement::setPositionFromPoint, renderer() can be NULL after HTMLInputElement::setValueFromRenderer,
2601         which dispatches 'input' event. Also, make a local vairable 'input' a RefPtr just in case.
2602
2603         Also add null-poinetr checks for the host element as SliderThumbElement only weakly holds onto the host element.
2604
2605         Test: fast/forms/range/range-type-change-oninput.html
2606
2607         * html/shadow/SliderThumbElement.cpp:
2608         (WebCore::SliderThumbElement::isDisabledFormControl):
2609         (WebCore::SliderThumbElement::matchesReadOnlyPseudoClass):
2610         (WebCore::SliderThumbElement::matchesReadWritePseudoClass):
2611         (WebCore::SliderThumbElement::setPositionFromPoint):
2612         (WebCore::SliderThumbElement::hostInput):
2613
2614 2013-08-19  Alexey Proskuryakov  <ap@apple.com>
2615
2616         https://bugs.webkit.org/show_bug.cgi?id=120028
2617         ASSERTION FAILED: m_history->provisionalItem() == m_requestedHistoryItem.get()
2618         when navigating to an uncached subframe
2619
2620         Reviewed by Brady Eidson.
2621
2622         Test: http/tests/navigation/post-frames-goback1-uncached.html
2623
2624         * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURLIntoChildFrame):
2625         Set m_requestedHistoryItem in a code path that doesn't go through FrameLoader::loadItem.
2626
2627         * loader/HistoryController.cpp: (WebCore::HistoryController::restoreDocumentState):
2628         Now that we always set m_requestedHistoryItem, there is no need to traverse frame
2629         tree to see if this document is being loaded as part of b/f navigation (which was
2630         add in bug 90870).
2631
2632 2013-08-19  Gavin Barraclough  <barraclough@apple.com>
2633
2634         https://bugs.webkit.org/show_bug.cgi?id=120034
2635         Remove custom getOwnPropertyDescriptor for global objects
2636
2637         Reviewed by Geoff Garen.
2638
2639         Fix attributes of JSC SynbolTableObject entries, ensure that cross frame access is safe, and suppress prototype chain walk.
2640
2641         * bindings/js/JSDOMWindowCustom.cpp:
2642         (WebCore::JSDOMWindow::getOwnPropertySlot):
2643             - Remove custom getOwnPropertyDescriptor implementation, on cross-frame access ensure
2644               all properties are marked as read-only, non-configurable to prevent defineProperty.
2645
2646 2013-08-19  Gavin Barraclough  <barraclough@apple.com>
2647
2648         https://bugs.webkit.org/show_bug.cgi?id=119995
2649         Start removing custom implementations of getOwnPropertyDescriptor
2650
2651         Reviewed by Sam Weinig.
2652
2653         This can now typically implemented in terms of getOwnPropertySlot.
2654         Add a macro to PropertyDescriptor to define an implementation of GOPD in terms of GOPS.
2655         Switch over most classes in JSC & the WebCore bindings generator to use this.
2656
2657         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2658         * bindings/js/JSHTMLAppletElementCustom.cpp:
2659         * bindings/js/JSHTMLEmbedElementCustom.cpp:
2660         * bindings/js/JSHTMLObjectElementCustom.cpp:
2661         * bindings/js/JSHistoryCustom.cpp:
2662         (WebCore::JSHistory::getOwnPropertySlotDelegate):
2663         * bindings/js/JSLocationCustom.cpp:
2664         (WebCore::JSLocation::getOwnPropertySlotDelegate):
2665         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2666             - Remove getOwnPropertyDescriptorDelegate methods,
2667               Change attributes of cross-frame access properties in JSHistory/JSLocation to prevent properties from being redefined.
2668         * bindings/scripts/CodeGeneratorJS.pm:
2669         (GenerateHeader):
2670         (GenerateImplementation):
2671         (GenerateConstructorHelperMethods):
2672             - Implement getOwnPropertySlot in terms of GET_OWN_PROPERTY_DESCRIPTOR_IMPL.
2673         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2674         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2675         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2676         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2677         * bindings/scripts/test/JS/JSTestException.cpp:
2678         * bindings/scripts/test/JS/JSTestInterface.cpp:
2679         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2680         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2681         * bindings/scripts/test/JS/JSTestNode.cpp:
2682         * bindings/scripts/test/JS/JSTestObj.cpp:
2683         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2684         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2685         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2686             - Update test expectations.
2687
2688 2013-08-19  Benjamin Poulain  <benjamin@webkit.org>
2689
2690         <https://webkit.org/b/119936> Fix some encapsulation issues of RuleSet
2691
2692         Reviewed by Darin Adler.
2693
2694         None of the attributes of RuleSet should be modified directly.
2695
2696         * css/DocumentRuleSets.cpp:
2697         (WebCore::DocumentRuleSets::initUserStyle):
2698         * css/ElementRuleCollector.cpp:
2699         (WebCore::ElementRuleCollector::collectMatchingRulesForRegion):
2700         * css/RuleSet.h:
2701         (WebCore::RuleSet::RuleSetSelectorPair::RuleSetSelectorPair):
2702         (WebCore::RuleSet::regionSelectorsAndRuleSets):
2703         (WebCore::RuleSet::ruleCount):
2704         * css/StyleResolver.cpp:
2705         (WebCore::StyleResolver::checkRegionStyle):
2706
2707 2013-08-19  Benjamin Poulain  <benjamin@webkit.org>
2708
2709         <https://webkit.org/b/119937> Remove ElementRuleCollector's m_behaviorAtBoundary
2710
2711         Reviewed by Darin Adler.
2712
2713         The value DoesNotCrossBoundary is the default behavior boundary of SelectorChecker,
2714         and it is never changed by ElementRuleCollector.
2715
2716         * css/ElementRuleCollector.cpp:
2717         (WebCore::ElementRuleCollector::collectMatchingRules):
2718         (WebCore::ElementRuleCollector::ruleMatches):
2719         * css/ElementRuleCollector.h:
2720         (WebCore::ElementRuleCollector::ElementRuleCollector):
2721
2722 2013-08-19  Benjamin Poulain  <benjamin@webkit.org>
2723
2724         <https://webkit.org/b/119934> Remove a repeated "private:" from ElementRuleCollector
2725
2726         Reviewed by Darin Adler.
2727
2728         * css/ElementRuleCollector.h:
2729
2730 2013-08-19  Pratik Solanki  <psolanki@apple.com>
2731
2732         <https://webkit.org/b/120019> Document::visitedLinkState() should return a reference
2733
2734         Reviewed by Andreas Kling.
2735
2736         Document::m_visitedLinkState is never NULL so we can just return a reference. Also make it a const.
2737
2738         * css/StyleResolver.cpp:
2739         (WebCore::StyleResolver::State::initElement):
2740         * dom/Document.h:
2741         (WebCore::Document::visitedLinkState):
2742         * history/CachedPage.cpp:
2743         (WebCore::CachedPage::restore):
2744         * page/Page.cpp:
2745         (WebCore::Page::allVisitedStateChanged):
2746         (WebCore::Page::visitedStateChanged):
2747
2748 2013-08-19  Ryosuke Niwa  <rniwa@webkit.org>
2749
2750         ASSERTION FAILED: !node || node->isShadowRoot() in WebCore::EventRetargeter::eventTargetRespectingTargetRules
2751         https://bugs.webkit.org/show_bug.cgi?id=119720
2752
2753         Reviewed by Andy Estes.
2754
2755         Merge https://chromium.googlesource.com/chromium/blink/+/4ce9bfbf54410179cd0f18b3d1a912045fc0ec3d
2756
2757         * dom/EventRetargeter.h:
2758         (WebCore::EventRetargeter::eventTargetRespectingTargetRules):
2759
2760 2013-08-19  Darin Adler  <darin@apple.com>
2761
2762         <https://webkit.org/b/120013> Tighten up logic in HTMLTableRowsCollection
2763
2764         Reviewed by Andy Estes.
2765
2766         I was looking for incorrect uses of hasLocalName in places where hasTagName should be used.
2767         The use in HTMLTableRowsCollection looked like that kind of mistake, but when I tried to
2768         make a test case to show the mistake, I found I could not. So I wrote assertions to restate
2769         what I learned, and removed an unneeded null check and tightened up the code a bit. This
2770         should make code size slightly smaller.
2771
2772         * html/HTMLTableRowsCollection.cpp:
2773         (WebCore::assertRowIsInTable): Added. Asserts that the row's position in the table is consistent
2774         with the invariants of how the collection class works. A row that is processed here would have
2775         to be an immediate child of the table, or an immediate child of a table section that in turn is
2776         an immediate child of the table.
2777         (WebCore::isInSection): Added. Replaces the three more-specific helper functions. Unlike those,
2778         this does not do a null check.
2779         (WebCore::HTMLTableRowsCollection::rowAfter): Changed to use the two new functions.
2780
2781 2013-08-19  Pratik Solanki  <psolanki@apple.com>
2782
2783         <https://webkit.org/b/119918> Frame::selection() should return a reference
2784
2785         Reviewed by Darin Adler.
2786
2787         m_selection is never NULL so return a reference from Frame::selection(). Also removed some
2788         unnecessary null checks and assert diff ts exposed as a result.
2789
2790         * accessibility/AccessibilityRenderObject.cpp:
2791         (WebCore::AccessibilityRenderObject::selection):
2792         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
2793         (WebCore::AccessibilityRenderObject::isFocused):
2794         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2795         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
2796         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2797         (-[WebAccessibilityObjectWrapper accessibilityModifySelection:increase:]):
2798         (-[WebAccessibilityObjectWrapper accessibilityMoveSelectionToMarker:]):
2799         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2800         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
2801         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2802         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
2803         * css/SelectorChecker.cpp:
2804         (WebCore::SelectorChecker::isFrameFocused):
2805         * dom/CharacterData.cpp:
2806         (WebCore::CharacterData::setDataAndUpdate):
2807         * dom/Document.cpp:
2808         (WebCore::Document::nodeChildrenWillBeRemoved):
2809         (WebCore::Document::nodeWillBeRemoved):
2810         * dom/Element.cpp:
2811         (WebCore::Element::updateFocusAppearance):
2812         * editing/AlternativeTextController.cpp:
2813         (WebCore::AlternativeTextController::stopPendingCorrection):
2814         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2815         (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
2816         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2817         (WebCore::AlternativeTextController::timerFired):
2818         (WebCore::AlternativeTextController::respondToChangedSelection):
2819         * editing/DeleteButtonController.cpp:
2820         (WebCore::DeleteButtonController::respondToChangedSelection):
2821         (WebCore::DeleteButtonController::enable):
2822         (WebCore::DeleteButtonController::deleteTarget):
2823         * editing/DeleteSelectionCommand.cpp:
2824         (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
2825         * editing/DictationCommand.cpp:
2826         (WebCore::DictationCommand::insertText):
2827         * editing/EditCommand.cpp:
2828         (WebCore::EditCommand::EditCommand):
2829         * editing/EditingStyle.cpp:
2830         (WebCore::EditingStyle::mergeTypingStyle):
2831         * editing/Editor.cpp:
2832         (WebCore::Editor::selectionForCommand):
2833         (WebCore::Editor::canEdit):
2834         (WebCore::Editor::canEditRichly):
2835         (WebCore::Editor::canDHTMLCut):
2836         (WebCore::Editor::canDHTMLCopy):
2837         (WebCore::Editor::canCopy):
2838         (WebCore::Editor::canDelete):
2839         (WebCore::Editor::canSmartCopyOrDelete):
2840         (WebCore::Editor::deleteWithDirection):
2841         (WebCore::Editor::deleteSelectionWithSmartDelete):
2842         (WebCore::Editor::replaceSelectionWithFragment):
2843         (WebCore::Editor::selectedRange):
2844         (WebCore::Editor::tryDHTMLCopy):
2845         (WebCore::Editor::tryDHTMLCut):
2846         (WebCore::Editor::hasBidiSelection):
2847         (WebCore::Editor::selectionUnorderedListState):
2848         (WebCore::Editor::selectionOrderedListState):
2849         (WebCore::Editor::increaseSelectionListLevel):
2850         (WebCore::Editor::increaseSelectionListLevelOrdered):
2851         (WebCore::Editor::increaseSelectionListLevelUnordered):
2852         (WebCore::Editor::decreaseSelectionListLevel):
2853         (WebCore::Editor::findEventTargetFromSelection):
2854         (WebCore::Editor::applyStyle):
2855         (WebCore::Editor::applyParagraphStyle):
2856         (WebCore::Editor::applyStyleToSelection):
2857         (WebCore::Editor::applyParagraphStyleToSelection):
2858         (WebCore::Editor::selectionStartHasStyle):
2859         (WebCore::Editor::selectionHasStyle):
2860         (WebCore::Editor::selectionStartCSSPropertyValue):
2861         (WebCore::Editor::appliedEditing):
2862         (WebCore::Editor::insertTextWithoutSendingTextEvent):
2863         (WebCore::Editor::insertLineBreak):
2864         (WebCore::Editor::insertParagraphSeparator):
2865         (WebCore::Editor::cut):
2866         (WebCore::Editor::copy):
2867         (WebCore::Editor::paste):
2868         (WebCore::Editor::baseWritingDirectionForSelectionStart):
2869         (WebCore::Editor::selectComposition):
2870         (WebCore::Editor::setComposition):
2871         (WebCore::Editor::ignoreSpelling):
2872         (WebCore::Editor::learnSpelling):
2873         (WebCore::Editor::advanceToNextMisspelling):
2874         (WebCore::Editor::misspelledWordAtCaretOrRange):
2875         (WebCore::Editor::isSelectionUngrammatical):
2876         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
2877         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2878         (WebCore::Editor::isSpellCheckingEnabledInFocusedNode):
2879         (WebCore::Editor::markAndReplaceFor):
2880         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
2881         (WebCore::Editor::revealSelectionAfterEditingOperation):
2882         (WebCore::Editor::getCompositionSelection):
2883         (WebCore::Editor::transpose):
2884         (WebCore::Editor::changeSelectionAfterCommand):
2885         (WebCore::Editor::selectedText):
2886         (WebCore::Editor::computeAndSetTypingStyle):
2887         (WebCore::Editor::findString):
2888         (WebCore::Editor::respondToChangedSelection):
2889         (WebCore::Editor::selectionStartHasMarkerFor):
2890         (WebCore::Editor::toggleOverwriteModeEnabled):
2891         * editing/EditorCommand.cpp:
2892         (WebCore::executeToggleStyleInList):
2893         (WebCore::expandSelectionToGranularity):
2894         (WebCore::stateTextWritingDirection):
2895         (WebCore::executeDelete):
2896         (WebCore::executeDeleteToMark):
2897         (WebCore::executeMoveBackward):
2898         (WebCore::executeMoveBackwardAndModifySelection):
2899         (WebCore::executeMoveDown):
2900         (WebCore::executeMoveDownAndModifySelection):
2901         (WebCore::executeMoveForward):
2902         (WebCore::executeMoveForwardAndModifySelection):
2903         (WebCore::executeMoveLeft):
2904         (WebCore::executeMoveLeftAndModifySelection):
2905         (WebCore::executeMovePageDown):
2906         (WebCore::executeMovePageDownAndModifySelection):
2907         (WebCore::executeMovePageUp):
2908         (WebCore::executeMovePageUpAndModifySelection):
2909         (WebCore::executeMoveRight):
2910         (WebCore::executeMoveRightAndModifySelection):
2911         (WebCore::executeMoveToBeginningOfDocument):
2912         (WebCore::executeMoveToBeginningOfDocumentAndModifySelection):
2913         (WebCore::executeMoveToBeginningOfLine):
2914         (WebCore::executeMoveToBeginningOfLineAndModifySelection):
2915         (WebCore::executeMoveToBeginningOfParagraph):
2916         (WebCore::executeMoveToBeginningOfParagraphAndModifySelection):
2917         (WebCore::executeMoveToBeginningOfSentence):
2918         (WebCore::executeMoveToBeginningOfSentenceAndModifySelection):
2919         (WebCore::executeMoveToEndOfDocument):
2920         (WebCore::executeMoveToEndOfDocumentAndModifySelection):
2921         (WebCore::executeMoveToEndOfSentence):
2922         (WebCore::executeMoveToEndOfSentenceAndModifySelection):
2923         (WebCore::executeMoveToEndOfLine):
2924         (WebCore::executeMoveToEndOfLineAndModifySelection):
2925         (WebCore::executeMoveToEndOfParagraph):
2926         (WebCore::executeMoveToEndOfParagraphAndModifySelection):
2927         (WebCore::executeMoveParagraphBackwardAndModifySelection):
2928         (WebCore::executeMoveParagraphForwardAndModifySelection):
2929         (WebCore::executeMoveUp):
2930         (WebCore::executeMoveUpAndModifySelection):
2931         (WebCore::executeMoveWordBackward):
2932         (WebCore::executeMoveWordBackwardAndModifySelection):
2933         (WebCore::executeMoveWordForward):
2934         (WebCore::executeMoveWordForwardAndModifySelection):
2935         (WebCore::executeMoveWordLeft):
2936         (WebCore::executeMoveWordLeftAndModifySelection):
2937         (WebCore::executeMoveWordRight):
2938         (WebCore::executeMoveWordRightAndModifySelection):
2939         (WebCore::executeMoveToLeftEndOfLine):
2940         (WebCore::executeMoveToLeftEndOfLineAndModifySelection):
2941         (WebCore::executeMoveToRightEndOfLine):
2942         (WebCore::executeMoveToRightEndOfLineAndModifySelection):
2943         (WebCore::executeSelectAll):
2944         (WebCore::executeSelectToMark):
2945         (WebCore::executeSetMark):
2946         (WebCore::executeSwapWithMark):
2947         (WebCore::executeUnselect):
2948         (WebCore::enabledInRichlyEditableText):
2949         (WebCore::enabledRangeInEditableText):
2950         (WebCore::enabledRangeInRichlyEditableText):
2951         (WebCore::valueFormatBlock):
2952         * editing/FrameSelection.cpp:
2953         (WebCore::FrameSelection::setSelection):
2954         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected):
2955         * editing/InsertLineBreakCommand.cpp:
2956         (WebCore::InsertLineBreakCommand::doApply):
2957         * editing/InsertTextCommand.cpp:
2958         (WebCore::InsertTextCommand::doApply):
2959         * editing/ModifySelectionListLevel.cpp:
2960         (WebCore::IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel):
2961         (WebCore::DecreaseSelectionListLevelCommand::canDecreaseSelectionListLevel):
2962         * editing/RemoveFormatCommand.cpp:
2963         (WebCore::RemoveFormatCommand::doApply):
2964         * editing/ReplaceSelectionCommand.cpp:
2965         (WebCore::ReplaceSelectionCommand::doApply):
2966         * editing/SetSelectionCommand.cpp:
2967         (WebCore::SetSelectionCommand::doApply):
2968         (WebCore::SetSelectionCommand::doUnapply):
2969         * editing/SpellingCorrectionCommand.cpp:
2970         (WebCore::SpellingCorrectionCommand::doApply):
2971         * editing/TextInsertionBaseCommand.cpp:
2972         (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
2973         * editing/TypingCommand.cpp:
2974         (WebCore::TypingCommand::deleteSelection):
2975         (WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection):
2976         (WebCore::TypingCommand::insertText):
2977         (WebCore::TypingCommand::deleteKeyPressed):
2978         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2979         * editing/ios/EditorIOS.mm:
2980         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2981         (WebCore::styleForSelectionStart):
2982         (WebCore::Editor::fontForSelection):
2983         * editing/mac/EditorMac.mm:
2984         (WebCore::styleForSelectionStart):
2985         (WebCore::Editor::fontForSelection):
2986         (WebCore::Editor::canCopyExcludingStandaloneImages):
2987         (WebCore::Editor::readSelectionFromPasteboard):
2988         * html/HTMLAnchorElement.cpp:
2989         (WebCore::HTMLAnchorElement::defaultEventHandler):
2990         (WebCore::HTMLAnchorElement::setActive):
2991         * html/HTMLInputElement.cpp:
2992         (WebCore::HTMLInputElement::updateFocusAppearance):
2993         * html/HTMLTextAreaElement.cpp:
2994         (WebCore::HTMLTextAreaElement::updateFocusAppearance):
2995         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
2996         * html/HTMLTextFormControlElement.cpp:
2997         (WebCore::HTMLTextFormControlElement::setSelectionRange):
2998         (WebCore::HTMLTextFormControlElement::computeSelectionStart):
2999         (WebCore::HTMLTextFormControlElement::computeSelectionEnd):
3000         (WebCore::HTMLTextFormControlElement::computeSelectionDirection):
3001         (WebCore::HTMLTextFormControlElement::selectionChanged):
3002         * html/TextFieldInputType.cpp:
3003         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
3004         * loader/FrameLoader.cpp:
3005         (WebCore::FrameLoader::clear):
3006         * loader/archive/cf/LegacyWebArchive.cpp:
3007         (WebCore::LegacyWebArchive::createFromSelection):
3008         * page/ContextMenuController.cpp:
3009         (WebCore::insertUnicodeCharacter):
3010         (WebCore::ContextMenuController::contextMenuItemSelected):
3011         (WebCore::selectionContainsPossibleWord):
3012         (WebCore::ContextMenuController::populate):
3013         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
3014         * page/DOMSelection.cpp:
3015         (WebCore::selectionShadowAncestor):
3016         (WebCore::DOMSelection::visibleSelection):
3017         (WebCore::DOMSelection::isCollapsed):
3018         (WebCore::DOMSelection::type):
3019         (WebCore::DOMSelection::rangeCount):
3020         (WebCore::DOMSelection::collapse):
3021         (WebCore::DOMSelection::collapseToEnd):
3022         (WebCore::DOMSelection::collapseToStart):
3023         (WebCore::DOMSelection::empty):
3024         (WebCore::DOMSelection::setBaseAndExtent):
3025         (WebCore::DOMSelection::setPosition):
3026         (WebCore::DOMSelection::modify):
3027         (WebCore::DOMSelection::extend):
3028         (WebCore::DOMSelection::getRangeAt):
3029         (WebCore::DOMSelection::removeAllRanges):
3030         (WebCore::DOMSelection::addRange):
3031         (WebCore::DOMSelection::deleteFromDocument):
3032         (WebCore::DOMSelection::containsNode):
3033         (WebCore::DOMSelection::toString):
3034         * page/DragController.cpp:
3035         (WebCore::DragController::dragIsMove):
3036         (WebCore::setSelectionToDragCaret):
3037         (WebCore::DragController::concludeEditDrag):
3038         (WebCore::DragController::draggableElement):
3039         (WebCore::selectElement):
3040         (WebCore::dragLocForSelectionDrag):
3041         (WebCore::DragController::startDrag):
3042         * page/DragController.h:
3043         * page/EventHandler.cpp:
3044         (WebCore::setSelectionIfNeeded):
3045         (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
3046         (WebCore::EventHandler::handleMousePressEventDoubleClick):
3047         (WebCore::EventHandler::handleMousePressEventSingleClick):
3048         (WebCore::EventHandler::updateSelectionForMouseDrag):
3049         (WebCore::EventHandler::lostMouseCapture):
3050         (WebCore::EventHandler::handleMouseReleaseEvent):
3051         (WebCore::nodeIsNotBeingEdited):
3052         (WebCore::EventHandler::selectCursor):
3053         (WebCore::EventHandler::handleMousePressEvent):
3054         (WebCore::EventHandler::handleMouseDoubleClickEvent):
3055         (WebCore::EventHandler::dispatchMouseEvent):
3056         (WebCore::EventHandler::sendContextMenuEvent):
3057         (WebCore::EventHandler::sendContextMenuEventForKey):
3058         (WebCore::handleKeyboardSelectionMovement):
3059         (WebCore::EventHandler::handleDrag):
3060         * page/FocusController.cpp:
3061         (WebCore::FocusController::setFocusedFrame):
3062         (WebCore::FocusController::setFocused):
3063         (WebCore::FocusController::advanceFocusInDocumentOrder):
3064         (WebCore::clearSelectionIfNeeded):
3065         (WebCore::FocusController::setActive):
3066         * page/Frame.cpp:
3067         (WebCore::Frame::dragImageForSelection):
3068         * page/Frame.h:
3069         (WebCore::Frame::selection):
3070         * page/FrameView.cpp:
3071         (WebCore::FrameView::performPostLayoutTasks):
3072         (WebCore::FrameView::paintContentsForSnapshot):
3073         * page/Page.cpp:
3074         (WebCore::Page::findString):
3075         (WebCore::Page::findStringMatchingRanges):
3076         (WebCore::Page::selection):
3077         * page/mac/FrameMac.mm:
3078         (WebCore::Frame::dragImageForSelection):
3079         * page/mac/FrameSnapshottingMac.mm:
3080         (WebCore::selectionImage):
3081         * page/win/FrameWin.cpp:
3082         (WebCore::imageFromSelection):
3083         (WebCore::Frame::dragImageForSelection):
3084         * platform/ios/PasteboardIOS.mm:
3085         (WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
3086         * rendering/HitTestResult.cpp:
3087         (WebCore::HitTestResult::isSelected):
3088         * rendering/RenderBlock.cpp:
3089         (WebCore::RenderBlock::paintCaret):
3090         * rendering/RenderImage.cpp:
3091         (WebCore::RenderImage::paintAreaElementFocusRing):
3092         * rendering/RenderLayer.cpp:
3093         (WebCore::RenderLayer::scrollTo):
3094         * rendering/RenderListBox.cpp:
3095         (WebCore::RenderListBox::paintItemForeground):
3096         (WebCore::RenderListBox::paintItemBackground):
3097         * rendering/RenderObject.cpp:
3098         (WebCore::RenderObject::selectionBackgroundColor):
3099         (WebCore::RenderObject::selectionColor):
3100         * rendering/RenderTextControlSingleLine.cpp:
3101         (WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged):
3102         * rendering/RenderTheme.cpp:
3103         (WebCore::RenderTheme::isFocused):
3104         * rendering/RenderThemeWin.cpp:
3105         (WebCore::RenderThemeWin::adjustSearchFieldStyle):
3106         * rendering/RenderTreeAsText.cpp:
3107         (WebCore::writeSelection):
3108         * rendering/RenderView.cpp:
3109         (WebCore::RenderView::setSelection):
3110         * svg/SVGSVGElement.cpp:
3111         (WebCore::SVGSVGElement::deselectAll):
3112         * svg/SVGTextContentElement.cpp:
3113         (WebCore::SVGTextContentElement::selectSubString):
3114         * testing/Internals.cpp:
3115         (WebCore::Internals::absoluteCaretBounds):
3116         (WebCore::Internals::selectionBounds):
3117
3118 2013-08-19  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3119
3120         <https://webkit.org/b/119679> Remove the cast-align warnings for ARM
3121
3122         Reviewed by Darin Adler.
3123
3124         While compiling WebKitGTK+ for ARM a lot of warnings of this form
3125         where shown (gcc 4.7.3):
3126
3127         ../../Source/WebCore/css/StylePropertySet.h: In member function 'const WebCore::StylePropertyMetadata* WebCore::ImmutableStylePropertySet::metadataArray() const':
3128 ../../Source/WebCore/css/StylePropertySet.h:179:142: warning: cast from 'const char*' to 'const WebCore::StylePropertyMetadata*' increases required alignment of target type [-Wcast-align]
3129
3130         This patch changes reinterpret_cast<>() for reinterpret_cast_ptr<>()
3131         which is part of WTF for this purpose, silencing the compiler.
3132
3133         * css/StylePropertySet.h:
3134         (WebCore::ImmutableStylePropertySet::metadataArray):
3135
3136 2013-08-19  Antti Koivisto  <antti@apple.com>
3137
3138         <https://webkit.org/b/120014> REGRESSION(r154268): Some stylesheet media attribute tests failing
3139
3140         Reviewed by Dan Bernstein.
3141
3142         * html/HTMLStyleElement.cpp:
3143         (WebCore::HTMLStyleElement::parseAttribute): Always set the media on InlineStyleSheetOwner.
3144
3145 2013-08-19  Chris Fleizach  <cfleizach@apple.com>
3146
3147         <https://webkit.org/b/119916> AX: WebKit is not exposing AXLanguage correctly
3148
3149         Reviewed by Darin Adler.
3150
3151         Expose the AXLanguage attribute for all objects.
3152
3153         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3154         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3155
3156 2013-08-19  Brent Fulgham  <bfulgham@apple.com>
3157
3158         [Windows] Unreviewed gardening.
3159
3160         * WebCore.vcxproj/WebCore.vcxproj: Add missing header for easy access/editing.
3161         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3162
3163 2013-08-19  Mario Sanchez Prada  <mario.prada@samsung.com>
3164
3165         <https://webkit.org/b/119882> Speed up moving cursor/selection up or down past non-rendered elements.
3166
3167         Reviewed by Darin Adler.
3168
3169         This is a port from Blink originally written by Dominic Mazzoni:
3170         https://src.chromium.org/viewvc/blink?revision=154977&view=revision
3171
3172         From the original commit:
3173
3174         Skips calling firstPositionInOrBeforeNode when a node doesn't have a
3175         renderer, since there couldn't possibly be a visible position there.
3176         This was particularly wasteful when trying to move the cursor up when at
3177         the beginning of a document, as it did a O(n^2) scan through the document head.
3178
3179         Test: editing/execCommand/move-up-down-should-skip-hidden-elements.html
3180
3181         * editing/VisibleUnits.cpp:
3182         (WebCore::previousRootInlineBoxCandidatePosition): Updated.
3183         (WebCore::nextRootInlineBoxCandidatePosition): Updates.
3184
3185 2013-08-19  Andreas Kling  <akling@apple.com>
3186
3187         <https://webkit.org/b/120000> Chrome::client() should return a reference.
3188
3189         Reviewed by Antti Koivisto.
3190
3191         Chrome::m_client should never be null.
3192
3193 2013-08-19  Antti Koivisto  <antti@apple.com>
3194
3195         <https://webkit.org/b/120004> Rename StyleElement to InlineStyleSheetOwner and stop inheriting from it
3196
3197         Reviewed by Andreas Kling.
3198         
3199         Saner names and class relations.
3200
3201         * CMakeLists.txt:
3202         * GNUmakefile.list.am:
3203         * Target.pri:
3204         * WebCore.vcxproj/WebCore.vcxproj:
3205         * WebCore.xcodeproj/project.pbxproj:
3206         * dom/DOMAllInOne.cpp:
3207         * dom/InlineStyleSheetOwner.cpp: Copied from Source/WebCore/dom/StyleElement.cpp.
3208         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
3209         (WebCore::InlineStyleSheetOwner::~InlineStyleSheetOwner):
3210         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
3211         (WebCore::InlineStyleSheetOwner::removedFromDocument):
3212         (WebCore::InlineStyleSheetOwner::clearDocumentData):
3213         (WebCore::InlineStyleSheetOwner::childrenChanged):
3214         (WebCore::InlineStyleSheetOwner::finishParsingChildren):
3215         (WebCore::InlineStyleSheetOwner::createSheetFromTextContents):
3216         (WebCore::InlineStyleSheetOwner::clearSheet):
3217         (WebCore::InlineStyleSheetOwner::createSheet):
3218         (WebCore::InlineStyleSheetOwner::isLoading):
3219         (WebCore::InlineStyleSheetOwner::sheetLoaded):
3220         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
3221         * dom/InlineStyleSheetOwner.h: Copied from Source/WebCore/dom/StyleElement.h.
3222         * dom/StyleElement.cpp: Removed.
3223         * dom/StyleElement.h: Removed.
3224         * html/HTMLStyleElement.cpp:
3225         (WebCore::HTMLStyleElement::HTMLStyleElement):
3226         (WebCore::HTMLStyleElement::~HTMLStyleElement):
3227         (WebCore::HTMLStyleElement::parseAttribute):
3228         (WebCore::HTMLStyleElement::finishParsingChildren):
3229         (WebCore::HTMLStyleElement::insertedInto):
3230         (WebCore::HTMLStyleElement::removedFrom):
3231         (WebCore::HTMLStyleElement::childrenChanged):
3232         * html/HTMLStyleElement.h:
3233         * svg/SVGStyleElement.cpp:
3234         (WebCore::SVGStyleElement::SVGStyleElement):
3235         (WebCore::SVGStyleElement::~SVGStyleElement):
3236         (WebCore::SVGStyleElement::parseAttribute):
3237         (WebCore::SVGStyleElement::finishParsingChildren):
3238         (WebCore::SVGStyleElement::insertedInto):
3239         (WebCore::SVGStyleElement::removedFrom):
3240         (WebCore::SVGStyleElement::childrenChanged):
3241         * svg/SVGStyleElement.h:
3242
3243 2013-08-19  Allan Sandfeld Jensen  <allan.jensen@digia.com>
3244
3245         [Qt] QtWebKit (using the Arora browser) displays the border radii (radius) of a button very ugly
3246         https://bugs.webkit.org/show_bug.cgi?id=28113
3247
3248         Reviewed by Jocelyn Turcotte.
3249
3250         StylePainter::init() was called twice making it clobber the previous antialiasing setting.
3251
3252         This patch cleans up the construction so we only have one constructor with init inlined.
3253
3254         * platform/qt/RenderThemeQStyle.cpp:
3255         (WebCore::StylePainterQStyle::StylePainterQStyle):
3256         (WebCore::StylePainterQStyle::setupStyleOption):
3257         * platform/qt/RenderThemeQStyle.h:
3258         * platform/qt/RenderThemeQt.cpp:
3259         (WebCore::StylePainter::StylePainter):
3260         * platform/qt/RenderThemeQt.h:
3261         * platform/qt/RenderThemeQtMobile.cpp:
3262         (WebCore::StylePainterMobile::StylePainterMobile):
3263
3264 2013-08-19  Julien Brianceau  <jbrianceau@nds.com>
3265
3266         <https://webkit.org/b/119998> [Qt] Build fix (broken since r154257).
3267
3268         Reviewed by Andreas Kling.
3269
3270         Element::attach() doesn't exist anymore since r154257.
3271
3272         * xml/parser/XMLDocumentParserQt.cpp:
3273         (WebCore::XMLDocumentParser::parseStartElement):
3274
3275 2013-08-19  Antti Koivisto  <antti@apple.com>
3276
3277         <https://webkit.org/b/120001> Clean up StyleElement
3278
3279         Reviewed by Andreas Kling.
3280
3281         - Make it non-virtual so we don't use virtual multiple inheritance
3282         - Improve names
3283         - Improve code clarity
3284
3285         * dom/StyleElement.cpp:
3286         (WebCore::StyleElement::StyleElement):
3287         (WebCore::StyleElement::insertedIntoDocument):
3288         (WebCore::StyleElement::clearDocumentData):
3289         (WebCore::StyleElement::childrenChanged):
3290         (WebCore::StyleElement::finishParsingChildren):
3291         (WebCore::StyleElement::createSheetFromTextContents):
3292         (WebCore::isValidCSSContentType):
3293         (WebCore::StyleElement::createSheet):
3294         (WebCore::StyleElement::isLoading):
3295         * dom/StyleElement.h:
3296         (WebCore::StyleElement::setStyleSheetContentType):
3297         (WebCore::StyleElement::setStyleSheetMedia):
3298         * html/HTMLStyleElement.cpp:
3299         (WebCore::HTMLStyleElement::parseAttribute):
3300         * html/HTMLStyleElement.h:
3301         * svg/SVGStyleElement.cpp:
3302         (WebCore::SVGStyleElement::isSupportedAttribute):
3303         (WebCore::SVGStyleElement::parseAttribute):
3304         * svg/SVGStyleElement.h:
3305
3306 2013-08-19  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3307
3308         <https://webkit.org/b/119990> Add toSVGStopElement(Node* node) to clean-up a static_cast<SVGStopElement*>
3309
3310         Reviewed by Darin Adler.
3311
3312         Clean up remained static_cast<SVGStopElement*> using toSVGStopElement(toSVGElement()).
3313
3314         * rendering/svg/SVGRenderTreeAsText.cpp:
3315         (WebCore::writeSVGGradientStop):
3316
3317 2013-08-19  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3318
3319         <https://webkit.org/b/119996> Introduce toSVGAnimateElement(), and use it
3320
3321         Reviewed by Andreas Kling.
3322
3323         As a step to clean-up static_cast<SVGXXX>, static_cast<SVGAnimateElement*> also can be changed
3324         with toSVGAnimateElement().
3325
3326         * svg/SVGAnimateElement.cpp:
3327         (WebCore::SVGAnimateElement::calculateAnimatedValue):
3328         * svg/SVGAnimateElement.h:
3329         (WebCore::toSVGAnimateElement):
3330         * svg/SVGAnimationElement.cpp:
3331         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
3332
3333 2013-08-19  Andreas Kling  <akling@apple.com>
3334
3335         <https://webkit.org/b/119997> Page::progress() should return a reference.
3336
3337         Reviewed by Antti Koivisto.
3338
3339         Page::m_progress is never null.
3340
3341 2013-08-18  Darin Adler  <darin@apple.com>
3342
3343         <https://webkit.org/b/119989> Make use of Node::ownerDocument a compile time error
3344
3345         Reviewed by Sam Weinig.
3346
3347         * dom/Element.h: Deleted the ownerDocument function. For compilers that don't support
3348         deleted functions, it is instead overrides the base class function with one that is
3349         private and not defined, which accomplishes almost the same thing: An error, either
3350         at compile time or link time.
3351
3352         * bindings/js/JSHTMLElementCustom.cpp:
3353         (WebCore::JSHTMLElement::pushEventHandlerScope): Use document instead of ownerDocument.
3354         * dom/Document.cpp:
3355         (WebCore::Document::~Document): Added a comment about this clearly-incorrect code.
3356         * inspector/InspectorInstrumentation.h:
3357         (WebCore::InspectorInstrumentation::didPushShadowRoot): Use document instead of ownerDocument.
3358         (WebCore::InspectorInstrumentation::willPopShadowRoot): Ditto.
3359         * inspector/InspectorStyleSheet.cpp:
3360         (WebCore::InspectorStyleSheetForInlineStyle::setStyleText): Ditto.
3361         * plugins/PluginView.cpp:
3362         (WebCore::getFrame): Removed ineffective call to ownerDocument after document when it
3363         returns 0. It will never return anything other than 0 in that case.
3364         * rendering/RenderVideo.cpp:
3365         (WebCore::RenderVideo::calculateIntrinsicSize): Use document instead of ownerDocument.
3366         Did not remove the null check at this time, although I'm pretty sure it's bogus. We can
3367         fix that when/if we change the return type of Element::document to a reference.
3368         * svg/SVGFEImageElement.cpp:
3369         (WebCore::SVGFEImageElement::requestImageResource): Use document instead of ownerDocument.
3370
3371 2013-08-18  Darin Adler  <darin@apple.com>
3372
3373         <https://webkit.org/b/119993> Remove most remaining platform-specific code from Clipboard class
3374
3375         Reviewed by Sam Weinig.
3376
3377         * GNUmakefile.list.am: Removed ClipboardGtk.cpp.
3378         * PlatformEfl.cmake: Removed ClipboardEfl.cpp.
3379         * PlatformGTK.cmake: Removed ClipboardGtk.cpp.
3380         * PlatformWinCE.cmake: Removed ClipboardWin.cpp.
3381         * Target.pri: Removed ClipboardQt.cpp.
3382         * WebCore.vcxproj/WebCore.vcxproj: Removed ClipboardWin.cpp and ClipboardWin.h.
3383         * WebCore.vcxproj/WebCore.vcxproj.filters: Removed ClipboardWin.cpp and ClipboardWin.h.
3384
3385         * dom/Clipboard.cpp:
3386         (WebCore::Clipboard::createDragImage): Added. Version that works for all platforms
3387         other than Mac, identical to the old one used in GTK and Qt, and close to the one used
3388         on Windows.
3389
3390         * platform/mac/ClipboardMac.mm: Trimmed includes down, and added a FIXME about next steps.
3391
3392         * platform/qt/DataTransferItemListQt.h: Removed "friend class ClipboardQt", which refers
3393         to a now-nonexistent class.
3394
3395         * platform/efl/ClipboardEfl.cpp: Removed.
3396         * platform/gtk/ClipboardGtk.cpp: Removed.
3397         * platform/qt/ClipboardQt.cpp: Removed.
3398         * platform/win/ClipboardWin.cpp: Removed.
3399
3400 2013-08-17  Darin Adler  <darin@apple.com>
3401
3402         <https://webkit.org/b/119949> Factor Clipboard into drag and non-drag parts
3403
3404         Reviewed by Sam Weinig.
3405
3406         * dom/Clipboard.cpp:
3407         (WebCore::Clipboard::Clipboard): Move the ClipboardType argument to go after the pasteboard.
3408         Initialize strings more efficiently. Put drag-specific data members inside an if statement.
3409         Replace m_clipboardType with m_forDrag.
3410         (WebCore::Clipboard::createForCopyAndPaste): Moved function up to be close to constructor.
3411         Removed explicit clipboard type since constructor now defaults to copy and paste style.
3412         (WebCore::Clipboard::setAccessPolicy): Tweaked comment.
3413         (WebCore::Clipboard::getData): Put drag-specific code inside #if ENABLE(DRAG_SUPPORT).
3414         (WebCore::Clipboard::setData): Ditto.
3415         (WebCore::Clipboard::files): Ditto.
3416         (WebCore::Clipboard::dropEffect): Added trivial non-drag versions of these functions to
3417         be used when !ENABLE(DRAG_SUPPORT).
3418         (WebCore::Clipboard::setDropEffect): Ditto.
3419         (WebCore::Clipboard::effectAllowed): Ditto.
3420         (WebCore::Clipboard::setEffectAllowed): Ditto.
3421         (WebCore::Clipboard::createForDragAndDrop): Renamed Clipboard::create that takes DragData
3422         to this, and kep the overload that does not as well. Made the DragData argument a const&.
3423         (WebCore::Clipboard::canSetDragImage): Moved down here since it is drag-specific.
3424         (WebCore::Clipboard::updateDragImage): Use m_shouldUpdateDragImage directly insted of
3425         calling a dragStarted function.
3426         (WebCore::dragOpFromIEOp): Moved this function down here to the drag-specific section.
3427         (WebCore::IEOpFromDragOp): Ditto.
3428         (WebCore::Clipboard::sourceOperation): Ditto.
3429         (WebCore::Clipboard::destinationOperation): Ditto.
3430         (WebCore::Clipboard::setSourceOperation): Ditto.
3431         (WebCore::Clipboard::setDestinationOperation): Ditto.
3432
3433         * dom/Clipboard.h: Removed unneeded include of "Node.h" and added and removed forward
3434         class declarations as required. Removed non-helpful comment. Made ClipboardType a private
3435         implementation detail. Moved functions that are not part of the DOM API down to a separate
3436         section lower down in the class, and sorted the functions to match the order they appear
3437         in the IDL file. Removed isForCopyAndPaste and isForDragAndDrop. Changed dropEffect and
3438         effectAllowed to not be inlined. Moved the long comment before canSetDragImage into the
3439         implementation since it's an implementation detail. Since this class is no longer polymorphic,
3440         use only private, not protected. Make m_dragImageElement an Element, not a Node.
3441
3442         * dom/Clipboard.idl: Removed flags to tell bindings how to deal with null strings, since
3443         these string properties can never return null strings anyway.
3444
3445         * page/DragController.cpp:
3446         (WebCore::DragController::dragExited): Updated to call the new createForDragAndDrop function.
3447         (WebCore::DragController::performDrag): Ditto.
3448         (WebCore::DragController::tryDHTMLDrag): Ditto.
3449
3450         * platform/mac/ClipboardMac.mm: Added now-needed include of Element.h since Clipboard.h no
3451         longer includes it.
3452
3453 2013-08-18  David Kilzer  <ddkilzer@apple.com>
3454
3455         WebCore fails to build with trunk clang: error: 'register' storage class specifier is deprecated [-Werror,-Wdeprecated-register]
3456         <http://webkit.org/b/119932>
3457         <rdar://problem/14764085>
3458
3459         Reviewed by Darin Adler.
3460
3461         Add pragma statements to ignore -Wdeprecated-register warnings
3462         in generated code.  Also ignore -Wunknown-pragmas so this
3463         doesn't cause a build failure in older versions of clang.
3464
3465         * css/makeprop.pl:
3466         (WebCore::findProperty): Remove register hints from parameters.
3467         * css/makevalues.pl:
3468         (WebCore::findValue): Ditto.
3469         * platform/ColorData.gperf:
3470         (WebCore::findColor): Ditto.
3471
3472 2013-08-18  Antti Koivisto  <antti@apple.com>
3473
3474         <https://webkit.org/b/119987> Make Element::attach standalone function
3475
3476         Reviewed by Andreas Kling.
3477
3478         This patch turns Element::attach() and the related functions into standalone functions.
3479
3480         * dom/ContainerNode.cpp:
3481         (WebCore::attachChild):
3482         (WebCore::detachChild):
3483         * dom/ContainerNode.h:
3484         * dom/Document.cpp:
3485         (WebCore::Document::attach):
3486         (WebCore::Document::detach):
3487         * dom/Element.cpp:
3488         (WebCore::Element::~Element):
3489         (WebCore::Element::lazyReattach):
3490         (WebCore::Element::removeShadowRoot):
3491         
3492             Shadow root should be detached by now. Remove the detach call.
3493
3494         (WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded):
3495         (WebCore::Element::updatePseudoElement):
3496         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
3497         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
3498         
3499             Factor some parts of former Element::attach/detach() into member functions.
3500
3501         * dom/Element.h:
3502         * dom/ElementRareData.h:
3503         (WebCore::ElementRareData::releasePseudoElement):
3504         * dom/NodeRenderingContext.cpp:
3505         (WebCore::NodeRenderingContext::NodeRenderingContext):
3506         * dom/NodeRenderingContext.h:
3507         * dom/ShadowRoot.cpp:
3508         * dom/ShadowRoot.h:
3509         * html/HTMLDetailsElement.cpp:
3510         (WebCore::HTMLDetailsElement::parseAttribute):
3511         * html/HTMLInputElement.cpp:
3512         (WebCore::HTMLInputElement::updateType):
3513         (WebCore::HTMLInputElement::parseAttribute):
3514         * html/HTMLObjectElement.cpp:
3515         (WebCore::HTMLObjectElement::renderFallbackContent):
3516         * html/HTMLPlugInImageElement.cpp:
3517         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
3518         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
3519         * html/HTMLSelectElement.cpp:
3520         (WebCore::HTMLSelectElement::parseAttribute):
3521         (WebCore::HTMLSelectElement::parseMultipleAttribute):
3522         * html/HTMLViewSourceDocument.cpp:
3523         (WebCore::HTMLViewSourceDocument::createContainingTable):
3524         (WebCore::HTMLViewSourceDocument::addSpanWithClassName):
3525         (WebCore::HTMLViewSourceDocument::addLine):
3526         (WebCore::HTMLViewSourceDocument::finishLine):
3527         (WebCore::HTMLViewSourceDocument::addBase):
3528         (WebCore::HTMLViewSourceDocument::addLink):
3529         * html/parser/HTMLConstructionSite.cpp:
3530         (WebCore::executeTask):
3531         * html/parser/HTMLTreeBuilder.cpp:
3532         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
3533         * html/shadow/InsertionPoint.cpp:
3534         (WebCore::InsertionPoint::willAttachRenderers):
3535         (WebCore::InsertionPoint::willDetachRenderers):
3536         * loader/PlaceholderDocument.cpp:
3537         (WebCore::PlaceholderDocument::attach):
3538         * style/StyleResolveTree.cpp:
3539         (WebCore::Style::createRendererIfNeeded):
3540         
3541             From Element::createRendererIfNeeded()
3542
3543         (WebCore::Style::attachShadowRoot):
3544         
3545             From ShadowRoot::attach()
3546
3547         (WebCore::Style::childAttachedAllowedWhenAttachingChildren):
3548         (WebCore::Style::attachChildren):
3549         
3550             From Element::attachChildren()
3551
3552         (WebCore::Style::attachRenderTree):
3553         
3554             From Element::attach()
3555
3556         (WebCore::Style::detachShadowRoot):
3557         
3558             From ShadowRoot::detach()
3559
3560         (WebCore::Style::detachChildren):
3561         
3562             From Element::detachChildren()
3563
3564         (WebCore::Style::detachRenderTree):
3565         
3566             From Element::deatach()
3567
3568         (WebCore::Style::reattachRenderTree):
3569         
3570              From Element::reattach()
3571
3572         (WebCore::Style::resolveLocal):
3573         * style/StyleResolveTree.h:
3574         (WebCore::Style::AttachContext::AttachContext):
3575         
3576             From Element::AttachContext
3577
3578         * svg/SVGTests.cpp:
3579         (WebCore::SVGTests::handleAttributeChange):
3580         * xml/XMLErrors.cpp:
3581         (WebCore::XMLErrors::insertErrorMessageBlock):
3582         * xml/parser/XMLDocumentParserLibxml2.cpp:
3583         (WebCore::XMLDocumentParser::startElementNs):
3584
3585 2013-08-18  Antti Koivisto  <antti@apple.com>
3586
3587         Fix crashing plugin tests caused by a logic error in the previous patch.
3588         
3589         Not reviewed.
3590
3591         * html/HTMLPlugInImageElement.cpp:
3592         (WebCore::HTMLPlugInImageElement::willDetachRenderers):
3593
3594 2013-08-18  Antti Koivisto  <antti@apple.com>
3595
3596         <https://webkit.org/b/119982> Make Element::attach non-virtual
3597
3598         Reviewed by Andreas Kling.
3599
3600         This will give us more future refactoring options.
3601
3602         * dom/Element.cpp:
3603         (WebCore::Element::attach):
3604         (WebCore::Element::detach):
3605         
3606             Make non-virtual. Call element type specific custom functions as needed.
3607
3608         (WebCore::Element::styleForRenderer):
3609         (WebCore::Element::willRecalcStyle):
3610         (WebCore::Element::didRecalcStyle):
3611         (WebCore::Element::willAttachRenderers):
3612         (WebCore::Element::didAttachRenderers):
3613         (WebCore::Element::willDetachRenderers):
3614         (WebCore::Element::didDetachRenderers):
3615         
3616             Add virtual custom callbacks.
3617
3618         (WebCore::Element::customStyleForRenderer):
3619         * dom/Element.h:
3620         * dom/Node.h:
3621         (WebCore::Node::pseudoId):
3622         (WebCore::Node::hasCustomStyleResolveCallbacks):
3623         (WebCore::Node::setHasCustomStyleResolveCallbacks):
3624         
3625             Use the existing bit as it largely overlaps. Rename for clarity.
3626
3627         (WebCore::Node::customPseudoId):
3628         * dom/PseudoElement.cpp:
3629         (WebCore::PseudoElement::PseudoElement):
3630         (WebCore::PseudoElement::didAttachRenderers):
3631         * dom/PseudoElement.h:
3632         * html/HTMLCanvasElement.cpp:
3633         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
3634         (WebCore::HTMLCanvasElement::willAttachRenderers):
3635         * html/HTMLCanvasElement.h:
3636         * html/HTMLFormControlElement.cpp:
3637         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
3638         (WebCore::HTMLFormControlElement::didAttachRenderers):
3639         * html/HTMLFormControlElement.h:
3640         * html/HTMLFrameElement.cpp:
3641         (WebCore::HTMLFrameElement::HTMLFrameElement):
3642         (WebCore::HTMLFrameElement::didAttachRenderers):
3643         * html/HTMLFrameElement.h:
3644         * html/HTMLFrameElementBase.cpp:
3645         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
3646         (WebCore::HTMLFrameElementBase::didAttachRenderers):
3647         * html/HTMLFrameElementBase.h:
3648         * html/HTMLFrameSetElement.cpp:
3649         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
3650         (WebCore::HTMLFrameSetElement::willAttachRenderers):
3651         * html/HTMLFrameSetElement.h:
3652         * html/HTMLIFrameElement.cpp:
3653         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
3654         * html/HTMLImageElement.cpp:
3655         (WebCore::HTMLImageElement::HTMLImageElement):
3656         (WebCore::HTMLImageElement::didAttachRenderers):
3657         * html/HTMLImageElement.h:
3658         * html/HTMLInputElement.cpp:
3659         (WebCore::HTMLInputElement::HTMLInputElement):
3660         (WebCore::HTMLInputElement::willAttachRenderers):
3661         (WebCore::HTMLInputElement::didAttachRenderers):
3662         (WebCore::HTMLInputElement::didDetachRenderers):
3663         * html/HTMLInputElement.h:
3664         * html/HTMLLIElement.cpp:
3665         (WebCore::HTMLLIElement::HTMLLIElement):
3666         (WebCore::HTMLLIElement::didAttachRenderers):
3667         * html/HTMLLIElement.h:
3668         * html/HTMLMediaElement.cpp:
3669         (WebCore::HTMLMediaElement::HTMLMediaElement):
3670         (WebCore::HTMLMediaElement::willAttachRenderers):
3671         (WebCore::HTMLMediaElement::didAttachRenderers):
3672         * html/HTMLMediaElement.h:
3673         * html/HTMLOptGroupElement.cpp:
3674         (WebCore::HTMLOptGroupElement::HTMLOptGroupElement):
3675         (WebCore::HTMLOptGroupElement::didAttachRenderers):
3676         (WebCore::HTMLOptGroupElement::willDetachRenderers):
3677         * html/HTMLOptGroupElement.h:
3678         * html/HTMLOptionElement.cpp:
3679         (WebCore::HTMLOptionElement::HTMLOptionElement):
3680         (WebCore::HTMLOptionElement::didAttachRenderers):
3681         (WebCore::HTMLOptionElement::willDetachRenderers):
3682         * html/HTMLOptionElement.h:
3683         * html/HTMLPlugInElement.cpp:
3684         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
3685         (WebCore::HTMLPlugInElement::willDetachRenderers):
3686         * html/HTMLPlugInElement.h:
3687         * html/HTMLPlugInImageElement.cpp:
3688         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
3689         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
3690         (WebCore::HTMLPlugInImageElement::willDetachRenderers):
3691         * html/HTMLPlugInImageElement.h:
3692         * html/HTMLProgressElement.cpp:
3693         (WebCore::HTMLProgressElement::HTMLProgressElement):
3694         (WebCore::HTMLProgressElement::didAttachRenderers):
3695         * html/HTMLProgressElement.h:
3696         * html/HTMLTextAreaElement.cpp:
3697         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement):
3698         (WebCore::HTMLTextAreaElement::didAttachRenderers):
3699         * html/HTMLTextAreaElement.h:
3700         * html/HTMLVideoElement.cpp:
3701         (WebCore::HTMLVideoElement::HTMLVideoElement):
3702         (WebCore::HTMLVideoElement::didAttachRenderers):
3703         * html/HTMLVideoElement.h:
3704         * html/shadow/InsertionPoint.cpp:
3705         (WebCore::InsertionPoint::InsertionPoint):
3706         (WebCore::InsertionPoint::willAttachRenderers):
3707         (WebCore::InsertionPoint::willDetachRenderers):
3708         * html/shadow/InsertionPoint.h:
3709         * html/shadow/SliderThumbElement.cpp:
3710         (WebCore::SliderThumbElement::SliderThumbElement):
3711         (WebCore::SliderThumbElement::willDetachRenderers):
3712         * html/shadow/SliderThumbElement.h:
3713         * html/shadow/SpinButtonElement.cpp:
3714         (WebCore::SpinButtonElement::SpinButtonElement):
3715         (WebCore::SpinButtonElement::willDetachRenderers):
3716         * html/shadow/SpinButtonElement.h:
3717         * html/shadow/TextControlInnerElements.cpp:
3718         (WebCore::TextControlInnerElement::TextControlInnerElement):
3719         (WebCore::TextControlInnerTextElement::TextControlInnerTextElement):
3720         (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
3721         (WebCore::SearchFieldCancelButtonElement::willDetachRenderers):
3722         (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
3723         (WebCore::InputFieldSpeechButtonElement::willAttachRenderers):
3724         (WebCore::InputFieldSpeechButtonElement::willDetachRenderers):
3725         * html/shadow/TextControlInnerElements.h:
3726         * style/StyleResolveTree.cpp:
3727         (WebCore::Style::resolveTree):
3728         * svg/SVGElement.cpp:
3729         (WebCore::SVGElement::SVGElement):
3730         * svg/SVGImageElement.cpp:
3731         (WebCore::SVGImageElement::SVGImageElement):
3732         (WebCore::SVGImageElement::didAttachRenderers):
3733         * svg/SVGImageElement.h:
3734         * svg/SVGUseElement.cpp:
3735         (WebCore::SVGUseElement::SVGUseElement):
3736
3737 2013-08-18  Gavin Barraclough  <barraclough@apple.com>
3738
3739         https://bugs.webkit.org/show_bug.cgi?id=119972
3740         Add attributes field to PropertySlot
3741
3742         Reviewed by Geoff Garen.
3743
3744         For all JSC types, this makes getOwnPropertyDescriptor redundant.
3745         There will be a bit more hacking required in WebCore to remove GOPD whilst maintaining current behaviour.
3746         (Current behaviour is in many ways broken, particularly in that GOPD & GOPS are inconsistent, but we should fix incrementally).
3747
3748         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3749         (WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate):
3750         * bindings/js/JSDOMWindowCustom.cpp:
3751         (WebCore::JSDOMWindow::getOwnPropertySlot):
3752         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3753         (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
3754         * bindings/js/JSHistoryCustom.cpp:
3755         (WebCore::JSHistory::getOwnPropertySlotDelegate):
3756         (WebCore::JSHistory::getOwnPropertyDescriptorDelegate):
3757         * bindings/js/JSLocationCustom.cpp:
3758         (WebCore::JSLocation::getOwnPropertySlotDelegate):
3759         (WebCore::JSLocation::getOwnPropertyDescriptorDelegate):
3760         * bindings/js/JSPluginElementFunctions.cpp:
3761         (WebCore::runtimeObjectCustomGetOwnPropertySlot):
3762         (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor):
3763         * bindings/scripts/CodeGeneratorJS.pm:
3764         (GenerateGetOwnPropertySlotBody):
3765         (GenerateGetOwnPropertyDescriptorBody):
3766         (GenerateImplementation):
3767         * bridge/runtime_array.cpp:
3768         (JSC::RuntimeArray::getOwnPropertySlot):
3769         (JSC::RuntimeArray::getOwnPropertyDescriptor):
3770         (JSC::RuntimeArray::getOwnPropertySlotByIndex):
3771         * bridge/runtime_method.cpp:
3772         (JSC::RuntimeMethod::getOwnPropertySlot):
3773         (JSC::RuntimeMethod::getOwnPropertyDescriptor):
3774         * bridge/runtime_object.cpp:
3775         (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
3776         (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
3777             - Pass attributes to PropertySlot::set* methods.
3778
3779 2013-08-18  Ryosuke Niwa  <rniwa@webkit.org>
3780
3781         <https://webkit.org/b/119917> Pasting multiple lines into a textarea can introduce extra new lines
3782
3783         Reviewed by Darin Adler.
3784
3785         Inspired by https://chromium.googlesource.com/chromium/blink/+/6152a12f7ace27beea4d284ff8416631e8aa5217.
3786
3787         The bug was caused by createFragmentFromText's falsely assuming that the newline were not preserved
3788         if the first node's renderer didn't exist.
3789
3790         Fixed the bug by obtaining the renderer of the container of the first visible position in the context.
3791
3792         Test: editing/pasteboard/paste-into-textarea-with-new-line.html
3793
3794         * editing/markup.cpp:
3795         (WebCore::contextPreservesNewline):
3796         (WebCore::createFragmentFromText):
3797
3798 2013-08-18  Andreas Kling  <akling@apple.com>
3799
3800         <https://webkit.org/b/119983> Add two missing RefPtr::release() in HTMLLinkElement.
3801
3802         Reviewed by Antti Koivisto.
3803
3804         * html/HTMLLinkElement.cpp:
3805         (WebCore::HTMLLinkElement::setCSSStyleSheet):
3806
3807 2013-08-18  Andreas Kling  <akling@apple.com>
3808
3809         <https://webkit.org/b/119981> Move ElementData & co to their own files.
3810
3811         Reviewed by Antti Koivisto.
3812
3813         I like to move it move it.
3814
3815 2013-08-18  David Kilzer  <ddkilzer@apple.com>
3816
3817         BUILD FIX (r153990): Add UNUSED_PARAM for heightChanged when CSS_SHAPES is disabled
3818
3819         Fixes the following build failure:
3820
3821             WebCore/rendering/RenderBlock.cpp:1529:53: error: unused parameter 'heightChanged' [-Werror,-Wunused-parameter]
3822             void RenderBlock::updateShapesAfterBlockLayout(bool heightChanged)
3823                                                                 ^
3824             1 error generated.
3825
3826         * rendering/RenderBlock.cpp:
3827         (WebCore::RenderBlock::updateShapesAfterBlockLayout): Add
3828         UNUSED_PARAM(heightChanged) when CSS_SHAPES is disabled.
3829
3830 2013-08-18  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
3831
3832         [EFL] minor method name fix for the textTrackOffMenuItemText method
3833         https://bugs.webkit.org/show_bug.cgi?id=119978
3834
3835         the method textTrackOffMenuItemText was renamed in
3836         https://bugs.webkit.org/show_bug.cgi?id=113822
3837
3838         Reviewed by Christophe Dumez.
3839
3840         * platform/efl/LocalizedStringsEfl.cpp:
3841         (WebCore::textTrackOffMenuItemText):
3842
3843 2013-08-17  Antti Koivisto  <antti@apple.com>
3844
3845         <https://webkit.org/b/119963> Use TextNodeTraversal for getting sheet text in StyleElement
3846
3847         Reviewed by Andreas Kling.
3848
3849         * dom/StyleElement.cpp:
3850         (WebCore::StyleElement::process):
3851         
3852             Use TextNodeTraversal::contentsAsString for the sheet text. The overflow check is removed as StringBuilder 
3853             (which is used by contentsAsString) does that itself. The behavior in case of overflow changes from empty
3854             sheet to CRASH(). Thats what we do elsewhere in similar situations too (scripts for example). Continuing
3855             with > 4GB of style sheet text nodes is probably not going to go well anyway.
3856
3857 2013-08-17  Antti Koivisto  <antti@apple.com>
3858
3859         <https://webkit.org/b/119960> Remove some optimizations made obsolete by use of StringBuilder
3860
3861         Reviewed by Andreas Kling.
3862
3863         * dom/ScriptElement.cpp:
3864         (WebCore::ScriptElement::scriptContent):
3865         
3866             StringBuilder already optimizes for the single string case. If there is only one the original string is returned.
3867
3868         * dom/Text.cpp:
3869         (WebCore::Text::wholeText):
3870         
3871             No need to traverse twice to compute the capacity. StringBuilder handles this efficiently. 
3872             Also in the common case there is only one string and the optimization here is actually hurting by disabling the StringBuilder one.
3873
3874 2013-08-17  Antti Koivisto  <antti@apple.com>
3875
3876         <https://webkit.org/b/119959> Add TextNodeTraversal
3877
3878         Reviewed by Andreas Kling.
3879
3880         Add TextNodeTraversal for cleaner and more compact traversal of Text nodes.
3881         
3882         Use it where appropriate.
3883
3884         * WebCore.xcodeproj/project.pbxproj:
3885         * dom/Attr.cpp:
3886         (WebCore::Attr::childrenChanged):
3887         * dom/NodeTraversal.h:
3888         (WebCore::NodeTraversal::next):
3889         * dom/ScriptElement.cpp:
3890         (WebCore::ScriptElement::scriptContent):
3891         * dom/Text.cpp:
3892         (WebCore::Text::wholeText):
3893         * dom/Text.h:
3894         (WebCore::toText):
3895         * dom/TextNodeTraversal.cpp: Added.
3896         (WebCore::TextNodeTraversal::appendContents):
3897         (WebCore::TextNodeTraversal::contentsAsString):
3898         
3899             Helpers for getting text content of a subtree.
3900
3901         * dom/TextNodeTraversal.h: Added.
3902         (WebCore::TextNodeTraversal::firstTextChildTemplate):
3903         (WebCore::TextNodeTraversal::firstChild):
3904         (WebCore::TextNodeTraversal::firstTextWithinTemplate):
3905         (WebCore::TextNodeTraversal::firstWithin):
3906         (WebCore::TextNodeTraversal::traverseNextTextTemplate):
3907         (WebCore::TextNodeTraversal::next):
3908         (WebCore::TextNodeTraversal::nextSibling):
3909         * editing/ApplyStyleCommand.cpp:
3910         (WebCore::ApplyStyleCommand::joinChildTextNodes):
3911         * html/HTMLTextAreaElement.cpp:
3912         (WebCore::HTMLTextAreaElement::defaultValue):
3913         (WebCore::HTMLTextAreaElement::setDefaultValue):
3914         * html/HTMLTitleElement.cpp:
3915         (WebCore::HTMLTitleElement::text):
3916         * html/track/TextTrackCue.cpp:
3917         (WebCore::TextTrackCue::determineTextDirection):
3918         * page/Frame.cpp:
3919         (WebCore::Frame::searchForLabelsAboveCell):
3920         * xml/XPathUtil.cpp:
3921         (WebCore::XPath::stringValue):
3922
3923 2013-08-17  Andreas Kling  <akling@apple.com>
3924
3925         <https://webkit.org/b/119957> Page::contextMenuController() should return a reference.
3926
3927         Reviewed by Antti Koivisto.
3928
3929         Page::m_contextMenuController is never null.
3930
3931         * page/Page.h:
3932         (WebCore::Page::contextMenuController):
3933
3934 2013-08-17  Andreas Kling  <akling@apple.com>
3935
3936         <https://webkit.org/b/119954> Page::dragCaretController() should return a reference.
3937
3938         Reviewed by Antti Koivisto.
3939
3940         Page::m_dragCaretController is never null.
3941
3942         * dom/Document.cpp:
3943         (WebCore::Document::nodeChildrenWillBeRemoved):
3944         (WebCore::Document::nodeWillBeRemoved):
3945         * page/DragController.cpp:
3946         (WebCore::DragController::cancelDrag):
3947         (WebCore::DragController::dragEnded):
3948         (WebCore::DragController::tryDocumentDrag):
3949         (WebCore::DragController::dispatchTextInputEventFor):
3950         (WebCore::DragController::concludeEditDrag):
3951         (WebCore::DragController::placeDragCaret):
3952         * page/Page.h:
3953         (WebCore::Page::dragCaretController):
3954         * rendering/RenderBlock.cpp:
3955         (WebCore::RenderBlock::paintCaret):
3956
3957 2013-08-17  Andreas Kling  <akling@apple.com>
3958
3959         <https://webkit.org/b/119952> Simplify Editor's back-pointer to the Frame.
3960
3961         Reviewed by Antti Koivisto.
3962
3963         Remove Editor's inheritance from FrameDestructionObserver. Editor is owned by Frame and
3964         has no interest in observing frame destruction since its own destruction will soon follow.
3965
3966         Editor::m_frame is now a reference instead of a pointer. Removed some null checking.
3967
3968 2013-08-17  Andreas Kling  <akling@apple.com>
3969
3970         <https://webkit.org/b/119950> Remove unused EditorClient::frameWillDetachPage() callback.
3971
3972         Reviewed by Antti Koivisto.
3973
3974         This callback was only used by the Chromium port.
3975
3976         * editing/Editor.h:
3977         * editing/Editor.cpp:
3978
3979             Remove override of FrameDestructionObserver::willDetachPage().
3980
3981         * page/EditorClient.h:
3982
3983             Remove frameWillDetachPage(). This is repeated in every EditorClient subclass.
3984
3985 2013-08-16  Antti Koivisto  <antti@apple.com>
3986
3987         <https://webkit.org/b/119886> PseudoElement is abusing parent node pointer
3988
3989         Reviewed by Darin Adler.
3990
3991         PseudoElement sets its host node as its parent. This is confusing and wrong as it breaks
3992         the basic tree consistency (a node is a child node of its parent node).
3993         
3994         This patch adds an explicit host pointer PseudoElement and switches the call sites over. Memory
3995         impact is negligible as there are not that many ::befores and ::afters.
3996
3997         * dom/ComposedShadowTreeWalker.cpp:
3998         (WebCore::ComposedShadowTreeWalker::traverseParent):
3999         * dom/EventPathWalker.cpp:
4000         (WebCore::EventPathWalker::moveToParent):
4001         * dom/EventRetargeter.h:
4002         (WebCore::EventRetargeter::eventTargetRespectingTargetRules):
4003         * dom/Node.cpp:
4004         (WebCore::Node::~Node):
4005         
4006             Add consistency assertions. Remove unnecessary clearing of sibling pointers. They should be cleared already.
4007
4008         (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc):
4009         * dom/PseudoElement.cpp:
4010         (WebCore::PseudoElement::PseudoElement):
4011         (WebCore::PseudoElement::customStyleForRenderer):
4012         * dom/PseudoElement.h:
4013         (WebCore::toPseudoElement):
4014         
4015             Add casting functions.
4016
4017         * inspector/InspectorLayerTreeAgent.cpp:
4018         (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
4019         * rendering/HitTestResult.cpp:
4020         (WebCore::HitTestResult::setInnerNode):
4021         (WebCore::HitTestResult::setInnerNonSharedNode):
4022
4023 2013-08-17  Darin Adler  <darin@apple.com>
4024
4025         <https://webkit.org/b/119948> Change drag-specific clipboard writing in DragController to go straight to Pasteboard, not forward through Clipboard
4026
4027         Reviewed by Andreas Kling.
4028
4029         * dom/Clipboard.cpp: Removed writeRange, writePlainText, and writeURL functions.
4030         All three are just unneeded forwarding to pasteboard.
4031         * dom/Clipboard.h: Ditto.
4032
4033         * page/DragController.cpp:
4034         (WebCore::DragController::startDrag): Move the logic in here. Later we might
4035         want to straighten this out a bit, perhaps using functions in Editor, but it's
4036         not much code so fine to just have it here for now.
4037
4038 2013-08-17  Darin Adler  <darin@apple.com>
4039
4040         <https://webkit.org/b/119947> Remove LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS
4041
4042         Reviewed by Andreas Kling.
4043
4044         * dom/Clipboard.cpp:
4045         (WebCore::Clipboard::Clipboard):
4046         (WebCore::Clipboard::~Clipboard):
4047         * dom/Clipboard.h:
4048         Remove LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS, LEGACY_VIRTUAL, and LEGACY_PURE.
4049         Keep only the !USE(LEGACY_STYLE_ABSTRACT_CLIPBOARD_CLASS) side of all conditionals.
4050
4051 2013-08-17  Darin Adler  <darin@apple.com>
4052
4053         <https://webkit.org/b/119946> Move some code used only by EventHandler from Clipboard to EventHandler
4054
4055         Reviewed by Andreas Kling.
4056
4057         Later it would be good to move this all to DragController, but there is no reason to have
4058         these functions as member functions of the DOM-exposed Clipboard class.
4059
4060         * dom/Clipboard.cpp: Deleted hasFileOfType, hasStringOfType, convertDropZoneOperationToDragOperation,
4061         convertDragOperationToDropZoneOperation.
4062         * dom/Clipboard.h: Ditto.
4063
4064         * page/EventHandler.cpp:
4065         (WebCore::convertDropZoneOperationToDragOperation): Moved here.
4066         (WebCore::convertDragOperationToDropZoneOperation): Moved here. Also changed to use ASCIILiteral.
4067         (WebCore::hasFileOfType): Moved here and made a free function instead of a member function. Removed
4068         canReadTypes check because Clipboard::files already takes care of that.
4069         (WebCore::hasStringOfType): Moved here and made a free function instead of a member function.
4070         Added a check for the