2009-03-31 Darin Adler <darin@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2009-03-31  Darin Adler  <darin@apple.com>
2
3         Reviewed by Eric Seidel.
4
5         Bug 24621: PositionIterator doesn't iterate "after last child" positions when going backwards
6         https://bugs.webkit.org/show_bug.cgi?id=24621
7
8         * dom/PositionIterator.cpp:
9         (WebCore::PositionIterator::decrement): Make sure that when the parent has no children, we
10         don't ever use Position::uncheckedPreviousOffset. This is consistent with the forward
11         iterator, but also should never arise because of the fix below.
12         * dom/PositionIterator.h:
13         (WebCore::PositionIterator::PositionIterator): Fixed so m_offset will always be 0 when
14         the passed-in node has no children. Like the change above, this is consistent with the rest
15         of the class, although in the long run I think it's a bit strange to treat a <p> element
16         with no children differently than a <p> element with children.
17
18 2009-03-31  Eric Carlson  <eric.carlson@apple.com>
19
20         Reviewed by Simon Fraser.
21
22         https://bugs.webkit.org/show_bug.cgi?id=24965
23         Bug 24965: HTMLMediaElement: network state changes can be missed
24         
25         * html/HTMLMediaElement.cpp:
26         (WebCore::HTMLMediaElement::setNetworkState): Always update m_networkState when the
27         state changes, even when no event needs to be fired.
28
29 2009-03-31  Eric Carlson  <eric.carlson@apple.com>
30
31         Reviewed by Darin Adler.
32         
33         https://bugs.webkit.org/show_bug.cgi?id=24964
34         Bug 24964: HTMLMediaElement: 'waiting' event may fire twice
35
36         * html/HTMLMediaElement.cpp:
37         (WebCore::HTMLMediaElement::setReadyState): Only fire 'waiting' event once when ready state
38         drops below HAVE_FUTURE_DATA.
39
40 2009-03-31  Eric Carlson  <eric.carlson@apple.com>
41
42         Reviewed by Darin Adler.
43
44         https://bugs.webkit.org/show_bug.cgi?id=24846
45         Bug 24846: HTMLMediaElement should implement 'autobuffer' attribute
46
47         Add 'autobuffer' attrubute to media element. 'autobuffer' is a hint that
48         the author recommends downloading the entire resource optimistically, so the
49         attribute is made available to the media engine to use if it is able.
50
51         Test: media/video-dom-autobuffer.html
52
53         * html/HTMLAttributeNames.in: Add autobuffer.
54
55         * html/HTMLMediaElement.cpp:
56         (WebCore::HTMLMediaElement::parseMappedAttribute): New.
57         (WebCore::HTMLMediaElement::autobuffer): Ditto.
58         (WebCore::HTMLMediaElement::setAutobuffer): Ditto.
59
60         * html/HTMLMediaElement.h: Declare autobuffer and setAutobuffer.
61
62         * html/HTMLMediaElement.idl: Add autobuffer.
63
64         * platform/graphics/MediaPlayer.cpp:
65         (WebCore::MediaPlayer::MediaPlayer): Initialize m_autobuffer.
66         (WebCore::MediaPlayer::autobuffer): New.
67         (WebCore::MediaPlayer::setAutobuffer): Ditto.
68         * platform/graphics/MediaPlayer.h: Declare m_autobuffer, autobuffer and setAutobuffer
69
70         * platform/graphics/MediaPlayerPrivate.h:
71         (WebCore::MediaPlayerPrivateInterface::setAutobuffer): Declare setAutobuffer.
72
73 2009-03-31  Craig Schlenter  <craig.schlenter@gmail.com>
74
75         Reviewed by Dimitri Glazkov.
76
77         https://bugs.webkit.org/show_bug.cgi?id=24550
78         Check return value of vasprintf. This should keep gcc 4.3.3
79         happy rather than have it complain about attribute warn_unused_result.
80
81         * dom/XMLTokenizerLibxml2.cpp:
82         (WebCore::XMLTokenizer::error):
83
84 2009-03-31  Dean Jackson  <dino@apple.com>
85
86         Style guide violation!
87
88         * loader/MediaDocument.cpp:
89         (WebCore::MediaDocument::defaultEventHandler):
90
91 2009-03-31  Dean Jackson  <dino@apple.com>
92
93         Fix Tiger build.
94
95         * loader/MediaDocument.cpp:
96         (WebCore::MediaDocument::defaultEventHandler):
97
98 2009-03-31  Jian Li  <jianli@chromium.org>
99
100         Reviewed by Darin Fisher.
101
102         Upstream V8DOMMap for v8 bindings.
103         https://bugs.webkit.org/show_bug.cgi?id=24951
104
105         * bindings/v8/V8DOMMap.cpp: Added.
106         * bindings/v8/V8DOMMap.h: Added.
107
108 2009-03-31  Dean Jackson  <dino@apple.com>
109
110         Reviewed by Simon Fraser.
111
112         https://bugs.webkit.org/show_bug.cgi?id=24955
113
114         Spacebar didn't play/pause in standalone MediaDocument
115
116         * loader/MediaDocument.cpp:
117         (WebCore::MediaDocument::defaultEventHandler):
118
119 2009-03-31  Alpha Lam  <hclam@chromium.org>
120
121         Reviewed by Eric Seidel.
122
123         https://bugs.webkit.org/show_bug.cgi?id=24901
124         Added the following methods to MediaPlayerPrivate for Chromium port.
125         void sizeChanged();
126         void rateChanged();
127         void durationChanged();
128
129         The above changes are to reflect changes in MediaPlayer.cpp.
130         More details can be found in the original changeset.
131         http://trac.webkit.org/changeset/41907
132
133         * platform/graphics/chromium/MediaPlayerPrivateChromium.h:
134
135 2009-03-31  Rafael Weinstein  <rafaelw@chromium.org>
136
137         Reviewed by Eric Seidel.
138
139         https://bugs.webkit.org/show_bug.cgi?id=24947
140
141         Special-case drawing text-shadow on win32, to let GDI draw in cases
142         when both fill & shadow color are opaque and the shadow has no blur.
143
144         * platform/graphics/chromium/FontChromiumWin.cpp:
145         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
146         (WebCore::Font::drawComplexText):
147         * platform/graphics/skia/SkiaFontWin.cpp:
148         (WebCore::windowsCanHandleDrawTextShadow):
149         (WebCore::windowsCanHandleTextDrawing):
150         * platform/graphics/skia/SkiaFontWin.h:
151
152 2009-03-31  Jeremy Moskovich  <jeremy@chromium.org>
153
154         Reviewed by Darin Fisher.
155
156         r42055 removed some functions in FrameLoader used by Chrome,
157         this CL backs out some of those changes to unbreak the Chrome build.
158
159         https://bugs.webkit.org/show_bug.cgi?id=24949
160
161         * WebCore.base.exp:
162         * loader/FrameLoader.cpp:
163         * loader/FrameLoader.h:
164
165 2009-03-31  Jeremy Moskovich  <jeremy@chromium.org>
166
167         Reviewed by Darin Adler.
168
169         Build fixes for Chromium.
170
171         https://bugs.webkit.org/show_bug.cgi?id=24945
172
173         * dom/Document.h:
174         * platform/chromium/ClipboardChromium.cpp:
175         (WebCore::imageToMarkup):
176
177 2009-03-31  Simon Hausmann  <simon.hausmann@nokia.com>
178
179         Fix the Qt build.
180
181         * dom/XMLTokenizerQt.cpp:
182         (WebCore::XMLTokenizer::XMLTokenizer): Use NamedNodeMap instead of NamedAttrMap.
183
184 2009-03-30  Steve Falkenburg  <sfalken@apple.com>
185
186         Don't create CFDataRef with a fixed size.
187         Fixes synchronous XMLHTTPRequests on Windows.
188         
189         Reviewed by Ada Chan.
190
191         * platform/network/cf/ResourceHandleCFNet.cpp:
192         (WebCore::WebCoreSynchronousLoader::didReceiveData):
193
194 2009-03-30  Darin Adler  <darin@apple.com>
195
196         Reviewed by Sam Weinig.
197
198         Bug 24594: PolicyDelegate NavigationAction is WebNavigationTypeOther instead of WebNavigationTypeReload
199         https://bugs.webkit.org/show_bug.cgi?id=24594
200         rdar://problem/6682110
201
202         Test: fast/loader/reload-policy-delegate.html
203
204         * loader/FrameLoader.cpp:
205         (WebCore::FrameLoader::loadWithDocumentLoader): Set the triggering action here where we know it's
206         the policy loader and can use m_policyLoadType rather than letting it get set inside
207         checkNavigationPolicy.
208
209 2009-03-30  Timothy Hatcher  <timothy@apple.com>
210
211         <rdar://problem/5838871> CrashTracer: 1483 crashes Quicklooking
212         in Finder (painting without up to date layout)
213
214         Reviewed by Dan Bernstein.
215
216         * page/FrameView.cpp:
217         (WebCore::FrameView::paintContents): Add an early return when
218         painting is attempted when layout is needed.
219
220 2009-03-30  Greg Bolsinga  <bolsinga@apple.com>
221
222         Reviewed by Simon Fraser.
223
224         https://bugs.webkit.org/show_bug.cgi?id=24938
225         
226         Sort alphabetically.
227
228         * css/CSSComputedStyleDeclaration.cpp:
229         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
230
231 2009-03-30  Greg Bolsinga  <bolsinga@apple.com>
232
233         Reviewed by Simon Fraser.
234
235         https://bugs.webkit.org/show_bug.cgi?id=24938
236         
237         Build fixes for building --3d-rendering and --no-svg
238
239         * rendering/RenderLayerBacking.cpp:
240
241 2009-03-30  Greg Bolsinga  <bolsinga@apple.com>
242
243         Reviewed by Simon Fraser.
244         
245         https://bugs.webkit.org/show_bug.cgi?id=24938
246
247         Build fixes when building --no-svg
248         
249         * css/CSSComputedStyleDeclaration.cpp:
250         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Add missing CSS properties
251         * css/CSSCursorImageValue.cpp:
252         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): Handle unused param
253         * css/CSSParser.cpp:
254         (WebCore::CSSParser::parseValue): Add missing CSS properties
255         * css/CSSStyleSelector.cpp:
256         (WebCore::CSSStyleSelector::applyProperty): Add missing CSS properties
257         * dom/Node.cpp:
258         (WebCore::updateSVGElementInstancesAfterEventListenerChange): Handle unused param
259         * platform/graphics/Font.cpp:
260         (WebCore::Font::floatWidth): Handle unused param
261         * platform/graphics/SimpleFontData.cpp:
262         (WebCore::SimpleFontData::SimpleFontData): Handle unused param
263
264 2009-03-30  Darin Adler  <darin@apple.com>
265
266         Reviewed by Adam Roben.
267
268         Bug 24916: REGRESSION: NavigationAction policy dispatch broken
269         https://bugs.webkit.org/show_bug.cgi?id=24916
270
271         * loader/FrameLoader.cpp:
272         (WebCore::FrameLoader::loadURL): Rearrange the code so that the "event" PassRefPtr
273         is not used twice. This also optimizes the case where a frame name is specified,
274         but it's the name of the frame being loaded. Also called release in all the final
275         uses of FormState.
276
277 2009-03-30  Darin Adler  <darin@apple.com>
278
279         Reviewed by Adam Roben.
280
281         Bug 24937: NamedNodeMap and NamedAttrMap should not be separate classes
282         https://bugs.webkit.org/show_bug.cgi?id=24937
283
284         Also should fix the Windows COM bindings build.
285
286         * bindings/scripts/CodeGeneratorJS.pm: Removed special case for NamedNodeMap.
287         * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
288
289         * dom/NamedAttrMap.h: Renamed class from NamedAttrMap to
290         NamedNodeMap and removed NamedNodeMap base class. Made the NamedNodeMap
291         functions all public and non-virtual. Removed virtualLength.
292
293         * dom/NamedNodeMap.h: Replaced file with just an include
294         of NamedAttrMap.h. As a follow up we will rename the NamedAttrMap
295         files and remove this file.
296
297         * bindings/js/JSNamedNodesCollection.cpp: Renamed from NamedAttrMap to NamedNodeMap.
298         * dom/Attr.h: Ditto.
299         * dom/Attribute.h: Ditto.
300         * dom/Document.cpp:
301         (WebCore::Document::importNode): Ditto.
302         * dom/Element.cpp:
303         (WebCore::Element::attributes): Ditto.
304         (WebCore::Element::setAttributeMap): Ditto.
305         (WebCore::Element::createAttributeMap): Ditto.
306         (WebCore::Element::insertedIntoDocument): Ditto.
307         (WebCore::Element::removedFromDocument): Ditto.
308         (WebCore::Element::openTagStartToString): Ditto.
309         (WebCore::Element::removeAttributeNode): Ditto.
310         (WebCore::Element::getAttributeNode): Ditto.
311         (WebCore::Element::getAttributeNodeNS): Ditto.
312         (WebCore::Element::hasAttribute): Ditto.
313         (WebCore::Element::hasAttributeNS): Ditto.
314         (WebCore::Element::normalizeAttributes): Ditto.
315         * dom/Element.h: Ditto.
316         * dom/NamedAttrMap.cpp:
317         (WebCore::NamedNodeMap::detachAttributesFromElement): Ditto.
318         (WebCore::NamedNodeMap::~NamedNodeMap): Ditto.
319         (WebCore::NamedNodeMap::isMappedAttributeMap): Ditto.
320         (WebCore::NamedNodeMap::getNamedItem): Ditto.
321         (WebCore::NamedNodeMap::getNamedItemNS): Ditto.
322         (WebCore::NamedNodeMap::removeNamedItem): Ditto.
323         (WebCore::NamedNodeMap::removeNamedItemNS): Ditto.
324         (WebCore::NamedNodeMap::setNamedItem): Ditto.
325         (WebCore::NamedNodeMap::item): Ditto.
326         (WebCore::NamedNodeMap::getAttributeItem): Ditto.
327         (WebCore::NamedNodeMap::clearAttributes): Ditto.
328         (WebCore::NamedNodeMap::detachFromElement): Ditto.
329         (WebCore::NamedNodeMap::setAttributes): Ditto.
330         (WebCore::NamedNodeMap::addAttribute): Ditto.
331         (WebCore::NamedNodeMap::removeAttribute): Ditto.
332         (WebCore::NamedNodeMap::mapsEquivalent): Ditto.
333         * dom/NamedMappedAttrMap.cpp:
334         (WebCore::NamedMappedAttrMap::clearAttributes): Ditto.
335         * dom/NamedMappedAttrMap.h:
336         (WebCore::NamedMappedAttrMap::NamedMappedAttrMap): Ditto.
337         * dom/Node.cpp:
338         (WebCore::Node::dumpStatistics): Ditto.
339         (WebCore::Node::isEqualNode): Ditto.
340         (WebCore::Node::isDefaultNamespace): Ditto.
341         (WebCore::Node::lookupNamespaceURI): Ditto.
342         (WebCore::Node::lookupNamespacePrefix): Ditto.
343         (WebCore::Node::compareDocumentPosition): Ditto.
344         * dom/Node.h: Ditto.
345         * dom/XMLTokenizerLibxml2.cpp:
346         (WebCore::XMLTokenizer::XMLTokenizer): Ditto.
347         * editing/ApplyStyleCommand.cpp:
348         (WebCore::isSpanWithoutAttributesOrUnstyleStyleSpan): Ditto.
349         (WebCore::isEmptyFontTag): Ditto.
350         (WebCore::areIdenticalElements): Ditto.
351         * editing/markup.cpp:
352         (WebCore::appendStartMarkup): Ditto.
353         (WebCore::completeURLs): Ditto.
354         * html/HTMLParser.cpp:
355         (WebCore::HTMLParser::handleError): Ditto.
356         * rendering/RenderPartObject.cpp:
357         (WebCore::RenderPartObject::updateWidget): Ditto.
358         * svg/SVGAnimatedProperty.h:
359         (WebCore::synchronizeProperty): Ditto.
360         * xml/XPathFunctions.cpp:
361         (WebCore::XPath::FunLang::evaluate): Ditto.
362         * xml/XPathStep.cpp:
363         (WebCore::XPath::Step::nodesInAxis): Ditto.
364
365 2009-03-30  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
366
367         Reviewed by Holger Freyther.
368
369         https://bugs.webkit.org/show_bug.cgi?id=24750
370         [GTK] requests download instead of displaying page
371
372         Use soup facilities to append parameters to the content type, to
373         make that more robust;
374
375         * platform/network/soup/ResourceHandleSoup.cpp:
376         (WebCore::fillResponseFromMessage):
377
378 2009-03-30  David Kilzer  <ddkilzer@apple.com>
379
380         <rdar://problem/6735683> Move SECTORDER_FLAGS from Xcode project to WebCore.xcconfig
381
382         Reviewed by Timothy Hatcher, Mark Rowe and Darin Adler.
383
384         * Configurations/Base.xcconfig: Moved Production definition of
385         SECTORDER_FLAGS to here from Xcode project file.
386         * Configurations/DebugRelease.xcconfig: Override SECTORDER_FLAGS
387         in Base.xcconfig to the empty string since it is not used for
388         Debug and Release configurations.
389         * WebCore.xcodeproj/project.pbxproj: Removed SECTORDER_FLAGS.
390
391 2009-03-30  Adam Roben  <aroben@apple.com>
392
393         Windows build fix after recent Node.idl changes
394
395         * bindings/scripts/CodeGeneratorCOM.pm: Touched this to force sources
396         of classes that derive from Node to rebuild.
397
398 2009-03-30  Adam Roben  <aroben@apple.com>
399
400         Windows build fix
401
402         * svg/graphics/SVGImage.cpp: Added a missing #include.
403
404 2009-03-30  Mads Ager  <ager@chromium.org>
405
406         Reviewed by Darin Adler.
407
408         https://bugs.webkit.org/show_bug.cgi?id=24879
409         Add frame accessor to Screen, Console, and BarInfo objects. Add type 
410         accessor to BarInfo objects.
411
412         In the V8 JavaScript bindings, we need access to the frame and
413         type for already created Screen, Console, and BarInfo objects in
414         order to keep their wrappers alive across GCs.
415
416         * page/BarInfo.cpp:
417         (WebCore::BarInfo::frame): Added.
418         (WebCore::BarInfo::type): Added.
419         * page/BarInfo.h:
420         * page/Console.cpp:
421         (WebCore::Console::frame): Added.
422         * page/Console.h:
423         * page/Screen.cpp:
424         (WebCore::Screen::frame): Added.
425         * page/Screen.h:
426
427 2009-03-29  Darin Adler  <darin@apple.com>
428
429         Requested by Antti Koivisto.
430
431         * loader/DocumentLoader.cpp:
432         (WebCore::DocumentLoader::subresource): Tweaked code to be a little clearer and added
433         a better comment.
434
435 2009-03-29  Darin Adler  <darin@apple.com>
436
437         Reviewed by Dan Bernstein.
438
439         Bug 23445: Copying certain hidden text causes a crash
440         https://bugs.webkit.org/show_bug.cgi?id=23445
441         rdar://problem/6512520
442
443         Test: editing/pasteboard/copy-display-none.html
444
445         * editing/markup.cpp:
446         (WebCore::createMarkup): Added a check for the case where adjusting the start node moves
447         the start of the selection past the end of the range entirely. If we try to iterate we'll
448         never hit the end of the range and will probably crash iterating the rest of the document.
449
450 2009-03-29  Darin Adler  <darin@apple.com>
451
452         Reviewed by Dan Bernstein.
453
454         Bug 24672: ASSERTION FAILURE: !m_purgeableData in WebCore::CachedResource::data() saving a WebArchive
455         https://bugs.webkit.org/show_bug.cgi?id=24672
456         rdar://problem/6574263
457
458         I couldn't create a test case for this. In fact, the case in the bug doesn't exist any more,
459         but there is an Apple-internal website I was able to use to reproduce and fix.
460
461         * loader/CachedResource.h: Made makePurgeable public.
462         * loader/DocumentLoader.cpp:
463         (WebCore::DocumentLoader::subresource): Call makePurgeable to make the resource non-purgeable
464         so we can get its data if it hasn't yet been purged.
465
466 2009-03-29  Darin Adler  <darin@apple.com>
467
468         Fix build again.
469
470         * loader/EmptyClients.h: Fix typo in name of FormState.h.
471
472 2009-03-29  Darin Adler  <darin@apple.com>
473
474         Try to fix the release build.
475
476         * history/CachedPage.cpp: Make include unconditional, not debug-only.
477
478 2009-03-29  Greg Bolsinga  <bolsinga@apple.com>
479
480         Undo that last build fix, since it turned out the file wasn't deleted.
481
482         * WebCore.xcodeproj/project.pbxproj:
483
484 2009-03-29  Greg Bolsinga  <bolsinga@apple.com>
485
486         Fix build break by removing references to deleted header files.
487
488         * WebCore.xcodeproj/project.pbxproj:
489
490 2009-03-29  Darin Adler  <darin@apple.com>
491
492         Try to fix the Windows build.
493
494         * loader/EmptyClients.h: Added include of FormState.h.
495         * loader/MainResourceLoader.cpp: Ditto.
496
497 2009-03-29  Dmitry Titov  <dimich@chromium.org>
498
499         Reviewed by Darin Adler.
500
501         https://bugs.webkit.org/show_bug.cgi?id=24926
502         Fix Chromium build break.
503
504         * bindings/v8/custom/V8DOMWindowCustom.cpp:
505         (WebCore::CALLBACK_FUNC_DECL(DOMWindowShowModalDialog)): renamed 'features' into 'windowFeatures'.
506
507 2009-03-29  Darin Adler  <darin@apple.com>
508
509         Another attempt to fix the Qt build.
510
511         * WebCore.pro: Added CheckedRadioButtons.cpp.
512
513 2009-03-29  Darin Adler  <darin@apple.com>
514
515         Reviewed by Cameron Zwarich.
516
517         Bug 24921: remove include of HTMLFormElement.h from Document.h
518         https://bugs.webkit.org/show_bug.cgi?id=24921
519
520         * GNUmakefile.am: Added CheckedRadioButtons source files.
521         * WebCore.scons: Ditto.
522         * WebCore.vcproj/WebCore.vcproj: Ditto.
523         * WebCore.xcodeproj/project.pbxproj: Ditto.
524         * WebCoreSources.bkl: Ditto.
525
526         * bindings/objc/PublicDOMInterfaces.h: Changed type of parentElement to Element.
527
528         * dom/CheckedRadioButtons.cpp: Copied from WebCore/html/HTMLFormElement.cpp.
529         Removed all the code except for CheckedRadioButtons, and moved that out to be
530         a namespace-level class instead of a member of HTMLFormElement.
531
532         * dom/CheckedRadioButtons.h: Copied from WebCore/html/HTMLFormElement.h.
533         Removed all the code except for CheckedRadioButtons, and moved that out to be
534         a namespace-level class instead of a member of HTMLFormElement.
535
536         * dom/Document.h: Removed unneeded includes, including HTMLFormElement.h.
537         Added include of CheckedRadioButtons.h. Changed uses of CheckedRadioButtons
538         class to use a namespace-level class instead of a member of HTMLFormElement.
539
540         * dom/Node.idl: Changed the type of parentElement from Node to Element for
541         two reasons. 1) Node was incorrect, since parentElement returns an Element.
542         2) The bindings won't compile any more unless they know parentElement's
543         return value is an Element due to include changes.
544
545         * html/HTMLFormElement.cpp: Moved definitions of the functions in the
546         CheckedRadioButtons class to the new CheckedRadioButtons.cpp.
547
548         * html/HTMLFormElement.h: Moved definition of the CheckedRadioButtons
549         class to the new CheckedRadioButtons.h.
550
551         * html/HTMLInputElement.cpp:
552         (WebCore::checkedRadioButtons): Changed use of CheckedRadioButtons
553         class to use a namespace-level class instead of a member of HTMLFormElement.
554
555         * page/Chrome.cpp:
556         (WebCore::Chrome::createWindow): Tweaked formatting.
557
558         * css/CSSGrammar.y: Added newly-needed include.
559         * dom/Range.cpp: Ditto.
560         * editing/BreakBlockquoteCommand.cpp: Ditto.
561         * editing/CompositeEditCommand.cpp: Ditto.
562         * editing/InsertLineBreakCommand.cpp: Ditto.
563         * editing/ModifySelectionListLevel.cpp: Ditto.
564         * editing/RemoveFormatCommand.cpp: Ditto.
565         * editing/TextIterator.cpp: Ditto.
566         * editing/VisiblePosition.cpp: Ditto.
567         * loader/DocLoader.cpp: Ditto.
568         * page/AccessibilityRenderObject.cpp: Ditto.
569         * page/Page.cpp: Ditto.
570         * rendering/RenderBlock.cpp: Ditto.
571         * rendering/RenderLayer.cpp: Ditto.
572         * rendering/RenderObject.h: Ditto.
573         * storage/LocalStorageArea.cpp: Ditto.
574         * storage/SessionStorageArea.cpp: Ditto.
575
576 2009-03-29  Darin Adler  <darin@apple.com>
577
578         Reviewed by Dan Bernstein.
579
580         <rdar://problem/6015407> attr parsing should allow only identifiers
581
582         Test: fast/css/attr-parsing.html
583
584         * css/CSSParser.cpp:
585         (WebCore::CSSParser::parseContent): Allow only CSS_IDENT, and filter out
586         identifiers that start with "-".
587         * css/CSSPrimitiveValue.cpp:
588         (WebCore::CSSPrimitiveValue::cssText): Added a case for CSS_ATTR so the test
589         case works. This has the pleasant side effect of fixing a bug too.
590
591 2009-03-29  Alexey Proskuryakov  <ap@webkit.org>
592
593         <rdar://problem/6492712> Cross-origin redirects are not handled correctly.
594
595         Forgot to save the file after applying changes for review comments.
596
597         * platform/network/cf/ResourceHandleCFNet.cpp:
598         (WebCore::willSendRequest):
599         (WebCore::didReceiveResponse):
600         (WebCore::didReceiveData):
601         (WebCore::didSendBodyData):
602         (WebCore::didFinishLoading):
603         (WebCore::didFail):
604         (WebCore::willCacheResponse):
605         (WebCore::didReceiveChallenge):
606         (WebCore::WebCoreSynchronousLoader::willSendRequest):
607         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
608         (WebCore::WebCoreSynchronousLoader::didReceiveData):
609         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
610         (WebCore::WebCoreSynchronousLoader::didFail):
611         (WebCore::WebCoreSynchronousLoader::didReceiveChallenge):
612
613 2009-03-28  Alexey Proskuryakov  <ap@webkit.org>
614
615         Reviewed by Darin Adler.
616
617         <rdar://problem/6492712> Cross-origin redirects are not handled correctly.
618
619         Test: http/tests/xmlhttprequest/redirect-cross-origin-tripmine.html
620
621         * platform/network/cf/ResourceHandleCFNet.cpp:
622         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
623         (WebCore::ResourceHandle::loadResourceSynchronously):
624         (WebCore::WebCoreSynchronousLoader::willSendRequest):
625         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
626         (WebCore::WebCoreSynchronousLoader::didReceiveData):
627         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
628         (WebCore::WebCoreSynchronousLoader::didFail):
629         (WebCore::WebCoreSynchronousLoader::didReceiveChallenge):
630         (WebCore::WebCoreSynchronousLoader::load):
631         Match Mac behavior more closely - we shouldn't rely on underlying library handling of
632         synchronous requests.
633
634         * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::willSendRequest):
635         -[NSURLConnection cancel] doesn't fully cancel the connection if called from willSendRequest
636         delegate method for a redirect.
637
638         * platform/network/mac/ResourceHandleMac.mm:
639         (-[WebCoreSynchronousLoader connection:willSendRequest:redirectResponse:]):
640         Match async behavior more closely.
641
642 2009-03-28  Darin Adler  <darin@apple.com>
643
644         Reviewed by Mark Rowe.
645
646         Bug 24914: empty-string assertion crash when running storage tests
647         https://bugs.webkit.org/show_bug.cgi?id=24914
648
649         * storage/Database.cpp:
650         (WebCore::Database::performOpenAndVerify): Don't store empty version strings
651         in the map, since empty strings are per-thread.
652
653 2009-03-28  Dmitry Titov  <dimich@chromium.org>
654
655         Reviewed by Dimitri Glazkov.
656
657         https://bugs.webkit.org/show_bug.cgi?id=24910
658         Fixes for Chromium build.
659
660         * bindings/v8/V8LazyEventListener.h: renamed IsInline() into virtualIsInline()
661         * bindings/v8/custom/V8CustomEventListener.h: ditto.
662         * dom/EventListener.h: used #if USE(JSC) to fix the build on non-JSC platform.
663
664 2009-03-28  Dimitri Glazkov  <dglazkov@chromium.org>
665
666         Not reviewed, correcting landing error.
667
668         https://bugs.webkit.org/show_bug.cgi?id=24812
669         Custom bindings should be in v8/custom, not v8.
670
671         * bindings/v8/V8HTMLDocumentCustom.cpp: Removed.
672         * bindings/v8/custom/V8HTMLDocumentCustom.cpp: Moved from parent dir.
673
674 2009-03-28  Mike Belshe  <mike@belshe.com>
675
676         Reviewed by Dimitri Glazkov.
677
678         https://bugs.webkit.org/show_bug.cgi?id=24616
679         Add V8 custom bindings for DOMWindow.
680
681         * bindings/v8/custom/V8DOMWindowCustom.cpp: Added.
682
683 2009-03-28  Mike Belshe  <mike@belshe.com>
684
685         Reviewed by Dimitri Glazkov.
686
687         https://bugs.webkit.org/show_bug.cgi?id=24812
688         Add V8 custom bindings for HTMLDocument.
689
690         * bindings/v8/V8HTMLDocumentCustom.cpp: Added.
691
692 2009-03-27  Mark Rowe  <mrowe@apple.com>
693
694         Reviewed by Sam Weinig.
695
696         Fix two SVG test failures in 64-bit.
697
698         getSubStringLength's arguments were declared as unsigned in the IDL and as signed long in the implementation.
699         This led to a value of -1 in JavaScript being converted to MAX_UINT in the bindings.  In 32-bit this was
700         identical to -1 when interpeted as signed long, but in 64-bit it was still equal to MAX_UINT.
701
702         The solution for this is to use the IsIndex attribute on arguments that the SVG spec declares as "unsigned long"
703         but requires an exception be thrown when a negative value is passed.  This results in the JS bindings handling the
704         check for a negative value and lets the implementation treat the arguments purely as unsigned values.
705
706         * svg/SVGTextContentElement.cpp:
707         (WebCore::SVGTextContentElement::getNumberOfChars):
708         (WebCore::SVGTextContentElement::getSubStringLength):
709         (WebCore::SVGTextContentElement::getStartPositionOfChar):
710         (WebCore::SVGTextContentElement::getEndPositionOfChar):
711         (WebCore::SVGTextContentElement::getExtentOfChar):
712         (WebCore::SVGTextContentElement::getRotationOfChar):
713         (WebCore::SVGTextContentElement::getCharNumAtPosition):
714         (WebCore::SVGTextContentElement::selectSubString):
715         * svg/SVGTextContentElement.h:
716         * svg/SVGTextContentElement.idl:
717
718 2009-03-27  Darin Adler  <darin@apple.com>
719
720         Reviewed by Sam Weinig.
721
722         Get mailto code out of FrameLoader.
723
724         * html/HTMLFormElement.cpp:
725         (WebCore::transferMailtoPostFormDataToURL): Added. Factored out the mailto
726         logic so HTMLFormElement::submit isn't full of ugly bits. This includes the
727         part of the logic that involves transformeing the URL that was previously
728         inside FrameLoader.
729         (WebCore::HTMLFormElement::submit): Call transferMailtoPostFormDataToURL and
730         also release the data for slightly less refcount churn.
731
732         * loader/FrameLoader.cpp:
733         (WebCore::FrameLoader::submitForm): Removed all the special casing for mailto,
734         since HTMLFormElement now properly prepares both the URL and the form data.
735
736 2009-03-27  Dan Bernstein  <mitz@apple.com>
737
738         Reviewed by Mark Rowe.
739
740         - fix <rdar://problem/6724514> A bit of OpenTypeUtilities cleanup
741
742         * platform/graphics/chromium/FontCustomPlatformData.cpp:
743         (WebCore::EOTStream::EOTStream): Changed to use EOTHeader.
744         (WebCore::createFontCustomPlatformData): Ditto.
745         * platform/graphics/opentype/OpenTypeUtilities.cpp:
746         (WebCore::EOTHeader::EOTHeader): Added. Initializes the buffer size to
747         the size of an EOTPrefix.
748         (WebCore::EOTHeader::updateEOTSize): Added. Updates the size field in
749         the prefix.
750         (WebCore::EOTHeader::appendBigEndianString): Changed the static
751         appendBigEndianStringToEOTHeader() into this member function.
752         (WebCore::EOTHeader::appendPaddingShort): Added.
753         (WebCore::getEOTHeader): Changed to use EOTHeader.
754         * platform/graphics/opentype/OpenTypeUtilities.h:
755         (WebCore::EOTHeader::size):
756         (WebCore::EOTHeader::data):
757         (WebCore::EOTHeader::prefix):
758         * platform/graphics/win/FontCustomPlatformData.cpp:
759         (WebCore::EOTStream::EOTStream): Changed to use EOTHeader.
760         (WebCore::createFontCustomPlatformData): Ditto.
761
762 2009-03-27  Darin Adler  <darin@apple.com>
763
764         Reviewed by Sam Weinig.
765
766         To prepare for work on a form loading fix, remove some unused functions,
767         consolidate some functions, and make many more functions private in
768         FrameLoader.
769
770         * WebCore.base.exp: Remove some unused entry points, update another.
771
772         * dom/Document.cpp:
773         (WebCore::Document::detach): Clear m_frame directly instead of using
774         clearFramePointer.
775         * dom/Document.h: Ditto.
776
777         * loader/FrameLoader.cpp:
778         (WebCore::FrameLoader::urlSelected): Consolidate the two functions
779         of this name into a single function. Also changed the event argument
780         to be PassRefPtr<Event>.
781         (WebCore::FrameLoader::submitForm): Changed the event argument to
782         be PassRefPtr<Event>.
783         (WebCore::FrameLoader::scheduleLocationChange): Call completeURL
784         explicitly so we can remove the version of changeLocation that does
785         completeURL for us.
786         (WebCore::FrameLoader::redirectionTimerFired): Ditto.
787         (WebCore::FrameLoader::loadURLIntoChildFrame): Set m_provisionalHistoryItem
788         directly so we don't need a setProvisionalHistoryItem function.
789         (WebCore::FrameLoader::canCachePageContainingThisFrame): Get at
790         m_quickRedirectComing directly so we don't need a isQuickRedirectComing
791         function.
792         (WebCore::FrameLoader::logCanCacheFrameDecision): Ditto.
793         (WebCore::FrameLoader::loadFrameRequestWithFormAndValues): Changed the
794         event argument to be PassRefPtr<Event>.
795         (WebCore::FrameLoader::loadURL): Move the logic of the continueLoadWithData
796         function here because this is the only caller. If we want to make the
797         resulting function smaller we should refactor some other way. Also
798         streamlined the user-chosen encoding logic, but did not change what it does.
799         (WebCore::FrameLoader::finishedLoadingDocument): Changed the event argument
800         to be PassRefPtr<Event>.
801         (WebCore::FrameLoader::loadPostRequest): Ditto.
802         (WebCore::FrameLoader::receivedMainResourceError): Moved the logic from
803         the didNotOpenURL function here, since this was the only caller.
804
805         * loader/FrameLoader.h: Removed include of FormState.h and used a forward
806         declaration instead. Removed unneeded forward declation of Element.
807         Moved many functions into the private section, and removed some other
808         unused or uneeded functions.
809
810 2009-03-27  Xiaomei Ji  <xji@chromium.org>
811
812         Reviewed by Dan Bernstein.
813
814         Fix https://bugs.webkit.org/show_bug.cgi?id=24303
815         Using keyboard select RTL text, Highlights goes to opposite direction from Firefox and IE.
816
817         Test: editing/selection/extend-selection.html
818
819         * editing/SelectionController.cpp:
820         (WebCore::SelectionController::directionOfEnclosingBlock): Added
821         (WebCore::SelectionController::modifyExtendingRight): Added. Currenctly 
822         implemented for character and word granularity, all other granularities
823         are treated as "forward".
824         (WebCore::SelectionController::modifyExtendingForward): Renamed 
825         modifyExtendingRightForward() to this.
826         (WebCore::SelectionController::modifyExtendingLeft): Added. Currenctly
827         implemented for character and word granularity, all other granularities
828         are treated as "backward".
829         (WebCore::SelectionController::modifyExtendingBackward): Renamed
830         modifyExtendingLeftBackward() to this.
831         (WebCore::SelectionController::modify): Change to call either the 
832         left/right or backward/forward methods depending on the 'dir' argument
833         for extends.
834         * editing/SelectionController.h:
835
836 2009-03-27  John Abd-El-Malek  <jam@google.com>
837
838         Reviewed by Eric Seidel.
839
840         https://bugs.webkit.org/show_bug.cgi?id=24836
841         Fix navigator.plugins.refresh(false) in Chromium.
842
843         * plugins/chromium/PluginDataChromium.cpp:
844         (WebCore::PluginData::refresh):
845
846 2009-03-27  Timothy Hatcher  <timothy@apple.com>
847
848         Make scrollLeft, scrollTop, scrollWidth, and scrollHeight
849         virtual to fix the broken layout tests from my last commit.
850
851         Reviewed by Mark Rowe.
852
853         * dom/Element.cpp:
854         (WebCore::Element::scrollLeft):
855         (WebCore::Element::scrollTop):
856         (WebCore::Element::scrollWidth):
857         (WebCore::Element::scrollHeight):
858         * dom/Element.h:
859         * html/HTMLBodyElement.h:
860
861 2009-03-27  Mark Rowe  <mrowe@apple.com>
862
863         Reviewed by Sam Weinig.
864
865         Fix <https://bugs.webkit.org/show_bug.cgi?id=24876>.
866         Bug 24876: fast/forms/select-max-length.html times out in debug builds due to HTMLSelectElement::setLength being O(N^2)
867
868         * html/HTMLSelectElement.cpp:
869         (WebCore::HTMLSelectElement::setLength): Repeatedly calling remove to remove elements causes us to recalculate the list
870         items after each node is removed, leading to O(N^2) behaviour.  By inlining the batch removal in to setLength we can avoid
871         this gratuitous recalcuation.
872
873 2009-03-27  Dirk Schulze  <krit@webkit.org>
874
875         Reviewed by Eric Seidel.
876
877         We don't support images for GtkCursors yet. We need a  placeholder to avoid crashes.
878         I took crosshair to have a common behavior with firefox.
879
880         [GTK] SVG - Crash on setting the cursor icon
881         https://bugs.webkit.org/show_bug.cgi?id=24565
882
883         * platform/gtk/CursorGtk.cpp:
884         (WebCore::Cursor::Cursor):
885
886 2009-03-27  Timothy Hatcher  <timothy@apple.com>
887
888         Remove redundant attributes and functions from IDL files that have the
889         same attributes and functions defined in the super class.
890
891         Reviewed by Simon Fraser.
892
893         * WebCore.xcodeproj/project.pbxproj: Remove DOMHTMLBodyElementPrivate.h.
894         * bindings/objc/PublicDOMInterfaces.h: Remove focus and blur from DOMHTMLElement.
895         * html/HTMLBodyElement.idl: Remove scrollLeft, scrollTop, scrollWidth
896         and scrollHeight.
897         * html/HTMLElement.idl: Remove blur and focus.
898
899 2009-03-27  Adam Roben  <aroben@apple.com>
900
901         Don't include substitute data URLs in global history redirect chains
902
903         <rdar://6690169>
904
905         Reviewed by Darin Adler.
906
907         This might be testable if:
908           - support were added to DRT for providing substitute data on failed
909             loads
910           - support were added to DRT for dumping redirect chains
911
912         I tried doing the above and was still unable to make a test.
913
914         * loader/FrameLoader.cpp:
915         (WebCore::FrameLoader::updateHistoryForStandardLoad):
916         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedBackForwardList):
917         Call updateGlobalHistoryRedirectLinks only if the load succeeded
918         (i.e., there is no unreachableURL). Previous the FrameLoaderClient
919         implementations were unconditionally calling
920         updateGlobalHistoryRedirectLinks from within updateGlobalHistory.
921
922 2009-03-27  Peter Kasting  <pkasting@google.com>
923
924         Reviewed by Eric Seidel.
925
926         https://bugs.webkit.org/show_bug.cgi?id=24861
927         Chromium port did not render decorations for <input type="search">.
928         This copies RenderThemeWin.*.
929
930         * css/themeChromiumWin.css: Removed.
931         * rendering/RenderThemeChromiumLinux.cpp:
932         (WebCore::RenderThemeChromiumLinux::extraDefaultStyleSheet):
933         (WebCore::RenderThemeChromiumLinux::adjustSearchFieldCancelButtonStyle):
934         (WebCore::RenderThemeChromiumLinux::paintSearchFieldCancelButton):
935         (WebCore::RenderThemeChromiumLinux::adjustSearchFieldDecorationStyle):
936         (WebCore::RenderThemeChromiumLinux::adjustSearchFieldResultsDecorationStyle):
937         (WebCore::RenderThemeChromiumLinux::paintSearchFieldResultsDecoration):
938         (WebCore::RenderThemeChromiumLinux::adjustSearchFieldResultsButtonStyle):
939         (WebCore::RenderThemeChromiumLinux::paintSearchFieldResultsButton):
940         * rendering/RenderThemeChromiumLinux.h:
941         (WebCore::RenderThemeChromiumLinux::paintSearchField):
942         * rendering/RenderThemeChromiumWin.cpp:
943         (WebCore::):
944         (WebCore::RenderThemeChromiumWin::extraDefaultStyleSheet):
945         (WebCore::RenderThemeChromiumWin::adjustSearchFieldCancelButtonStyle):
946         (WebCore::RenderThemeChromiumWin::paintSearchFieldCancelButton):
947         (WebCore::RenderThemeChromiumWin::adjustSearchFieldDecorationStyle):
948         (WebCore::RenderThemeChromiumWin::adjustSearchFieldResultsDecorationStyle):
949         (WebCore::RenderThemeChromiumWin::paintSearchFieldResultsDecoration):
950         (WebCore::RenderThemeChromiumWin::adjustSearchFieldResultsButtonStyle):
951         (WebCore::RenderThemeChromiumWin::paintSearchFieldResultsButton):
952         * rendering/RenderThemeChromiumWin.h:
953         (WebCore::RenderThemeChromiumWin::paintSearchField):
954
955 2009-03-27  David Hyatt  <hyatt@apple.com>
956
957         Reviewed by Simon Fraser
958
959         If an object has a self-painting layer, don't count it as part of a block's visual overflow.
960         This fix has only been made for block-level children.   The inline-level case is still broken
961         (and covered by an existing bug).
962
963         Added fast/block/positioning/negative-rel-position.html
964
965         * rendering/InlineFlowBox.cpp:
966         (WebCore::InlineFlowBox::placeBoxesVertically):
967         * rendering/RenderBlock.cpp:
968         (WebCore::RenderBlock::layoutBlockChildren):
969         (WebCore::RenderBlock::lowestPosition):
970         (WebCore::RenderBlock::rightmostPosition):
971         (WebCore::RenderBlock::leftmostPosition):
972
973 2009-03-27  Anders Carlsson  <andersca@apple.com>
974
975         Reviewed by Darin Adler.
976
977         <rdar://problem/6642221>
978         REGRESSION: With the Movie widget, movie trailer fails to load if movie had been previously viewed
979         
980         Add a dashboard specific workaround so that we always create renderers for object elements, even if display:none is set.
981         
982         I've filed <rdar://problem/6731022> against the Movies widget.
983         
984         * html/HTMLObjectElement.cpp:
985         (WebCore::HTMLObjectElement::rendererIsNeeded):
986
987 2009-03-25  Timothy Hatcher  <timothy@apple.com>
988
989         Expose new DOM methods as public Objective-C API.
990
991         <rdar://problem/5837350> Expose new DOM classes and methods
992         as public API (match the additions to the JavaScript DOM)
993
994         Reviewed by Mark Rowe and Darin Adler.
995
996         * WebCore.xcodeproj/project.pbxproj:
997         * bindings/objc/DOMHTML.h:
998         * bindings/objc/DOMPrivate.h:
999         * bindings/objc/PublicDOMInterfaces.h:
1000
1001 2009-03-27  Zack Rusin <zack@kde.org>
1002
1003         Reviewed by Simon Hausmann.
1004
1005         https://bugs.webkit.org/show_bug.cgi?id=24280
1006
1007         Fix propagation of fill rules when rendering paths in the Qt build.
1008
1009         * platform/graphics/qt/GraphicsContextQt.cpp:
1010         (WebCore::toQtFillRule):
1011         (WebCore::GraphicsContext::fillPath):
1012         (WebCore::GraphicsContext::strokePath):
1013
1014 2009-03-27  Zack Rusin <zack@kde.org>
1015
1016         Reviewed by Tor Arne Vestbø.
1017
1018         https://bugs.webkit.org/show_bug.cgi?id=24275
1019
1020         Fix text field theming in the Qt build with the KDE 4 Oxygen
1021         style by adjusting the size vertically and horizontally to
1022         set padding on the element equal to the width of the style painted border.
1023
1024         * platform/qt/RenderThemeQt.cpp:
1025         (WebCore::RenderThemeQt::RenderThemeQt):
1026         (WebCore::RenderThemeQt::computeSizeBasedOnStyle):
1027         (WebCore::RenderThemeQt::adjustTextFieldStyle):
1028         (WebCore::RenderThemeQt::paintTextField):
1029         * platform/qt/RenderThemeQt.h:
1030
1031 2009-03-27  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1032
1033         Reviewed by Simon Hausmann.
1034
1035         https://bugs.webkit.org/show_bug.cgi?id=24852
1036         Build fix for GNU mode RVCT compilation
1037
1038         * html/PreloadScanner.cpp:
1039
1040 2009-03-27  Erik L. Bunce  <elbunce@xendom.com>
1041
1042         Reviewed by Simon Hausmann.
1043
1044         https://bugs.webkit.org/show_bug.cgi?id=24868
1045
1046         Make text of the writing direction items more user friendly.
1047
1048         * platform/qt/Localizations.cpp:
1049         (WebCore::contextMenuItemTagLeftToRight):
1050         (WebCore::contextMenuItemTagRightToLeft):
1051
1052 2009-03-27  Erik L. Bunce  <elbunce@xendom.com>
1053
1054         Reviewed by Simon Hausmann.
1055
1056         https://bugs.webkit.org/show_bug.cgi?id=24274
1057
1058         Fixed the Qt 4.4 Mac build with netscape plugins enabled.
1059
1060         * plugins/mac/PluginViewMac.cpp:
1061
1062 2009-03-26  Mark Rowe  <mrowe@apple.com>
1063
1064         Try and fix the Qt build.
1065
1066         * platform/text/TextEncodingDetectorNone.cpp:
1067         (WebCore::detectTextEncoding):
1068
1069 2009-03-26  Eric Carlson  <eric.carlson@apple.com>
1070
1071         Reviewed by Simon Fraser.
1072
1073         https://bugs.webkit.org/show_bug.cgi?id=24874
1074         24874: HTMLMediaElement: 'duration' defaults to NaN, deal with it
1075         
1076         The 'duration' attribute is NaN when no media is available, so the
1077         media element should take care when comparing with duration().
1078
1079         * html/HTMLMediaElement.cpp:
1080         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Don't compare with duration when
1081         it is NaN.
1082         (WebCore::HTMLMediaElement::endedPlayback): Ditto.
1083
1084 2009-03-26  Mark Rowe  <mrowe@apple.com>
1085
1086         Fix the build.
1087
1088         * platform/text/TextEncodingDetectorICU.cpp:
1089         * platform/text/TextEncodingDetectorNone.cpp:
1090
1091 2009-03-26  Jungshik Shin  <jshin@chromium.org>
1092
1093         Reviewed by Cameron Zwarich.
1094
1095         1. Fix the crash in setHintEncoding
1096         2. Fix build failures on Tiger and Qt.
1097         UnusedParam.h was not included by TextEncodingDetector{None,ICU}.cpp
1098         in the patch landed in r42023
1099         for http://bugs.webkit.org/show_bug.cgi?id=16482
1100
1101         * loader/TextResourceDecoder.h:
1102         (WebCore::TextResourceDecoder::setHintEncoding):
1103         * platform/text/TextEncodingDetectorICU.cpp:
1104         * platform/text/TextEncodingDetectorNone.cpp:
1105
1106 2009-03-26  Simon Fraser  <simon.fraser@apple.com>
1107
1108         Build fix when ACCELERATED_COMPOSITING is turned on.
1109
1110         * rendering/RenderLayerBacking.cpp:
1111         (WebCore::RenderLayerBacking::canUseDirectCompositing):
1112
1113 2009-03-26  Eric Seidel  <eric@webkit.org>
1114
1115         No additional review, committing previously reviewed files for build fix only.
1116
1117         Add files I missed when commiting Jungshik's patch in r42022.
1118         https://bugs.webkit.org/show_bug.cgi?id=16482
1119
1120         * icu/unicode/ucsdet.h: Added.
1121         * platform/text/TextEncodingDetector.h: Added.
1122         * platform/text/TextEncodingDetectorICU.cpp: Added.
1123         (WebCore::detectTextEncoding):
1124         * platform/text/TextEncodingDetectorNone.cpp: Added.
1125         (WebCore::detectTextEncoding):
1126
1127 2009-03-26  Jungshik Shin  <jshin@chromium.org>
1128
1129         Reviewed by Alexey Proskuryakov.
1130
1131         Add an encoding detector 'hook' to TextResourceDecoder.
1132          - add |usesEncodingDetector| to Settings. It's off by default.
1133          - add a new encoding source type |EncodingFromParent| 
1134            to distinguish cases when the encoding is inherited from
1135            the parent frame from cases when it's actually auto-detected.
1136          - add TextEncodingDetector* to platform/text. Currently,
1137            the only implementation uses ICU. Stub is added for 
1138            ports that do not use ICU and a build on Tiger. Mac OS 
1139            Tiger comes with ICU 3.2 that does not support encoding detector.
1140          - add ucsdet.h to icu/unicode for ports using ICU.
1141
1142         Layout tests will be added once bug 20534 is fixed and a WebPreference
1143         can be controlled in test_shell. With UsesEncodingDetector off, there
1144         is no change to test. 
1145
1146         http://bugs.webkit.org/show_bug.cgi?id=16482
1147
1148         * WebCore.vcproj/WebCore.vcproj:
1149         * WebCore.xcodeproj/project.pbxproj:
1150         * WebCore/GNUmakefile.am
1151         * WebCore/WebCore.pro
1152         * WebCore/WebCore.scons
1153         * WebCore/WebCoreSources.bkl
1154         * WebCore.base.exp
1155         * icu/unicode/ucsdet.h
1156         * loader/FrameLoader.cpp:
1157         (WebCore::FrameLoader::write): turn on/off encoding detector depending on Settings and set hintEncoding of TextResourceDecoder to the parent frame encoding if necessary and the security policy allows refering to the parent frame encoding.
1158         * loader/TextResourceDecoder.cpp:
1159         (WebCore::TextResourceDecoder::TextResourceDecoder):
1160         (WebCore::TextResourceDecoder::checkForCSSCharset): add check for EncodingFromParentFrame
1161         (WebCore::TextResourceDecoder::checkForHeadCharset): ditto
1162         (WebCore::TextResourceDecoder::shouldAutoDetect):
1163         (WebCore::TextResourceDecoder::decode): call encoding detector if shouldAutoDetect returns true.
1164         (WebCore::TextResourceDecoder::flush): if encoding is not determined by now, call encoding detector if shouldAutoDetect returns true.
1165         * loader/TextResourceDecoder.h:
1166         (WebCore::TextResourceDecoder::):
1167         (WebCore::TextResourceDecoder::create):
1168         (WebCore::TextResourceDecoder::setHintEncoding):
1169         (WebCore::TextResourceDecoder::source):
1170         * page/Settings.cpp: add m_usesEncodingDetector
1171         (WebCore::Settings::Settings):
1172         (WebCore::Settings::setUsesEncodingDetector):
1173         * page/Settings.h:
1174         (WebCore::Settings::usesEncodingDetector):
1175         * platform/text/TextEncodingDetector.h: Added.
1176         * platform/text/TextEncodingDetectorICU.cpp: Added.
1177         (WebCore::detectTextEncoding):
1178         * platform/text/TextEncodingDetectorNone.cpp: Added.
1179         (WebCore::detectTextEncoding):
1180
1181 2009-03-26  Darin Adler  <darin@apple.com>
1182
1183         Reviewed by Geoff Garen.
1184
1185         Removed code that casts EventListener down to derived classes
1186         without type checking. A crash could happen if you added event
1187         listeners with Objective-C and then manipulated the class with
1188         JavaScript.
1189
1190         * bindings/js/JSDOMApplicationCacheCustom.cpp:
1191         (WebCore::JSDOMApplicationCache::mark): Removed all the casts
1192         and used the markIfNotNull function and mark functions on
1193         EventListener instead.
1194         * bindings/js/JSMessagePortCustom.cpp:
1195         (WebCore::JSMessagePort::mark): Ditto.
1196         * bindings/js/JSWorkerContextCustom.cpp:
1197         (WebCore::JSWorkerContext::mark): Ditto.
1198         * bindings/js/JSWorkerCustom.cpp:
1199         (WebCore::JSWorker::mark): Ditto.
1200         * bindings/js/JSXMLHttpRequestCustom.cpp:
1201         (WebCore::JSXMLHttpRequest::mark): Ditto.
1202         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
1203         (WebCore::JSXMLHttpRequestUpload::mark): Ditto.
1204
1205         * bindings/js/JSEventListener.cpp:
1206         (WebCore::JSAbstractEventListener::handleEvent): Used function,
1207         the new name for what used to be called listenerObj.
1208         (WebCore::JSAbstractEventListener::virtualIsInline): Renamed since
1209         this doesn't need to be virtual for callers who have a pointer to
1210         this class, not the base class.
1211         (WebCore::JSEventListener::function): Renamed from listenerObj.
1212         (WebCore::JSProtectedEventListener::function): Ditto.
1213
1214         * bindings/js/JSEventListener.h: Removed unneeded forward class
1215         declarations. Made all virtual functions private since there's no
1216         need to call any of them on a particular derived class, only on
1217         EventListener. Explicitly declare JSEventListener::mark as virtual
1218         since it's now overriding a function in the EventListener base class.
1219         Made JSProtectedEventListener::m_globalObject protected so the
1220         JSLazyEventListener derived class can use it directly instead of using
1221         a virtual function to get the pointer.
1222
1223         * bindings/js/JSLazyEventListener.cpp:
1224         (WebCore::JSLazyEventListener::parseCode): Use m_globalObject instead
1225         of globalObject since the latter is a virtual function and there's no
1226         need to pay virtual function overhead.
1227         (WebCore::JSLazyEventListener::function): Renamed from listenerObj.
1228
1229         * bindings/js/JSLazyEventListener.h: Moved forward declaration of the
1230         Node class here from JSEventListener.h.
1231
1232         * bindings/scripts/CodeGeneratorJS.pm: Removed now-unneeded cast to
1233         JSEventListener when getting the script object from a listener.
1234
1235         * dom/EventListener.h: Added virtual function and mark functions
1236         so we can extract the JavaScript function object or mark a JavaScript
1237         event listener in a type safe manner.
1238
1239 2009-03-26  Peter Kasting  <pkasting@google.com>
1240
1241         Reviewed by Adele Peterson.
1242
1243         https://bugs.webkit.org/show_bug.cgi?id=24859
1244         Use CSS file instead of code to adjust search field styling.
1245
1246         * css/themeWin.css:
1247         * rendering/RenderThemeWin.cpp:
1248         * rendering/RenderThemeWin.h:
1249
1250 2009-03-26  Darin Adler  <darin@apple.com>
1251
1252         Reviewed by Geoff Garen.
1253
1254         Split JSLazyEventListener out into its own separate source file.
1255         We'll be removing JSAbstractEventListener and JSProtectedEventListener soon,
1256         so leave those in the same file with JSEventListener.
1257
1258         * GNUmakefile.am: Added JSLazyEventListener.
1259         * WebCore.pro: Ditto.
1260         * WebCore.scons: Ditto.
1261         * WebCore.vcproj/WebCore.vcproj: Ditto.
1262         * WebCore.xcodeproj/project.pbxproj: Ditto.
1263         * WebCoreSources.bkl: Ditto.
1264
1265         * bindings/js/JSEventListener.cpp: Removed the JSLazyEventListener part.
1266         Removed unneeded includes. Removed incorrect ASSERT_CLASS_FITS_IN_CELL, since
1267         JSAbstractEventListener is not derived from JSCell.
1268
1269         * bindings/js/JSEventListener.h: Removed the JSLazyEventListener part
1270         and the now-unneeded include of PlatformString.h.
1271
1272         * bindings/js/JSLazyEventListener.cpp: Copied from bindings/js/JSEventListener.cpp.
1273         Kept only the JSLazyEventListener part.
1274         (WebCore::eventParameterName): Made this have internal linkage by adding "static".
1275         Also moved the default case out of the switch statement so we will get a warning
1276         if we omit any cases in the future.
1277
1278         * bindings/js/JSLazyEventListener.h: Copied from bindings/js/JSEventListener.h.
1279         Kept only the JSLazyEventListener part.
1280
1281         * bindings/js/ScriptController.cpp: Removed unneeded includes and sorted the
1282         remanining ones. Include JSLazyEventListener.h instead of JSEventListener.h.
1283
1284 2009-03-26  Darin Adler  <darin@apple.com>
1285
1286         Reviewed by Geoff Garen.
1287
1288         Renamed JSUnprotectedEventListener to JSEventListener.
1289         And related renames.
1290
1291         Soon Geoff will make all JavaScript event listeners use mark instead
1292         of protect, so there's no need to emphasize "unprotected".
1293
1294         * bindings/js/JSDOMApplicationCacheCustom.cpp:
1295         (WebCore::JSDOMApplicationCache::mark):
1296         (WebCore::JSDOMApplicationCache::addEventListener):
1297         (WebCore::JSDOMApplicationCache::removeEventListener):
1298         * bindings/js/JSDOMGlobalObject.cpp:
1299         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
1300         (WebCore::JSDOMGlobalObject::findJSEventListener):
1301         (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener):
1302         (WebCore::JSDOMGlobalObject::jsEventListeners):
1303         (WebCore::JSDOMGlobalObject::jsInlineEventListeners):
1304         * bindings/js/JSDOMGlobalObject.h:
1305         * bindings/js/JSDOMWindowBase.h:
1306         * bindings/js/JSEventListener.cpp:
1307         (WebCore::JSEventListener::JSEventListener):
1308         (WebCore::JSEventListener::~JSEventListener):
1309         (WebCore::JSEventListener::listenerObj):
1310         (WebCore::JSEventListener::globalObject):
1311         (WebCore::JSEventListener::clearGlobalObject):
1312         (WebCore::JSEventListener::mark):
1313         * bindings/js/JSEventListener.h:
1314         (WebCore::JSEventListener::create):
1315         * bindings/js/JSMessagePortCustom.cpp:
1316         (WebCore::JSMessagePort::mark):
1317         (WebCore::JSMessagePort::addEventListener):
1318         (WebCore::JSMessagePort::removeEventListener):
1319         * bindings/js/JSWorkerContextCustom.cpp:
1320         (WebCore::JSWorkerContext::mark):
1321         (WebCore::JSWorkerContext::addEventListener):
1322         (WebCore::JSWorkerContext::removeEventListener):
1323         * bindings/js/JSWorkerCustom.cpp:
1324         (WebCore::JSWorker::mark):
1325         (WebCore::JSWorker::addEventListener):
1326         (WebCore::JSWorker::removeEventListener):
1327         * bindings/js/JSXMLHttpRequestCustom.cpp:
1328         (WebCore::JSXMLHttpRequest::mark):
1329         (WebCore::JSXMLHttpRequest::addEventListener):
1330         (WebCore::JSXMLHttpRequest::removeEventListener):
1331         * bindings/js/JSXMLHttpRequestUploadCustom.cpp:
1332         (WebCore::JSXMLHttpRequestUpload::mark):
1333         (WebCore::JSXMLHttpRequestUpload::addEventListener):
1334         (WebCore::JSXMLHttpRequestUpload::removeEventListener):
1335         * bindings/scripts/CodeGeneratorJS.pm:
1336         All just renaming.
1337
1338 2009-03-26  Darin Adler  <darin@apple.com>
1339
1340         Reviewed by Geoff Garen.
1341
1342         Renamed JSEventListener to JSProtectedEventListener.
1343         And related renames.
1344
1345         Soon Geoff will make all JavaScript event listeners use mark instead
1346         of protect, and so this class will be be obsolete. We will rename
1347         JSUnrpotectedEventListener to JSEventListener in the next check-in,
1348         since that one will remain.
1349
1350         * bindings/js/JSDOMGlobalObject.cpp:
1351         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject):
1352         (WebCore::JSDOMGlobalObject::findJSProtectedEventListener):
1353         (WebCore::JSDOMGlobalObject::findOrCreateJSProtectedEventListener):
1354         (WebCore::JSDOMGlobalObject::jsProtectedEventListeners):
1355         (WebCore::JSDOMGlobalObject::jsProtectedInlineEventListeners):
1356         * bindings/js/JSDOMGlobalObject.h:
1357         * bindings/js/JSDOMWindowBase.h:
1358         * bindings/js/JSDOMWindowCustom.cpp:
1359         (WebCore::JSDOMWindow::addEventListener):
1360         (WebCore::JSDOMWindow::removeEventListener):
1361         * bindings/js/JSEventListener.cpp:
1362         (WebCore::JSProtectedEventListener::JSProtectedEventListener):
1363         (WebCore::JSProtectedEventListener::~JSProtectedEventListener):
1364         (WebCore::JSProtectedEventListener::listenerObj):
1365         (WebCore::JSProtectedEventListener::globalObject):
1366         (WebCore::JSProtectedEventListener::clearGlobalObject):
1367         (WebCore::JSLazyEventListener::JSLazyEventListener):
1368         (WebCore::JSLazyEventListener::parseCode):
1369         * bindings/js/JSEventListener.h:
1370         (WebCore::JSProtectedEventListener::create):
1371         * bindings/js/JSNodeCustom.cpp:
1372         (WebCore::JSNode::addEventListener):
1373         (WebCore::JSNode::removeEventListener):
1374         * bindings/js/JSSVGElementInstanceCustom.cpp:
1375         (WebCore::JSSVGElementInstance::addEventListener):
1376         (WebCore::JSSVGElementInstance::removeEventListener):
1377         * bindings/scripts/CodeGeneratorJS.pm:
1378         All just renaming.
1379
1380 2009-03-26  Dan Bernstein  <mitz@apple.com>
1381
1382         Reviewed by Anders Carlsson.
1383
1384         - fix <rdar://problem/6725042> BidiResolver::createBidiRunsForLine can
1385           create runs extending beyond the end
1386
1387         No test because Safari does not use this version of
1388         createBidiRunsForLine() with the end iterator not pointing to the end
1389         of the text run.
1390
1391         * platform/text/BidiResolver.h:
1392         (WebCore::BidiResolver::appendRun): Cap the end of the run at the end
1393         of the line and set the reachedEndOfLine flag. This mirrors the logic
1394         in the specialized version of appendRun() in bidi.cpp, which is why the
1395         problem did not show up in HTML. Also avoid creating empty runs.
1396
1397 2009-03-26  Simon Fraser  <simon.fraser@apple.com>
1398
1399         Reviewed by Dave Hyatt
1400         
1401         https://bugs.webkit.org/show_bug.cgi?id=24864
1402
1403         Change the terminology from "inner content layer" to "direct compositing"
1404         for cases where we can push an image directly over to the compositing system,
1405         without having to draw it.
1406         
1407         Clean up much of the code which looks at style to determine if this is possible,
1408         and fix some bugs when backgrounds change dynamically.
1409         
1410         * rendering/RenderLayerBacking.cpp:
1411         (WebCore::hasBorderOutlineOrShadow):
1412         (WebCore::hasBoxDecorations):
1413         (WebCore::hasBoxDecorationsWithBackgroundImage):
1414         (WebCore::RenderLayerBacking::canBeSimpleContainerCompositingLayer):
1415         (WebCore::RenderLayerBacking::canUseDirectCompositing):
1416         (WebCore::RenderLayerBacking::detectDrawingOptimizations):
1417         (WebCore::RenderLayerBacking::rendererContentChanged):
1418         (WebCore::RenderLayerBacking::updateImageContents):
1419         * rendering/RenderLayerBacking.h:
1420
1421 2009-03-26  Simon Fraser  <simon.fraser@apple.com>
1422
1423         Reviewed by Dave Hyatt
1424         
1425         https://bugs.webkit.org/show_bug.cgi?id=23914
1426
1427         Tests: compositing/overflow/ancestor-overflow.html
1428                compositing/overflow/parent-overflow.html
1429
1430         * rendering/RenderLayer.cpp:
1431         (WebCore::RenderLayer::calculateClipRects):
1432         * rendering/RenderLayer.h:
1433         (WebCore::ClipRects::infiniteRect):
1434         New static method that returns a large rect that is used by the clipping
1435         logic.
1436         
1437         * rendering/RenderLayerBacking.cpp:
1438         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1439         Use parentClipRects(), rather than calculateRects(), to compute the overflow
1440         rect that we'll use to create a masking layer for composited clipping.
1441         
1442         * rendering/RenderLayerCompositor.cpp:
1443         (WebCore::RenderLayerCompositor::clippedByAncestor):
1444         Use parentClipRects() to see whether there's a layer between us and our
1445         compositing ancestor which applies clipping.
1446         
1447         (WebCore::RenderLayerCompositor::clipsCompositingDescendants):
1448         A layer which imposes clipping to its children doesn't have to be a stacking
1449         context; it might be a normal flow layer; in either case, we can rely on the
1450         hasCompositingDescendant() bit.
1451
1452 2009-03-26  Steve Falkenburg  <sfalken@apple.com>
1453
1454         https://bugs.webkit.org/show_bug.cgi?id=24837
1455         Escape key should dismiss select menu
1456
1457         Reviewed by Adam Roben.
1458
1459         * platform/win/PopupMenuWin.cpp:
1460         (WebCore::PopupWndProc):
1461
1462 2009-03-26  Kevin Ollivier  <kevino@theolliviers.com>
1463
1464         Reviewed by Alexey Proskuryakov.
1465
1466         Make sure the script uses LF line endings even on Windows.
1467         
1468         https://bugs.webkit.org/show_bug.cgi?id=24805
1469
1470         * WebCore/make-generated-sources.sh: Change svn:eol-style to LF
1471
1472 2009-03-26  Eli Fidler  <eli.fidler@torchmobile.com>
1473
1474         Reviewed by George Staikos.
1475
1476         Remove warnings all over the place by making operator precedence
1477         explicit in cases like x && y || z.  No functional change.
1478
1479         * css/CSSFontSelector.cpp:
1480         (WebCore::CSSFontSelector::addFontFaceRule):
1481         * css/CSSParser.cpp:
1482         (WebCore::CSSParser::parseValue):
1483         (WebCore::CSSParser::parseShadow):
1484         * dom/Document.cpp:
1485         (WebCore::Document::shouldScheduleLayout):
1486         * dom/Node.cpp:
1487         (WebCore::Node::isBlockFlowOrBlockTable):
1488         * dom/Node.h:
1489         (WebCore::Node::document):
1490         * dom/Position.cpp:
1491         (WebCore::Position::next):
1492         (WebCore::Position::upstream):
1493         (WebCore::Position::downstream):
1494         (WebCore::Position::getInlineBoxAndOffset):
1495         * dom/PositionIterator.cpp:
1496         (WebCore::PositionIterator::atStart):
1497         * dom/Range.cpp:
1498         (WebCore::Range::intersectsNode):
1499         * editing/Editor.cpp:
1500         (WebCore::Editor::setBaseWritingDirection):
1501         * editing/InsertParagraphSeparatorCommand.cpp:
1502         (WebCore::InsertParagraphSeparatorCommand::doApply):
1503         * editing/ReplaceSelectionCommand.cpp:
1504         (WebCore::ReplaceSelectionCommand::doApply):
1505         * editing/TextIterator.cpp:
1506         (WebCore::TextIterator::advance):
1507         (WebCore::SimplifiedBackwardsTextIterator::advance):
1508         * editing/VisiblePosition.cpp:
1509         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
1510         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
1511         (WebCore::VisiblePosition::canonicalPosition):
1512         * editing/htmlediting.cpp:
1513         (WebCore::isMailBlockquote):
1514         (WebCore::lineBreakExistsAtPosition):
1515         * html/HTMLSelectElement.cpp:
1516         (WebCore::HTMLSelectElement::parseMappedAttribute):
1517         * loader/FTPDirectoryDocument.cpp:
1518         (WebCore::processFileDateString):
1519         * loader/ImageLoader.cpp:
1520         (WebCore::ImageLoader::updateFromElement):
1521         * loader/TextResourceDecoder.cpp:
1522         (WebCore::TextResourceDecoder::checkForHeadCharset):
1523         * page/AccessibilityObject.cpp:
1524         (WebCore::updateAXLineStartForVisiblePosition):
1525         * page/EventHandler.cpp:
1526         (WebCore::EventHandler::sendContextMenuEvent):
1527         * page/animation/AnimationBase.cpp:
1528         (WebCore::PropertyWrapperGetter::equals):
1529         (WebCore::PropertyWrapperShadow::equals):
1530         * platform/ContextMenu.cpp:
1531         (WebCore::ContextMenu::populate):
1532         * platform/ScrollView.cpp:
1533         (WebCore::ScrollView::adjustScrollbarsAvoidingResizerCount):
1534         * platform/text/Base64.cpp:
1535         (WebCore::base64Encode):
1536         * platform/text/BidiResolver.h:
1537         (WebCore::::raiseExplicitEmbeddingLevel):
1538         (WebCore::::createBidiRunsForLine):
1539         * rendering/InlineTextBox.cpp:
1540         (WebCore::InlineTextBox::placeEllipsisBox):
1541         * rendering/RenderBlock.cpp:
1542         (WebCore::RenderBlock::addChild):
1543         (WebCore::RenderBlock::repaintOverhangingFloats):
1544         (WebCore::RenderBlock::fillInlineSelectionGaps):
1545         (WebCore::RenderBlock::positionForPoint):
1546         (WebCore::RenderBlock::calcInlinePrefWidths):
1547         (WebCore::RenderBlock::hasLineIfEmpty):
1548         * rendering/RenderBox.cpp:
1549         (WebCore::RenderBox::imageChanged):
1550         (WebCore::RenderBox::localCaretRect):
1551         (WebCore::RenderBox::positionForPoint):
1552         (WebCore::RenderBox::shrinkToAvoidFloats):
1553         * rendering/RenderObject.h:
1554         (WebCore::objectIsRelayoutBoundary):
1555         * rendering/RenderTableCell.cpp:
1556         (WebCore::RenderTableCell::clippedOverflowRectForRepaint):
1557         * rendering/RenderText.cpp:
1558         (WebCore::RenderText::calcPrefWidths):
1559         * rendering/bidi.cpp:
1560         (WebCore::RenderBlock::determineStartPosition):
1561         (WebCore::textWidth):
1562         * rendering/style/RenderStyle.cpp:
1563         (WebCore::RenderStyle::diff):
1564         * rendering/style/StyleInheritedData.cpp:
1565         (WebCore::cursorDataEquivalent):
1566         * rendering/style/StyleRareInheritedData.cpp:
1567         (WebCore::StyleRareInheritedData::shadowDataEquivalent):
1568         * rendering/style/StyleRareNonInheritedData.cpp:
1569         (WebCore::StyleRareNonInheritedData::shadowDataEquivalent):
1570         (WebCore::StyleRareNonInheritedData::animationDataEquivalent):
1571         (WebCore::StyleRareNonInheritedData::transitionDataEquivalent):
1572
1573 2009-03-26  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1574
1575         Reviewed by Holger Freyther.
1576
1577         https://bugs.webkit.org/show_bug.cgi?id=24804
1578         [GTK] 401 responses cause rogue content to be loaded
1579
1580         Our soup code handles 401 responses itself, so we should not feed
1581         the headers and data of those responses to the loader.
1582
1583         * platform/network/soup/ResourceHandleSoup.cpp:
1584         (WebCore::gotHeadersCallback):
1585         (WebCore::gotChunkCallback):
1586
1587 2009-03-25  Geoffrey Garen  <ggaren@apple.com>
1588
1589         Reviewed by Oliver Hunt and Darin Adler.
1590         
1591         Fixed <rdar://problem/6603167> Crash in WebKit!JSC::JSGlobalObject::resetPrototype
1592         during Stress test (#3 & #7 WER crashes for Safari 4 Beta)
1593         
1594         The problem was that allocation of the global object would, for just a
1595         moment, leave the global object's prototype unprotected from GC. This
1596         bug doesn't apply to non-global DOM objects because their prototypes are
1597         cached and marked by the global object.
1598
1599         No test case because the crashing condition is hard to deterministically
1600         produce in a normal build, and in a Windows Release build with
1601         COLLECT_ON_EVERY_ALLOCATION set to 1, existing tests crash/hang.
1602
1603         * bindings/js/JSDOMWindowShell.cpp:
1604         (WebCore::JSDOMWindowShell::setWindow):
1605         * bindings/js/WorkerScriptController.cpp:
1606         (WebCore::WorkerScriptController::initScript): Protect the global object's
1607         prototype from GC during construction, since the global object does not
1608         yet point to it, and therefore won't mark it.
1609
1610 2009-03-25  Dean Jackson  <dino@apple.com>
1611
1612         Reviewed by Simon Fraser
1613
1614         https://bugs.webkit.org/show_bug.cgi?id=23361
1615
1616         When using hardware compositing, some images can be directly
1617         rendered by the hardware - no need to draw them into a separate
1618         context, therefore saving memory.
1619         Only images with certain style properties can be directly
1620         composited - basically anything that is not a simple image requires
1621         the usual rendering path (eg. if the image has borders).
1622
1623         Test: compositing/direct-image-compositing.html
1624
1625         * manual-tests/resources/simple_image.png: Added.
1626         * manual-tests/simple-image-compositing.html: Added.
1627         * platform/graphics/Image.h:
1628         (WebCore::Image::startAnimation):
1629             - move this to public
1630         * rendering/RenderImage.cpp:
1631         (WebCore::RenderImage::imageChanged):
1632             - poke compositing layer if image has changed
1633         (WebCore::RenderImage::notifyFinished):
1634             - let the compositing layer know that it can render the image
1635         * rendering/RenderImage.h:
1636         * rendering/RenderLayer.cpp:
1637         (WebCore::RenderLayer::rendererContentChanged):
1638         * rendering/RenderLayer.h:
1639         * rendering/RenderLayerBacking.cpp:
1640         (WebCore::RenderLayerBacking::canUseInnerContentLayer):
1641         (WebCore::RenderLayerBacking::detectDrawingOptimizations):
1642         (WebCore::RenderLayerBacking::rendererContentChanged):
1643         * rendering/RenderLayerBacking.h:
1644             - code to hook up direct compositing of images where
1645               possible
1646
1647 2009-03-25  David Levin  <levin@chromium.org>
1648
1649         Reviewed by Dimitri Glazkov.
1650
1651         Chromium build fix. Fix #include in V8NodeFilterCondition.cpp due to the
1652         rename of V8NodeFilter to V8NodeFilterCondition.
1653
1654         * bindings/v8/V8NodeFilterCondition.cpp:
1655
1656 2009-03-25  Simon Fraser  <simon.fraser@apple.com>
1657
1658         Reviewed by Darin Adler
1659         
1660         https://bugs.webkit.org/show_bug.cgi?id=24817
1661         
1662         When the slider range is zero, avoid a divide by zero, which caused the
1663         thumb to be positioned off in the weeds, which broke painting.
1664
1665         Test: media/video-empty-source.html
1666
1667         * rendering/RenderSlider.cpp:
1668         (WebCore::SliderRange::proportionFromValue):
1669         (WebCore::SliderRange::valueFromProportion):
1670         (WebCore::sliderPosition):
1671         (WebCore::RenderSlider::setValueForPosition):
1672
1673 2009-03-24  Eric Seidel  <eric@webkit.org>
1674
1675         Reviewed by Darin Adler.
1676
1677         Remove dead code and style cleanup
1678         https://bugs.webkit.org/show_bug.cgi?id=24684
1679
1680         * html/CanvasStyle.cpp:
1681         (WebCore::CanvasStyle::CanvasStyle):
1682           Coverty was annoyed that we didn't initialize all of our members.  I agree, but I didn't
1683           want to paste all 8 members each time, so I just cleaned up the existing constructors and left them.
1684         * page/FocusController.cpp:
1685         (WebCore::FocusController::setFocusedNode):
1686           "node" was checked just above and is already known to be non-null
1687         * rendering/RenderLayer.cpp:
1688         (WebCore::RenderLayer::insertOnlyThisLayer):
1689           We were already using parentLayer w/o a NULL check above, so just add an explicit ASSERT and use it w/o NULL check
1690         (WebCore::RenderLayer::resize):
1691           element is already ASSERTed above, no need to null check it here
1692         * rendering/RenderTableSection.cpp:
1693         (WebCore::RenderTableSection::addCell):
1694           currentCell.cell was just assigned to the value "cell" which is known to be non-null, no need to null check again.
1695
1696 2009-03-24  Eric Seidel  <eric@webkit.org>
1697
1698         Reviewed by Darin Adler.
1699
1700         Move ASSERT(foo) to before where foo-> is used
1701         https://bugs.webkit.org/show_bug.cgi?id=24684
1702
1703         * platform/chromium/PasteboardChromium.cpp:
1704         (WebCore::Pasteboard::writeImage):
1705           Move ASSERTs to the top of the function, code was using "node" before ASSERT(node), once I moved
1706           ASSERT(node) to the top of the function it made sense to move the rest of them there too.
1707         * rendering/SVGRenderSupport.cpp:
1708         (WebCore::prepareToRenderSVGContent):
1709           move ASSERT(object) to *before* we use "object" :)
1710
1711 2009-03-24  Eric Seidel  <eric@webkit.org>
1712
1713         Reviewed by Simon Fraser.
1714
1715         Make TextTokenizer ASSERT that the buffer was freed
1716         https://bugs.webkit.org/show_bug.cgi?id=24684
1717
1718         * loader/TextDocument.cpp:
1719         (WebCore::TextTokenizer::TextTokenizer):
1720         (WebCore::TextTokenizer::~TextTokenizer):
1721         (WebCore::TextTokenizer::finish):
1722           Make it clear by adding a ~TextTokenizer that finish() will always be called and the memory never leaked.
1723
1724 2009-03-24  Eric Seidel  <eric@webkit.org>
1725
1726         Reviewed by Darin Adler.
1727
1728         Fix case where lBreak.obj->isBR() when lBreak.obj was NULL
1729         https://bugs.webkit.org/show_bug.cgi?id=24684
1730
1731         I don't have a test case where we were taking the wrong path here
1732         However, adding an ASSERT(lBreak.obj) before this usage caused
1733         multiple bidi tests to fail, so lBreak.obj can be null here.
1734
1735         * rendering/bidi.cpp:
1736         (WebCore::RenderBlock::findNextLineBreak):
1737           lBreak.obj can be null, so we can't call ->isBR() on it unconditionally.
1738
1739 2009-03-24  Eric Seidel  <eric@webkit.org>
1740
1741         Reviewed by Simon Fraser.
1742
1743         Style cleanup and dead code removal in dom, editing
1744         https://bugs.webkit.org/show_bug.cgi?id=24684
1745
1746         * dom/ContainerNode.cpp:
1747         (WebCore::ContainerNode::getUpperLeftCorner):
1748         (WebCore::ContainerNode::getLowerRightCorner):
1749         (WebCore::ContainerNode::getRect):
1750           Coverty was (rightly) confused as to what the hell "o" was being used for
1751           and whether or not it would ever be NULL.  I added some ASSERTS so that people (and machines)
1752           would be less confused about the logic in getUpperLeftCorner/getLowerRightCorner
1753         * dom/Document.cpp:
1754         (WebCore::Document::recalcStyle):
1755           Remove dead code, this block already checked that change == Force
1756         * editing/ApplyStyleCommand.cpp:
1757         (WebCore::ApplyStyleCommand::removeInlineStyle):
1758           Coverty correctly identified that traversePreviousNodePostOrder can return NULL, thus
1759           prev will be null, and we don't really explicitly handle it (like we probably should)
1760           It's OK though, because we end up creating a null position object, which may not have
1761           been what we intended, but we certainly don't crash.
1762         * editing/InsertParagraphSeparatorCommand.cpp:
1763         (WebCore::InsertParagraphSeparatorCommand::doApply):
1764           Remove dead code, insertionPosition.node() is already checked to be non-null above.
1765         * editing/markup.cpp:
1766         (WebCore::appendStartMarkup):
1767           removed dead code, annotate is already known to be true at this point in the file
1768           !annotate was checked above, and break; was called.
1769
1770 2009-03-24  Eric Seidel  <eric@webkit.org>
1771
1772         Reviewed by Simon Fraser.
1773
1774         CSS dead code removal and cleanup from Coverty errors
1775         https://bugs.webkit.org/show_bug.cgi?id=24684
1776
1777         * css/CSSStyleSelector.cpp:
1778         (WebCore::CSSStyleSelector::applyProperty):
1779           Every other place in the code we check settings() for NULL, so I made these places
1780           check too, even though we should never be resolving style against a document which has
1781           no frame (which I believe is the only time settings() can be null)
1782         * css/CSSStyleSheet.cpp:
1783         (WebCore::CSSStyleSheet::styleSheetChanged):
1784           Removing dead code, "root" can never be null here.
1785         * css/SVGCSSStyleSelector.cpp:
1786         (WebCore::colorFromSVGColorCSSValue):
1787         (WebCore::CSSStyleSelector::applySVGProperty):
1788           Extra returns in the old macros caused dead code.  Removing the old macros and use modern
1789           ones instead. :)
1790           Extra null checks to value were not needed.  Added an ASSERT at the top of the function
1791           to make it clear that value will never be NULL.
1792           Added colorFromSVGColorCSSValue to clean up the code a little.
1793
1794 2009-03-24  Eric Seidel  <eric@webkit.org>
1795
1796         Reviewed by Simon Fraser.
1797
1798         Font fallback cleanup and added ASSERT for GlyphPageTreeNode
1799         https://bugs.webkit.org/show_bug.cgi?id=24684
1800
1801         * css/CSSFontSelector.cpp:
1802         (WebCore::compareFontFaces):
1803           Coverty was concerned that it was possible to index off the end of weightFallbackRuleSets
1804           I can't read the code well enough to tell, so I tried to make the code clearer
1805           and added an ASSERT.        
1806         * platform/graphics/GlyphPageTreeNode.cpp:
1807         (WebCore::GlyphPageTreeNode::initializePage):
1808           Coverty believes we can crash here due to j being larger than GlyphPage::size.  I think to is already
1809           known to be < GlyphPage::size due to the min() statement above, but not being sure I added an ASSERT.
1810
1811 2009-03-24  Eric Seidel  <eric@webkit.org>
1812
1813         Reviewed by Simon Fraser.
1814
1815         Coverty inspired fixes in Animations/Transforms
1816         https://bugs.webkit.org/show_bug.cgi?id=24684
1817
1818         * page/animation/AnimationBase.h:
1819           Fix animate() signatures to match so that the virtual methods actually override one another. :)
1820         * page/animation/AnimationController.cpp:
1821         (WebCore::AnimationControllerPrivate::removeFromStartTimeResponseWaitList):
1822           Attempt to fix this method, prevAnimation was never set to anything but NULL,
1823           as far as I can tell the author originally intended to update it at the end
1824           of the loop, which is what I changed this code to do.
1825         * page/animation/ImplicitAnimation.cpp:
1826         (WebCore::ImplicitAnimation::animate):
1827           Make method signature match AnimationBase::animate
1828         * page/animation/ImplicitAnimation.h:
1829         * page/animation/KeyframeAnimation.cpp:
1830         (WebCore::KeyframeAnimation::animate):
1831           Make method signature match AnimationBase::animate
1832         * page/animation/KeyframeAnimation.h:
1833         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1834         (WebCore::PerspectiveTransformOperation::blend):
1835           if (blendToIdentity) already returned above.
1836         * platform/graphics/transforms/RotateTransformOperation.cpp:
1837         (WebCore::RotateTransformOperation::blend):
1838           if (blendToIdentity) already returned above.
1839
1840 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
1841
1842         Reviewed by George Staikos.
1843
1844         Fix compiler warnings regarding assignments in if statements.
1845
1846         * html/HTMLFormElement.cpp:
1847         (WebCore::HTMLFormElement::createFormData):
1848         * plugins/PluginPackage.cpp:
1849         (WebCore::PluginPackage::compare):
1850
1851 2009-03-25  Dan Bernstein  <mitz@apple.com>
1852
1853         Reviewed by Dave Hyatt.
1854
1855         - fix <rdar://problem/6472150> repro crash in
1856           RenderBlock::rightmostPosition(bool, bool) const at mercotte.fr using
1857           menus
1858
1859         Test: fast/inline/continuation-positioned-reparenting.html
1860
1861         * rendering/RenderInline.cpp:
1862         (WebCore::RenderInline::splitFlow): When repurposing the existing
1863         container as the "pre" block, clear its positioned objects list, because
1864         positioned descendants may end up in a different block after the split.
1865
1866 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
1867
1868         Reviewed by Dave Hyatt
1869         
1870         https://bugs.webkit.org/show_bug.cgi?id=24784
1871         
1872         Length values in transform operations need to take zoom into account.
1873
1874         Test: fast/transforms/transforms-with-zoom.html
1875
1876         * css/CSSStyleSelector.cpp:
1877         (WebCore::CSSStyleSelector::createTransformOperations):
1878
1879 2009-03-25  David Hyatt  <hyatt@apple.com>
1880
1881         Reviewed by Simon Fraser.
1882
1883         https://bugs.webkit.org/show_bug.cgi?id=24809, background-clip/origin don't use the correct
1884         values.  Add support for the new values (while preserving the old values for backwards
1885         compatibility).
1886
1887         Changed some existing test cases to use the new values.
1888
1889         * css/CSSParser.cpp:
1890         (WebCore::CSSParser::parseFillProperty):
1891         * css/CSSPrimitiveValueMappings.h:
1892         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1893         (WebCore::CSSPrimitiveValue::operator EFillBox):
1894         * css/CSSValueKeywords.in:
1895
1896 2009-03-25  Brett Wilson  <brettw@dhcp-172-22-71-191.mtv.corp.google.com>
1897
1898         Reviewed by Dimitri Glazkov.
1899
1900         Fix complex text opacity on the Chromium Windows port.
1901         https://bugs.webkit.org/show_bug.cgi?id=24757
1902
1903         Test: fast/text/complex-text-opacity.html
1904
1905         * platform/graphics/chromium/FontChromiumWin.cpp:
1906         (WebCore::):
1907         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::TransparencyAwareFontPainter):
1908         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::init):
1909         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::initializeForGDI):
1910         (WebCore::TransparencyAwareFontPainter::TransparencyAwareFontPainter::~TransparencyAwareFontPainter):
1911         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::TransparencyAwareGlyphPainter):
1912         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::~TransparencyAwareGlyphPainter):
1913         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::estimateTextBounds):
1914         (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
1915         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::hdc):
1916         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::TransparencyAwareUniscribePainter):
1917         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::~TransparencyAwareUniscribePainter):
1918         (WebCore::TransparencyAwareFontPainter::TransparencyAwareUniscribePainter::estimateTextBounds):
1919         (WebCore::Font::drawGlyphs):
1920         (WebCore::Font::drawComplexText):
1921
1922 2009-03-25  David Hyatt  <hyatt@apple.com>
1923
1924         Reviewed by Eric Seidel
1925
1926         Fix for bug 23198, border images should not clip to border radii.  The border-image should just ignore
1927         the border-radius, since the assumption is that any desired rounding will be built into the border-image
1928         itself.
1929
1930         Note that I do not agree with this change, but I am matching the spec.
1931
1932         Added fast/borders/border-image-border-radius.html
1933
1934         * rendering/RenderBoxModelObject.cpp:
1935         (WebCore::RenderBoxModelObject::paintNinePieceImage):
1936
1937 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
1938
1939         Reviewed by Holger Freyther.
1940
1941         https://bugs.webkit.org/show_bug.cgi?id=24750
1942         [GTK] requests download instead of displaying page
1943
1944         Fix the Content-Type headers we get from soup, so that we set a
1945         proper media type on the ResourceResponse.
1946
1947         * platform/network/soup/ResourceHandleSoup.cpp:
1948         (WebCore::fillResponseFromMessage):
1949
1950 2009-03-25  Gustavo Noronha Silva  <gns@gnome.org>
1951
1952         Reviewed by Holger Freyther.
1953
1954         https://bugs.webkit.org/show_bug.cgi?id=24600
1955         [GTK] responses with status code >= 400 should not be given special treatment
1956
1957         Do not special case requests that have HTTP responses >=
1958         400. Redirects are handled automatically by libsoup, but the rest
1959         of the responses should be treated like any other.
1960
1961         * platform/network/soup/ResourceHandleSoup.cpp:
1962         (WebCore::):
1963         (WebCore::gotHeadersCallback):
1964         (WebCore::gotChunkCallback):
1965         (WebCore::finishedCallback):
1966
1967 2009-03-25  Darin Adler  <darin@apple.com>
1968
1969         Reviewed by John Sullivan.
1970
1971         Tidy up LegacyWebArchive a bit. And don't include favicons in web archives when
1972         they are being used only for selections, not an entire document.
1973
1974         * WebCore.base.exp: Remove exported function that's not used in WebKit.
1975
1976         * loader/archive/cf/LegacyWebArchive.cpp:
1977         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Made a static member
1978         function so it can share private things with other member functions. Added some FIXME
1979         comments to a branch of code I think is dead. Changed boolean argument into a named
1980         one. Renamed to match other similar functions.
1981         (WebCore::LegacyWebArchive::createResourceResponseFromPropertyListData): Ditto.
1982         (WebCore::LegacyWebArchive::createResource): Ditto.
1983         (WebCore::LegacyWebArchive::create): Merged the create and init functions.
1984         (WebCore::LegacyWebArchive::rawDataRepresentation): Added some assertions because
1985         we should never fail to write (we can fail to read).
1986         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Made a static
1987         member function as above.
1988         (WebCore::LegacyWebArchive::createFromSelection): Ditto.
1989         (WebCore::LegacyWebArchive::create): Iterate the vector with indices rather than
1990         iterators. Only include the favicon if the first node is the document since we don't
1991         want to include the favicon when copying and pasting.
1992
1993         * loader/archive/cf/LegacyWebArchive.h: Made one of the create functions private.
1994         Made the Mac-specific functions be static member functions. Made other helpers be
1995         static member functions. Removed the nit function.
1996
1997         * loader/archive/cf/LegacyWebArchiveMac.mm:
1998         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Updated
1999         comment and made this a static member function.
2000         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto. Also made
2001         it so we only type cast in one place.
2002
2003 2009-03-25  Darin Adler  <darin@apple.com>
2004
2005         Reviewed by David Hyatt.
2006
2007         Bug 24740: crash in RenderSlider::setPositionFromValue when calling pause() after setting <video> to display: none
2008         https://bugs.webkit.org/show_bug.cgi?id=24740
2009         rdar://problem/6679873
2010
2011         Bug 12104: Native Slider: When the thumb's height is specified as a percentage, it is not centered properly
2012         https://bugs.webkit.org/show_bug.cgi?id=12104
2013
2014         Test: media/video-display-none-crash.html
2015
2016         The problem here was that RenderSlider was trying to position its thumb in a way that
2017         requires it to call updateLayout inside rendering code. The right way to position a
2018         child renderer is to do layout, so I had to write a layout function. And then fix a few
2019         other small problems shown by the same test case.
2020
2021         * rendering/RenderSlider.cpp: Made defaultTrackLength have internal linkage.
2022         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
2023         prefix for public DOM classes, not elements used as implementation details.
2024         Made SliderThumbElement function members private and got rid of unneeded default
2025         argument value for shadowParent.
2026         (WebCore::SliderRange::SliderRange): Added. Parses precision, max, and min attributes.
2027         (WebCore::SliderRange::clampValue): Added. Does standard clamping based on the above.
2028         (WebCore::SliderRange::valueFromElement): Added. Reads the value from the element in
2029         a way that clamps to the range.
2030         (WebCore::sliderPosition): Added. Computes the slider position: a double.
2031         (WebCore::SliderThumbElement::SliderThumbElement): Removed unneeded explicit
2032         initialization of m_initialClickPoint.
2033         (WebCore::SliderThumbElement::defaultEventHandler): Call setValueForPosition instead
2034         of calling setCurrentPosition and valueChanged.
2035         (WebCore::RenderSlider::RenderSlider): Remove unneeded explicit initialization of m_thumb.
2036         (WebCore::RenderSlider::styleDidChange): Remove unneeded second argument to createThumbStyle.
2037         (WebCore::RenderSlider::createThumbStyle): Remove unneeded second argument. Get rid of code
2038         setting the position to relative and setting the left and top. We now handle positioning
2039         in a custom layout function.
2040         (WebCore::RenderSlider::layout): Rewrote to handle positioning of the thumb as layout.
2041         (WebCore::RenderSlider::updateFromElement): Added code to immediately update the value
2042         in the element if it's out of range. This clamping used to be done as a side effect of
2043         setPositionFromValue. Also, this has nothing to do with the renderer, so at some point
2044         it could be moved into HTMLInputElement. Removed call to setPositionFromValue
2045         and instead just rely on the call to setNeedsLayout. Fix the setNeedsLayout call to be
2046         a normal setNeedsLayout(true), not a setNeedsLayout(true, false), because we do want
2047         this to be propagated to the parent -- it's not called during layout.
2048         (WebCore::RenderSlider::setValueForPosition): Refactor to use the new SliderRange
2049         class. Also don't call setCurrentPosition; instead just call setNeedsLayout.
2050         (WebCore::RenderSlider::currentPosition): Use the actual position of the renderer rather
2051         than the style to find the position; that means this needs to be done after layout is done.
2052         Also removed unneeded runtime checks and replaced them with assertions, after checking
2053         all callers to see they already guarantee this.
2054         (WebCore::RenderSlider::trackSize): Removed unneeded runtime checks and replaced them
2055         with assertions, after checking all callers to see they already guarantee this.
2056         (WebCore::RenderSlider::inDragMode): Added a null check for m_thumb so this won't
2057         crash if called early on a brand new RenderSlider.
2058
2059         * rendering/RenderSlider.h: Made all functions private except for forwardEvent and inDragMode.
2060         Renamed HTMLSliderThumbElement to SliderThumbElement because we only use the HTML
2061         prefix for public DOM classes, not elements used as implementation details. Made the
2062         mouseEventIsInThumb function non-virtual. Removed the return value and argument from
2063         setPositionFromValue. Removed valueChanged and setCurrentPosition. Removed the oldStyle
2064         argument to createThumbStyle (see above). Made SliderThumbElement a friend so it can use some
2065         private member functions.
2066
2067 2009-03-25  Eli Fidler  <eli.fidler@torchmobile.com>
2068
2069         Reviewed by George Staikos.
2070
2071         Fix ambiguous else cases by adding braces to nested if()s with elses.
2072
2073         * loader/MainResourceLoader.cpp:
2074         (WebCore::MainResourceLoader::continueAfterContentPolicy):
2075         * page/EventHandler.cpp:
2076         (WebCore::EventHandler::updateDragAndDrop):
2077         * rendering/RenderListMarker.cpp:
2078         (WebCore::toArmenianUnder10000):
2079         * rendering/TextControlInnerElements.cpp:
2080         (WebCore::TextControlInnerTextElement::defaultEventHandler):
2081
2082 2009-03-24  Eli Fidler  <eli.fidler@torchmobile.com>
2083
2084         Reviewed by George Staikos.
2085
2086         Move variable into proper platform block to quiet warning.
2087
2088         * html/CanvasRenderingContext2D.cpp:
2089         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2090
2091 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
2092
2093         Reviewed by Antti Koivisto.
2094
2095         Fix for <rdar://problem/6719375> Deal with QTKit loadstate changes when playing streaming movies
2096
2097         *  WebCore/html/HTMLMediaElement.cpp:
2098         (WebCore::HTMLMediaElement::setNetworkState): Deal with media engine reviving after having
2099         network state of NETWORK_NO_SOURCE.
2100
2101         *  WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2102         (WebCore::MediaPlayerPrivate::updateStates): Reset m_readyState at each state change since
2103         some types of movies currently cause QTKit's load state to bounce around. QTMovieLoadStatePlaythroughOK
2104         corresponds to HaveFutureData, not HaveEnoughData.
2105
2106 2009-03-24  Adele Peterson  <adele@apple.com>
2107
2108         Reviewed by Darin Adler.
2109
2110         Fix for https://bugs.webkit.org/show_bug.cgi?id=24707
2111         <rdar://problem/6593021> Deleting with a caret in a blank, quoted line decreases the quoting, but does not delete the line
2112
2113         * editing/TypingCommand.cpp: (WebCore::TypingCommand::deleteKeyPressed):
2114         After breaking out of an empty mail blockquote, we still want continue with the deletion
2115         so actual content will get deleted, and not just the quote style.
2116
2117 2009-03-24  Darin Adler  <darin@apple.com>
2118
2119         Reviewed by Brady Eidson.
2120
2121         <rdar://problem/6624662> REGRESSION (r39904): can't save certain web pages as web archive (ones without favicons!)
2122
2123         * loader/archive/cf/LegacyWebArchive.cpp:
2124         (WebCore::LegacyWebArchive::create): Added a null check.
2125
2126 2009-03-24  Adam Langley  <agl@google.com>
2127
2128         Reviewed by Darin Fisher.
2129
2130         https://bugs.webkit.org/show_bug.cgi?id=24685
2131
2132         The Skia drawLine function takes subpixel values and attempts to draw
2133         a line with subpixel precision. This is complex and slow for drawing
2134         scrollbars which use only vertical and horizontal lines.
2135
2136         This changes the Chromium Linux scrollbar code to use drawIRect.
2137
2138         * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
2139         (WebCore::ScrollbarThemeChromium::invalidateOnMouseEnterExit):
2140         (WebCore::drawVertLine):
2141         (WebCore::drawHorizLine):
2142         (WebCore::drawBox):
2143         (WebCore::ScrollbarThemeChromium::paintTrackPiece):
2144         (WebCore::ScrollbarThemeChromium::paintThumb):
2145
2146 2009-03-24  David Kilzer  <ddkilzer@apple.com>
2147
2148         Bug 23310: Setting an absolute path (/abs) on an <iframe> with no src doesn't resolve the URL properly
2149
2150         <https://bugs.webkit.org/show_bug.cgi?id=23310>
2151
2152         Reviewed by Darin Adler.
2153
2154         Test: fast/frames/iframe-no-src-set-location.html
2155
2156         * dom/Document.cpp:
2157         (WebCore::Document::completeURL): If m_baseURL is empty or is
2158         about:blank and we have a parent document, use the parent
2159         document's URL for the base when completing a new URL.
2160
2161 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
2162
2163         Reviewed by Dave Hyatt
2164         
2165         https://bugs.webkit.org/show_bug.cgi?id=24659
2166         
2167         When hit-testing 3d-transformed layers, it doesn't make sense to project the hitTestRect
2168         into the coordinate space of the layer, and doing so can result in pathalogical quads
2169         that break hit testing. In that case, simply use the same bounds as used for painting,
2170         which are the composited bounds for this layer.
2171
2172         Test: transforms/3d/hit-testing/rotated-hit-test.html
2173
2174         * rendering/RenderLayer.cpp:
2175         (WebCore::RenderLayer::hitTestLayer):
2176
2177 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
2178
2179         Reviewed by Dave Hyatt
2180
2181         https://bugs.webkit.org/show_bug.cgi?id=24436
2182         
2183         When compositing is enabled, painting and hit testing end up using different
2184         clipping roots, because, for painting, every composited layer is a clipping root,
2185         but for hit testing only layers with transforms are. To fix this, we use
2186         temporary clip rects for hit testing, if the page is in compositing mode.
2187
2188         * rendering/RenderLayer.cpp:
2189         (WebCore::RenderLayer::paintLayer):
2190         (WebCore::RenderLayer::hitTestLayer):
2191         (WebCore::RenderLayer::parentClipRects):
2192         (WebCore::RenderLayer::calculateRects):
2193         * rendering/RenderLayer.h:
2194
2195 2009-03-24  Simon Fraser  <simon.fraser@apple.com>
2196
2197         Reviewed by Dan Bernstein
2198         
2199         https://bugs.webkit.org/show_bug.cgi?id=24782
2200
2201         Fix regression with CSS clip rects with non-length values, by reverting to
2202         the original code, but passing the zoom multiplier through convertToLength().
2203         
2204         Also make stylistic change in createTransformOperations(), renaming 'inStyle'
2205         to 'style.
2206         
2207         Tested by existing tests.
2208
2209         * css/CSSStyleSelector.cpp:
2210         (WebCore::convertToLength):
2211         (WebCore::CSSStyleSelector::applyProperty):
2212         (WebCore::CSSStyleSelector::createTransformOperations):
2213
2214 2009-03-24  David Hyatt  <hyatt@apple.com>
2215
2216         Reviewed by Simon Fraser
2217
2218         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents
2219         to a border-radius.
2220
2221         This patch makes non-self-painting overflow layers and control clips work with border-radius.  RenderLayers
2222         that should be clipped by overflow ancestors with border-radius are still broken.
2223
2224         Added fast/clip/overflow-border-radius-clip.html
2225
2226         * rendering/RenderBox.cpp:
2227         (WebCore::RenderBox::pushContentsClip):
2228
2229 2009-03-24  David Hyatt  <hyatt@apple.com>
2230
2231         Reviewed by Simon Fraser
2232
2233         https://bugs.webkit.org/show_bug.cgi?id=21789, overflow:hidden elements should clip their foreground contents.
2234         
2235         This first patch makes overflow:hidden properly clip the foreground contents of overflow:hidden replaced elements.  Common
2236         replaced elements now default to overflow:hidden in the UA stylesheet (this is what the spec specifically recommends be
2237         done).
2238     
2239         Added fast/replaced/border-radius-clip.html
2240
2241         * css/html4.css:
2242         * rendering/RenderReplaced.cpp:
2243         (WebCore::RenderReplaced::paint):
2244         * rendering/RenderWidget.cpp:
2245         (WebCore::RenderWidget::paint):
2246
2247 2009-03-24  Adele Peterson  <adele@apple.com>
2248
2249         RS by Mark Rowe.
2250
2251         Only build these Mail quirks checks in on the Mac.
2252
2253         * dom/Document.cpp: (WebCore::disableRangeMutation):
2254         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
2255
2256 2009-03-24  Brent Fulgham  <bfulgham@webkit.org>
2257
2258         Build fix, no review.
2259
2260         Remove ResourceLoaderCFNet.cpp from build list for Cairo Releas
2261         and Debug targets.
2262
2263         * WebCore.vcproj/WebCore.vcproj:
2264
2265 2009-03-24  Eric Carlson  <eric.carlson@apple.com>
2266
2267         Fix layout tests broken by r41907.
2268
2269         * html/HTMLMediaElement.cpp:
2270         (WebCore::HTMLMediaElement::setReadyState): Don't set "was playing" based on the new ready state
2271
2272 2009-03-24  Dmitry Titov  <dimich@chromium.org>
2273
2274         Reviewed by Dimitri Glazkov.
2275
2276         https://bugs.webkit.org/show_bug.cgi?id=24689
2277         Fix Chromium compilation errors.
2278
2279         * bindings/v8/WorkerContextExecutionProxy.cpp:
2280         (WebCore::WorkerContextExecutionProxy::FindOrCreateEventListener):
2281         (WebCore::WorkerContextExecutionProxy::RemoveEventListener):
2282
2283 2009-03-24  Yury Semikhatsky  <yurys@chromium.org>
2284
2285         Reviewed by Darin Adler.
2286
2287         https://bugs.webkit.org/show_bug.cgi?id=24759
2288         Add missing methods Element.prototype.removeMatchingStyleClasses and
2289         Node.prototype.enclosingNodeOrSelfWithNodeNameInArray to SourceFrame content
2290         iframe. These methods are called by Element.prototype.removeStyleClass and
2291         Node.prototype.enclosingNodeOrSelfWithNodeName.
2292
2293         * inspector/front-end/SourceFrame.js:
2294         (WebInspector.SourceFrame.prototype._loaded):
2295
2296 2009-03-24  Mark Mentovai  <mark@chromium.org>
2297
2298         Reviewed by Mark Rowe.
2299
2300         https://bugs.webkit.org/show_bug.cgi?id=24653
2301         WebKit should be buildable without prefix header injection.
2302         Adds missing #includes and forward declarations as needed.
2303
2304         * editing/SmartReplaceCF.cpp:
2305         * platform/graphics/mac/ColorMac.mm:
2306         * platform/graphics/mac/FontCacheMac.mm:
2307         * platform/graphics/mac/FontCustomPlatformData.h:
2308         * platform/graphics/mac/FontMac.mm:
2309         * platform/graphics/mac/FontMacATSUI.mm:
2310         * platform/graphics/mac/FontPlatformData.h:
2311         * platform/graphics/mac/FontPlatformDataMac.mm:
2312         * platform/graphics/mac/GraphicsContextMac.mm:
2313         * platform/graphics/mac/SimpleFontDataMac.mm:
2314         * platform/mac/FoundationExtras.h:
2315         * platform/mac/LocalCurrentGraphicsContext.h:
2316         * platform/mac/WebCoreSystemInterface.h:
2317         * platform/mac/WebCoreSystemInterface.mm:
2318         * platform/mac/WebCoreTextRenderer.h:
2319         * platform/mac/WebCoreTextRenderer.mm:
2320         * platform/mac/WebFontCache.h:
2321         * platform/mac/WebFontCache.mm:
2322         * platform/text/PlatformString.h:
2323         * platform/text/mac/ShapeArabic.c:
2324         * platform/text/mac/StringMac.mm:
2325         * rendering/RenderThemeChromiumMac.h:
2326
2327 2009-03-24  Dan Bernstein  <mitz@apple.com>
2328
2329         Reviewed by Darin Adler.
2330
2331         - fix <rdar://problem/6107874> by capping the nesting depth of
2332           "block-level" elements generated by the parser
2333
2334         Test: fast/parser/block-nesting-cap.html
2335
2336         * html/HTMLParser.cpp:
2337         (WebCore::HTMLParser::HTMLParser):
2338         (WebCore::HTMLParser::insertNode):
2339         (WebCore::HTMLParser::pushBlock):
2340         (WebCore::HTMLParser::popOneBlockCommon):
2341         (WebCore::HTMLParser::freeBlock):
2342         * html/HTMLParser.h:
2343
2344 2009-03-23  Greg Bolsinga  <bolsinga@apple.com>
2345
2346         Reviewed by David Kilzer.
2347
2348         https://bugs.webkit.org/show_bug.cgi?id=24771
2349         
2350         DOMTimeStamps are based upon 1970.
2351
2352         * platform/mac/GeolocationServiceMac.mm:
2353         (-[WebCoreCoreLocationObserver locationManager:didUpdateToLocation:fromLocation:]):
2354
2355 2009-03-23  Eric Seidel  <eric@webkit.org>
2356
2357         Build fix, no review.
2358
2359         * rendering/RenderObject.cpp:
2360         (WebCore::RenderObject::createVisiblePosition): change .container to .isNotNull()
2361
2362 2009-03-23  Eric Seidel  <eric@webkit.org>
2363
2364         Reviewed by Darin Adler.
2365
2366         Rename Position::container to m_anchorNode and make it private
2367         https://bugs.webkit.org/show_bug.cgi?id=24760
2368
2369         More code cleanup for Position.
2370
2371         Change all uses of m_container to node()
2372         Eventually most uses of node() should change to anchorNode() to designate
2373         that it's the node the Position is anchored to, but not necessarily the
2374         container of the position (it could be the before/after neighbor).
2375
2376         Remove any code which sets m_container, and change it to use a new
2377         Position::moveToPosition function which takes a node and offset.
2378         It never makes sense to change the node and leave the offset.
2379
2380         * dom/Position.h:
2381         (WebCore::Position::Position):
2382         (WebCore::Position::clear):
2383         (WebCore::Position::anchorNode):
2384         (WebCore::Position::node):
2385         (WebCore::Position::moveToPosition):
2386         (WebCore::Position::moveToOffset):
2387         (WebCore::Position::isNull):
2388         (WebCore::Position::isNotNull):
2389         (WebCore::operator==):
2390         * dom/Range.cpp:
2391         (WebCore::Range::create):
2392         (WebCore::Range::compareBoundaryPoints):
2393         * dom/RangeBoundaryPoint.h:
2394         (WebCore::RangeBoundaryPoint::container):
2395         (WebCore::RangeBoundaryPoint::set):
2396         (WebCore::RangeBoundaryPoint::setOffset):
2397         (WebCore::RangeBoundaryPoint::setToChild):
2398         (WebCore::RangeBoundaryPoint::setToStart):
2399         (WebCore::RangeBoundaryPoint::setToEnd):
2400
2401 2009-03-17  Eric Seidel  <eric@webkit.org>
2402
2403         Reviewed by David Hyatt.
2404
2405         document.write() should be able to make a document strict mode
2406         https://bugs.webkit.org/show_bug.cgi?id=24336
2407
2408         Remove an implicit write of "<html>" on the first document.write call
2409         this was added as part of a KDE import http://trac.webkit.org/changeset/798
2410         with no layout test or explanation.  I can't think of any reason why
2411         an implicit <html> write is necessary (or correct), so I'm removing it and
2412         adding a test for the correct behavior.  The parser will add any necessary
2413         HTMLHTMLElements during the write() anyway.
2414
2415         Our behavior is now tested by fast/dom/Document/document-write-doctype
2416         and matches IE, FF fails this new test.  Mozilla bug filed:
2417         https://bugzilla.mozilla.org/show_bug.cgi?id=483908
2418
2419         * dom/Document.cpp:
2420         (WebCore::Document::write):
2421
2422 2009-03-23  Sam Weinig  <sam@webkit.org>
2423
2424         Reviewed by Dan Bernstein.
2425
2426         Fix for <rdar://problem/6140966>
2427         Empty Caches does not clear the Cross-site XMLHttpRequest preflight cache
2428
2429         * WebCore.base.exp:
2430         * WebCore.xcodeproj/project.pbxproj:
2431         * loader/CrossOriginPreflightResultCache.cpp:
2432         (WebCore::CrossOriginPreflightResultCache::empty):
2433         * loader/CrossOriginPreflightResultCache.h:
2434
2435 2009-03-23  Darin Adler  <darin@apple.com>
2436
2437         Reviewed by Adele Peterson.
2438
2439         Bug 24726: hit testing doesn't work right when the click is on anonymous content
2440         https://bugs.webkit.org/show_bug.cgi?id=24726
2441         rdar://problem/6696992
2442
2443         Test: editing/selection/hit-test-anonymous.html
2444
2445         * rendering/RenderBR.cpp:
2446         (WebCore::RenderBR::positionForPoint): Call createVisiblePosition instead of
2447         creating a VisiblePosition directly. It will handle finding non-anonymous
2448         content nearby if node() is 0.
2449         * rendering/RenderBlock.cpp:
2450         (WebCore::positionForPointRespectingEditingBoundaries): Ditto.
2451         (WebCore::positionForPointWithInlineChildren): Ditto.
2452         (WebCore::RenderBlock::positionForPoint): Ditto.
2453         * rendering/RenderBox.cpp:
2454         (WebCore::RenderBox::positionForPoint): Ditto.
2455         * rendering/RenderObject.cpp:
2456         (WebCore::RenderObject::positionForPoint): Ditto.
2457         (WebCore::RenderObject::createVisiblePosition): Added.
2458         * rendering/RenderObject.h: Added createVisiblePosition.
2459         * rendering/RenderReplaced.cpp:
2460         (WebCore::RenderReplaced::positionForPoint): Call createVisiblePosition.
2461         * rendering/RenderSVGInlineText.cpp:
2462         (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
2463         * rendering/RenderText.cpp:
2464         (WebCore::RenderText::positionForPoint): Ditto.
2465
2466 2009-03-23  Adele Peterson  <adele@apple.com>
2467
2468         Reviewed by Darin Adler & Dave Hyatt.
2469
2470         Fix for <rdar://problem/6621310> REGRESSION(35185): Apple Travel HTML emails missing some style after Safari 4 upgrade
2471
2472         Leopard Mail doesn't expect <style> to be in the body.  This change reverts back to the old behavior of
2473         moving <style> to <head> for that version of Mail.
2474
2475         * html/HTMLElement.cpp: (WebCore::HTMLElement::inEitherTagList):
2476
2477 2009-03-23  Adele Peterson  <adele@apple.com>
2478
2479         Reviewed by Mark Rowe & Dave Hyatt.
2480
2481         Merge some of the individual Mail quirks into two settings that we can check for future quirks.
2482
2483         * WebCore.base.exp:
2484         * dom/Document.cpp:
2485         (WebCore::disableRangeMutation):
2486         (WebCore::Document::nodeChildrenChanged):
2487         (WebCore::Document::nodeWillBeRemoved):
2488         (WebCore::Document::textInserted):
2489         (WebCore::Document::textRemoved):
2490         (WebCore::Document::textNodesMerged):
2491         (WebCore::Document::textNodeSplit):
2492         * page/Settings.cpp:
2493         (WebCore::Settings::Settings):
2494         (WebCore::Settings::setNeedsLeopardMailQuirks):
2495         (WebCore::Settings::setNeedsTigerMailQuirks):
2496         * page/Settings.h:
2497         (WebCore::Settings::needsLeopardMailQuirks):
2498         (WebCore::Settings::needsTigerMailQuirks):
2499
2500 2009-03-23  Ada Chan  <adachan@apple.com>
2501
2502         https://bugs.webkit.org/show_bug.cgi?id=24762
2503         Support text-indent in <option> elements on windows platform.
2504
2505         Reviewed by Adele Peterson.
2506
2507         * css/themeWin.css:
2508         * platform/PopupMenuStyle.h: We don't honor font specified on <option> elements right now.  Make this
2509         explicit via windows themed default stylesheet.
2510         (WebCore::PopupMenuStyle::PopupMenuStyle): Also store text-indent and text-direction.
2511         (WebCore::PopupMenuStyle::textIndent):
2512         (WebCore::PopupMenuStyle::textDirection):
2513         * platform/win/PopupMenuWin.cpp:
2514         (WebCore::PopupMenu::paint): Adjust the text's x-coordinate if text-indent is supported for options and 
2515         text-indent is specified with LTR direction.
2516         * rendering/RenderMenuList.cpp:
2517         (WebCore::RenderMenuList::updateOptionsWidth): Take text-indent into account if theme supports text-indent for options.
2518         (WebCore::RenderMenuList::itemStyle): Use new PopupMenuStyle constructor on windows.
2519         (WebCore::RenderMenuList::menuStyle): Ditto.
2520         * rendering/RenderTextControlSingleLine.cpp:
2521         (WebCore::RenderTextControlSingleLine::menuStyle): Ditto.
2522         * rendering/RenderTheme.h:
2523         (WebCore::RenderTheme::popupOptionSupportsTextIndent): Added.  Default is false since we are only supporting it in windows for now.
2524         * rendering/RenderThemeWin.h:
2525         (WebCore::RenderThemeWin::popupOptionSupportsTextIndent): Returns true for windows.
2526
2527 2009-03-23  Sam Weinig  <sam@webkit.org>
2528
2529         Reviewed by Anders Carlsson.
2530
2531         Fix for https://bugs.webkit.org/show_bug.cgi?id=24699
2532         REGRESSION: Java Applets broken
2533         <rdar://problem/6707494>
2534
2535         Fix loading Java applets without a codeBase. Only pass the base (up to the
2536         the last path component) of the baseURL to the plug-in.
2537
2538         * html/HTMLAppletElement.cpp:
2539         (WebCore::HTMLAppletElement::createRenderer):
2540         * platform/KURL.cpp:
2541         (WebCore::KURL::baseAsString):
2542         * platform/KURL.h:
2543
2544 2009-03-23  Darin Adler  <darin@apple.com>
2545
2546         Reviewed by Sam Weinig.
2547
2548         * platform/KURL.h: Removed now-incorrect comments.
2549         None of the parts include the separator characters any more, now that
2550         query doesn't include the "?", so the comments explaining which do and do
2551         not are no-longer helpful.
2552
2553 2009-03-23  David Levin  <levin@chromium.org>
2554
2555         Reviewed by Dimitri Glazkov.
2556
2557         https://bugs.webkit.org/show_bug.cgi?id=24764
2558
2559         Renamed files V8NodeFilter -> V8NodeFilterCondition to reflect
2560         class names.  Also fixed some headers that got mangled in search/replace
2561         operations.
2562
2563         No change in behavior, so no test.
2564
2565         * bindings/v8/V8NodeFilter.h: Removed.
2566         * bindings/v8/V8NodeFilterCondition.cpp: Renamed from WebCore/bindings/v8/V8NodeFilter.cpp.
2567         * bindings/v8/V8NodeFilterCondition.h: Added.
2568         * bindings/v8/custom/V8ClipboardCustom.cpp:
2569         * bindings/v8/custom/V8DocumentCustom.cpp:
2570         * bindings/v8/custom/V8ElementCustom.cpp:
2571         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
2572         * bindings/v8/custom/V8NavigatorCustom.cpp:
2573
2574 2009-03-23  Darin Fisher  <darin@chromium.org>
2575
2576         Reviewed by Antti Koivisto.
2577
2578         https://bugs.webkit.org/show_bug.cgi?id=24741
2579
2580         Adds a unique across-browser-sessions identifier to FormData, which may
2581         be used by ResourceHandle as a secondary cache key to enable cached
2582         form submissions.
2583
2584         At issue: two otherwise identical form submissions may result in
2585         completely independent responses, which may each be appropriate to
2586         store and reuse from cache.
2587
2588         * html/HTMLFormElement.cpp: Added call to FormData::setIdentifier so that
2589         we only enable cached form submissions for those generated by HTML.  This
2590         way we do not bother with POSTs generated by XMLHttpRequest.
2591         (WebCore::generateFormDataIdentifier):
2592         (WebCore::HTMLFormElement::createFormData):
2593         * platform/network/FormData.cpp: Initialize m_identifier to 0, which means
2594         the unspecified identifier.  So by default there is no identifier and
2595         nothing changes.
2596         (WebCore::FormData::FormData):
2597         * platform/network/FormData.h: Added m_identifier with setter and getter.
2598         (WebCore::FormData::setIdentifier):
2599         (WebCore::FormData::identifier):
2600
2601 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
2602
2603         Reviewed by Antti Koivisto
2604         
2605         https://bugs.webkit.org/show_bug.cgi?id=24733
2606         
2607         Fix media controller with full-page zoom. Previously, the media controller
2608         shadow nodes never saw style changes on the RenderMedia, so did not respond
2609         to zooming at all. Now, we update the style on the shadow renderers
2610         whenever RenderMedia gets a style change. Also fix the video thumb in
2611         the theme to be scaled properly.
2612
2613         Test: media/video-controls-zoomed.html
2614
2615         * rendering/MediaControlElements.cpp:
2616         (WebCore::MediaControlShadowRootElement::updateStyle):
2617         (WebCore::MediaTextDisplayElement::MediaTextDisplayElement):
2618         (WebCore::MediaTextDisplayElement::updateStyle):
2619         (WebCore::MediaControlInputElement::MediaControlInputElement):
2620         (WebCore::MediaControlInputElement::updateStyle):
2621         * rendering/MediaControlElements.h:
2622         * rendering/RenderMedia.cpp:
2623         (WebCore::RenderMedia::styleDidChange):
2624         * rendering/RenderMedia.h:
2625         * rendering/RenderThemeMac.mm:
2626         (WebCore::RenderThemeMac::adjustSliderThumbSize):
2627
2628 2009-03-23  Mike Belshe  <mike@belshe.com>
2629
2630         Reviewed by Darin Adler.
2631
2632         https://bugs.webkit.org/show_bug.cgi?id=24739
2633
2634         Rework StringImpl::create methods to try to allocate a single buffer
2635         rather than allocating both the StringImpl class and a separate data
2636         buffer.
2637
2638         * platform/text/StringImpl.cpp:
2639         * platform/text/StringImpl.h:
2640
2641 2009-03-23  Darin Adler  <darin@apple.com>
2642
2643         Reviewed by Antti Koivisto.
2644
2645         Based on a patch by Nico Weber <nicolasweber@gmx.de>
2646
2647         Bug 24755: LayoutTests/http/tests/misc/url-in-utf16le.html regression
2648         https://bugs.webkit.org/show_bug.cgi?id=24755
2649
2650         * platform/text/TextEncoding.cpp:
2651         (WebCore::TextEncoding::isUTF7Encoding): Added. Checks if the current encoding
2652         is UTF7 without loading extended codecs.
2653         (WebCore::TextEncoding::encodingForFormSubmission): Use isUTF7Encoding() instead
2654         of comparing with UTF7Encoding(). Eliminate the explicit check of
2655         noExtendedTextEncodingNameUsed() because that's now handled by the functions
2656         that this function calls instead.
2657
2658         * platform/text/TextEncoding.h: Added isUTF7Encoding function.
2659         Also tweaked formatting a bit.
2660
2661 2009-03-20  Peter Kasting  <pkasting@google.com>
2662
2663         Reviewed by Darin Fisher.
2664
2665         https://bugs.webkit.org/show_bug.cgi?id=24720
2666         RenderThemeChromium should draw something for Slider parts instead of
2667         dropping them on the floor.
2668
2669         * platform/chromium/ChromiumBridge.h:
2670         * rendering/RenderThemeChromiumWin.cpp:
2671         (WebCore::RenderThemeChromiumWin::adjustSliderThumbSize):
2672         (WebCore::RenderThemeChromiumWin::paintSliderTrack):
2673         (WebCore::RenderThemeChromiumWin::determineSliderThumbState):
2674         (WebCore::RenderThemeChromiumWin::getThemeData):
2675         * rendering/RenderThemeChromiumWin.h:
2676         (WebCore::RenderThemeChromiumWin::paintSliderThumb):
2677
2678 2009-03-23  Glen Murphy  <glen@chromium.org>
2679
2680         Reviewed by Darin Fisher.
2681
2682         https://bugs.webkit.org/show_bug.cgi?id=24657
2683
2684         Fix Skia drawing of highly scaled bitmaps; the conversion to
2685         IntRect produced visible layout test failures in highly scaled 
2686         coordinate systems.
2687
2688         Test: svg/custom/image-small-width-height.svg
2689
2690         * WebCore\platform\graphics\skia\ImageSkia.cpp:
2691
2692 2009-03-23  David Kilzer  <ddkilzer@apple.com>
2693
2694         Provide JavaScript exception information after slow script timeout
2695
2696         Reviewed by Oliver Hunt.
2697
2698         * bindings/js/ScriptController.cpp:
2699         (WebCore::ScriptController::evaluate): Changed to report
2700         exceptions for the Interrupted completion type as well.
2701
2702 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
2703
2704         Reviewed by Darin Adler
2705
2706         https://bugs.webkit.org/show_bug.cgi?id=24736
2707         
2708         Fix three mostly-unrelated problems with full-page zoom:
2709         
2710         * dom/Document.cpp:
2711         (WebCore::Document::elementFromPoint):
2712         Document::elementFromPoint() needs to take full-page zoom into account.
2713         
2714         * dom/MouseRelatedEvent.cpp:
2715         (WebCore::MouseRelatedEvent::receivedTarget):
2716         Take full-page zoom into account when computing offsetX/offsetY.
2717         
2718         * html/HTMLSelectElement.cpp:
2719         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2720         Don't use offsetX/offsetY when hit testing list boxes; offsets were broken
2721         with full-page zoom, and using pageX/pageY is easier because we don't
2722         have to worry about the event target, and we already have a point in
2723         absolute coordinates.
2724
2725         Tests: fast/forms/listbox-hit-test-zoomed.html
2726                fast/forms/search-zoomed.html
2727                fast/forms/slider-zoomed.html
2728
2729 2009-03-23  Simon Fraser  <simon.fraser@apple.com>
2730
2731         Reviewed by Dan Bernstein
2732
2733         https://bugs.webkit.org/show_bug.cgi?id=24753
2734         
2735         The rect for CSS 'clip' needs to have zooming applied to it.
2736
2737         Test: fast/css/clip-zooming.html
2738
2739         * css/CSSStyleSelector.cpp:
2740         (WebCore::CSSStyleSelector::applyProperty):
2741
2742 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
2743
2744         Reviewed by Adam Roben.
2745
2746         <rdar://problem/6704282>
2747         https://bugs.webkit.org/show_bug.cgi?id=24719
2748         QTMovieWinTimer logic inversion
2749
2750         Fix logic inversion in the Win32 timer used by QTMovieWin that caused it to always
2751         use SetTimer, even when the intervals was below USER_TIMER_MINIMUM. A side effect of
2752         this was that a movie timer would sometimes be blocked for significant amounts of time 
2753         because WM_TIMER messages are not processed when the thread's message queue has any
2754         higher priority messages, and WebCore/Win's timer uses PostMessage for low interval
2755         timers. Also change SetTimer call to use HWND and custom message instead of 
2756         timer function since the timer already has an HWND for processing PostMessage.
2757
2758         Not possible to make a test for this because it is so timing dependant.
2759
2760         * platform/graphics/win/QTMovieWinTimer.cpp:
2761         (TimerWindowWndProc):
2762         (setSharedTimerFireDelay):
2763
2764 2009-03-23  Eric Carlson  <eric.carlson@apple.com>
2765
2766         Reviewed by Adele Peterson.
2767
2768         https://bugs.webkit.org/show_bug.cgi?id=24588
2769         
2770         Update media element implementation to current HTML5 spec
2771
2772         New tests: 
2773                media/media-constants.html
2774                media/video-seek-no-src-exception.html
2775                media/video-source-add-src.html
2776                media/video-src-invalid-remove.html
2777                media/video-src-plus-source.html
2778                media/video-timeupdate-during-playback.html
2779
2780         * dom/EventNames.h: Remove obsolute events, add new ones.
2781         * html/HTMLMediaElement.cpp:
2782         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new member vars.
2783         (WebCore::HTMLMediaElement::attributeChanged): Trigger load() only when we don't
2784         have a source.
2785         (WebCore::HTMLMediaElement::removedFromDocument): Deal with state name changes.
2786         (WebCore::HTMLMediaElement::scheduleProgressEvent): New, create a progress event and 
2787         add it to the event queue to be dispatch when the timer fires.
2788         (WebCore::HTMLMediaElement::scheduleEvent): New, create a generic event and add
2789         it to the event queue to be dispatch when the timer fires.
2790         (WebCore::HTMLMediaElement::enqueueEvent): Add an event to the queue and ticke the 
2791         asynch event timer.
2792         (WebCore::HTMLMediaElement::asyncEventTimerFired): Dispatch all pending events.
2793         (WebCore::HTMLMediaElement::loadTimerFired): Either trigger the initial load or
2794         try to load the next <source> url.
2795         (WebCore::HTMLMediaElement::load): Minor style change.
2796         (WebCore::HTMLMediaElement::loadInternal): The first part of the spec load algorithm, cleanup
2797         the current load (if any) and set up state for a new load.
2798         (WebCore::HTMLMediaElement::selectMediaResource): Deal with no 'src' or <source>, post 'loadstart'
2799         event, and initiate load from 'src' if present.
2800         (WebCore::HTMLMediaElement::loadNextSourceChild): Initiate load from next <source> url, or trigger
2801         noneSupported() if no more to consider.
2802         (WebCore::HTMLMediaElement::loadResource): Instantiate a new MediaPlayer and ask it to load a url.
2803         (WebCore::HTMLMediaElement::startProgressEventTimer): Start the repeating progress event timer.
2804         (WebCore::HTMLMediaElement::noneSupported): Post error event and set up state when no valid 
2805         media url was found.
2806         (WebCore::HTMLMediaElement::mediaEngineError): Post error event and set up state when no valid 
2807         media engine failed with a decode error or a network error.
2808         (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
2809         (WebCore::HTMLMediaElement::setNetworkState): Updated for new spec network states.
2810         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
2811         (WebCore::HTMLMediaElement::setReadyState): Updated for new spec ready state.
2812         (WebCore::HTMLMediaElement::progressEventTimerFired): Bail if the network is not active.
2813         (WebCore::HTMLMediaElement::seek): Return INVALID_STATE_ERR exception if state is too low or
2814         if player hasn't been set up yet. This is necessary becase load() is async. Clear the flag
2815         we use to guard against sending 'ended' more than once.
2816         (WebCore::HTMLMediaElement::duration): Don't bother calling media engine before it has metadata.
2817         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Remove exception param, 0 is no longer an
2818         invalid rate. 
2819         (WebCore::HTMLMediaElement::setPlaybackRate): Remove exception param, 0 is no longer an
2820         invalid rate. Cache rate being set so we can use it later if media engine isn't ready now.
2821         (WebCore::HTMLMediaElement::play): Remove exception param, play() before load() now just
2822         starts loading asynchronously.
2823         (WebCore::HTMLMediaElement::playInternal): Remove exception param. Fire 'waiting' or 'playing'
2824         event depending on current state.
2825         (WebCore::HTMLMediaElement::pause): Remove exception param, pause() before load() now just
2826         starts loading asynchronously.
2827         (WebCore::HTMLMediaElement::pauseInternal): Remove exception param.
2828         (WebCore::HTMLMediaElement::setVolume): dispatchEventAsync -> scheduleEvent
2829         (WebCore::HTMLMediaElement::setMuted): dispatchEventAsync -> scheduleEvent
2830         (WebCore::HTMLMediaElement::togglePlayState): Remove exception param.
2831         (WebCore::HTMLMediaElement::beginScrubbing): pause() doesn't take an exception param.
2832         (WebCore::HTMLMediaElement::startPlaybackProgressTimer): New, starts timer that fires 4 times per
2833         second when the movie is playing to timeupdate so we can post 'timeupdate' events.
2834         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Timer proc.
2835         (WebCore::HTMLMediaElement::scheduleTimeupdateEvent): Bottleneck around scheduling a 'timeupdate'
2836         event because we both fire them them when the spec says we should and when the media engine
2837         says that time has jumped, but we don't want to fire more than one at a given movie time. We also
2838         use this bottleneck to keep track of the last time one was posted so we won't fire too often
2839         during playback.
2840         (WebCore::HTMLMediaElement::canPlay): readyState now tracks whether or not we have metadata.
2841         (WebCore::HTMLMediaElement::havePotentialSourceChild): New, checks to see if there are a <source>
2842         element with a 'src' attribute that we have not tried to load yet.
2843         (WebCore::HTMLMediaElement::nextSourceChild): New, returns the url and content type of the next
2844         <source> element that we haven't tried to load.
2845         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Schedule 'seeked' event when seeking completes.
2846         Set a flag when we post the 'ended' event, clear it when time changed and we aren't at the end since
2847         some media engines call this proc more than once when playback reaches the end and stops, but we
2848         don't want to post 'ended' more than once.
2849         (WebCore::HTMLMediaElement::mediaPlayerDurationChanged): New, added so media engine can inform
2850         when the movie duration changes and we can post 'durationchanged' event.
2851         (WebCore::HTMLMediaElement::mediaPlayerRateChanged): New, added so media engine can inform when
2852         the rate changed and we can updated our cached rate. This is useful because we only want to know
2853         post periodic 'timeupdate' events when the movie is actually playing, and because we want to know
2854         the actual playback rate when it differs from what we tried to set.
2855         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged): New, added so media engine can inform when
2856         a movie's intrinsic size changes and we can inform the renderer.
2857         (WebCore::HTMLMediaElement::potentiallyPlaying): Renamed from activelyPlaying since the spec now
2858         uses "actively playing" for this concept. Update logic for new state names and un-comment calls
2859         to stoppedDueToErrors() and pausedForUserInteraction() since the spec says those condiditons
2860         are part of the answer.
2861         (WebCore::HTMLMediaElement::endedPlayback): Update logic for new state names. 
2862         (WebCore::HTMLMediaElement::stoppedDueToErrors): New, spec says this logic should be part of
2863         the determination of "potentially playing".
2864         (WebCore::HTMLMediaElement::pausedForUserInteraction): New, placeholder for when (if) user
2865         agent supports this spec concept.
2866         (WebCore::HTMLMediaElement::updatePlayState): Stop timer used to fire periodic 'timeupdate' 
2867         events when we pauses the movie. Set the media engine rate before calling play() in case it
2868         wasn't set up when the rate was changed.
2869         (WebCore::HTMLMediaElement::stopPeriodicTimers): New, stop the progress event and 'timeupate'
2870         event timers.
2871         (WebCore::HTMLMediaElement::userCancelledLoad): New, logic pulled out of documentWillBecomeInactive
2872         and updated for the current spec.
2873         (WebCore::HTMLMediaElement::documentWillBecomeInactive): Moved some logic to userCancelledLoad.
2874         (WebCore::HTMLMediaElement::documentDidBecomeActive): Update comments.
2875         (WebCore::HTMLMediaElement::initialURL): Update for refactoring of code that determines the 
2876         initial url.
2877         * html/HTMLMediaElement.h: Change ReadyState and NetworkState enums to match names in the spec,
2878         update for changes in .cpp.
2879         (WebCore::HTMLMediaElement::):
2880
2881         * html/HTMLMediaElement.idl: Update ready state and network state constants for spec changes.
2882         defaultPlaybackRate, playbackRate, play(), and pause() no longer raise exceptions.
2883
2884         * html/HTMLSourceElement.cpp:
2885         (WebCore::HTMLSourceElement::insertedIntoDocument): Update for network state name changes.
2886
2887         * html/HTMLVideoElement.cpp:
2888         (WebCore::HTMLVideoElement::updatePosterImage): Update for ready state name changes.
2889
2890         * html/MediaError.h:
2891         (WebCore::MediaError::): add MEDIA_ERR_NONE_SUPPORTED.
2892
2893         * html/MediaError.idl: add MEDIA_ERR_NONE_SUPPORTED.
2894
2895         * loader/MediaDocument.cpp:
2896         (WebCore::MediaDocument::defaultEventHandler): play() and pause() don't take an exception.
2897
2898         * platform/graphics/MediaPlayer.cpp:
2899         (WebCore::NullMediaPlayerPrivate::readyState): Update for newtork state name changes.
2900         (WebCore::MediaPlayer::sizeChanged): New, so engine can report intrinsic size changes.
2901         (WebCore::MediaPlayer::rateChanged): New, so engine can report rate changes.
2902         (WebCore::MediaPlayer::durationChanged): New, so engine can report duration changes.
2903         * platform/graphics/MediaPlayer.h: Update NetworkState and ReadyState enum names to match spec
2904         states.
2905         (WebCore::MediaPlayerClient::mediaPlayerDurationChanged): New.
2906         (WebCore::MediaPlayerClient::mediaPlayerRateChanged): New.
2907         (WebCore::MediaPlayerClient::mediaPlayerSizeChanged): New.
2908         (WebCore::MediaPlayer::):
2909
2910         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
2911         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
2912         (WebCore::MediaPlayerPrivate::load): Ditto.
2913         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
2914         (WebCore::MediaPlayerPrivate::loadingFailed): Ditto.
2915
2916         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Update for network/ready state name changes.
2917         Remove endPointTimer, it is no longer necessary. Add m_enabledTrackCount and m_duration.
2918         (WebCore::MediaPlayerPrivate::metaDataAvailable):
2919         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2920         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer or m_endTime. Initialize
2921         m_enabledTrackCount and m_duration. Update for network/ready state name changes.
2922         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes.
2923         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
2924         (WebCore::MediaPlayerPrivate::pause): Ditto.
2925         (WebCore::MediaPlayerPrivate::currentTime): No more m_endTime.
2926         (WebCore::MediaPlayerPrivate::seek): Ditto.
2927         (WebCore::MediaPlayerPrivate::doSeek): Ditto, plus don't call setRate(0) when the rate is
2928         already zero.
2929         (WebCore::MediaPlayerPrivate::setEndTime): No more m_endTime.
2930         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes. Return
2931         different errors depending on what causes a failure. Watch for and report duration changes.
2932         (WebCore::MediaPlayerPrivate::rateChanged): Report rate changes.
2933         (WebCore::MediaPlayerPrivate::sizeChanged): Report size changes.
2934         (WebCore::MediaPlayerPrivate::didEnd): No more endpoint timer.
2935         (WebCore::MediaPlayerPrivate::setVisible): Update for network/ready state name changes.
2936         (WebCore::MediaPlayerPrivate::disableUnsupportedTracks): Don't return number of unsupported
2937         tracks, store in m_enabledTrackCount so we can use it to help determine causes of failure.
2938
2939         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
2940         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): Update for network/ready state name changes.
2941         (WebCore::MediaPlayerPrivate::load): Ditto.
2942         (WebCore::MediaPlayerPrivate::duration): Ditto.
2943         (WebCore::MediaPlayerPrivate::updateStates): Ditto.
2944         (WebCore::MediaPlayerPrivate::naturalSize): Ditto.
2945
2946         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
2947         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate): No more m_endPointTimer. Update for 
2948         network/ready state name changes.
2949         (WebCore::MediaPlayerPrivate::load): Update for network/ready state name changes. No more
2950         m_endPointTimer.
2951         (WebCore::MediaPlayerPrivate::play): No more m_endPointTimer.
2952         (WebCore::MediaPlayerPrivate::pause): Ditto. 
2953         (WebCore::MediaPlayerPrivate::setEndTime): Ditto.
2954         (WebCore::MediaPlayerPrivate::updateStates): Update for network/ready state name changes.
2955         (WebCore::MediaPlayerPrivate::didEnd): No more m_endPointTimer.
2956         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
2957
2958         * rendering/MediaControlElements.cpp:
2959         (WebCore::MediaControlPlayButtonElement::defaultEventHandler): Update for network/ready state 
2960         name changes.
2961         (WebCore::MediaControlSeekButtonElement::defaultEventHandler): Ditto.
2962
2963 2009-03-22  Kevin Ollivier  <kevino@theolliviers.com>
2964
2965         wxGTK build fix. Add missing header.
2966
2967         * platform/wx/wxcode/gtk/non-kerned-drawing.cpp:
2968
2969 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
2970
2971         Reviewed by Dan Bernstein
2972         
2973         https://bugs.webkit.org/show_bug.cgi?id=24665
2974         
2975         Image-map code in RenderImage could result in RenderImage::nodeAtPoint()
2976         setting HitTestResult::innerNode(), but returning false, which violates
2977         hit testing rules. Use a temporary HitTestResult so that we only fill in
2978         result when we know we've hit.
2979
2980         * rendering/RenderImage.cpp:
2981         (WebCore::RenderImage::nodeAtPoint):
2982
2983 2009-03-22  Simon Fraser  <simon.fraser@apple.com>
2984
2985         Reviewed by Dan Bernstein
2986         
2987         https://bugs.webkit.org/show_bug.cgi?id=24743
2988         
2989         Fix hit testing regression from r41840. We need to pass the temporary
2990         HitTestResult when testing sublayers, then only copy to 'result' when
2991         the layer is known to have been hit.
2992
2993         Test: fast/layers/zindex-hit-test.html
2994
2995         * rendering/RenderLayer.cpp:
2996         (WebCore::RenderLayer::hitTestLayer):
2997
2998 2009-03-20  Simon Fraser  <simon.fraser@apple.com>
2999
3000         Reviewed by Darin Adler
3001
3002         https://bugs.webkit.org/show_bug.cgi?id=24733
3003         
3004         Fix hit testing on video controls after full page zoom by fixing wider issue
3005         with event->pageX(), pageY() with zooming. pageX and pageY are "fixed" to be
3006         invariant under zooming (for JavaScript), so we keep an actual page point around
3007         in MouseEvent::absoluteLocation() to avoid the need to factor in zooming everywhere.
3008
3009         * dom/MouseRelatedEvent.cpp:
3010         (WebCore::MouseRelatedEvent::initCoordinates):
3011         (WebCore::MouseRelatedEvent::computePageLocation):
3012         * dom/MouseRelatedEvent.h:
3013         (WebCore::MouseRelatedEvent::absoluteLocation):
3014         (WebCore::MouseRelatedEvent::setAbsoluteLocation):
3015         Member var, and getter and setter for absoluteLocation.
3016         New method, computePageLocation(), to compute the actual page point,
3017         and call it when creating and initting mouse-related events.
3018
3019         * dom/Node.cpp:
3020         (WebCore::Node::dispatchMouseEvent):
3021         (WebCore::Node::dispatchWheelEvent):
3022         Keep non-adjusted pageX and pageY around, and call setAbsoluteLocation()
3023         on the event to replace a potentially rounded point.
3024         
3025         * html/HTMLInputElement.cpp:
3026         (WebCore::HTMLInputElement::defaultEventHandler):
3027         Clean up slider handling code.
3028         
3029         * html/HTMLSelectElement.cpp:
3030         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
3031         Add FIXME comment for use of offsetX/offsetY.
3032         
3033         * page/ContextMenuController.cpp:
3034         (WebCore::ContextMenuController::handleContextMenuEvent):
3035         Use absoluteLocation() when hit testing for context menus.
3036         
3037         * rendering/RenderFrameSet.cpp:
3038         (WebCore::RenderFrameSet::userResize):
3039         Use absoluteLocation() when resizing frames.
3040         
3041         * rendering/RenderMedia.cpp:
3042         (WebCore::RenderMedia::forwardEvent):
3043         Use absoluteLocation() when hit testing media controls.
3044
3045         * rendering/RenderSlider.cpp:
3046         (WebCore::HTMLSliderThumbElement::defaultEventHandler):
3047         (WebCore::RenderSlider::mouseEventIsInThumb):
3048         Use absoluteLocation() when handling slider events.
3049
3050         (WebCore::RenderSlider::forwardEvent):
3051         Factor some code out of HTMLInputElement::defaultEventHandler().
3052         
3053         * rendering/RenderTextControlSingleLine.cpp:
3054         (WebCore::RenderTextControlSingleLine::forwardEvent):
3055         Use absoluteLocation() when hit testing search field buttons, which fixees
3056         bugs in the search field with zooming.
3057
3058 2009-03-21  David Levin  <levin@chromium.org>
3059
3060         Reviewed by Dimitri Glazkov.
3061
3062         https://bugs.webkit.org/show_bug.cgi?id=24727
3063         Add V8XMLHttpRequest*.
3064
3065         * bindings/v8/V8XMLHttpRequestUtilities.cpp: Added.
3066         * bindings/v8/V8XMLHttpRequestUtilities.h: Added.
3067         * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: Added.
3068         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: Added.
3069         * bindings/v8/custom/V8XMLHttpRequestUploadCustom.cpp: Added.
3070
3071 2009-03-21  David Levin  <levin@chromium.org>
3072
3073         Reviewed by Dimitri Glazkov.
3074
3075         https://bugs.webkit.org/show_bug.cgi?id=24725
3076         Add V8NodeFilter.
3077
3078         * bindings/v8/V8NodeFilter.cpp: Added.
3079         * bindings/v8/V8NodeFilter.h: Added.
3080
3081 2009-03-21  Dan Bernstein  <mitz@apple.com>
3082
3083         Rubber-stamped by Kevin Decker
3084
3085         - remove some redundant #include statements
3086
3087         * bindings/js/JSDOMWindowBase.cpp:
3088
3089 2009-03-20  Dan Bernstein  <mitz@apple.com>
3090
3091         Reviewed by Mark Rowe.
3092
3093         - fix <rdar://problem/6574185> REGRESSION (3.2.2-TOT): hang in text drawing code
3094
3095         * platform/graphics/win/FontCGWin.cpp:
3096         (WebCore::drawGDIGlyphs): Changed glyph stroking to fill and stroke each
3097         glyph as a separate path, instead of all glyphs as a single path. This
3098         matches what CGContextShowGlyphsWithAdvances() does, and has comparable
3099         performance.
3100
3101 2009-03-20  Dean Jackson  <dino@apple.com>
3102
3103         Reviewed by Simon Fraser
3104
3105         Build fix for ENABLE(3D_RENDERING)
3106
3107         * rendering/RenderObject.h:
3108         (WebCore::makeMatrixRenderable):
3109
3110 2009-03-20  Dave Moore  <davemoore@google.com>
3111
3112         Reviewed by Dimitri Glazkov.
3113
3114         https://bugs.webkit.org/show_bug.cgi?id=24705
3115
3116         A bug in the V8 bindings is preventing chromium from setting the href on the
3117         location object...any attempt throws a security error, not just for javascript
3118         protocol
3119
3120         * page/Location.idl:
3121
3122 2009-03-20  Craig Schlenter  <craig.schlenter@gmail.com>
3123
3124         Reviewed by Dimitri Glazkov.
3125
3126         https://bugs.webkit.org/show_bug.cgi?id=24608
3127
3128         Include stdio.h needed for printf on gcc 4.4.0
3129
3130         * platform/KURLGoogle.cpp:
3131
3132 2009-03-20  Mike Belshe <mike@belshe.com>
3133
3134         Reviewed by Darin Fisher.
3135
3136         https://bugs.webkit.org/show_bug.cgi?id=24577
3137
3138         Don't let comments at the end of an event handler
3139         break the event handler.
3140
3141         No change in behavior, so no test.
3142
3143         * bindings/v8/V8LazyEventListener.cpp:
3144         (WebCore::V8LazyEventListener::getWrappedListenerFunction):
3145
3146 2009-03-20  Norbert Leser  <norbert.leser@nokia.com>
3147
3148         Reviewed by Darin Adler.
3149
3150         https://bugs.webkit.org/show_bug.cgi?id=24535
3151
3152         Fixes missing line terminator character (;) after macro call.
3153         It is common practice to add the trailing ";" where macros are substituted
3154         and not where they are defined with #define.
3155         This change is consistent with other macro declarations across webkit,
3156         and it also solves compilation failure with symbian compilers. 
3157  
3158         No change in behavior, so no test.
3159
3160         * bindings/js/JSDOMWindowShell.cpp:
3161         * bindings/js/JSEventListener.cpp:
3162         * bindings/js/JSImageConstructor.cpp:
3163         * bindings/js/JSInspectedObjectWrapper.cpp:
3164         * bindings/js/JSInspectorCallbackWrapper.cpp:
3165         * bindings/js/JSNamedNodesCollection.cpp:
3166         * bindings/js/JSNodeFilterCondition.cpp:
3167         * bindings/js/JSOptionConstructor.cpp:
3168         * bindings/js/JSQuarantinedObjectWrapper.cpp:
3169         * bindings/js/JSRGBColor.cpp:
3170         * bindings/js/JSWorkerContextBase.cpp:
3171         * bindings/js/JSXMLHttpRequestConstructor.cpp:
3172         * bindings/js/JSXSLTProcessorConstructor.cpp:
3173         * bindings/scripts/CodeGeneratorJS.pm:
3174
3175 2009-03-20  Mike Belshe  <mike@belshe.com>
3176
3177         Reviewed by Dimitri Glazkov and Dave Hyatt.
3178
3179         https://bugs.webkit.org/show_bug.cgi?id=24324
3180
3181         Make the minimum timer configurable for different platforms.
3182
3183         * page/DOMTimer.cpp:
3184         (WebCore::DOMTimer::DOMTimer):
3185         (WebCore::DOMTimer::fired):
3186         * page/DOMTimer.h:
3187         (WebCore::DOMTimer::minTimerInterval):
3188         (WebCore::DOMTimer::setMinTimerInterval):
3189
3190 2009-03-20  Dean McNamee  <deanm@chromium.org>
3191
3192         Reviewed by Darin Adler.
3193
3194         https://bugs.webkit.org/show_bug.cgi?id=22834
3195
3196         Make sure to consistently match new/delete and fastMalloc/fastFree.
3197
3198         * css/CSSSelectorList.cpp:
3199         (WebCore::CSSSelectorList::adoptSelectorVector):
3200         (WebCore::CSSSelectorList::deleteSelectors):
3201
3202 2009-03-20  Dan Bernstein  <mitz@apple.com>
3203
3204         Reviewed by Dave Hyatt.
3205
3206         - fix https://bugs.webkit.org/show_bug.cgi?id=23739
3207           <rdar://problem/6556371> REGRESSION (r36513): iframe isn't sized properly upon load
3208
3209         * rendering/RenderBlock.cpp:
3210         (WebCore::RenderBlock::percentHeightDescendants): Added this accessor.
3211         * rendering/RenderBlock.h:
3212         * rendering/RenderTableSection.cpp:
3213         (WebCore::RenderTableSection::layoutRows): Extended the check for
3214         children that flex to include other descendants with percent height
3215         which is relative to the cell.
3216
3217 2009-03-20  Dmitry Titov  <dimich@chromium.org>
3218
3219         Reviewed by Alexey Proskuryakov.
3220
3221         https://bugs.webkit.org/show_bug.cgi?id=24706
3222         Remove ScriptExecutionContext::encoding() since Workers do not need it.
3223         WorkerContext::encoding() is simply removed, while Document::encoding()
3224         made non-virtual and private. Workers use UTF-8 now except when instructed
3225         otherwise by http header. Also updated test.
3226
3227         * dom/Document.h: Made encoding() non-virtual and private.
3228         * dom/ScriptExecutionContext.h: removed encoding().
3229
3230         * workers/Worker.cpp:
3231         (WebCore::Worker::Worker):
3232         (WebCore::Worker::notifyFinished):
3233         * workers/WorkerContext.cpp: removed encoding() implementation.
3234         (WebCore::WorkerContext::WorkerContext):
3235         (WebCore::WorkerContext::completeURL):
3236         * workers/WorkerContext.h: removed encoding()
3237         (WebCore::WorkerContext::create):
3238         * workers/WorkerContextProxy.h:
3239         * workers/WorkerImportScriptsClient.cpp:
3240         (WebCore::WorkerImportScriptsClient::didReceiveData):
3241         * workers/WorkerMessagingProxy.cpp:
3242         (WebCore::WorkerMessagingProxy::startWorkerContext):
3243         * workers/WorkerMessagingProxy.h:
3244         * workers/WorkerThread.cpp:
3245         (WebCore::WorkerThreadStartupData::create):
3246         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
3247         (WebCore::WorkerThread::create):
3248         (WebCore::WorkerThread::WorkerThread):
3249         (WebCore::WorkerThread::workerThread):
3250         * workers/WorkerThread.h:
3251         In all these, removed storing encoding and 'inheriting' it from the parent.
3252         Instead, they are all using UTF-8 now.
3253
3254 2009-03-20  Timothy Hatcher  <timothy@apple.com>
3255
3256         Change how threading exceptions are checked so they are reported
3257         by what round they were added. That way WebKit can decided the
3258         behavior per-round based on linked-on-or-after checks.
3259
3260         <rdar://problem/6626741&6648478&6635474&6674079>
3261
3262         Reviewed by Darin Adler.
3263
3264         * WebCore.base.exp: Export the new symbols.
3265         * bindings/objc/DOMAbstractView.mm: Use the new WebCoreThreadViolationCheckRoundOne macro.
3266         * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
3267         * platform/ThreadCheck.h:
3268         * platform/mac/ThreadCheck.mm:
3269         (WebCore::readThreadViolationBehaviorFromUserDefaults): Refactor how the default is read.
3270         (WebCore::setDefaultThreadViolationBehavior): Take a round argument.
3271         (WebCore::reportThreadViolation): Ditto.
3272         (WebCoreReportThreadViolation): Ditto.
3273
3274 2009-03-20  Geoffrey Garen  <ggaren@apple.com>
3275
3276         Reviewed by Sam Weinig.
3277
3278         Fixed up an out-of-date comment.
3279
3280         * bindings/js/JSDOMWindowCustom.h:
3281         (WebCore::JSDOMWindow::customPut):
3282
3283 2009-03-20  Beth Dakin  <bdakin@apple.com>
3284
3285         Reviewed by Dave Hyatt.
3286
3287         Fix for https://bugs.webkit.org/show_bug.cgi?id=20909 REGRESSION 
3288         (r35318): A press release at pfizer.com does not display correctly
3289         - and corresponding -
3290         <rdar://problem/6680073>
3291
3292         * rendering/RenderObject.cpp:
3293         (WebCore::RenderObject::invalidateContainerPrefWidths):
3294         * rendering/RenderObject.h:
3295         (WebCore::RenderObject::markContainingBlocksForLayout):
3296
3297 2009-03-20  Eric Seidel  <eric@webkit.org>
3298
3299         Reviewed by Justin Garcia.
3300
3301         maxDeepOffset is confusing and should be removed
3302         https://bugs.webkit.org/show_bug.cgi?id=24586
3303
3304         Abstract some hard-to-read (but shared) logic into a new renderedAsNonInlineTableOrHR function.
3305         Add first/lastDeepEditingPositionForNode Position creation functions
3306         and deploy them to places we used to call maxDeepOffset.
3307
3308         Rename Position::atStart and atEnd to atStartOfTree atEndOfTree
3309         Add a new Position::atFirst/atLastEditingPositionForNode() and use these
3310         to replace a few more callers for maxDeepOffset()
3311         
3312         Rename maxDeepOffset to lastEditingOffsetForNode (so that we mere mortals have some clue what it does)
3313
3314         "Editing positions" are confusing because they have one
3315         of two behaviors, depending on if the container node is ignored
3316         by editing (if editingIgnoresContent(node) returns true) or not.
3317         Positions referring to nodes ignored by editing are
3318         neighbor-relative (they are before or after the node) where as
3319         positions reffering to other nodes are container-relative
3320         (they are between two child nodes of the container, identified
3321         by the offset() member).  I will be fixing this confusion in
3322         future patches.  These renames hopefully make the current behavior clearer.
3323
3324         * dom/Position.cpp:
3325         (WebCore::Position::previous):
3326         (WebCore::Position::next):
3327         (WebCore::Position::atFirstEditingPositionForNode):
3328         (WebCore::Position::atLastEditingPositionForNode):
3329         (WebCore::Position::atStartOfTree):
3330         (WebCore::Position::atEndOfTree):
3331         (WebCore::Position::previousCharacterPosition):
3332         (WebCore::Position::nextCharacterPosition):
3333         (WebCore::Position::upstream):
3334         (WebCore::Position::isCandidate):
3335         (WebCore::firstDeepEditingPositionForNode):
3336         (WebCore::lastDeepEditingPositionForNode):
3337         * dom/Position.h:
3338         * dom/PositionIterator.cpp:
3339         (WebCore::PositionIterator::operator Position):
3340         (WebCore::PositionIterator::increment):
3341         (WebCore::PositionIterator::decrement):
3342         (WebCore::PositionIterator::atEnd):
3343         (WebCore::PositionIterator::atEndOfNode):
3344         * editing/CompositeEditCommand.cpp:
3345         (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
3346         * editing/DeleteSelectionCommand.cpp:
3347         (WebCore::isTableCellEmpty):
3348         (WebCore::DeleteSelectionCommand::removeNode):
3349         (WebCore::DeleteSelectionCommand::handleGeneralDelete):
3350         * editing/Editor.cpp:
3351         (WebCore::Editor::advanceToNextMisspelling):
3352         * editing/InsertLineBreakCommand.cpp:
3353         (WebCore::InsertLineBreakCommand::doApply):
3354         * editing/InsertListCommand.cpp:
3355         (WebCore::InsertListCommand::doApply):
3356         * editing/ReplaceSelectionCommand.cpp:
3357         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
3358         * editing/TypingCommand.cpp:
3359         (WebCore::TypingCommand::forwardDeleteKeyPressed):
3360         * editing/VisiblePosition.cpp:
3361         (WebCore::VisiblePosition::previous):
3362         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
3363         (WebCore::VisiblePosition::left):
3364         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
3365         (WebCore::VisiblePosition::right):
3366         * editing/VisibleSelection.cpp:
3367         (WebCore::VisibleSelection::selectionFromContentsOfNode):
3368         (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
3369         * editing/htmlediting.cpp:
3370         (WebCore::nextVisuallyDistinctCandidate):
3371         (WebCore::previousVisuallyDistinctCandidate):
3372         (WebCore::firstEditablePositionAfterPositionInRoot):
3373         (WebCore::lastEditablePositionBeforePositionInRoot):
3374         (WebCore::lastOffsetForEditing):
3375         (WebCore::isFirstPositionAfterTable):
3376         (WebCore::isLastPositionBeforeTable):
3377         (WebCore::positionBeforeNode):
3378         (WebCore::positionAfterNode):
3379         (WebCore::enclosingEmptyListItem):
3380         (WebCore::caretMaxOffset):
3381         * editing/htmlediting.h:
3382         * editing/visible_units.cpp:
3383         (WebCore::renderedAsNonInlineTableOrHR):
3384         (WebCore::startOfParagraph):
3385         (WebCore::endOfParagraph):
3386         (WebCore::startOfEditableContent):
3387         (WebCore::endOfEditableContent):
3388         * page/AccessibilityObject.cpp:
3389         (WebCore::endOfStyleRange):
3390         * page/AccessibilityRenderObject.cpp:
3391         (WebCore::AccessibilityRenderObject::visiblePositionRange):
3392         * rendering/RenderBox.cpp:
3393         (WebCore::RenderBox::positionForPoint):
3394
3395 2009-03-20  Dmitry Titov  <dimich@chromium.org>
3396
3397         Reviewed by Dimitri Glazkov.
3398
3399         https://bugs.webkit.org/show_bug.cgi?id=24689
3400         Add (upstream) V8 bindings for Workers. Mostly style cleaning.
3401
3402         * bindings/v8/WorkerContextExecutionProxy.cpp: Added.
3403         * bindings/v8/WorkerContextExecutionProxy.h: Added.
3404         * bindings/v8/WorkerScriptController.cpp: Added.
3405         * bindings/v8/WorkerScriptController.h: Added.
3406         * bindings/v8/V8Index.h: Added. This is just a wrapper for v8_index.h, like V8Proxy.h
3407         * bindings/v8/V8Proxy.h: Added domObjectMap() function that wraps GetDOMObjectMap().
3408         * bindings/v8/V8WorkerContextEventListener.cpp:
3409         (WebCore::V8WorkerContextEventListener::callListenerFunction): TrackEvent() renamed trackEvent()
3410
3411 2009-03-20  Stephen White  <senorblanco@chromium.org>
3412
3413         Reviewed by Eric Seidel.
3414
3415         Fix for LayoutTests/fast/canvas/canvas-text-alignment.html
3416         on chromium/skia.  The problem was that the gradient matrix
3417         for text was being applied twice.  Fixed by reverting some of
3418         https://bugs.webkit.org/show_bug.cgi?id=23957, so that skiaDrawText
3419         is no longer responsible for measuring the text and scaling up
3420         the gradient matrix.  Instead, the text bounding box is passed
3421         in from SVGPaintServerGradient.  I didn't make this change for CG,
3422         since it uses a different method (the gradient is drawn using the
3423         text as a pre-rendered mask).
3424         https://bugs.webkit.org/show_bug.cgi?id=24687
3425
3426         * platform/graphics/skia/SkiaFontWin.cpp:
3427         (WebCore::skiaDrawText):
3428         * svg/graphics/SVGPaintServerGradient.cpp:
3429         (WebCore::SVGPaintServerGradient::setup):
3430
3431 2009-03-20  Xan Lopez  <xlopez@igalia.com>
3432
3433         Rubber-stamped by Holger Freyther.
3434
3435         There seems to be some rounding error in cairo (or in how we use
3436         cairo) with some fonts, like DejaVu Sans Mono, which makes cairo
3437         report a height smaller than ascent + descent, which is wrong and
3438         confuses WebCore's layout system. Workaround this while we figure
3439         out what's going on.
3440
3441         * platform/graphics/gtk/SimpleFontDataGtk.cpp:
3442         (WebCore::SimpleFontData::platformInit):
3443         * platform/graphics/gtk/SimpleFontDataPango.cpp:
3444         (WebCore::SimpleFontData::platformInit):
3445
3446 2009-03-19  Alexey Proskuryakov  <ap@webkit.org>
3447
3448         Reviewed by Darin Adler.
3449
3450         https://bugs.webkit.org/show_bug.cgi?id=24122
3451         <rdar://problem/6674179>
3452         REGRESSION: DOM Range extractContents/deleteContents failures seen on Moxiecode tests
3453
3454         Test: fast/dom/Range/deleted-range-endpoints.html
3455
3456         * dom/Range.cpp: (WebCore::Range::processContents): Set the final range in accordance
3457         to the specification.
3458
3459 2009-03-19  Anders Carlsson  <andersca@apple.com>
3460
3461         Reviewed by Dan Bernstein.
3462
3463         <rdar://problem/6682554> Flash content not being rendered (Shockwave Flash 10.0 r22)
3464         
3465         If calling updateWidget for some reason resulted in another widget being added to m_widgetUpdateSet, then
3466         that object would never be updated.
3467         
3468         * page/FrameView.cpp:
3469         (WebCore::FrameView::updateWidgets):
3470         Factor the widget updating code out into this method. Return true if the update set is empty.
3471         
3472         (WebCore::FrameView::performPostLayoutTasks):
3473         Loop over the update set multiple times until all widgets have been updated or until we reach the cap.
3474         
3475         * page/FrameView.h:
3476
3477 2009-03-18  Timothy Hatcher  <timothy@apple.com>
3478
3479         Make the defered data loading timer honor the Page's scheduled runloop pairs.
3480         Introduces a new RunLoopTimer class that has an API mimicking Timer but
3481         allows it to be scheduled with one or more SchedulePairs.
3482
3483         <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
3484
3485         Reviewed by Darin Adler.
3486
3487         * WebCore.xcodeproj/project.pbxproj: Adds the new RunLoopTimer.{cpp,h} files.
3488         * loader/MainResourceLoader.cpp:
3489         (WebCore::MainResourceLoader::handleDataLoadNow): Use the MainResourceLoaderTimer typedef.
3490         (WebCore::MainResourceLoader::startDataLoadTimer): Added. Start the timer and on
3491         Mac platforms also schedule with the Page's SchedulePairs.
3492         (WebCore::MainResourceLoader::handleDataLoadSoon): Call startDataLoadTimer().
3493         (WebCore::MainResourceLoader::setDefersLoading): Ditto.
3494         * loader/MainResourceLoader.h:
3495         * platform/cf/RunLoopTimerCF.cpp: Added.
3496         (WebCore::RunLoopTimerBase::~RunLoopTimerBase):
3497         (WebCore::timerFired):
3498         (WebCore::RunLoopTimerBase::start):
3499         (WebCore::RunLoopTimerBase::schedule):
3500         (WebCore::RunLoopTimerBase::stop):
3501         (WebCore::RunLoopTimerBase::isActive):
3502         * platform/RunLoopTimer.h: Added.
3503         (WebCore::RunLoopTimerBase::RunLoopTimerBase):
3504         (WebCore::RunLoopTimerBase::startRepeating):
3505         (WebCore::RunLoopTimerBase::startOneShot):
3506         (WebCore::RunLoopTimer::RunLoopTimer):
3507         (WebCore::RunLoopTimer::fired):
3508
3509 2009-03-19  Dimitri Glazkov  <dglazkov@chromium.org>
3510
3511         Reviewed by Darin Fisher.
3512
3513         https://bugs.webkit.org/show_bug.cgi?id=24702
3514         Upstream miscellaneous bindings changes.
3515
3516         * bindings/v8/ScheduledAction.cpp:
3517         (WebCore::ScheduledAction::execute): Changed to call lower-case evaluate.
3518         * bindings/v8/ScriptCallStack.h: Added an extra include.
3519
3520 2009-03-19  Simon Fraser  <simon.fraser@apple.com>
3521
3522         Reviewed by Dave Hyatt
3523
3524         https://bugs.webkit.org/show_bug.cgi?id=24686
3525         
3526         When hit testing a RenderLayer whose parent lives in a preserves-3D hierarchy,
3527         we need to compare the computed z-offset with the depth-test z-offset before
3528         deciding that such a RenderLayer was hit. This fixes an issue, tested by the
3529         3d-point-mapping-overlapping.html test, where the child of a transformed element
3530         is found by hit testing, even when some other element with greater Z overlaps
3531         them both.
3532         
3533         Improved the code by adding a utility method, isHitCandidate(), which computes and tests
3534         z-depth when necessary.
3535