LayoutTests:
[WebKit-https.git] / WebCore / ChangeLog
1 2007-01-29  Justin Garcia  <justin.garcia@apple.com>
2
3         Reviewed by harrison
4         
5         <rdar://problem/4960137>
6         ASSERTION FAILURE calling SelectionController::setBaseAndExtent (11833)
7
8         * editing/SelectionController.cpp:
9         (WebCore::SelectionController::setSelection): Hand off the selection
10         to the selectionController responsible for it, instead of asserting.
11         A selection object can't be constructed with endpoints in different 
12         documents, so this code is only necessary for one endpoint.
13
14 2007-01-29  Ada Chan  <adachan@apple.com>
15
16         Reviewed by Brady.
17         
18         Moved the update of the title of the current entry in the backforward list to WebCore.
19
20         * loader/FrameLoader.cpp:
21         (WebCore::FrameLoader::didChangeTitle):
22
23 2007-01-29  Adele Peterson  <adele@apple.com>
24
25         Reviewed by Darin.
26
27         More preparation for event handling fixes.
28
29         * bridge/EditorClient.h: Removed EventTargetNode parameter from handleKeyPress since we can just get that from the event.
30         * dom/EventTargetNode.cpp: (WebCore::EventTargetNode::defaultEventHandler): ditto.
31         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler): ditto.
32         * page/EventHandler.h: ditto.
33         * platform/graphics/svg/SVGImageEmptyClients.h: (WebCore::SVGEmptyEditorClient::handleKeyPress): ditto.
34
35         * editing/Editor.h:
36         * editing/Editor.cpp:
37         (WebCore::Editor::handleKeyPress): Removed EventTargetNode parameter.
38         (WebCore::Editor::execCommand): Made commandMap use AtomicStringImpls instead of Strings.
39         (WebCore::Editor::insertText): Moved from the bridge.
40
41         * page/mac/WebCoreFrameBridge.h: Moved insertText method to Editor.
42         * page/mac/WebCoreFrameBridge.mm:
43
44         * WebCore.exp: Updated exports.
45
46 2007-01-29  Anders Carlsson  <acarlsson@apple.com>
47
48         Reviewed by Geoff.
49
50         <rdar://problem/4960097>
51         http://bugs.webkit.org/show_bug.cgi?id=12444
52         Assertion failure in -[WebCoreFrameBridge installInFrame:]
53         
54         The problem was that the XML tokenizer didn't create elements with 
55         createdByParser set to true.
56         
57         * dom/Document.cpp:
58         (WebCore::Document::createElement):
59         New method which takes a QName. This is used by both the XML tokenizer and createElementNS.
60         
61         (WebCore::Document::createElementNS):
62         Call new createElement method.
63         
64         * dom/XMLTokenizer.h:        
65         * dom/XMLTokenizer.cpp:
66         (WebCore::XMLTokenizer::XMLTokenizer):
67         (WebCore::XMLTokenizer::~XMLTokenizer):
68         Use an OwnPtr for the pending callbacks object. Also, use String instead of StringImpl in the hash map.
69         
70         (WebCore::toString):
71         (WebCore::XMLTokenizer::startElementNs):
72         Call createElement.
73         
74 2007-01-29  Brady Eidson  <beidson@apple.com>
75
76         Reviewed by Oliver
77
78         http://bugs.webkit.org/show_bug.cgi?id=12465
79         Only set the iconURL port for non-zero ports
80
81         * loader/FrameLoader.cpp:
82         (WebCore::FrameLoader::iconURL):
83
84 2007-01-29  John Sullivan  <sullivan@apple.com>
85
86         * platform/network/mac/ResourceRequestMac.mm:
87         Build fix -- removed #import of no-longer-extant WebDataProtocol.h (and also one of the
88         two #imports for WebCoreSystemInterface.h, while I was at it)
89
90 2007-01-29  Anders Carlsson  <acarlsson@apple.com>
91
92         Reviewed by Oliver.
93
94         * page/DragController.cpp:
95         (WebCore::DragController::dragEnteredOrUpdated):
96         Only try a drag operation if the drag client explicitly specified that it is OK
97
98 2007-01-29  Oliver Hunt  <oliver@apple.com>
99
100         Reviewed by Adam.
101
102         Migrated more drag logic and state to WebCore
103                                               
104         * page/DragClient.h:       
105
106         * page/DragController.cpp:
107         (WebCore::DragController::delegateDragSourceAction):
108           New forwarding method for the UI delegate
109         * page/DragController.h:
110         (WebCore::DragController::dragOffset):
111           Now store the drag offset -- the offset of the cursor relative to the drag image)
112           in DragController
113         * page/EventHandler.cpp:
114         (WebCore::EventHandler::allowDHTMLDrag):
115           Moved from WebFrameBridge
116         * page/EventHandler.h:
117         * page/mac/EventHandlerMac.mm:
118         (WebCore::EventHandler::eventMayStartDrag):
119         (WebCore::EventHandler::handleDrag):                  
120           EventHandlerMac now uses EventHandler::allowDHTMLDrag rather than the 
121           implementation in WebFrameBridge
122         * page/mac/WebCoreFrameBridge.h:
123           removed definition of allowDHTMLDrag from WebFrameBridge
124         * platform/graphics/svg/SVGImageEmptyClients.h:
125         (WebCore::SVGEmptyDragClient::dragSourceActionMaskForPoint):
126           Updated empty DragClient
127
128 2007-01-29  Alexey Proskuryakov  <ap@webkit.org>
129
130         Reviewed by Darin.
131
132         http://bugs.webkit.org/show_bug.cgi?id=12359
133         XPathEvaluator may return some nodes more than once in a result set
134
135         Test: fast/xpath/nodeset-duplicates.html
136
137         * xml/XPathPath.cpp:
138         (WebCore::XPath::LocationPath::doEvaluate): Ensure uniqueness of elements
139         in the node-set.
140
141         * xml/XPathPredicate.cpp:
142         (WebCore::XPath::Union::doEvaluate): Fixed a uniqueness algorithm that was
143         already present here. Added a FIXME about incorrect result ordering.
144
145 2007-01-29  Alexey Proskuryakov  <ap@webkit.org>
146
147         Reviewed by Darin.
148
149         http://bugs.webkit.org/show_bug.cgi?id=12340
150         XPathEvaluator behavior does not match Firefox - name() and attribute nodes
151
152         * xml/XPathFunctions.cpp:
153         (WebCore::XPath::FunName::doEvaluate): Do not try to append a prefix if it doesn't exist.
154
155 2007-01-29  Alexey Proskuryakov  <ap@webkit.org>
156
157         Reviewed by Darin.
158
159         http://bugs.webkit.org/show_bug.cgi?id=11815
160         XPathEvaluator behavior does not match Firefox - substring() and empty element
161
162         Test: fast/xpath/empty-string-substring.html
163
164         * xml/XPathValue.cpp:
165         (WebCore::XPath::Value::Value):
166         * xml/XPathValue.h:
167         Added a constructor taking const char*, so that string literals and arrays don't 
168         get converted to boolean values.
169
170 2007-01-29  Zack Rusin  <zrusin@trolltech.com>
171
172         Cosmetic fixes - don't resize the widget in the constructor
173         (it was a hack from the initial port) and fix the paint
174         signature.
175
176         * platform/qt/ScrollViewCanvasQt.cpp:
177         (WebCore::ScrollViewCanvasQt::ScrollViewCanvasQt):
178         * platform/qt/WidgetQt.cpp:
179         (WebCore::Widget::paint):
180
181 2007-01-29  Maciej Stachowiak  <mjs@apple.com>
182
183         - change from struct to class to make picky compilers happy
184
185         * loader/SubstituteData.h:
186
187 2007-01-30  Mark Rowe  <mrowe@apple.com>
188
189         Reviewed by Maciej.
190
191         http://bugs.webkit.org/show_bug.cgi?id=12458
192         Bug 12458: Crash in W3C-SVG-1.1/animate-elem-09-t.svg running layout tests under guard malloc
193
194         * ksvg2/svg/SVGAnimationElement.cpp: 
195         (WebCore::parseValues): ptr either points to a ';' or off the end of the buffer.  We're
196         interested in what comes before the ';', so start there instead.
197
198 2007-01-29  Zack Rusin  <zrusin@trolltech.com>
199
200         Reviewed by Lars.
201
202         Take the scrollbars into considation when computing
203         the contents size of the main frame.
204
205         * platform/qt/PlatformScrollBarQt.cpp:
206         (WebCore::PlatformScrollbar::paint):
207         * platform/qt/ScrollViewQt.cpp:
208         (WebCore::ScrollView::visibleWidth):
209         (WebCore::ScrollView::visibleHeight):
210         (WebCore::ScrollView::visibleContentRect):
211         * platform/qt/WidgetQt.cpp:
212         (WebCore::Widget::invalidate):
213         (WebCore::Widget::invalidateRect):
214
215 2007-01-29  Maciej Stachowiak  <mjs@apple.com>
216
217         - fix includes
218
219         * loader/SubstituteData.h:
220
221 2007-01-29  Maciej Stachowiak  <mjs@apple.com>
222
223         - added new file that I forgot in the last commit
224
225         * loader/SubstituteData.h: Added.
226         (WebCore::SubstituteData::SubstituteData):
227         (WebCore::SubstituteData::isValid):
228         (WebCore::SubstituteData::content):
229         (WebCore::SubstituteData::mimeType):
230         (WebCore::SubstituteData::textEncoding):
231         (WebCore::SubstituteData::failingURL):
232
233 2007-01-29  Maciej Stachowiak  <mjs@apple.com>
234
235         Reviewed by Mark.
236
237         - made data loading cross-platform
238         - fixed <rdar://problem/4910106>
239
240         * WebCore.exp:
241         * WebCore.xcodeproj/project.pbxproj:
242         * loader/CachedResource.cpp:
243         * loader/CachedResource.h:
244         * loader/DocLoader.cpp:
245         (WebCore::DocLoader::requestResource):
246         * loader/DocumentLoader.cpp:
247         (WebCore::DocumentLoader::DocumentLoader):
248         (WebCore::DocumentLoader::setRequest):
249         (WebCore::DocumentLoader::urlForHistory):
250         (WebCore::DocumentLoader::unreachableURL):
251         * loader/DocumentLoader.h:
252         (WebCore::DocumentLoader::substituteData):
253         * loader/FrameLoader.cpp:
254         (WebCore::FrameLoader::load):
255         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL):
256         (WebCore::FrameLoader::reloadAllowingStaleData):
257         (WebCore::FrameLoader::reload):
258         (WebCore::FrameLoader::commitProvisionalLoad):
259         (WebCore::FrameLoader::startLoadingMainResource):
260         (WebCore::FrameLoader::startLoading):
261         (WebCore::FrameLoader::checkNavigationPolicy):
262         * loader/FrameLoader.h:
263         * loader/FrameLoaderClient.h:
264         * loader/MainResourceLoader.cpp:
265         (WebCore::MainResourceLoader::willSendRequest):
266         (WebCore::MainResourceLoader::continueAfterContentPolicy):
267         (WebCore::MainResourceLoader::handleEmptyLoad):
268         (WebCore::MainResourceLoader::handleDataLoad):
269         (WebCore::MainResourceLoader::loadNow):
270         (WebCore::MainResourceLoader::load):
271         * loader/MainResourceLoader.h:
272         * loader/mac/DocumentLoaderMac.mm:
273         * loader/mac/WebDataProtocol.h: Removed.
274         * loader/mac/WebDataProtocol.mm: Removed.
275         * loader/qt/DocumentLoaderQt.cpp:
276         * platform/graphics/svg/SVGImageEmptyClients.h:
277         (WebCore::SVGEmptyFrameLoaderClient::createDocumentLoader):
278
279 2007-01-29  Zack Rusin  <zrusin@trolltech.com>
280
281         Order the build files alphabetically instead of
282         the random mess we had before.
283
284         * WebCore.pro:
285
286 2007-01-29  Zack Rusin  <zack@kde.org>
287
288         Reviewed by Lars
289
290         Use the platform independent scrollbar code.
291         Remove the redundant empty stubs and forward
292         few missing platform scrollbar calls.
293
294         * WebCore.pro:
295         * platform/qt/PlatformScrollBarQt.cpp:
296         (WebCore::PlatformScrollbar::paint):
297         (WebCore::PlatformScrollbar::setRect):
298
299 2007-01-29  Lars Knoll <lars@trolltech.com>
300
301         Reviewed by Zack
302
303         Fix the way we handle native widgets (QWidget) inside
304         WebCore. Now WebCore::Widget owns the QWidget in all
305         cases. This is the only way to get well defined semantics
306         for all teh native widgets we have (currently ScrollView
307         and ScrollBar, but plugins will follow).
308
309         This has the side effect that one cannot rely on a defined 
310         lifetime of a QWebFrame when using the API. 
311
312         * platform/Widget.h:
313         * platform/qt/PlatformScrollBarQt.cpp:
314         (WebCore::PlatformScrollbar::PlatformScrollbar):
315         * platform/qt/ScrollViewQt.cpp:
316         (WebCore::ScrollView::addChild):
317         (WebCore::ScrollView::removeChild):
318         * platform/qt/WidgetQt.cpp:
319         (WebCore::WidgetPrivate::WidgetPrivate):
320         (WebCore::WidgetPrivate::~WidgetPrivate):
321         (WebCore::Widget::qwidget):
322
323 2007-01-28  George Staikos  <staikos@kde.org>
324
325         Reviewed by Maciej.
326
327         Don't send data during a redirect -> causes assert failure.
328
329         * platform/network/qt/ResourceHandleManagerQt.cpp:
330         (WebCore::ResourceHandleManager::receivedData):
331
332 2007-01-29  Mark Rowe  <mrowe@apple.com>
333
334         Reviewed by Brady.
335
336         http://bugs.webkit.org/show_bug.cgi?id=11085
337         Bug 11085: REGRESSION: favicon.ico always looked for on port 80
338
339         * loader/FrameLoader.cpp:
340         (WebCore::FrameLoader::iconURL): Copy the port over to the favicon URL.
341
342 2007-01-28  Adam Roben  <aroben@apple.com>
343
344         Reviewed by Adele.
345
346         Fix http://bugs.webkit.org/show_bug.cgi?id=12453
347         REGRESSION(r19197): Tabbing into web page requires two key presses
348
349         All layout tests pass.
350
351         * page/FocusController.cpp:
352         (WebCore::FocusController::advanceFocus): If there's no focused frame,
353         actually go ahead and find a focusable node instead of just focusing
354         the main frame and quitting. This behavior was a holdover from a
355         previous desired tabbing behavior with respect to frames.
356
357 2007-01-28  David Kilzer  <ddkilzer@webkit.org>
358
359         Reviewed by Darin and David Hyatt.
360
361         - fix http://bugs.webkit.org/show_bug.cgi?id=12423
362           Mixing white-space:pre text with non white-space:pre text does not wrap properly
363
364         Test: fast/block/basic/white-space-pre-wraps.html
365
366         * rendering/bidi.cpp:
367         (WebCore::RenderBlock::findNextLineBreak): Wrap a non-wrapping text run if it
368         appears on a line with previous text runs that do wrap.
369
370 2007-01-28  Mitz Pettel  <mitz@webkit.org>
371
372         Reviewed by Darin.
373
374         - fix http://bugs.webkit.org/show_bug.cgi?id=8360
375           Repro crash when onscroll handler deletes the scrolled object
376
377         Test: fast/layers/removed-by-scroll-handler.html
378
379         * page/FrameView.cpp:
380         (WebCore::FrameViewPrivate::FrameViewPrivate): Added a m_enqueueEvents count.
381         (WebCore::FrameView::layout): Raise the enqueue count before starting layout and
382         until after enqueued events are dispatched.
383         (WebCore::FrameView::scheduleEvent): Made this function dispatch the event
384         immediately unless the enqueue count is positive.
385         * rendering/RenderLayer.cpp:
386         (WebCore::RenderLayer::scrollToOffset): Schedule the scroll event through the
387         FrameView.
388         (WebCore::RenderLayer::scrollRectToVisible):
389         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
390         (WebCore::Marquee::start):
391
392 2007-01-28  Charles Ying  <charles_ying@yahoo.com>
393
394         Reviewed by eseidel.  Landed by eseidel.
395
396         Fix http://bugs.webkit.org/show_bug.cgi?id=12429
397             animateTransform rotate, with cx/cy is broken
398             
399         SVGTransform now contains a float point to store the rotation center, needed
400             to track rotation center for interpolation by animateTransform.
401             
402         SVGTransform now has an additional constructor:
403             SVGTransform(type) to make empty base value transforms that match their
404             distanced values.
405             
406         Removed m_colorDistance and m_transformDistance from their respective classes
407             as they are now computed at update time.
408
409         Fix a case where animateTransform did not parse transform values correctly
410             according to BNF in W3C spec:
411
412         Test case in:
413         * manual-tests/animation/animateTransform-toanimation.svg: Added.
414
415         Fix a case where animateTransform only specified a to animation only.
416
417         Test case in:
418         * manual-tests/animation/animateTransform-parser.svg: Added.
419
420         * ksvg2/svg/SVGAnimateColorElement.cpp:
421         (WebCore::SVGAnimateColorElement::updateAnimationBaseValueFromElement):
422         (WebCore::SVGAnimateColorElement::updateAnimatedValue):
423         (WebCore::SVGAnimateColorElement::calculateFromAndToValues):
424         * ksvg2/svg/SVGAnimateColorElement.h:
425         * ksvg2/svg/SVGAnimateTransformElement.cpp:
426         (WebCore::SVGAnimateTransformElement::updateAnimatedValue):
427         (WebCore::SVGAnimateTransformElement::updateAnimationBaseValueFromElement):
428         (WebCore::SVGAnimateTransformElement::calculateFromAndToValues):
429         (WebCore::SVGAnimateTransformElement::parseTransformValue):
430         * ksvg2/svg/SVGAnimateTransformElement.h:
431         * ksvg2/svg/SVGTransform.cpp:
432         (SVGTransform::SVGTransform):
433         (SVGTransform::angle):
434         (SVGTransform::rotationCenter):
435         (SVGTransform::setTranslate):
436         (SVGTransform::setScale):
437         (SVGTransform::setRotate):
438         (SVGTransform::setSkewX):
439         (SVGTransform::setSkewY):
440         * ksvg2/svg/SVGTransform.h:
441         * ksvg2/svg/SVGTransformDistance.cpp:
442         (WebCore::SVGTransformDistance::SVGTransformDistance):
443         (WebCore::SVGTransformDistance::scaledDistance):
444         (WebCore::SVGTransformDistance::addSVGTransforms):
445         (WebCore::SVGTransformDistance::addSVGTransform):
446         (WebCore::SVGTransformDistance::addToSVGTransform):
447         (WebCore::SVGTransformDistance::distance):
448         * ksvg2/svg/SVGTransformDistance.h:
449         * manual-tests/animation/animateTransform-parser.svg: Added.
450         * manual-tests/animation/animateTransform-toanimation.svg: Added.
451
452 2007-01-27  Adam Roben  <aroben@apple.com>
453
454         Reviewed by Ada.
455
456         Fix <rdar://problem/4957184> REGRESSION: After creating a new mail
457         message, the caret is automatically in message body
458
459         -[WebHTMLView _updateActiveState] was calling
460         FocusController::focusedOrMainFrame, which had the surprising
461         side-effect of setting the focused frame if there was none. The fix
462         was to remove this side-effect.
463
464         No tests possible, as this bug involves focus outside the WebView,
465         which we have no support for in DRT.
466
467         Change inspired by Dave Harrison.
468
469         * page/FocusController.cpp:
470         (WebCore::FocusController::focusedOrMainFrame): Removed this method's
471         non-obvious side-effect of setting the focused frame.
472         * WebCore.xcodeproj/project.pbxproj: Version wars.
473
474 2007-01-27  Don Gibson  <dgibson77@gmail.com>
475
476         Reviewed by Maciej.
477
478         http://bugs.webkit.org/show_bug.cgi?id=11880: Improve some egregious
479         Windows form control drawing issues:
480         Provide Classic mode fallbacks for the button/textfield drawing
481         routines.
482         Provide some basic drawing of menulists (still relatively broken).
483         Some cleanup.
484
485         * platform/win/TemporaryLinkStubs.cpp:
486         (WebCore::RenderThemeWin::systemFont):
487         * rendering/RenderThemeWin.cpp:
488         (WebCore::m_menuListTheme):
489         (WebCore::RenderThemeWin::close):
490         (WebCore::RenderThemeWin::determineClassicState):
491         (WebCore::RenderThemeWin::getThemeData):
492         (WebCore::RenderThemeWin::paintButton):
493         (WebCore::RenderThemeWin::paintTextField):
494         (WebCore::RenderThemeWin::paintMenuList):
495         (WebCore::RenderThemeWin::paintMenuListButton):
496         * rendering/RenderThemeWin.h:
497         (WebCore::ThemeData::m_classicState):
498         (WebCore::RenderThemeWin::setRadioSize):
499         (WebCore::RenderThemeWin::paintTextArea):
500
501 2007-01-27  David Kilzer  <ddkilzer@webkit.org>
502
503         Reviewed by Adam.
504
505         - fix http://bugs.webkit.org/show_bug.cgi?id=12260
506           Windows platform build is not maintained
507
508         * loader/win/FrameLoaderWin.cpp:
509         * platform/network/win/ResourceHandleWin.cpp:
510         * platform/win/TemporaryLinkStubs.cpp:
511         (WebCore::contextMenuItemTagOpenLinkInNewWindow):
512         (WebCore::contextMenuItemTagDownloadLinkToDisk):
513         (WebCore::contextMenuItemTagCopyLinkToClipboard):
514         (WebCore::contextMenuItemTagOpenImageInNewWindow):
515         (WebCore::contextMenuItemTagDownloadImageToDisk):
516         (WebCore::contextMenuItemTagCopyImageToClipboard):
517         (WebCore::contextMenuItemTagOpenFrameInNewWindow):
518         (WebCore::contextMenuItemTagCopy):
519         (WebCore::contextMenuItemTagGoBack):
520         (WebCore::contextMenuItemTagGoForward):
521         (WebCore::contextMenuItemTagStop):
522         (WebCore::contextMenuItemTagReload):
523         (WebCore::contextMenuItemTagCut):
524         (WebCore::contextMenuItemTagPaste):
525         (WebCore::contextMenuItemTagNoGuessesFound):
526         (WebCore::contextMenuItemTagIgnoreSpelling):
527         (WebCore::contextMenuItemTagLearnSpelling):
528         (WebCore::contextMenuItemTagSearchWeb):
529         (WebCore::contextMenuItemTagLookUpInDictionary):
530         (WebCore::contextMenuItemTagOpenLink):
531         (WebCore::contextMenuItemTagIgnoreGrammar):
532         (WebCore::contextMenuItemTagSpellingMenu):
533         (WebCore::contextMenuItemTagShowSpellingPanel):
534         (WebCore::contextMenuItemTagCheckSpelling):
535         (WebCore::contextMenuItemTagCheckSpellingWhileTyping):
536         (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
537         (WebCore::contextMenuItemTagFontMenu):
538         (WebCore::contextMenuItemTagBold):
539         (WebCore::contextMenuItemTagItalic):
540         (WebCore::contextMenuItemTagUnderline):
541         (WebCore::contextMenuItemTagOutline):
542         (WebCore::contextMenuItemTagWritingDirectionMenu):
543         (WebCore::contextMenuItemTagDefaultDirection):
544         (WebCore::contextMenuItemTagLeftToRight):
545         (WebCore::contextMenuItemTagRightToLeft):
546         (WebCore::DocumentLoader::unreachableURL):
547         (WebCore::FrameLoader::redirectDataToPlugin):
548         (WebCore::FrameLoader::partClearedInBegin):
549         (WebCore::FrameLoader::createPlugin):
550
551 2007-01-27  Sam Weinig  <sam@webkit.org>
552
553         Reviewed by Mitz.
554
555         - Patch for http://bugs.webkit.org/show_bug.cgi?id=11957
556           REGRESSION: Unordered List Bullets too big and changing from size
557
558         * rendering/RenderListMarker.cpp:
559         (WebCore::RenderListMarker::paint): Explicitly set the stroke size to 1.0f.
560
561 2007-01-27  Lars Knoll <lars@trolltech.com>
562
563         Fix the Qt build and disable the usage
564         of QScrollbars for PlatformScrollBar for 
565         now as it causes crashes in the layout tests.
566
567         * WebCore.pro:
568         * ksvg2/svg/SVGTransformDistance.cpp:
569         * page/qt/FrameQt.cpp:
570         (WebCore::FrameQt::FrameQt):
571         (WebCore::FrameQt::bindingRootObject):
572         (WebCore::FrameQt::createRootObject):
573         * page/qt/FrameQt.h:
574         * platform/qt/PlatformScrollBarQt.cpp:
575         (WebCore::PlatformScrollbar::PlatformScrollbar):
576         * platform/qt/ScrollViewQt.cpp:
577         (WebCore::ScrollView::addChild):
578
579 2007-01-27  David Kilzer  <ddkilzer@kilzer.net>
580
581         Reviewed by NOBODY (buildbot build fix).
582
583         * ksvg2/svg/ColorDistance.cpp:
584         (WebCore::ColorDistance::scaledDistance): Added static cast of arguments to int.
585
586 2007-01-27  Rob Buis  <buis@kde.org>
587
588         Reviewed by NOBODY (typo in method name fix).
589
590         * ksvg2/svg/SVGSVGElement.cpp:
591         (WebCore::SVGSVGElement::addSVGWindowEventListener):
592         (WebCore::SVGSVGElement::parseMappedAttribute):
593         * ksvg2/svg/SVGSVGElement.h:
594
595 2007-01-27  Eric Seidel  <eric@webkit.org>
596
597         Reviewed by olliej.
598
599         Fix support for SVG's <set> element.
600
601         Manual test added.
602
603         * ksvg2/svg/SVGSetElement.cpp:
604         (WebCore::SVGSetElement::updateAnimatedValue):
605         (WebCore::SVGSetElement::calculateFromAndToValues):
606         * ksvg2/svg/SVGSetElement.h:
607         * manual-tests/animation/set-to.svg: Added.
608
609 2007-01-27  Alexey Proskuryakov  <ap@webkit.org>
610
611         Release build fix.
612
613         * loader/TextResourceDecoder.cpp:
614         (WebCore::TextResourceDecoder::checkForHeadCharset):
615
616 2007-01-27  Alexey Proskuryakov  <ap@webkit.org>
617
618         Reviewed by Darin.
619
620         http://bugs.webkit.org/show_bug.cgi?id=12389
621         Chinese decoding error at hk.antispam.yahoo.com
622
623         Test: fast/encoding/noscript-in-head.html
624
625         * loader/TextResourceDecoder.cpp:
626         (WebCore::TextResourceDecoder::checkForHeadCharset): We were already allowing 
627         NOSCRIPT tags in head, let's actually skip over their content.
628
629 2007-01-26  Geoffrey Garen  <ggaren@apple.com>
630
631         Reviewed by Maciej Stachowiak.
632         
633         Fixed <rdar://problem/4608404> WebScriptObject's _executionContext lack 
634         of ownership policy causes crashes (e.g., in Dashcode)
635
636         Added RootObject ref-counting goodness.
637
638         * page/mac/FrameMac.h:
639         * page/mac/FrameMac.mm:
640         (WebCore::FrameMac::cleanupPluginObjects): Invalidate our RootObjects 
641         instead of detroying them. Track _bindingRootObject separately from the
642         rest of our RootObjects, since it has its own variable.
643
644         * page/mac/WebCoreFrameBridge.mm:
645         (createRootObject): Use the Frame's new, more encapsulated function to
646         create a RootObject.
647
648         * bindings/objc/WebScriptObject.mm: Nixed rootObject setters, since they
649         were unused and they complicated reference-counting.
650
651 2007-01-26  David Kilzer  <ddkilzer@webkit.org>
652
653         Reviewed by Eric.
654
655         Release build fix.
656
657         * ksvg2/svg/SVGAnimationElement.cpp:
658         (WebCore::SVGAnimationElement::calculateValueIndexAndPercentagePast): Added static cast
659         to unsigned when calculating flooredValueIndex.
660
661 2007-01-26  Darin Adler  <darin@apple.com>
662
663         - checked in slightly newer revision of the patch below
664
665         * css/CSSComputedStyleDeclaration.cpp:
666         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
667         Grouped all the unimplemented values at the bottom. Fixed the ifdef for
668         CSS_PROP__WEBKIT_DASHBOARD_REGION so that it compiles on all platforms.
669
670         * css/cssparser.cpp: (WebCore::CSSParser::parseValue): Removed default
671         case and added type so that the compiler warns about missing properties.
672         * css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::applyProperty): Ditto.
673
674 2007-01-26  Darin Adler  <darin@apple.com>
675
676         Reviewed by Beth.
677
678         - fix http://bugs.webkit.org/show_bug.cgi?id=12412
679           "unimplemented propertyID: 46" seen at dojotoolkit.org
680
681         Covered by fast/css/computed-style.html
682
683         * css/CSSPropertyNames.in: Sorted the file into two separate sections, one
684         for properties without the -webkit- prefix and another for properties with.
685
686         * css/makeprop: Generate a CSSPropertyID enum instead of a set of #defines.
687         Removed unused CSS_PROP_MIN and CSS_PROP_MAX. Renamed CSS_PROP_TOTAL to
688         numCSSProperties and changed it to a const int instead of #define.
689         Added a declaration of getPropertyName in the header. Changed the return
690         type of getPropertyName to const char* and the parameter type to CSSPropertyID.
691
692         * css/CSSComputedStyleDeclaration.cpp: Sort the lists of properties in
693         an easier to maintain order -- properties without a WebKit prefix first.
694         (WebCore::valueForLength): Changed return value to PassRefPtr.
695         (WebCore::valueForMaxLength): Ditto.
696         (WebCore::valueForBorderStyle): Ditto.
697         (WebCore::valueForTextAlign): Ditto.
698         (WebCore::valueForAppearance): Added.
699         (WebCore::valueForMarginCollapse): Added.
700         (WebCore::valueForShadow): Changed return value to PassRefPtr.
701         (WebCore::getPositionOffsetValue): Ditto.
702         (WebCore::currentColorOrValidColor): Ditto.
703         (WebCore::CSSComputedStyleDeclaration::cssText): Added cast since
704         getPropertyName now takes an enum value.
705         (WebCore::primitiveValueFromLength): Changed return value to PassRefPtr.
706         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
707         Added cast to CSSPropertyID so that gcc will detect missing enums in the
708         switch statement. Simplified the background-size and border-spacing
709         implementations so they don't have local variables. Added lots of cases
710         to the switch statement for unimplemented properties. Implemented the
711         outline-width, box-sizing, -webkit-appearance, -webkit-rtl-ordering,
712         -webkit-user-drag, and -webkit-user-select properties.
713         (WebCore::CSSComputedStyleDeclaration::item): Added cast since
714         getPropertyName now takes an enum value.
715
716         * css/CSSMutableStyleDeclaration.cpp: Removed declaration of getPropertyName.
717         (WebCore::CSSMutableStyleDeclaration::item): Added cast since
718         getPropertyName now takes an enum value.
719
720         * css/CSSProperty.cpp: Removed declaration of getPropertyName.
721         (WebCore::CSSProperty::cssText): Added cast since
722         getPropertyName now takes an enum value and returns a const char*.
723
724         * css/CSSStyleDeclaration.cpp: Removed declaration of getPropertyName.
725         (WebCore::CSSStyleDeclaration::getPropertyShorthand): Added cast since
726         getPropertyName now takes an enum value and returns a const char*.
727
728 2007-01-26  Alice Liu  <alice.liu@apple.com>
729
730         Reviewed by Brady.
731
732         Fixed <rdar://problem/4838076> CrashTracer: 10 crashes in Mail at com.apple.WebCore: WTF::HashMap<WebCore::String
733
734         * loader/DocLoader.cpp:
735         (WebCore::DocLoader::requestResource):
736         Added nil check around resource from cache.
737
738 2007-01-26  Adam Roben  <aroben@apple.com>
739
740         Reviewed by Oliver.
741
742         Build fix.
743
744         * ksvg2/svg/SVGAnimationElement.cpp:
745         (WebCore::SVGAnimationElement::calculateValueIndexAndPercentagePast):
746         Keep index variables as unsigned until we need to convert to float.
747
748 2007-01-26  Alice Liu  <alice.liu@apple.com>
749
750         Reviewed by Ada.
751
752         Fixed <rdar://problem/4919097> REGRESSION: Ctrl-Y fails to yank (11076)
753
754         * editing/Editor.cpp:
755         (WebCore::Editor::deleteWithDirection):
756         If there's no selection, locally create a range that is to the end of the granularity unit and pass that to deleteRange(). 
757
758 2007-01-26  Sam Weinig  <sam@webkit.org>
759
760         Reviewed by Maciej.
761
762         Qt build fix.
763
764         * page/qt/EventHandlerQt.cpp:
765
766 2007-01-26  Dex Deacon  <occupant4@gmail.com>
767
768         Reviewed by Hyatt.
769
770         Fix so that we only relayout frameset children on calls to layout.
771
772         * page/FrameView.cpp:
773         (WebCore::FrameView::layout):
774
775 2007-01-26  Oliver Hunt  <oliver@apple.com>
776
777         Build Fix
778
779         * ksvg2/svg/ColorDistance.cpp:
780         * ksvg2/svg/SVGAnimationElement.cpp:
781         (WebCore::SVGAnimationElement::handleTimerEvent):
782
783 2007-01-26  Eric Seidel  <eric@webkit.org>
784
785         Reviewed by olliej.
786
787         Add support for calcMode, keyTimes and (nearly) keySplines.
788         http://bugs.webkit.org/show_bug.cgi?id=12350
789         Re-architect much of the animation system to remove huge sections of code.
790         Added new ColorDistance, SVGTransformDistance to simplify animateColor, animateTransform calculations.
791         I also added basic <animateMotion> support since it was so easy w/ the new architecture.
792         
793         Adding manual animation tests until bug 12074 is fixed.
794
795         * WebCore.xcodeproj/project.pbxproj:
796         * ksvg2/misc/SVGTimer.cpp:
797         (WebCore::SVGTimer::applyAnimations):
798         * ksvg2/svg/ColorDistance.cpp: Added.
799         (WebCore::ColorDistance::ColorDistance):
800         (WebCore::clampColorValue):
801         (WebCore::ColorDistance::scaledDistance):
802         (WebCore::ColorDistance::addColorsAndClamp):
803         (WebCore::ColorDistance::addToColorAndClamp):
804         (WebCore::ColorDistance::isZero):
805         (WebCore::ColorDistance::distance):
806         * ksvg2/svg/ColorDistance.h: Added.
807         * ksvg2/svg/SVGAnimateColorElement.cpp:
808         (WebCore::SVGAnimateColorElement::SVGAnimateColorElement):
809         (WebCore::SVGAnimateColorElement::updateAnimationBaseValueFromElement):
810         (WebCore::SVGAnimateColorElement::applyAnimatedValueToElement):
811         (WebCore::SVGAnimateColorElement::updateAnimatedValue):
812         (WebCore::SVGAnimateColorElement::calculateFromAndToValues):
813         * ksvg2/svg/SVGAnimateColorElement.h:
814         (WebCore::SVGAnimateColorElement::contextElement):
815         * ksvg2/svg/SVGAnimateElement.h:
816         (WebCore::SVGAnimateElement::updateAnimatedValue):
817         (WebCore::SVGAnimateElement::calculateFromAndToValues):
818         * ksvg2/svg/SVGAnimateMotionElement.cpp:
819         (WebCore::SVGAnimateMotionElement::hasValidTarget):
820         (WebCore::SVGAnimateMotionElement::updateAnimatedValue):
821         (WebCore::parsePoint):
822         (WebCore::SVGAnimateMotionElement::calculateFromAndToValues):
823         (WebCore::SVGAnimateMotionElement::updateAnimationBaseValueFromElement):
824         (WebCore::SVGAnimateMotionElement::applyAnimatedValueToElement):
825         * ksvg2/svg/SVGAnimateMotionElement.h:
826         * ksvg2/svg/SVGAnimateTransformElement.cpp:
827         (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
828         (WebCore::SVGAnimateTransformElement::updateAnimatedValue):
829         (WebCore::SVGAnimateTransformElement::updateAnimationBaseValueFromElement):
830         (WebCore::SVGAnimateTransformElement::applyAnimatedValueToElement):
831         (WebCore::SVGAnimateTransformElement::calculateFromAndToValues):
832         (WebCore::SVGAnimateTransformElement::parseTransformValue):
833         * ksvg2/svg/SVGAnimateTransformElement.h:
834         (WebCore::SVGAnimateTransformElement::contextElement):
835         * ksvg2/svg/SVGAnimationElement.cpp:
836         (WebCore::SVGAnimationElement::parseKeyNumbers):
837         (WebCore::parseValues):
838         (WebCore::parseKeySplines):
839         (WebCore::SVGAnimationElement::parseMappedAttribute):
840         (WebCore::SVGAnimationElement::targetAttributeAnimatedValue):
841         (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
842         (WebCore::SVGAnimationElement::detectAnimationMode):
843         (WebCore::adjustPercentagePastForKeySplines):
844         (WebCore::SVGAnimationElement::valueIndexAndPercentagePastForDistance):
845         (WebCore::SVGAnimationElement::calculateTotalDistance):
846         (WebCore::caculateValueIndexForKeyTimes):
847         (WebCore::SVGAnimationElement::isValidAnimation):
848         (WebCore::SVGAnimationElement::calculateValueIndexAndPercentagePast):
849         (WebCore::SVGAnimationElement::updateAnimationBaseValueFromElement):
850         (WebCore::SVGAnimationElement::applyAnimatedValueToElement):
851         (WebCore::SVGAnimationElement::handleTimerEvent):
852         (WebCore::SVGAnimationElement::updateAnimatedValueForElapsedSeconds):
853         * ksvg2/svg/SVGAnimationElement.h:
854         * ksvg2/svg/SVGParserUtilities.cpp:
855         (WebCore::SVGPolyParser::parsePoints):
856         * ksvg2/svg/SVGParserUtilities.h:
857         * ksvg2/svg/SVGSetElement.cpp:
858         * ksvg2/svg/SVGSetElement.h:
859         (WebCore::SVGSetElement::updateAnimatedValue):
860         (WebCore::SVGSetElement::calculateFromAndToValues):
861         * ksvg2/svg/SVGTransform.cpp:
862         (SVGTransform::type):
863         (SVGTransform::translate):
864         (SVGTransform::scale):
865         (SVGTransform::setSkewX):
866         (SVGTransform::setSkewY):
867         * ksvg2/svg/SVGTransform.h:
868         (WebCore::operator==):
869         (WebCore::operator!=):
870         * ksvg2/svg/SVGTransformDistance.cpp: Added.
871         (WebCore::SVGTransformDistance::SVGTransformDistance):
872         (WebCore::SVGTransformDistance::scaledDistance):
873         (WebCore::SVGTransformDistance::addSVGTransforms):
874         (WebCore::SVGTransformDistance::addSVGTransform):
875         (WebCore::SVGTransformDistance::addToSVGTransform):
876         (WebCore::SVGTransformDistance::isZero):
877         (WebCore::SVGTransformDistance::distance):
878         * ksvg2/svg/SVGTransformDistance.h: Added.
879         * ksvg2/svg/SVGTransformList.cpp:
880         (SVGTransformList::concatenateForType):
881         * ksvg2/svg/SVGTransformList.h:
882         * manual-tests/animation/animateColor-by.svg: Added.
883         * manual-tests/animation/animateColor-from-by.svg: Added.
884         * manual-tests/animation/animateColor-repeat-indefinite.svg: Added.
885         * manual-tests/animation/animateColor-to-from.svg: Added.
886         * manual-tests/animation/animateColor-to.svg: Added.
887         * manual-tests/animation/animateColor-values-simple.svg: Added.
888         * manual-tests/animation/animateMotion-to.svg: Added.
889         * manual-tests/animation/animateTransform-keyTimes.svg: Added.
890         * manual-tests/animation/animateTransform-repeat-once.svg: Added.
891
892 2007-01-26  Beth Dakin  <bdakin@apple.com>
893
894         Reviewed by Darin.
895
896         Fix for <rdar://problem/4956565> REGRESSION: After scrolling frame, 
897         hovering over link in this frame doesn't change cursor to pointing 
898         hand
899
900         The mouseMove event was not being propagated correctly after using 
901         the mouse to scroll the frame because m_mousePressed was never 
902         getting set to false.
903
904         * page/EventHandler.cpp:
905         (WebCore::EventHandler::handleMousePressEvent): This code does not 
906         belong here.
907         * page/EventHandler.h: lastEventIsMouseUp() is only ever relevant 
908         in EventHandlerMac, so it can just be a static function there.
909         * page/mac/EventHandlerMac.mm:
910         (WebCore::lastEventIsMouseUp): Make this static.
911         (WebCore::EventHandler::passMouseDownEventToWidget): Here is where 
912         we need to set m_mousePressed to false if lastEventIsMouseUp() is 
913         true.
914
915 2007-01-26  David Hyatt  <hyatt@apple.com>
916
917         Fix for style regression caused by strictness checking of the number of properties.  This caused code like:
918         "width: 20 px" to fail, because we interpreted it as two values and rejected it.  Our old code allowed 20 to be
919         used like a pixel value and then ignored the orphaned unit.
920
921         This patch actually scans the list of values looking for orphaned units and reattaches them to the numeric
922         values that they should correspond to.  This means rules like "width: 5 em" will now work in quirks mdoe and
923         the "em" unit type will be honored.
924
925         Reviewed by beth
926
927         * WebCore.xcodeproj/project.pbxproj:
928         * css/cssparser.cpp:
929         (WebCore::unitFromString):
930         (WebCore::CSSParser::checkForOrphanedUnits):
931         (WebCore::CSSParser::parseValue):
932         * css/cssparser.h:
933         (WebCore::ValueList::valueAt):
934         (WebCore::ValueList::deleteValueAt):
935
936 2007-01-26  George Staikos  <staikos@kde.org>
937
938         Reviewed by Zack.
939
940         Qt implementation.
941
942         * WebCore.pro:
943         * platform/qt/FontPlatformDataQt.cpp:
944         (WebCore::FontPlatformData::FontPlatformData):
945         * platform/qt/ScrollViewQt.cpp:
946         (WebCore::ScrollView::scrollbarUnderMouse):
947
948 2007-01-26  Brady Eidson  <beidson@apple.com>
949
950         Reviewed by Anders' rubberstamp
951         
952         Warning about unreferenced formal parameter caused compile to fail
953
954         * platform/cf/RetainPtr.h:
955         (WebCore::adoptCFReference):
956
957 2007-01-26  Darin Adler  <darin@apple.com>
958
959         Reviewed by Brady.
960
961         - fix <rdar://problem/4956688> move Mac-specific part of icon code into IconMac
962         - fix a GC-compatibility problem in the icon code I noticed by code inspection
963
964         * platform/FileChooser.cpp: (WebCore::FileChooser::chooseIcon): Removed Mac-specific
965         path check -- that's in newIconForFile now.
966
967         * platform/graphics/Icon.h: Changed the image to be a RetainPtr. The old code was
968         using -[NSObject retain] which is not good enough for a pointer in a C++ object.
969         * platform/graphics/mac/IconMac.mm:
970         (WebCore::Icon::Icon): Got rid of unneeded code to do what RetainPtr does for us.
971         (WebCore::Icon::~Icon): Ditto.
972         (WebCore::Icon::newIconForFile): Added check for non-absolute file names. Updated
973         for use of RetainPtr. Use constructor that takes NSImage.
974         (WebCore::Icon::paint): Add get() calls needed now that we are using a RetainPtr.
975
976         * WebCore.xcodeproj/project.pbxproj: Let Xcode do its thing.
977
978 2007-01-26  Alexey Proskuryakov  <ap@webkit.org>
979
980         Reviewed by Maciej.
981
982         http://bugs.webkit.org/show_bug.cgi?id=12385
983         Assertion failure when loading subresources from "data:" frames
984
985         Test: fast/loader/opaque-base-url.html
986
987         * platform/KURL.cpp:
988         (WebCore::KURL::init): Make the URL invalid if it's relative, but has an opaque or empty base.
989
990 2007-01-26  Dex Deacon  <occupant4@gmail.com>
991
992         Reviewed by Darin.
993
994         * page/EventHandler.cpp:
995         (WebCore::EventHandler::handleMouseMoveEvent):
996         Removed a call to invalidateClick(), since we don't want to cancel a
997         click if the mouse moves.
998
999 2007-01-26  Darin Adler  <darin@apple.com>
1000
1001         * css/MediaQueryEvaluator.cpp:
1002         (WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific):
1003         Oops, forgot a !.
1004
1005 2007-01-26  Darin Adler  <darin@apple.com>
1006
1007         Patch by Nate Begeman.
1008         Reviewed by Darin and Maciej.
1009
1010         - <rdar://problem/4946877> Avoid unnecessary allocations in CSS, patch attached (12401)
1011           http://bugs.webkit.org/show_bug.cgi?id=12401
1012
1013         * css/MediaQueryEvaluator.h: Add mediaTypeMatchSpecific, a function that
1014         takes a char* to avoid creating and destroying a String for simple media
1015         type queries.
1016         * css/MediaQueryEvaluator.cpp:
1017         (WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific): Added. Besides
1018         avoiding the conversion to String, this also doesn't have the special
1019         case code to handle "" and "all".
1020
1021         * css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::matchUARules):
1022         Call mediaTypeMatchSpecific here when deciding whether to use the
1023         print version of the user agent style sheet.
1024
1025         * loader/Cache.cpp: (WebCore::Cache::requestResource): Don't convert to
1026         a string and back to a KURL when calling createResource. Avoids reparsing
1027         the URL string.
1028
1029 2007-01-26  Zack Rusin  <zrusin@trolltech.com>
1030
1031         Reviewed by Lars
1032
1033         Add history related classes to the project file.
1034
1035         * WebCore.pro:
1036
1037 2007-01-26  Zack Rusin  <zack@kde.org>
1038
1039         Reviewed by Lars
1040
1041         Introduce PlatformScrollBar and try to make 
1042         the scrollbar behavior a little more sane.
1043
1044         * WebCore.pro:
1045         * platform/qt/PlatformScrollBarQt.cpp: Added.
1046         (WebCore::Scrollbar::Scrollbar):
1047         (WebCore::Scrollbar::setSteps):
1048         (WebCore::Scrollbar::scroll):
1049         (WebCore::Scrollbar::setValue):
1050         (WebCore::Scrollbar::setProportion):
1051         (WebCore::PlatformScrollbar::PlatformScrollbar):
1052         (WebCore::PlatformScrollbar::~PlatformScrollbar):
1053         (WebCore::PlatformScrollbar::width):
1054         (WebCore::PlatformScrollbar::height):
1055         (WebCore::PlatformScrollbar::setEnabled):
1056         (WebCore::PlatformScrollbar::paint):
1057         (WebCore::PlatformScrollbar::updateThumbPosition):
1058         (WebCore::PlatformScrollbar::updateThumbProportion):
1059         (WebCore::PlatformScrollbar::setRect):
1060         * platform/qt/ScrollViewQt.cpp:
1061         (WebCore::ScrollView::addChild):
1062         * platform/qt/TemporaryLinkStubs.cpp:
1063         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1064
1065 2007-01-26  Mitz Pettel  <mitz@webkit.org>
1066
1067         Reviewed by Darin.
1068
1069         - fix http://bugs.webkit.org/show_bug.cgi?id=11109
1070           REGRESSION (r15471): menus are offset on eink.com
1071           <rdar://problem/4824760>
1072
1073         Changed offset{Left,Top} to match Firefox. If the body element is statically
1074         positioned, it is still returned as the offsetParent of elements whose containing
1075         block is the initial containing block (the root), but their offset{Left,Top} are
1076         relative to the root. If the body element is positioned, then offsets are relative
1077         to it. The body's own offset{Left,Top} are always 0. 
1078
1079         Test: fast/dom/Element/offsetLeft-offsetTop-body-quirk.html
1080
1081         * rendering/RenderObject.cpp:
1082         (WebCore::RenderObject::offsetLeft):
1083         (WebCore::RenderObject::offsetTop):
1084
1085 2007-01-26  Mitz Pettel  <mitz@webkit.org>
1086
1087         Reviewed by Darin and Maciej.
1088
1089         - fix http://bugs.webkit.org/show_bug.cgi?id=10983
1090           REGRESSION (r12290): Drop shadow of flickr photo note is positioned incorrectly the second time it's shown
1091
1092         Test: fast/dynamic/staticY.html
1093
1094         * rendering/RenderBlock.cpp:
1095         (WebCore::RenderBlock::layoutPositionedObjects): Avoid marking the object's
1096         parents, since they have already been laid out.
1097         * rendering/RenderBox.cpp:
1098         (WebCore::RenderBox::setStaticY): Added a call to setChildNeedsLayout() to
1099         ensure relayout by this box's container (third and fourth cases in the
1100         layout test).
1101         * rendering/RenderBox.h:
1102         * rendering/RenderObject.cpp:
1103         (WebCore::RenderObject::markContainingBlocksForLayout): For positioned objects
1104         with static y, also mark the object's parent to ensure that it recomputes
1105         the static y value (first case in the layout test).
1106
1107 2007-01-26  Lars Knoll <lars@trolltech.com>
1108
1109         Reviewed by Zack
1110
1111         Get rid of FrameQtClient. It's unused since we moved over
1112         to the loader.
1113
1114         * WebCore.pro:
1115         * page/qt/FrameQt.cpp:
1116         (WebCore::FrameQt::FrameQt):
1117         * page/qt/FrameQt.h:
1118         * page/qt/FrameQtClient.cpp: Removed.
1119         * page/qt/FrameQtClient.h: Removed.
1120         * platform/network/ResourceHandleInternal.h:
1121         * platform/network/qt/ResourceHandleManagerQt.cpp:
1122         (WebCore::RequestQt::RequestQt):
1123         (WebCore::ResourceHandleManager::add):
1124         * platform/network/qt/ResourceHandleManagerQt.h:
1125         * platform/network/qt/ResourceHandleQt.cpp:
1126         (WebCore::ResourceHandle::start):
1127
1128 2007-01-26  Zack Rusin  <zack@kde.org>
1129
1130         Fix the compile
1131
1132         * WebCore.pro:
1133
1134 2007-01-26  Adam Roben  <aroben@apple.com>
1135
1136         Reviewed by Maciej.
1137
1138         Fixed <rdar://problem/4946499>, which made it impossible to tab
1139         forward into the left frame of tivofaq.com after tabbing out of the
1140         document.
1141
1142         * page/FocusController.cpp:
1143         (WebCore::FocusController::advanceFocus): Clear the focused frame
1144         before passing off focus to Chrome so that when we re-enter the
1145         document we start at the main frame instead of the last focused frame.
1146
1147 2007-01-25  Rob Buis  <buis@kde.org>
1148
1149         Reviewed by olliej.
1150
1151         http://bugs.webkit.org/show_bug.cgi?id=11911
1152         SVG exhibits double-text-selection behavior
1153
1154         Fix selection height of the inline text boxes for svg.
1155
1156         * WebCore.xcodeproj/project.pbxproj:
1157         * rendering/InlineTextBox.cpp:
1158         (WebCore::InlineTextBox::selectionTop):
1159         (WebCore::InlineTextBox::selectionHeight):
1160         (WebCore::InlineTextBox::selectionRect):
1161         (WebCore::InlineTextBox::paintSelection):
1162         (WebCore::InlineTextBox::paintMarkedTextBackground):
1163         (WebCore::InlineTextBox::paintCustomHighlight):
1164         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
1165         (WebCore::InlineTextBox::paintTextMatchMarker):
1166         * rendering/InlineTextBox.h:
1167         * rendering/RenderSVGInlineText.cpp:
1168         (WebCore::RenderSVGInlineText::createInlineTextBox):
1169         * rendering/RenderSVGInlineText.h:
1170         * rendering/RenderText.cpp:
1171         (WebCore::RenderText::createInlineTextBox):
1172         (WebCore::RenderText::createInlineBox):
1173         * rendering/RenderText.h:
1174         * rendering/SVGInlineTextBox.cpp: Added.
1175         (WebCore::SVGInlineTextBox::selectionTop):
1176         (WebCore::SVGInlineTextBox::selectionHeight):
1177         * rendering/SVGInlineTextBox.h: Added.
1178         (WebCore::SVGInlineTextBox::SVGInlineTextBox):
1179
1180 2007-01-26  Zack Rusin  <zack@kde.org>
1181
1182         Reviewed by Lars
1183
1184         Fix drawing of tiled images.
1185
1186         * WebCore.pro:
1187         * platform/graphics/qt/ImageQt.cpp:
1188         (WebCore::BitmapImage::drawPattern):
1189
1190 2007-01-26  Zack Rusin  <zack@kde.org>
1191
1192         Reviewed by Lars
1193
1194         Fixing image loading - we decode QImages
1195         but render QPixmaps now. Implement Icon
1196         class
1197
1198         * platform/graphics/BitmapImage.h:
1199         * platform/graphics/Icon.h:
1200         * platform/graphics/Image.h:
1201         (WebCore::Image::getPixmap):
1202         * platform/graphics/qt/IconQt.cpp:
1203         (WebCore::Icon::Icon):
1204         (WebCore::Icon::~Icon):
1205         (WebCore::Icon::newIconForFile):
1206         (WebCore::Icon::paint):
1207         * platform/graphics/qt/ImageDecoderQt.cpp:
1208         (WebCore::ImageDecoderQt::ImageData::ImageData):
1209         (WebCore::ImageDecoderQt::ReadContext::read):
1210         (WebCore::ImageDecoderQt::ReadContext::readImageLines):
1211         (WebCore::ImageDecoderQt::reset):
1212         (WebCore::ImageDecoderQt::imageAtIndex):
1213         * platform/graphics/qt/ImageDecoderQt.h:
1214         * platform/graphics/qt/ImageQt.cpp:
1215         (WebCore::BitmapImage::drawPattern):
1216         (WebCore::BitmapImage::getPixmap):
1217         * platform/graphics/qt/ImageSourceQt.cpp:
1218         (WebCore::ImageSource::createFrameAtIndex):
1219
1220 2007-01-25  Justin Garcia  <justin.garcia@apple.com>
1221
1222         Reviewed by oliver
1223         
1224         <http://bugs.webkit.org/show_bug.cgi?id=12409>
1225         REGRESSION (r19039): Drag caret isn't cleared after a drop
1226
1227         No new layout tests because the regression was
1228         caught by current layout tests.
1229
1230         * page/DragController.cpp:
1231         (WebCore::DragController::concludeDrag): Clear the drag caret.
1232
1233 2007-01-25  Darin Adler  <darin@apple.com>
1234
1235         Reviewed and landed by Geoffrey Garen.
1236
1237         - fix http://bugs.webkit.org/show_bug.cgi?id=12342
1238           REGRESSION: destroying a frame from its own script causes various crashes
1239
1240         * bindings/js/kjs_window.cpp: (KJS::ScheduledAction::execute):
1241         Use RefPtr for the frame and the interpreter object so they don't get deleted
1242         out from underneath us.
1243
1244         * bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::evaluate):
1245         Add a check for a page of 0. This was the only call site for the
1246         addMessageToConsole function that did not have a check for a page of 0.
1247
1248 2007-01-25 Dirk Mueller  <mueller@kde.org>
1249
1250         Reviewed and merged by Beth.
1251
1252         Fix for <rdar://problem/4921692> not processing comments inside a 
1253         title element leads to XSS (for at least BlogSpot)
1254
1255         This is equivalent to commit 626791 in the KDE tree. Basically, the 
1256         patch allows comment parsing in titles to avoid capturing a 
1257         <script> tag by accident.
1258
1259         * html/HTMLTokenizer.cpp:
1260         (WebCore::HTMLTokenizer::parseSpecial):
1261         (WebCore::HTMLTokenizer::parseComment):
1262
1263 2007-01-25  Darin Adler  <darin@apple.com>
1264
1265         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Add a couple of comments.
1266
1267 2007-01-25  Darin Adler  <darin@apple.com>
1268
1269         Reviewed by Maciej.
1270
1271         - fix http://bugs.webkit.org/show_bug.cgi?id=12365
1272           Reproducible crash in WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio
1273           in svg/W3C-SVG-1.1/animate-elem-40-t.svg under guard malloc
1274         - fix bug where the parser accepts "meet" or "slice" as an entire string
1275         - fix bug where "slice" is ignored if the old alignment was "none"
1276           even if the newly-parsed alignment is something other than "none", and
1277           "slice" is not ignored if the old alignment was not "none", but the
1278           newly-parsed alignment is "none"
1279         - optimize to only call notifyAttributeChange if the attribute actually changed
1280
1281         Test: svg/dom/preserve-aspect-ratio-parser-test.html
1282
1283         * ksvg2/svg/SVGPreserveAspectRatio.cpp:
1284         (WebCore::checkString): Added an overload for using char* constants which is
1285         much simpler than the old one, and almost as fast.
1286         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio): Fail if there's no
1287         more text after "defer". Fail if there's neither "none" nor an x/y specified.
1288         Check that there's more text before looking at the "m" and "s" for "meet" and
1289         "slice". Merged the failure and success cases. Only call notifyAttributeChange
1290         if something changed.
1291
1292         I think all the "optimized" code where we check the first character before
1293         calling checkString isn't really helpful, but I decided to leave it as-is
1294         for now.
1295
1296 2007-01-25  Lars Knoll <lars@trolltech.com>
1297
1298         Reviewed by Zack
1299
1300         Trivial implementation of getMIMETypeForExtension.
1301         Use the above method in the ResourceHandleManager to set
1302         a mimetype on Resources that don't have one set (which
1303         includes everything loaded from local disk).
1304
1305         Should fix quite a few test cases :)
1306
1307         * platform/network/qt/ResourceHandleManagerQt.cpp:
1308         (WebCore::ResourceHandleManager::receivedResponse):
1309         * platform/qt/MimeTypeRegistryQt.cpp:
1310         (WebCore::):
1311         (WebCore::MimeTypeRegistry::getMIMETypeForExtension):
1312
1313 2007-01-25 Harald Fernengel <harald@trolltech.com>
1314
1315         Reviewed by zack
1316
1317         Compile on platforms where qreal is not a double.
1318
1319         * platform/graphics/qt/AffineTransformQt.cpp:
1320         (WebCore::AffineTransform::map):
1321
1322 2007-01-25  Zack Rusin  <zack@kde.org>
1323
1324         Reviewed by Lars.
1325
1326         Add wheel event handling and make explicit usage
1327         of the EventHandler.
1328
1329         * WebCore.pro:
1330         * page/qt/EventHandlerQt.cpp:
1331         (WebCore::EventHandler::focusDocumentView):
1332         (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
1333         (WebCore::EventHandler::passMouseDownEventToWidget):
1334         (WebCore::EventHandler::lastEventIsMouseUp):
1335         (WebCore::EventHandler::handleMouseUp):
1336         * platform/PlatformWheelEvent.h:
1337         * platform/qt/ScrollViewCanvasQt.cpp:
1338         (WebCore::ScrollViewCanvasQt::ScrollViewCanvasQt):
1339         (WebCore::ScrollViewCanvasQt::mousePressEvent):
1340         (WebCore::ScrollViewCanvasQt::wheelEvent):
1341         (WebCore::ScrollViewCanvasQt::dragEnterEvent):
1342         (WebCore::ScrollViewCanvasQt::dragLeaveEvent):
1343         (WebCore::ScrollViewCanvasQt::dragMoveEvent):
1344         * platform/qt/ScrollViewCanvasQt.h:
1345         * platform/qt/ScrollViewQt.cpp:
1346         (WebCore::ScrollView::wheelEvent):
1347         * platform/qt/WheelEventQt.cpp: Added.
1348         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
1349
1350 2007-01-25  Rob Buis  <buis@kde.org>
1351
1352         Reviewed by Maciej.
1353
1354         http://bugs.webkit.org/show_bug.cgi?id=12391
1355         SVG containers with viewports should respect overflow when hit testing
1356
1357         Take into account the overflow property when hit testing <svg>.
1358
1359         * rendering/RenderSVGContainer.cpp:
1360         (WebCore::RenderSVGContainer::nodeAtPoint):
1361
1362 2007-01-23  Alice Liu  <alice.liu@apple.com>
1363
1364         Reviewed by Maciej.
1365
1366         fixed <rdar://problem/4808039> REGRESSION: eBay ID check never completes
1367         Also known as http://bugs.webkit.org/show_bug.cgi?id=11230
1368
1369         * bindings/js/kjs_window.cpp:
1370         It's not necessary to check safeScript when doing a location.replace, .reload, or .assign
1371         (KJS::Location::getOwnPropertySlot):
1372         (KJS::LocationFunc::callAsFunction):
1373
1374 2007-01-25  Alice Liu  <alice.liu@apple.com>
1375
1376         Reviewed by Geoff and Adele.
1377
1378         fixed <rdar://problem/4866655> REGRESSION: Copying out of Calculator & CIFIlterWidget is broken on 9A320
1379
1380         * editing/Editor.cpp:
1381         (WebCore::Editor::canDHTMLCut):
1382         (WebCore::Editor::canDHTMLCopy):
1383         (WebCore::Editor::tryDHTMLCopy):
1384         (WebCore::Editor::tryDHTMLCut):
1385         Reverting some mistakes made in r17504:
1386         Anything in r17503 that used to call mayDHTML* still calls canDHTML* as it was changed in r17504, where canDHTML* now calls !selectionController::isInPasswordField instead of editor::canCopy
1387         Anything else in r17503 that used to call mayCopy now calls (!)selectionController::isInPasswordField.
1388
1389         * editing/JSEditor.cpp:
1390         copy via JS should be enabled as long as selection is not in a password field.  a range selection shouldn't be required. 
1391
1392 2007-01-24  Adele Peterson  <adele@apple.com>
1393
1394         Reviewed by Brady and Oliver.
1395
1396         Fix for <rdar://problem/4953504> When the keydown event changes focus, the keypress event should go to the new focused node
1397
1398         Test: fast/events/keydown-keypress-focus-change.html
1399
1400         * page/EventHandler.cpp:
1401         (WebCore::eventTargetNodeForDocument): Added for convenience.
1402         (WebCore::EventHandler::keyEvent): Moved from EventHandlerMac.mm.  After dispatching the keyDown event,
1403          recheck the target node for the keyPress event in case its changed.
1404         * page/EventHandler.h:
1405         * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::keyEvent):
1406           Moved the bulk of this code to EventHandler.cpp.
1407
1408 2007-01-24  Geoffrey Garen  <ggaren@apple.com>
1409
1410         New forwarding header. No review necessary.
1411
1412         * ForwardingHeaders/kjs/ustring.h: Added.
1413
1414 2007-01-24  Oliver Hunt  <oliver@apple.com>
1415
1416         Reviewed by Maciej.
1417
1418         Migrating more drag state information to WebCore
1419
1420         * page/DragController.cpp:
1421         * page/DragController.h:
1422         (WebCore::DragController::dragOperation):
1423         (WebCore::DragController::setDraggingImageURL):
1424         (WebCore::DragController::draggingImageURL):
1425         (WebCore::DragController::setDragOffset):
1426         (WebCore::DragController::dragOffset):
1427
1428 2007-01-24  Darin Adler  <darin@apple.com>
1429
1430         Reviewed by Adele.
1431
1432         - fix http://bugs.webkit.org/show_bug.cgi?id=12331
1433           REGRESSION(r18951): Selecting text in a textarea makes the page scroll
1434
1435         Test: fast/events/autoscroll.html
1436
1437         * rendering/RenderLayer.cpp: (WebCore::RenderLayer::autoscroll):
1438         Adjust position to be relative to the object's corner for the hit test, but not for the
1439         scrollRectToVisible call. The previous version accidentally re-used the version that was
1440         adjusted for the hit test.
1441
1442 2007-01-24  Beth Dakin  <bdakin@apple.com>
1443
1444         Reviewed by Geoff.
1445
1446         Fix for <rdar://problem/4948128> REGRESSION: A crash occurs at 
1447         WebCore::Frame::view() after completing a query at mapquest.com 
1448         then switching to Bookmarks view
1449
1450         This is just a null-check. If you are in strict mode and ask for 
1451         the clientWidth or clientHeight after the document was removed from 
1452         it's parent, we no longer have a frameView, so we have to null-
1453         check it. I added null checks for the FrameView in some other 
1454         places where it seems like we could potentially run into this 
1455         issue.
1456
1457         * bindings/objc/DOMHTML.mm:
1458         (-[DOMHTMLInputElement _rectOnScreen]):
1459         * bridge/mac/WebCoreAXObject.mm:
1460         (-[WebCoreAXObject accessibilityAttributeValue:]):
1461         * dom/ContainerNode.cpp:
1462         (WebCore::ContainerNode::getUpperLeftCorner):
1463         * dom/Element.cpp:
1464         (WebCore::Element::clientWidth): Actual bug fix here!
1465         (WebCore::Element::clientHeight): And here!
1466         * ksvg2/svg/SVGLength.cpp:
1467         (WebCore::SVGLength::PercentageOfViewport):
1468         * loader/FrameLoader.cpp:
1469         (WebCore::FrameLoader::createJavaAppletWidget):
1470         * page/mac/WebCoreFrameBridge.mm:
1471         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
1472         * rendering/RenderLayer.cpp:
1473         (WebCore::RenderLayer::windowClipRect):
1474         (WebCore::RenderLayer::updateOverflowStatus):
1475         (WebCore::frameVisibleRect):
1476         * rendering/RenderListBox.cpp:
1477         (WebCore::RenderListBox::windowClipRect):
1478         * rendering/RenderTable.cpp:
1479         (WebCore::RenderTable::layout):
1480
1481 2007-01-24  Maciej Stachowiak  <mjs@apple.com>
1482
1483         Not reviewed, just removing accidentally committed file.
1484
1485         - removed file that shouldn't be there
1486
1487         * Image Viewer/Image Viewer.aps: Removed.
1488
1489 2007-01-24  Anders Carlsson  <acarlsson@apple.com>
1490
1491         Reviewed by Geoff and Adam.
1492
1493         <rdar://problem/4922655>
1494         http://galeri.milliyet.com.tr/ reproducibly crashes Safari
1495         
1496         * loader/FrameLoader.cpp:
1497         (WebCore::FrameLoader::requestFrame):
1498         If the frame already exists, defer the navigation so that we won't end up replacing the document
1499         while we're parsing it. This is similar to what setting window.location ends up doing.
1500
1501 2007-01-25  Mark Rowe  <mrowe@apple.com>
1502
1503         Reviewed by Darin.
1504
1505         * Info.plist: Update copyright string.
1506
1507 2007-01-24  Justin Garcia  <justin.garcia@apple.com>
1508
1509         Reviewed by harrison
1510
1511         <rdar://problem/4916235>
1512         eBay Editor: Crash occurs at WebCore::Range::startPosition() after applying ordered list styling to selected text
1513         <rdar://problem/4857269>
1514         REGRESSION: editing/execCommand/create-list-from-range-selection.html no longer works as intended
1515         <rdar://problem/4916583>
1516         eBay Editor: Removing a indent from a list item actually deletes the list item instead
1517         <rdar://problem/4928635>
1518         designMode outdent causes crash (11750)
1519
1520         * editing/CompositeEditCommand.cpp:
1521         (WebCore::CompositeEditCommand::moveParagraphs): Fixed br insertion
1522         after the pruning of empty containers left over after the paragraph
1523         to move is removed.
1524         * editing/DeleteSelectionCommand.cpp:
1525         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): There are
1526         bugs that leave the wrong number of line breaks after a deletion 
1527         that expands to include special elements (lists/tables).  Added 
1528         a workaround so that moveParagraphs can avoid these until they 
1529         are fixed.
1530         (WebCore::DeleteSelectionCommand::initializeStartEnd): Ditto.
1531         (WebCore::DeleteSelectionCommand::initializePositionData): Ditto.
1532         * editing/DeleteSelectionCommand.h:
1533         * editing/TextIterator.cpp:
1534         (WebCore::TextIterator::advance): We used to not call exitNode for
1535         ancestors of a node where the next node in a pre-order traversal is 
1536         the ranges's pastEndNode().  This is only correct for ancestors that
1537         contain the end of the range.
1538         (WebCore::shouldEmitNewlineAfterNode): Added, we should only emit newlines
1539         after blocks that have VisiblePositions after them.  VisiblePosition creation
1540         though is too expensive to do here, what I added here is an OK substitute.
1541         (WebCore::shouldEmitNewlineBeforeNode): Added.  No special logic yet.
1542         (WebCore::TextIterator::handleNonTextNode): Call shouldEmitNewlineBeforeNode.
1543         (WebCore::TextIterator::exitNode): Call shouldEmitNewlineAfterNode.
1544         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Call
1545         shouldEmitNewlineAfterNode.
1546
1547 2007-01-24  Darin Adler  <darin@apple.com>
1548
1549         Reviewed by Mark Rowe.
1550
1551         * WebCore.xcodeproj/project.pbxproj: Changed to /usr/sbin/sysctl
1552         so we don't rely on people's paths.
1553
1554 2007-01-24  Darin Adler  <darin@apple.com>
1555
1556         Reviewed by Adele.
1557
1558         - a couple minor tweaks to recently-changed things
1559
1560         * dom/Document.h: Use HTMLHeadElement as type for the head function.
1561         * dom/Document.cpp: (WebCore::Document::head):
1562
1563         * ksvg2/svg/SVGElementInstance.cpp:
1564         (WebCore::SVGElementInstance::~SVGElementInstance): Change loop to
1565         a for loop and use a local variable for document.
1566
1567 2007-01-24  Oliver Hunt  <oliver@apple.com>
1568
1569         Reviewed by Adele.
1570
1571         Fixes DragController to allow a null target Document.
1572         This is encountered in new tabs/windows that have not 
1573         loaded any page
1574
1575         * page/DragController.cpp:
1576         (WebCore::documentAtPoint):
1577         (WebCore::DragController::tryDocumentDrag):
1578         (WebCore::DragController::operationForLoad):
1579         (WebCore::DragController::concludeDrag):
1580         * page/mac/DragControllerMac.mm:
1581         (WebCore::DragController::dragOperation):
1582
1583 2007-01-24  Sam Weinig  <sam@webkit.org>
1584
1585         Reviewed by Mitz.
1586
1587         Patch for http://bugs.webkit.org/show_bug.cgi?id=12394
1588         Cleanup RenderBox
1589
1590         No functionality changes, just a good old fashion cleanup,
1591         thus no tests.
1592
1593         * rendering/RenderBox.cpp:
1594         (WebCore::RenderBox::RenderBox):
1595         (WebCore::RenderBox::setStyle):
1596         (WebCore::RenderBox::destroy):
1597         (WebCore::RenderBox::setPos):
1598         (WebCore::RenderBox::calcBorderBoxWidth):
1599         (WebCore::RenderBox::calcBorderBoxHeight):
1600         (WebCore::RenderBox::calcContentBoxWidth):
1601         (WebCore::RenderBox::calcContentBoxHeight):
1602         (WebCore::RenderBox::nodeAtPoint):
1603         (WebCore::RenderBox::paintRootBoxDecorations):
1604         (WebCore::RenderBox::paintBoxDecorations):
1605         (WebCore::RenderBox::paintBackgrounds):
1606         (WebCore::RenderBox::paintBackground):
1607         (WebCore::cacluateBackgroundSize):
1608         (WebCore::RenderBox::paintBackgroundExtended):
1609         (WebCore::RenderBox::getOverflowClipRect):
1610         (WebCore::RenderBox::getClipRect):
1611         (WebCore::RenderBox::containingBlockWidth):
1612         (WebCore::RenderBox::absolutePosition):
1613         (WebCore::RenderBox::dirtyLineBoxes):
1614         (WebCore::RenderBox::position):
1615         (WebCore::RenderBox::getAbsoluteRepaintRect):
1616         (WebCore::RenderBox::computeAbsoluteRepaintRect):
1617         (WebCore::RenderBox::repaintDuringLayoutIfMoved):
1618         (WebCore::RenderBox::relativePositionOffsetX):
1619         (WebCore::RenderBox::relativePositionOffsetY):
1620         (WebCore::RenderBox::calcWidth):
1621         (WebCore::RenderBox::calcWidthUsing):
1622         (WebCore::RenderBox::sizesToIntrinsicWidth):
1623         (WebCore::RenderBox::calcHorizontalMargins):
1624         (WebCore::RenderBox::calcHeight):
1625         (WebCore::RenderBox::calcPercentageHeight):
1626         (WebCore::RenderBox::calcReplacedWidthUsing):
1627         (WebCore::RenderBox::calcReplacedHeightUsing):
1628         (WebCore::RenderBox::availableHeightUsing):
1629         (WebCore::RenderBox::calcVerticalMargins):
1630         (WebCore::RenderBox::containingBlockWidthForPositioned):
1631         (WebCore::RenderBox::calcAbsoluteHorizontal):
1632         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
1633         (WebCore::RenderBox::calcAbsoluteVertical):
1634         (WebCore::RenderBox::calcAbsoluteVerticalValues):
1635         (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
1636         (WebCore::RenderBox::caretRect):
1637         * rendering/RenderBox.h:
1638         (WebCore::RenderBox::setOverrideSize):
1639         (WebCore::RenderBox::width):
1640         (WebCore::RenderBox::height):
1641         (WebCore::RenderBox::setWidth):
1642         (WebCore::RenderBox::setHeight):
1643         (WebCore::RenderBox::inlineBoxWrapper):
1644         (WebCore::RenderBox::setInlineBoxWrapper):
1645         (WebCore::RenderBox::stretchesToViewHeight):
1646         (WebCore::RenderBox::setStaticX):
1647         (WebCore::RenderBox::setStaticY):
1648
1649 2007-01-24  Eric Seidel  <eric@webkit.org>
1650
1651         Reviewed by ap.
1652
1653         Converted SVGTransform from being Shared<T> to a POD type.
1654
1655         No functional changes, thus no tests.
1656
1657         * bindings/scripts/CodeGenerator.pm:
1658         * bindings/scripts/CodeGeneratorJS.pm:
1659         * ksvg2/misc/SVGTimer.cpp:
1660         (WebCore::baseValueTransformList):
1661         * ksvg2/svg/SVGAnimateTransformElement.cpp:
1662         (WebCore::SVGAnimateTransformElement::storeInitialValue):
1663         (WebCore::SVGAnimateTransformElement::resetValues):
1664         (WebCore::SVGAnimateTransformElement::updateCurrentValue):
1665         (WebCore::SVGAnimateTransformElement::handleStartCondition):
1666         (WebCore::SVGAnimateTransformElement::applyAnimationToValue):
1667         (WebCore::SVGAnimateTransformElement::parseTransformValue):
1668         * ksvg2/svg/SVGAnimateTransformElement.h:
1669         * ksvg2/svg/SVGLinearGradientElement.cpp:
1670         (WebCore::SVGLinearGradientElement::collectGradientProperties):
1671         * ksvg2/svg/SVGPatternElement.cpp:
1672         (WebCore::SVGPatternElement::collectPatternProperties):
1673         * ksvg2/svg/SVGRadialGradientElement.cpp:
1674         (WebCore::SVGRadialGradientElement::collectGradientProperties):
1675         * ksvg2/svg/SVGSVGElement.cpp:
1676         (WebCore::SVGSVGElement::createSVGTransform):
1677         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
1678         * ksvg2/svg/SVGSVGElement.h:
1679         * ksvg2/svg/SVGStyledTransformableElement.cpp:
1680         (WebCore::SVGStyledTransformableElement::updateLocalTransform):
1681         * ksvg2/svg/SVGTextElement.cpp:
1682         (WebCore::SVGTextElement::updateLocalTransform):
1683         * ksvg2/svg/SVGTransform.cpp:
1684         (SVGTransform::SVGTransform):
1685         (SVGTransform::isValid):
1686         * ksvg2/svg/SVGTransform.h:
1687         * ksvg2/svg/SVGTransform.idl:
1688         * ksvg2/svg/SVGTransformList.cpp:
1689         (SVGTransformList::SVGTransformList):
1690         (SVGTransformList::createSVGTransformFromMatrix):
1691         (SVGTransformList::consolidate):
1692         (SVGTransformList::concatenate):
1693         * ksvg2/svg/SVGTransformList.h:
1694         * ksvg2/svg/SVGTransformable.cpp:
1695         (WebCore::SVGTransformable::parseTransformAttribute):
1696
1697 2007-01-24  Mark Rowe  <mrowe@apple.com>
1698
1699         Reviewed by Eric.
1700
1701         Plug another bunch of SVG memory leaks.
1702
1703         * ksvg2/misc/SVGDocumentExtensions.cpp:
1704         (WebCore::SVGDocumentExtensions::~SVGDocumentExtensions): Delete memory we have allocated.
1705         (WebCore::SVGDocumentExtensions::removePendingResource): Return an auto_ptr to show that we are transferring ownership.
1706         * ksvg2/misc/SVGDocumentExtensions.h:
1707         * ksvg2/svg/SVGElement.cpp:
1708         (WebCore::SVGElement::insertedIntoDocument): Update for use of auto_ptr.
1709
1710 2007-01-23  Mark Rowe  <mrowe@apple.com>
1711
1712         Reviewed by Brady.
1713
1714         Plug thousands of node leaks seen running layout tests.
1715
1716         * ksvg2/svg/SVGElementInstance.cpp:
1717         (WebCore::SVGElementInstance::~SVGElementInstance): Disassociate ourselves from our children so they will
1718         be destroyed if we were the only thing referencing them.
1719         * ksvg2/svg/SVGUseElement.cpp:
1720         (WebCore::SVGUseElement::removedFromDocument):
1721         * ksvg2/svg/SVGUseElement.h:
1722
1723 2007-01-23  Alice Liu  <alice.liu@apple.com>
1724
1725         Reviewed by Brady.
1726
1727         * editing/Editor.cpp:
1728         (WebCore::Editor::appliedEditing):
1729         minor change.  removing unnecessary call to frame to fetch editor
1730
1731 2007-01-23  Mark Rowe  <mrowe@apple.com>
1732
1733         Reviewed by Adele.
1734
1735         http://bugs.webkit.org/show_bug.cgi?id=12375
1736         Bug 12375: REGRESSION(r19038): fast/dom/title-text-property-2.html failing
1737
1738         Fix regression by making setTitle/updateTitle/removeTitle logic match document.title
1739         specification at http://whatwg.org/specs/web-apps/current-work/#the-title1.
1740
1741         * dom/Document.cpp:
1742         (WebCore::Document::setTitle): Materialize a title element into the head if one doesn't exist when setting
1743         document.title.  Also update the contents of the title element when the title is set via document.title.
1744         (WebCore::Document::removeTitle): Update the title based on first title element in the head, if one exists.
1745         (WebCore::Document::head): Convenience method to retrieve the head element in an HTML document.
1746         * dom/Document.h:
1747
1748 2007-01-23  Beth Dakin  <bdakin@apple.com>
1749
1750         Reviewed by Hyatt.
1751
1752         Follow-up to the fix below for 4843226.
1753
1754         * rendering/RenderLayer.cpp:
1755         (WebCore::transparencyClipBox): Has to be recursive or we will miss 
1756         out on grandchildren!
1757
1758 2007-01-23  Oliver Hunt  <oliver@apple.com>
1759
1760         Reviewed by Adam.
1761
1762         Fixes dropping of files into safari
1763
1764         * page/DragController.cpp:
1765         (WebCore::DragController::performDrag):
1766
1767 2007-01-23  Brady Eidson  <beidson@apple.com>
1768
1769         Reviewed by Darin
1770
1771         Added a couple of CF things previously missed
1772
1773         * platform/network/ResourceError.h:
1774         * platform/network/ResourceHandle.h:
1775
1776 2007-01-23  Nikolas Zimmermann  <zimmermann@kde.org>
1777
1778         Reviewed by Maciej.
1779
1780         Fix evil genericContext() assertion, which occours sometimes when running DRT.
1781         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12379
1782
1783         * bindings/scripts/CodeGeneratorJS.pm:
1784         * ksvg2/misc/SVGDocumentExtensions.h:
1785         (WebCore::SVGDocumentExtensions::genericContextMap):
1786         (WebCore::SVGDocumentExtensions::forgetGenericContext):
1787
1788 2007-01-23  Beth Dakin  <bdakin@apple.com>
1789
1790         Reviewed by Hyatt.
1791
1792         Fix for <rdar://problem/4843226> REGRESSION: Pull down menu appears 
1793         clipped at http://istweb.apple.com/
1794
1795         * rendering/RenderLayer.cpp:
1796         (WebCore::transparencyClipBox): Always unite with sibling rects.
1797
1798 2007-01-22  Justin Garcia  <justin.garcia@apple.com>
1799
1800         Reviewed by john
1801
1802         <rdar://problem/4920742>
1803         REGRESSION: GMail Editor: Attempting to remove formatting from selection results in a crash at WebCore::Range::checkDeleteExtract()
1804
1805         * dom/Range.cpp:
1806         (WebCore::Range::checkDeleteExtract): Return if there is no
1807         commonAncestor container or if commonAncestorContainer() throws
1808         an exception.
1809         * editing/Editor.cpp:
1810         (WebCore::Editor::removeFormattingAndStyle): Fixed a bug that reversed
1811         the order of the selected paragraphs.
1812
1813 2007-01-23  Nikolas Zimmermann  <zimmermann@kde.org>
1814
1815         Reviewed by Sam.
1816
1817         Fix dynamic creation/updates of markers, masks, clipPaths, and several tiny pattern issues.
1818         Added 16 (!) new layout tests covering quite some weird scenerios - Batik & Opera do have problems, we don't.
1819
1820         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12380
1821         Fixes: svg/custom/image-with-transform-clip-filter.svg (filter shows up again)
1822
1823         Added: svg/custom/clip-path-child-changes.svg
1824         Added: svg/custom/clip-path-href-changes.svg
1825         Added: svg/custom/clip-path-units-changes.svg
1826         Added: svg/custom/deep-dynamic-updates.svg
1827         Added: svg/custom/js-late-clipPath-and-object-creation.svg
1828         Added: svg/custom/js-late-clipPath-creation.svg
1829         Added: svg/custom/js-late-marker-and-object-creation.svg
1830         Added: svg/custom/js-late-marker-creation.svg
1831         Added: svg/custom/js-late-mask-and-object-creation.svg
1832         Added: svg/custom/js-late-mask-creation.svg
1833         Added: svg/custom/js-update-pattern-child.svg
1834         Added: svg/custom/marker-changes.svg
1835         Added: svg/custom/marker-child-changes.svg
1836         Added: svg/custom/marker-viewBox-changes.svg
1837         Added: svg/custom/mask-changes.svg
1838         Added: svg/custom/mask-child-changes.svg
1839
1840         * ksvg2/misc/KCanvasRenderingStyle.cpp:
1841         (WebCore::KSVGPainterFactory::fillPaintServer):
1842         (WebCore::KSVGPainterFactory::strokePaintServer):
1843         * ksvg2/svg/SVGClipPathElement.cpp:
1844         (WebCore::SVGClipPathElement::notifyAttributeChange):
1845         * ksvg2/svg/SVGClipPathElement.h:
1846         * ksvg2/svg/SVGGradientElement.cpp:
1847         * ksvg2/svg/SVGGradientElement.h:
1848         * ksvg2/svg/SVGMarkerElement.cpp:
1849         (WebCore::SVGMarkerElement::canvasResource):
1850         (WebCore::SVGMarkerElement::notifyAttributeChange):
1851         * ksvg2/svg/SVGMarkerElement.h:
1852         * ksvg2/svg/SVGMaskElement.cpp:
1853         (WebCore::SVGMaskElement::notifyAttributeChange):
1854         * ksvg2/svg/SVGMaskElement.h:
1855         * ksvg2/svg/SVGStopElement.cpp:
1856         (WebCore::SVGStopElement::notifyAttributeChange):
1857         * ksvg2/svg/SVGStyledElement.cpp:
1858         (WebCore::SVGStyledElement::notifyAttributeChange):
1859         (WebCore::SVGStyledElement::notifyResourceParentIfExistant):
1860         (WebCore::SVGStyledElement::rebuildRenderer):
1861         * ksvg2/svg/SVGStyledElement.h:
1862         * ksvg2/svg/SVGUseElement.cpp:
1863         (WebCore::SVGUseElement::notifyAttributeChange):
1864         * platform/graphics/svg/SVGResource.cpp:
1865         (WebCore::SVGResource::invalidate):
1866         (WebCore::SVGResource::addClient):
1867         (WebCore::SVGResource::repaintClients):
1868         * platform/graphics/svg/SVGResource.h:
1869         * platform/graphics/svg/SVGResourceMarker.cpp:
1870         (WebCore::SVGResourceMarker::draw):
1871         (WebCore::SVGResourceMarker::cachedBounds):
1872         * platform/graphics/svg/SVGResourceMarker.h:
1873         * rendering/RenderPath.cpp:
1874         (WebCore::RenderPath::layout):
1875         (WebCore::RenderPath::getAbsoluteRepaintRect):
1876         (WebCore::RenderPath::paint):
1877         (WebCore::drawMarkerWithData):
1878         (WebCore::RenderPath::drawMarkersIfNeeded):
1879         * rendering/RenderPath.h:
1880         * rendering/RenderSVGContainer.cpp:
1881         (WebCore::RenderSVGContainer::paint):
1882         (WebCore::RenderSVGContainer::getAbsoluteRepaintRect):
1883         * rendering/RenderSVGImage.cpp:
1884         (WebCore::RenderSVGImage::paint):
1885         (WebCore::RenderSVGImage::getAbsoluteRepaintRect):
1886         * rendering/SVGInlineFlowBox.cpp:
1887         (WebCore::paintSVGInlineFlow):
1888
1889 2007-01-23  Adele Peterson  <adele@apple.com>
1890
1891         Reviewed by Darin.
1892         
1893         WebCore part of fix for <rdar://problem/4946753>REGRESSION: Inserting tabs is broken in Mail
1894
1895         In addition to this fix, I also reorganized some event handling code for keyPress events to
1896         prepare for another fix.  There's also just a little bit of unrelated cleanup.
1897         
1898         * dom/EventTargetNode.cpp: (WebCore::EventTargetNode::defaultEventHandler):
1899           Move tab focus behavior into new defaultKeyboardEventHandler method.
1900         
1901         * bridge/EditorClient.h: Added handleKeyPress.
1902         * editing/Editor.cpp:
1903         (WebCore::Editor::handleKeyPress): Added. Calls over to the client method.
1904         (WebCore::Editor::deleteRange): Removed unnecessary propogateDOMException.
1905         * editing/Editor.h: Added handleKeyPress.
1906         (WebCore::Editor::addToKillRing): Formatting cleanup.
1907         * editing/mac/EditorMac.mm: Removed unnecessary propogateDOMException.
1908         
1909         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler): Added. Checks
1910           the tabKeyCyclesThroughElements setting before advancing focus for tab key events.  Calls handleKeyPress.
1911         * page/EventHandler.h: Added defaultKeyboardEventHandler.
1912         
1913         * page/Page.cpp: (WebCore::Page::Page): Initialize m_tabKeyCyclesThroughElements to true.
1914         * page/Page.h: Added m_tabKeyCyclesThroughElements.
1915         (WebCore::Page::setTabKeyCyclesThroughElements): Added.
1916         (WebCore::Page::tabKeyCyclesThroughElements): Added.
1917         
1918         * platform/PlatformKeyboardEvent.h: Added ability to get NSEvent from PlatformKeyboardEvent.
1919         * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1920           Initialize m_macEvent to the NSEvent.
1921         
1922         * platform/graphics/svg/SVGImageEmptyClients.h: (WebCore::SVGEmptyEditorClient::handleKeyPress): Added.
1923
1924 2007-01-23  George Staikos  <staikos@kde.org>
1925
1926         Compile with a released Qt.
1927
1928         * platform/graphics/qt/ImageQt.cpp:
1929
1930 2007-01-23  Lars Knoll <lars@trolltech.com>
1931
1932         Reviewed by Zack
1933
1934         Widget and ScrollView do not own the Qt widgets
1935         anymore. Make sure they can handle the case of
1936         a null QWidget and never delete them.
1937
1938         * platform/qt/ScrollViewQt.cpp:
1939         (WebCore::ScrollView::setScrollArea):
1940         (WebCore::ScrollView::updateContents):
1941         (WebCore::ScrollView::visibleWidth):
1942         (WebCore::ScrollView::visibleHeight):
1943         (WebCore::ScrollView::visibleContentRect):
1944         (WebCore::ScrollView::setContentsPos):
1945         (WebCore::ScrollView::resizeContents):
1946         (WebCore::ScrollView::contentsX):
1947         (WebCore::ScrollView::contentsY):
1948         (WebCore::ScrollView::contentsWidth):
1949         (WebCore::ScrollView::contentsHeight):
1950         (WebCore::ScrollView::scrollOffset):
1951         (WebCore::ScrollView::scrollBy):
1952         (WebCore::ScrollView::hScrollbarMode):
1953         (WebCore::ScrollView::vScrollbarMode):
1954         (WebCore::ScrollView::setHScrollbarMode):
1955         (WebCore::ScrollView::setVScrollbarMode):
1956         * platform/qt/WidgetQt.cpp:
1957         (WebCore::WidgetPrivate::~WidgetPrivate):
1958         (WebCore::Widget::setQWidget):
1959
1960 2007-01-23  Zack Rusin  <zack@kde.org>
1961
1962         Forgot to add one new file to the build.
1963
1964         * WebCore.pro: Add dom/clipboard.cpp
1965
1966 2007-01-23  Zack Rusin  <zack@kde.org>
1967
1968         Fix the Qt build
1969
1970         * page/DragActions.h:
1971         * page/DragController.cpp:
1972         * platform/qt/DragDataQt.cpp:
1973         (WebCore::DragData::canSmartReplace):
1974         (WebCore::DragData::containsColor):
1975         (WebCore::DragData::containsPlainText):
1976         (WebCore::DragData::asPlainText):
1977         (WebCore::DragData::asColor):
1978         (WebCore::DragData::createClipboard):
1979         (WebCore::DragData::containsCompatibleContent):
1980         (WebCore::DragData::containsURL):
1981         (WebCore::DragData::asURL):
1982         (WebCore::DragData::asFragment):
1983         * platform/qt/FileChooserQt.cpp:
1984
1985 2007-01-23  Lars Knoll <lars@trolltech.com>
1986
1987         Reviewed by Maciej
1988
1989         Make the last remaining pieces of the FrameLoader platform 
1990         independent. Move most of the code over to WebFrameLoaderClient.
1991         Some smaller cleanups in the WebFrameBridge, and moved some
1992         platform independent functionality over to the shared code
1993         in WebCore.
1994         
1995         * WebCore.exp:
1996         * WebCore.pro:
1997         * WebCore.xcodeproj/project.pbxproj:
1998         * loader/FrameLoader.cpp:
1999         (WebCore::FrameLoader::loadSubframe):
2000         (WebCore::FrameLoader::shouldUsePlugin):
2001         (WebCore::FrameLoader::loadPlugin):
2002         (WebCore::FrameLoader::detachFromParent):
2003         (WebCore::FrameLoader::partClearedInBegin):
2004         (WebCore::FrameLoader::createJavaAppletWidget):
2005         (WebCore::FrameLoader::didChangeTitle):
2006         * loader/FrameLoader.h:
2007         * loader/FrameLoaderClient.h:
2008         * loader/FrameLoaderTypes.h:
2009         (WebCore::):
2010         * loader/PluginDocument.cpp:
2011         (WebCore::PluginTokenizer::writeRawData):
2012         * loader/mac/FrameLoaderMac.mm: Removed.
2013         * loader/qt/FrameLoaderQt.cpp: Removed.
2014         * page/Frame.cpp:
2015         (WebCore::Frame::Frame):
2016         * page/FrameView.cpp:
2017         (WebCore::FrameView::mediaType):
2018         * page/qt/FrameQt.cpp:
2019         (WebCore::FrameQt::FrameQt):
2020         * platform/graphics/svg/SVGImageEmptyClients.h:
2021         (WebCore::SVGEmptyFrameLoaderClient::makeRepresentation):
2022         (WebCore::SVGEmptyFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache):
2023         (WebCore::SVGEmptyFrameLoaderClient::dispatchDidCommitLoad):
2024         (WebCore::SVGEmptyFrameLoaderClient::dispatchDidFailLoad):
2025         (WebCore::SVGEmptyFrameLoaderClient::dispatchCreatePage):
2026         (WebCore::SVGEmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2027         (WebCore::SVGEmptyFrameLoaderClient::dispatchUnableToImplementPolicy):
2028         (WebCore::SVGEmptyFrameLoaderClient::revertToProvisionalState):
2029         (WebCore::SVGEmptyFrameLoaderClient::setMainDocumentError):
2030         (WebCore::SVGEmptyFrameLoaderClient::startDownload):
2031         (WebCore::SVGEmptyFrameLoaderClient::committedLoad):
2032         (WebCore::SVGEmptyFrameLoaderClient::shouldFallBack):
2033         (WebCore::SVGEmptyFrameLoaderClient::willUseArchive):
2034         (WebCore::SVGEmptyFrameLoaderClient::createDocumentLoader):
2035         (WebCore::SVGEmptyFrameLoaderClient::createFrame):
2036         (WebCore::SVGEmptyFrameLoaderClient::createPlugin):
2037         (WebCore::SVGEmptyFrameLoaderClient::createJavaAppletWidget):
2038         (WebCore::SVGEmptyFrameLoaderClient::objectContentType):
2039         (WebCore::SVGEmptyFrameLoaderClient::overrideMediaType):
2040         (WebCore::SVGEmptyFrameLoaderClient::redirectDataToPlugin):
2041         (WebCore::SVGEmptyFrameLoaderClient::windowObjectCleared):
2042
2043 2007-01-23  Oliver Hunt  <oliver@apple.com>
2044
2045         Reviewed by Adam.
2046
2047         Added DragController to handled drag and drop state and control logic.
2048         Currently this only handles logic for Dragging and Dropping, and is 
2049         unable to initialise a drag itself.
2050
2051         platform/DragData encapsulate the paltform Drag data (NSDraggingInfo on Mac, 
2052         QMimeType in Qt).  This provides methods to pull data out the drag data as a String, 
2053         a URL, a DocumentFragment (for rich content), or a Colour.
2054
2055         * WebCore.exp:
2056         * WebCore.pro:
2057         * WebCore.xcodeproj/project.pbxproj:
2058         * dom/Clipboard.cpp: Added.
2059         (WebCore::Clipboard::setAccessPolicy):
2060         (WebCore::dragOpFromIEOp):
2061         (WebCore::IEOpFromDragOp):
2062         (WebCore::Clipboard::sourceOperation):
2063         (WebCore::Clipboard::destinationOperation):
2064         (WebCore::Clipboard::setSourceOperation):
2065         (WebCore::Clipboard::setDestinationOperation):
2066         (WebCore::Clipboard::setDropEffect):
2067         (WebCore::Clipboard::setEffectAllowed):
2068           move platform independent functions from ClipboardMac to Clipboard
2069
2070         * dom/Clipboard.h:
2071         (WebCore::Clipboard::Clipboard):
2072         (WebCore::Clipboard::dropEffect):
2073         (WebCore::Clipboard::effectAllowed):
2074         (WebCore::Clipboard::policy):
2075           as above -- also removed virtual modifier from now 
2076           platform independent methods
2077
2078         * editing/Editor.cpp:
2079         (WebCore::Editor::smartInsertDeleteEnabled): 
2080         (WebCore::Editor::shouldApplyStyle):
2081         * editing/Editor.h:
2082           adding calls through to EditorClient
2083          
2084         * page/DragActions.h: Added.
2085         (WebCore::):
2086           Replicates a number of NS* enums in the WebCore namespace
2087
2088         * page/DragClient.h: Added.
2089         (WebCore::DragClient::~DragClient):
2090           Standard client interface for dragging UIDelegate
2091
2092         * page/DragController.cpp: Added.
2093         (WebCore::createMouseEvent):
2094         (WebCore::DragController::DragController):
2095         (WebCore::DragController::~DragController):
2096         (WebCore::documentFragmentFromDragData):
2097         (WebCore::DragController::isMoveDrag):
2098         (WebCore::visiblePositionForPoint):
2099         (WebCore::DragController::cancelDrag):
2100         (WebCore::documentAtPoint):
2101         (WebCore::DragController::dragEntered):
2102         (WebCore::DragController::dragExited):
2103         (WebCore::DragController::dragUpdated):
2104         (WebCore::DragController::performDrag):
2105         (WebCore::DragController::dragEnteredOrUpdated):
2106         (WebCore::DragController::tryDocumentDrag):
2107         (WebCore::DragController::operationForLoad):
2108         (WebCore::DragController::concludeDrag):
2109         (WebCore::DragController::canProcessDrag):
2110         (WebCore::DragController::tryDHTMLDrag):
2111           Class to handle state and logic for dragging and dropping
2112
2113         * page/DragController.h: Added.
2114         (WebCore::DragController::client):
2115         (WebCore::DragController::didInitiateDrag):
2116         (WebCore::DragController::isHandlingDrag):
2117         (WebCore::DragController::dragOperation):
2118         (WebCore::DragController::document):
2119         (WebCore::DragController::dragInitiator):
2120         (WebCore::DragController::dragDestinationAction):
2121         (WebCore::DragController::dragSourceAction):
2122         (WebCore::DragController::dragEnded):
2123         (WebCore::DragController::setIsHandlingDrag):
2124         (WebCore::DragController::setDidInitiateDrag):
2125         (WebCore::DragController::setDragOperation):
2126         (WebCore::DragController::setDragSourceAction):
2127         (WebCore::DragController::setDragInitiator):
2128           See above
2129
2130         * page/Page.cpp:
2131         (WebCore::Page::Page):
2132           Update Page to have DragController
2133
2134         * page/Page.h:
2135         (WebCore::Page::dragController):
2136           ditto
2137
2138         * page/mac/DragControllerMac.mm: Added.
2139         (WebCore::DragController::isCopyKeyDown):
2140         (WebCore::DragController::dragOperation):
2141           Platform specific portions of the DragController
2142
2143         * page/mac/EventHandlerMac.mm:
2144         (WebCore::EventHandler::handleDrag):
2145         (WebCore::EventHandler::dragSourceEndedAt):
2146           Convert from NSDragOperation to WebCore::DragOperation
2147
2148         * page/mac/WebCoreFrameBridge.h:
2149         * page/mac/WebCoreFrameBridge.mm:
2150           Remove obsolete Drag functions
2151
2152         * page/qt/DragControllerQt.cpp: Added.
2153         (WebCore::DragController::isCopyKeyDown):
2154         (WebCore::DragController::dragOperation):
2155           Basic stubs to maintain Qt  build
2156
2157         * platform/DragData.cpp: Added.
2158         (WebCore::DragData::DragData):
2159         * platform/DragData.h: Added.
2160         (WebCore::DragData::clientPosition):
2161         (WebCore::DragData::globalPosition):
2162         (WebCore::DragData::platformData):
2163         (WebCore::DragData::draggingSourceOperationMask):
2164           DragData class to encapsulate platform drag data/event
2165
2166         * platform/graphics/svg/SVGImage.cpp:
2167         (WebCore::SVGImage::setData):
2168           Addition of dummy DragClient
2169
2170         * platform/graphics/svg/SVGImageEmptyClients.h:
2171         (WebCore::SVGEmptyDragClient::~SVGEmptyDragClient):
2172         (WebCore::SVGEmptyDragClient::willPerformDragDestinationAction):
2173         (WebCore::SVGEmptyDragClient::actionMaskForDrag):
2174         (WebCore::SVGEmptyDragClient::dragControllerDestroyed):
2175           ditto
2176
2177         * platform/mac/ClipboardMac.h:
2178         * platform/mac/ClipboardMac.mm:
2179         (WebCore::ClipboardMac::ClipboardMac):
2180         (WebCore::ClipboardMac::clearData):
2181         (WebCore::ClipboardMac::clearAllData):
2182         (WebCore::ClipboardMac::getData):
2183         (WebCore::ClipboardMac::setData):
2184         (WebCore::ClipboardMac::types):
2185         (WebCore::ClipboardMac::setDragImage):
2186          Moving platform independent logic to Clipboard, and updating
2187          platform specific methods to use appropriate accessors rather than 
2188          directly manipulating data they no longer own
2189
2190         * platform/mac/DragDataMac.mm: Added.
2191         (WebCore::DragData::DragData):
2192         (WebCore::DragData::canSmartReplace):
2193         (WebCore::DragData::containsColor):
2194         (WebCore::DragData::containsPlainText):
2195         (WebCore::DragData::asPlainText):
2196         (WebCore::DragData::asColor):
2197         (WebCore::DragData::createClipboard):
2198         (WebCore::imageExistsAtPaths):
2199         (WebCore::DragData::containsCompatibleContent):
2200         (WebCore::DragData::containsURL):
2201         (WebCore::DragData::asURL):
2202         (WebCore::DragData::asFragment):
2203           Mac implementations of DragData methods.  A number of these use
2204           a Helper class that accesses WebKit functionality.  That functionality 
2205           should be migrated to WebCore in the future.
2206
2207         * platform/mac/PasteboardHelper.h: Added.
2208         (WebCore::PasteboardHelper::~PasteboardHelper):
2209           Temporary, and Mac only, helper class to access WebKit functionality 
2210           from WebCore
2211
2212         * platform/qt/DragDataQt.cpp: Added.
2213         (WebCore::DragData::canSmartReplace):
2214         (WebCore::DragData::containsColor):
2215         (WebCore::DragData::containsPlainText):
2216         (WebCore::DragData::asPlainText):
2217         (WebCore::DragData::asColor):
2218         (WebCore::DragData::createClipboard):
2219         (WebCore::DragData::containsCompatibleContent):
2220         (WebCore::DragData::containsURL):
2221         (WebCore::DragData::asURL):
2222         (WebCore::DragData::asFragment):
2223          Basic stubs to maintain Qt build
2224
2225         * rendering/HitTestResult.cpp:
2226         (WebCore::HitTestResult::HitTestResult):
2227          Correct HitTestResult copy contructor to copy localPoint
2228
2229 2007-01-22  Mark Rowe  <mrowe@apple.com>
2230
2231         Reviewed by Maciej.
2232
2233         http://bugs.webkit.org/show_bug.cgi?id=11692
2234         Bug 11692: REGRESSION(r17352): Disappearing page title
2235
2236         * dom/Document.cpp:
2237         (WebCore::Document::setTitle): If the title has already been set explicitly via JavaScript,
2238         ignore any changes to it due to encountering <title> tags.
2239
2240 2007-01-22  Mitz Pettel  <mitz@webkit.org>
2241
2242         Reviewed by Darin.
2243
2244         - fix http://bugs.webkit.org/show_bug.cgi?id=12344
2245           NativeListBox: item hit testing does not account for top padding and border
2246
2247         Test: fast/forms/listbox-selection-2.html
2248
2249         * rendering/RenderListBox.cpp:
2250         (WebCore::RenderListBox::numVisibleItems): Changed height() to contentHeight()
2251         since items are visible only in the content box.
2252         (WebCore::RenderListBox::listIndexAtOffset): Adjusted for vertical padding and
2253         borders. Changed to return -1 instead of the last item's index if the given offset
2254         is below the last item.
2255         (WebCore::RenderListBox::autoscroll): Adjusted for vertical padding and borders.
2256         (WebCore::RenderListBox::controlClipRect): Changed to return the content box since
2257         items should not spill into the padding box. This change is the reason the test
2258         generates pixel results.
2259
2260 2007-01-22  Justin Garcia  <justin.garcia@apple.com>
2261
2262         Reviewed by darin
2263         
2264         <rdar://problem/4944770>
2265         editing/pasteboard/4641033 layout test is broken (12328)
2266         
2267         This layout test failure demonstrates three bugs:
2268         Smart replace shouldn't be turned on, but is because a word
2269         selection granularity from the previous test isn't cleared.
2270         Smart replace shouldn't add any spaces because the paste is performed
2271         in an empty paragraph.
2272         Smart replace spaces are added to the text of options inside
2273         the select element instead of before/after the select element.
2274         
2275         This patch fixes the second two problems.  During a 
2276         ReplaceSelectionCommand, the VisiblePosition for the end of 
2277         the inserted content is the last position in the last leaf 
2278         inserted.  This is a problem when the last leaf is inside a 
2279         select element, since VP creation is inconsistent there.  
2280         Second, smart spaces were inserted inside the last leaf, not
2281         at the endOfInsertedContent.
2282
2283         * editing/ReplaceSelectionCommand.cpp:
2284         (WebCore::ReplaceSelectionCommand::shouldMergeStart): Renamed 
2285         m_lastNodeInserted to m_lastLeafInserted.  Use the 
2286         start/endOfInsertedContent getters.
2287         (WebCore::ReplaceSelectionCommand::shouldMergeEnd): Ditto.
2288         (WebCore::ReplaceSelectionCommand::removeNodePreservingChildren): Ditto.
2289         (WebCore::ReplaceSelectionCommand::removeRedundantStyles): Ditto.
2290         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent): Added.
2291         Special case for when the last leaf inserted is inside a select 
2292         element: return the VisiblePosition after the select element.
2293         (WebCore::ReplaceSelectionCommand::positionAtStartOfInsertedContent): Added.
2294         (WebCore::ReplaceSelectionCommand::doApply): Did renaming.  Used
2295         the start/endOfInsertedContent getters.  Insert smart replace spaces
2296         into the right nodes.
2297         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renaming.
2298         (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
2299         (WebCore::ReplaceSelectionCommand::updateNodesInserted): Ditto.
2300         * editing/ReplaceSelectionCommand.h:
2301
2302 2007-01-22  Darin Adler  <darin@apple.com>
2303
2304         Reviewed by Adam.
2305
2306         - fix http://bugs.webkit.org/show_bug.cgi?id=12273
2307           REGRESSION: File input value invisible after removing and re-appending
2308
2309         - made more of the file chooser code cross-platform
2310
2311         - fixed an Objective-C garbage collection problem in FileChooser
2312
2313         - tried to remove layering violations where FileChooser in the platform
2314           directory knows about the rendering and DOM trees (but wasn't able to
2315           do it entirely)
2316
2317         * platform/FileChooser.cpp: Added.
2318         (WebCore::FileChooser::create): Changed parameters.
2319         (WebCore::FileChooser::chooseFile): Changed to call chooseIcon function.
2320         (WebCore::FileChooser::chooseIcon): Added.
2321
2322         * platform/FileChooser.h: Added FileChooserClient so this file doesn't have
2323         to know about RenderFileUploadControl. Used RetainPtr instead of retain/release
2324         so this works properly with Objective-C GC. Replaced disconnectUploadControl
2325         with disconnectClient, which has a simple inline implementation. Moved the
2326         Document parameter from the constructor to openFileChooser, along with a comment
2327         about why it should not be there. Added a filename parameter to the constructor
2328         for the initial filename. Added a font parameter to basenameForWidth so we don't
2329         depend on having a pointer to the renderer. Removed the uploadControl() and
2330         document() functions since no one calls either of them.
2331
2332         * platform/mac/FileChooserMac.mm: Removed code that is now cross-platform.
2333         (-[OpenPanelController beginSheetWithFrame:]): Added frame parameter, instead
2334         of storing a document pointer in the FileChooser.
2335         (WebCore::FileChooser::FileChooser): Updated for changed parameters. Also added
2336         code to choose the icon based on the initial filename. Pass the adopt parameter
2337         to the constructor of the RetainPtr.
2338         (WebCore::FileChooser::~FileChooser): Removed the release call, since the
2339         RetainPtr will take care of it. Added a call to disconnectFileChooser here.
2340         There's no need to disconnect at disconnectClient time, and that lets us have
2341         one more cross-platform function.
2342         (WebCore::FileChooser::openFileChooser): Added document parameter. Added code
2343         to get the frame from the document. And added a nil check since there's no
2344         ironclad guarantee the document won't have outlived its frame.
2345         (WebCore::FileChooser::basenameForWidth): Added font parameter. Use that instead
2346         of going at the upload control's style. The caller can handle that now.
2347
2348         * rendering/RenderFileUploadControl.h: Removed unnecessary includes.
2349         Made class inherit privately from FileChooserClient. Changed constructor
2350         parameter to HTMLInputElement rather than Node. Made protected members be
2351         private instead, and made a couple function members const.
2352         * rendering/RenderFileUploadControl.cpp: Moved constants to the top of the file,
2353         but after the "using namespace"
2354         (WebCore::RenderFileUploadControl::RenderFileUploadControl): Updated for changes
2355         to the FileChooser::create function and the parameter types.
2356         (WebCore::RenderFileUploadControl::~RenderFileUploadControl): Removed unneeded
2357         null check -- there's no case where the FileChooser fails to be created.
2358         (WebCore::RenderFileUploadControl::click): Pass document to openFileChooser.
2359         (WebCore::RenderFileUploadControl::updateFromElement): Tweaked code a bit by
2360         using updateFromElement and setValue instead of casting the renderer to a
2361         RenderButton and calling setText directly. Put setInputType call here.
2362         (WebCore::RenderFileUploadControl::maxFilenameWidth): Made const. Broke long line.
2363         (WebCore::RenderFileUploadControl::createButtonStyle): Made const.
2364         (WebCore::RenderFileUploadControl::paintObject): Moved buttonShadowHeight constant
2365         to the top of the file. Call isEmpty instead of checking width and height of
2366         IntRect for 0. Computed font to pass to FileChooser::basenameForWidth. Broke
2367         long lines.
2368         (WebCore::HTMLFileUploadInnerButtonElement::HTMLFileUploadInnerButtonElement):
2369         Moved the setInputType call to the caller; concept here is that this class is
2370         as simple as possible, rather than doing as much of the button job as possible.
2371
2372         * WebCore.xcodeproj/project.pbxproj: Added FileChooser.cpp.
2373         * WebCore.pro: Ditto.
2374         * CMakeLists.txt: Ditto.
2375         * WebCoreSources.bkl: Ditto.
2376
2377         * platform/gdk/TemporaryLinkStubs.cpp: Updated stubs.
2378         * platform/qt/FileChooserQt.cpp: Updated stubs.
2379
2380 2007-01-22  Mitz Pettel  <mitz@webkit.org>
2381
2382         Reviewed by Darin.
2383
2384         - fix http://bugs.webkit.org/show_bug.cgi?id=12364
2385           REGRESSSION (NativeListBox): Selected option's background is not clipped to the list box
2386
2387         Test: fast/forms/select-item-background-clip.html
2388
2389         * rendering/RenderListBox.cpp:
2390         (WebCore::RenderListBox::paintItemBackground): Intersect the item's rect with
2391         the list box's clip rect.
2392
2393 2007-01-22  Darin Adler  <darin@apple.com>
2394
2395         Reviewed by Beth.
2396
2397         - fix http://bugs.webkit.org/show_bug.cgi?id=12369
2398           REGRESSION (r19027): amazon.com home page crashes WebKit r19028 debug build
2399
2400         I caused this a few hours ago. Oops!
2401
2402         * rendering/RenderText.cpp: (WebCore::RenderText::setStyle):
2403         Compute whether the font changed before calling RenderObject::setStyle.
2404
2405 2007-01-22  Beth Dakin  <bdakin@apple.com>
2406
2407         Reviewed by Maciej.
2408
2409         Fix for <rdar://problem/4912129> REGRESSION: Crash occurs at 
2410         WebCore::Frame::eventHandler() after clicking to dismiss a 
2411         contextual menu on the page
2412
2413         * page/EventHandler.cpp:
2414         (WebCore::EventHandler::stopAutoscrollTimer): Added nil-check.
2415
2416 2007-01-22  Darin Adler  <darin@apple.com>
2417
2418         Reviewed by Mitz.
2419
2420         Inspired by a much simpler patch by Andrew Wellington <proton@wiretapped.net>.
2421
2422         - fix http://bugs.webkit.org/show_bug.cgi?id=11197
2423           REGRESSION: Specifying a counter for a CODE tag's content style property
2424           on before or after causes a crash.
2425
2426         Test: fast/css/beforeSelectorOnCodeElement.html
2427
2428         - fix regression I recently introduced where the monospace cache could be
2429           used for text that was not ASCII, if text was changed after the style was set
2430
2431         Test: fast/text/monospace-width-cache.html
2432
2433         - streamline RenderText.h -- remove unneeded functions, make some needlessly
2434           virtual functions non-virtual, remove unneeded header includes, replace use
2435           of Font* with Font& for consistency with RenderStyle, use "text" consistently
2436           instead of "string"
2437
2438         * rendering/RenderText.h: Removed unneeded include of "Text.h", declarations of
2439         SOFT_HYPHEN, DocumentMarker, InlineBox, Position, String. Got rid of friend
2440         declaration for InlineTextBox. Changed constructor to take a PassRefPtr since
2441         we do take owership of the passed-in text. Made deleteTextBoxes() private.
2442         Removed unneeded data(). Made override of length() private so people will use
2443         the faster textLength() instead. Renamed string() to text() so it matches up
2444         better with setText(). Same for stringLength(), originalString(), and
2445         setInternalString(), which are now textLength(), originalText(), and
2446         setTextInternal(). Renamed the old text() function to characters(), since it
2447         returns a pointer as StringImpl::characters does. Changed Font* to Font& everywhere.
2448         Renamed the internal calcMinMaxWidth() function to calcMinMaxWidthInternal() and
2449         made it non-virtual since it's not overriden anywhere. Also made the
2450         trimmedMinMaxWidth() function non-virtual. Made containsOnlyWhitespace() private.
2451         Removed both font() functions (one was needlessly virtual) and element().
2452         Renamed cacheWidths() to updateMonospaceCharacterWidth() and removed the
2453         shouldUseMonospaceCache() function. Renamed allAscii() to isAllASCII() and made
2454         it an inline function. Removed the m_allAsciiChecked flag and renamed the
2455         m_allAscii flag to m_isAllASCII.
2456         * rendering/RenderText.cpp:
2457         (WebCore::RenderText::RenderText): Removed initialization of m_allAsciiChecked.
2458         Initialize m_isAllASCII. Changed all occurrences of m_str->length() and
2459         m_str->characters () to use the stringLength() and characters() inline functions
2460         instead.
2461         (WebCore::RenderText::setStyle): Replaced the unconditional call to cacheWidths
2462         with a conditional call to updateMonospaceCharacterWidth. This speeds up the common
2463         case where style is changed without changing the font.
2464         (WebCore::RenderText::originalText): Changed code to not depend on overridden
2465         element() function with casts to a Text node -- this was one of only two call sites.
2466         Also renamed.
2467         (WebCore::RenderText::positionForCoordinates): Name change.
2468         (WebCore::RenderText::caretRect): Ditto.
2469         (WebCore::RenderText::updateMonospaceCharacterWidth): Renamed from cacheWidths and
2470         incorporate the check that was formerly in a separate shouldUseMonospaceCache
2471         function.
2472         (WebCore::RenderText::widthFromCache): Changed to take a Font& instead of Font*.
2473         Changed to take advantage of the fact that the string is known to be all ASCII in
2474         the m_monospaceCharacterWidth code path.
2475         (WebCore::RenderText::trimmedMinMaxWidth): Ditto. Also use style()->font() instead
2476         of font(false).
2477         (WebCore::RenderText::calcMinMaxWidth): Ditto. Also changed to use softHyphen instead
2478         of SOFT_HYPHEN.
2479         (WebCore::RenderText::containsOnlyWhitespace): More of the same.
2480         (WebCore::RenderText::setSelectionState): Ditto.
2481         (WebCore::RenderText::setTextWithOffset): Ditto.
2482         (WebCore::isInlineFlowOrEmptyText): Ditto.
2483         (WebCore::RenderText::setTextInternal): Updated for name changes. Also changed to
2484         set the m_isAllASCII flag every time, in the more-efficient way we use elsewhere
2485         (or'ing all the characters together), and to call updateMonospaceCharacterWidth
2486         if the "all ASCII"-ness of the text changes.
2487         (WebCore::RenderText::setText): Updated for name changes.
2488         (WebCore::RenderText::width): More like above.
2489         (WebCore::RenderText::selectionRect): Ditto.
2490         (WebCore::RenderText::caretMaxOffset): Ditto.
2491         (WebCore::RenderText::previousOffset): Ditto.
2492         (WebCore::RenderText::nextOffset): Ditto.
2493
2494         * dom/Position.cpp:
2495         * dom/Range.cpp:
2496         * editing/CompositeEditCommand.cpp:
2497         * editing/DeleteSelectionCommand.cpp:
2498         * editing/VisiblePosition.cpp:
2499         * html/HTMLElement.cpp:
2500         Added now-needed include of "Text.h" which is no longer included by "RenderText.h".
2501
2502         * editing/SelectionController.cpp:
2503         (WebCore::SelectionController::debugRenderer):
2504         * editing/TextIterator.cpp:
2505         (WebCore::TextIterator::handleTextNode):
2506         (WebCore::TextIterator::handleTextBox):
2507         (WebCore::SimplifiedBackwardsTextIterator::handleTextNode):
2508         Update for name changes of stringLength(), string(), and originalString() to
2509         textLength(), text(), and originalText(), and to always use textLength() instead
2510         of length() when we have a RenderText* rather than a RenderObject*.
2511         * editing/visible_units.cpp:
2512         (WebCore::startOfParagraph): Ditto.
2513         (WebCore::endOfParagraph): Ditto.
2514         * rendering/InlineFlowBox.cpp:
2515         (WebCore::InlineFlowBox::placeBoxesHorizontally): Ditto. Also removed use of the
2516         RenderObject::font() function and replaced it with explicit access to the style.
2517         (WebCore::InlineFlowBox::placeBoxesVertically): Ditto.
2518         * rendering/InlineTextBox.cpp:
2519         (WebCore::InlineTextBox::selectionRect): Ditto.
2520         (WebCore::InlineTextBox::isLineBreak): Ditto.
2521         (WebCore::InlineTextBox::paint): Ditto.
2522         (WebCore::InlineTextBox::selectionStartEnd): Ditto.
2523         (WebCore::InlineTextBox::paintSelection): Ditto.
2524         (WebCore::InlineTextBox::paintMarkedTextBackground): Ditto.
2525         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker): Ditto.
2526         (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
2527         (WebCore::InlineTextBox::offsetForPosition): Ditto.
2528         (WebCore::InlineTextBox::positionForOffset): Ditto.
2529         * rendering/RenderContainer.cpp:
2530         (WebCore::RenderContainer::addChild): Ditto.
2531         * rendering/RenderCounter.cpp:
2532         (WebCore::RenderCounter::originalText): Ditto.
2533         (WebCore::RenderCounter::calcMinMaxWidth): Ditto.
2534         * rendering/RenderCounter.h: Ditto.
2535         * rendering/RenderTextFragment.cpp:
2536         (WebCore::RenderTextFragment::originalText): Ditto.
2537         * rendering/RenderTextFragment.h: Ditto.
2538         * rendering/SVGInlineFlowBox.cpp:
2539         (WebCore::placePositionedBoxesHorizontally): Ditto.
2540         (WebCore::placeBoxesVerticallyWithAbsBaseline): Ditto.
2541         * rendering/bidi.cpp:
2542         (WebCore::BidiIterator::increment): Ditto.
2543         (WebCore::BidiIterator::current): Ditto.
2544         (WebCore::BidiIterator::direction): Ditto.
2545         (WebCore::addRun): Ditto.
2546         (WebCore::checkMidpoints): Ditto.
2547         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Ditto.
2548         (WebCore::RenderBlock::skipWhitespace): Ditto.
2549         (WebCore::RenderBlock::findNextLineBreak): Ditto.
2550
2551         * rendering/RenderBR.h: Updated signature of width function which now takes a
2552         Font& instead of a Font*.
2553
2554         * rendering/RenderBlock.cpp: (WebCore::stripTrailingSpace): Updated to no longer
2555         use the RenderObject::font() function, and added a comment about first-line, which
2556         is not handled properly here.
2557
2558         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::text):
2559         * rendering/RenderTreeAsText.cpp: (WebCore::writeTextRun):
2560         Eliminated use of RenderText::data().
2561
2562         * rendering/RenderObject.h: Removed RenderObject::font(). This had the bad effect of
2563         having everyone pass in a boolean rather than using the cleaner style() and
2564         firstLineStyle() functions in cases where there's no a firstLineStyle boolean.
2565         * rendering/RenderObject.cpp:
2566         (WebCore::RenderObject::getVerticalPosition): Replaced use of RenderObject::font()
2567         with direct use of the style instead, which is arguably easier to understand anyway.
2568         (WebCore::RenderObject::baselinePosition): Ditto.
2569
2570 2007-01-22  Sam Weinig  <sam@webkit.org>
2571
2572         Reviewed by The Mitz.
2573
2574         Move JSHTMLSelectElementCustom.cpp from bindings to bindings/js
2575         where it belongs.
2576
2577         * WebCore.pro:
2578         * WebCore.xcodeproj/project.pbxproj:
2579         * bindings/JSHTMLSelectElementCustom.cpp: Removed.
2580         * bindings/js/JSHTMLSelectElementCustom.cpp: Added.
2581
2582 2007-01-22  Zack Rusin  <zack@kde.org>
2583
2584         Fix the Qt build.
2585
2586         * WebCore.pro: adjust after last changes
2587
2588 2007-01-21  Alexey Proskuryakov  <ap@webkit.org>
2589
2590         Reviewed by Darin.
2591
2592         http://bugs.webkit.org/show_bug.cgi?id=10934
2593         REGRESSION: prototype.js logs error (HTMLFormElement) on webkit builds
2594
2595         Added constructors for most HTML elements; started auto-generating HTMLSelectElement JS binding.
2596
2597         Test: fast/dom/Window/element-constructors-on-window.html
2598
2599         * DerivedSources.make: Generate JSHTMLSelectElement.
2600         * WebCore.xcodeproj/project.pbxproj: Added JSHTMLSelectElement{Custom}.
2601         * bindings/js/JSHTMLElementWrapperFactory.cpp: Create a proper binding for SELECT.
2602
2603         * bindings/js/kjs_html.cpp:
2604         (KJS::):
2605         (KJS::JSHTMLElement::classInfo):
2606         (KJS::JSHTMLElement::accessors):
2607         (KJS::JSHTMLElement::getOwnPropertySlot):
2608         (KJS::HTMLElementFunction::callAsFunction):
2609         (KJS::JSHTMLElement::put):
2610         * bindings/js/kjs_html.h:
2611         (KJS::JSHTMLElement::):
2612         Removed everything related to SELECT. Renamed getHTMLOptionsCollection to toJS for autogenerated code 
2613         to be happy, and rewrote it using cacheDOMObject.
2614
2615         * bindings/scripts/CodeGeneratorJS.pm: Added HTMLElement to the list of types that cannot fail conversion.
2616
2617         * html/HTMLAnchorElement.idl:
2618         * html/HTMLAppletElement.idl:
2619         * html/HTMLAreaElement.idl:
2620         * html/HTMLBRElement.idl:
2621         * html/HTMLBaseElement.idl:
2622         * html/HTMLBaseFontElement.idl:
2623         * html/HTMLBodyElement.idl:
2624         * html/HTMLButtonElement.idl:
2625         * html/HTMLCanvasElement.idl:
2626         * html/HTMLDListElement.idl:
2627         * html/HTMLDirectoryElement.idl:
2628         * html/HTMLDivElement.idl:
2629         * html/HTMLFieldSetElement.idl:
2630         * html/HTMLFontElement.idl:
2631         * html/HTMLFormElement.idl:
2632         * html/HTMLHRElement.idl:
2633         * html/HTMLHeadElement.idl:
2634         * html/HTMLHeadingElement.idl:
2635         * html/HTMLHtmlElement.idl:
2636         * html/HTMLImageElement.idl:
2637         * html/HTMLInputElement.idl:
2638         * html/HTMLIsIndexElement.idl:
2639         * html/HTMLLIElement.idl:
2640         * html/HTMLLabelElement.idl:
2641         * html/HTMLLegendElement.idl:
2642         * html/HTMLLinkElement.idl:
2643         * html/HTMLMapElement.idl:
2644         * html/HTMLMenuElement.idl:
2645         * html/HTMLMetaElement.idl:
2646         * html/HTMLModElement.idl:
2647         * html/HTMLOListElement.idl:
2648         * html/HTMLOptGroupElement.idl:
2649         * html/HTMLParagraphElement.idl:
2650         * html/HTMLParamElement.idl:
2651         * html/HTMLPreElement.idl:
2652         * html/HTMLQuoteElement.idl:
2653         * html/HTMLScriptElement.idl:
2654         * html/HTMLStyleElement.idl:
2655         * html/HTMLTextAreaElement.idl:
2656         * html/HTMLTitleElement.idl:
2657         * html/HTMLUListElement.idl:
2658         Generate constructors.
2659
2660         * html/HTMLSelectElement.cpp:
2661         (WebCore::HTMLSelectElement::length):
2662         * html/HTMLSelectElement.h:
2663         Make length() return unsigned for auto-generated code to be happy.
2664
2665         * html/HTMLSelectElement.idl: Adjusted to be usable for JS.
2666
2667         * bindings/JSHTMLSelectElementCustom.cpp: Added. Implements remove().
2668
2669         * page/DOMWindow.idl:
2670         Added properties for most elements' constructors.
2671
2672 2007-01-21  Mark Rowe  <mrowe@apple.com>
2673
2674         Reviewed by Maciej.
2675
2676         http://bugs.webkit.org/show_bug.cgi?id=12357
2677         Bug 12357: Reproducible crash in WebCore::Settings::isJavaScriptEnabled in svg/custom/js-update-bounce.svg under guard-malloc
2678
2679         * page/Frame.cpp:
2680         (WebCore::Frame::~Frame): Access the global object directly rather than via Window::retrieveWindow to prevent our reference to
2681         a deleted settings object being used.
2682
2683 2007-01-21  Darin Adler  <darin@apple.com>
2684
2685         Reviewed by Maciej.
2686
2687         - fix <rdar://problem/4930503> REGRESSION: Page changes title when
2688           command-clicking on named anchor link (12299)
2689
2690         * loader/FrameLoader.cpp:
2691         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2692         Return if shouldContinue is false. This matches the other similar
2693         functions and prevents us from doing extra work in the "ignore" case.
2694
2695 2007-01-21  Mark Rowe  <mrowe@apple.com>
2696
2697         Reviewed by Darin.
2698
2699         http://bugs.webkit.org/show_bug.cgi?id=12355
2700         Bug 12355: Reproducible crash in WebCore::parseNumber in svg/custom/js-update-bounce.svg under guard-malloc
2701
2702         * ksvg2/svg/SVGParserUtilities.cpp:
2703         (WebCore::parseNumber): Parenthesize to prevent reading past end of buffer.
2704
2705 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2706
2707         Reviewed by Darin.
2708
2709         - fix http://bugs.webkit.org/show_bug.cgi?id=12345
2710           REGRESSION: Disabled pop-up text is not grayed out
2711
2712         Test: fast/forms/select-disabled-appearance.html
2713
2714         * rendering/RenderThemeMac.mm:
2715         (WebCore::RenderThemeMac::adjustMenuListStyle):
2716
2717 2007-01-21  Darin Adler  <darin@apple.com>
2718
2719         - fix non-Mac builds
2720
2721         * CMakeLists.txt: Added JSDocumentCustom.cpp.
2722         * WebCore.pro: Ditto.
2723         * WebCoreSources.bkl: Ditto.
2724
2725 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2726
2727         Reviewed by Darin.
2728
2729         - fix http://bugs.webkit.org/show_bug.cgi?id=12353 <rdar://problem/4944599>
2730           REGRESSION: Crash on load (mutation event dispatch under the image element constructor deletes the element)
2731     
2732         Test: fast/dom/HTMLImageElement/constructor-mutation-event-dispatch.html
2733
2734         * bindings/js/kjs_html.cpp:
2735         (KJS::ImageConstructorImp::construct): Protect the image element before setting
2736         its attributes.
2737
2738 2007-01-21  Sam Weinig  <sam@webkit.org>
2739
2740         Rolling out patch for http://bugs.webkit.org/show_bug.cgi?id=8360.
2741
2742         * rendering/RenderLayer.cpp:
2743         (WebCore::RenderLayer::RenderLayer):
2744         (WebCore::RenderLayer::scrollToOffset):
2745         (WebCore::RenderLayer::scrollRectToVisible):
2746         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2747         (WebCore::Marquee::start):
2748         * rendering/RenderLayer.h:
2749
2750 2007-01-21  David Kilzer  <ddkilzer@webkit.org>
2751
2752         Reviewed by Darin.
2753
2754         - fix http://bugs.webkit.org/show_bug.cgi?id=12280
2755           select element not available by name through document.all
2756           (dropdown list not available on smarthome.com checkout)
2757
2758         Test: fast/dom/document-all-select.html
2759
2760         * html/HTMLCollection.cpp:
2761         (WebCore::HTMLCollection::checkForNameMatch):
2762         (WebCore::HTMLCollection::updateNameCache):
2763
2764 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2765
2766         Reviewed by Darin.
2767
2768         - http://bugs.webkit.org/show_bug.cgi?id=10805
2769           REGRESSION (r15720): manual-tests/onblur-remove.html failing
2770
2771         * manual-tests/onblur-remove.html: Changed the test to not require pressing
2772         Enter, since the correct behavior for Enter is to send a blur event.
2773
2774 2007-01-21  Sanjay Madhav  <sanjay12@gmail.com>
2775
2776         Reviewed by Darin.
2777
2778         Fix for: <rdar://problem/4928583> Memory usage grows when reloading google.com/ig
2779
2780         JSDocuments are now responsible for marking the DOM wrappers associated with them, when they get marked.
2781         This fixes a JS object leak when a DOM wrapper has a reference to a JSDocument that is otherwise not reachable.
2782
2783         Test: fast/dom/gc-10.html
2784
2785         * WebCore.vcproj/WebCore/WebCore.vcproj:
2786         * WebCore.xcodeproj/project.pbxproj:
2787         * bindings/js/JSDocumentCustom.cpp: Added.
2788         (WebCore::JSDocument::mark):
2789         * bindings/js/kjs_binding.cpp:
2790         (KJS::ScriptInterpreter::markDOMNodesForDocument):
2791         (KJS::ScriptInterpreter::mark):
2792         * bindings/js/kjs_binding.h:
2793         * dom/Document.idl:
2794
2795 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2796
2797         Reviewed by Darin.
2798
2799         - fix http://bugs.webkit.org/show_bug.cgi?id=10692
2800           REGRESSION (r14847): Unnecessary scrollbars with position:relative; and overflow:auto;
2801
2802         Test: fast/overflow/position-relative.html
2803
2804         * rendering/RenderBox.cpp:
2805         (WebCore::RenderBox::lowestPosition): Add the relative position offset only
2806         if 'includeSelf' is true.
2807         (WebCore::RenderBox::rightmostPosition): Ditto.
2808         (WebCore::RenderBox::leftmostPosition): Ditto.
2809         * rendering/RenderFlow.cpp:
2810         (WebCore::RenderFlow::lowestPosition): Ditto.
2811         (WebCore::RenderFlow::rightmostPosition): Ditto.
2812         (WebCore::RenderFlow::leftmostPosition): Ditto.
2813
2814 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2815
2816         Reviewed by Darin.
2817
2818         - fix http://bugs.webkit.org/show_bug.cgi?id=10472
2819           REGRESSION: "add" method of <select> object does not put the <option> object in the correct position
2820
2821         Test: fast/dom/HTMLSelectElement/options-collection-detached.html
2822
2823         * html/HTMLSelectElement.cpp:
2824         (WebCore::HTMLSelectElement::setRecalcListItems): Reset the options collection
2825         info if the <select> is not in the document. For in-document <select>s this
2826         happens anyway as a result of the DOM tree version increasing.
2827
2828 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2829
2830         Reviewed by Darin.
2831
2832         - fix http://bugs.webkit.org/show_bug.cgi?id=12349
2833           NativeFileUpload: Button text is not grayed out when the control is disabled
2834
2835         Covered by fast/forms/file-input-disabled.html 
2836
2837         * css/html4.css: Changed selectors that had pseudo-classes after the -webkit-file-upload-button
2838         pseudo-element to have the pseudo-element at the end. Pseudo-elements must be at the end.
2839         * rendering/RenderFileUploadControl.cpp:
2840         (WebCore::RenderFileUploadControl::createButtonStyle): Changed to not overwrite the button's
2841         style with its parent's style. getPseudoStyle() handles inheritance properly.
2842
2843 2007-01-21  Mitz Pettel  <mitz@webkit.org>
2844
2845         Reviewed by Darin.
2846
2847         - fix http://bugs.webkit.org/show_bug.cgi?id=12343
2848           crash in css2.1/t1202-counter-09-b.html
2849
2850         * platform/Font.cpp:
2851         (WebCore::Font::glyphDataForCharacter):
2852
2853 2007-01-21  Darin Adler  <darin@apple.com>
2854
2855         Reviewed by Adam and Mitz.
2856
2857         - fix http://bugs.webkit.org/show_bug.cgi?id=12347
2858           REGRESSION: list box scrolling broken (fast/forms/listbox-selection.html)
2859
2860         Covered by existing test: fast/forms/listbox-selection.html
2861
2862         * rendering/RenderListBox.h: Added override of layout(), made selectionChanged()
2863         no longer an inline. Added private scrollToRevealSelection(),
2864         m_scrollToRevealSelectionAfterLayout, and m_inAutoscroll.
2865         * rendering/RenderListBox.cpp:
2866         (WebCore::RenderListBox::RenderListBox): Initialize new data members.
2867         (WebCore::RenderListBox::updateFromElement): Remove scrolling code.
2868         (WebCore::RenderListBox::selectionChanged): Moved from header. Calls repaint
2869         and then scrollToRevealSelection, but if we need layout, instead schedules
2870         scrollToRevealSelection to be done after layout.
2871         (WebCore::RenderListBox::layout): Added. After calling base class, calls
2872         scrollToRevealSelection if the m_scrollToRevealSelectionAfterLayout is set.
2873         (WebCore::RenderListBox::scrollToRevealSelection): Added. Code was originally
2874         in updateFromElement.
2875         (WebCore::RenderListBox::autoscroll): Set m_inAutoscroll so that the
2876         selectionChanged function knows not to scroll. Also removed the repaint()
2877         here because updateListBoxSelection() takes care of repainting by calling
2878         selectionChanged().
2879
2880 2007-01-21  David Kilzer  <ddkilzer@webkit.org>
2881
2882         * page/EventHandler.cpp:
2883         (WebCore::EventHandler::handleMouseMoveEvent): Changed #if SVG_SUPPORT to #ifdef SVG_SUPPORT.
2884
2885 2007-01-20  Mitz Pettel  <mitz@webkit.org>
2886
2887         Reviewed by Maciej.
2888
2889         - fix http://bugs.webkit.org/show_bug.cgi?id=11115
2890           REGRESSION: Crash on Flickr after hitting cancel from adding a note
2891
2892         Test: fast/forms/text-set-value-crash.html
2893
2894         * html/HTMLInputElement.cpp:
2895         (WebCore::HTMLInputElement::setValue): Added a call to Document::updateRendering().
2896         * html/HTMLTextAreaElement.cpp:
2897         (WebCore::HTMLTextAreaElement::setValue): Ditto.
2898
2899 2007-01-20  Mitz Pettel  <mitz@webkit.org>
2900
2901         Reviewed by Darin.
2902
2903         - fix http://bugs.webkit.org/show_bug.cgi?id=8360
2904           Repro crash when onscroll handler deletes the scrolled object
2905
2906         Test: fast/layers/removed-by-scroll-handler.html
2907
2908         * rendering/RenderLayer.cpp:
2909         (WebCore::RenderLayer::RenderLayer):
2910         (WebCore::RenderLayer::dispatchScrollEvent): Added. Called when the timer
2911         fires and dispatches the scroll event to the layer's element.
2912         (WebCore::RenderLayer::scrollToOffset): Instead of dispatching the scroll
2913         event from this function, which is called during layout, schedule a 0-duration
2914         timer to dispatch the event after layout.
2915         (WebCore::RenderLayer::scrollRectToVisible):
2916         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
2917         (WebCore::Marquee::start):
2918         * rendering/RenderLayer.h:
2919
2920 2007-01-20  Nikolas Zimmermann  <zimmermann@kde.org>
2921
2922         Reviewed by Sam.
2923
2924         Fix JS bindings for SVGAnimated{Boolean, Enumeration, Integer, Number, String}.
2925
2926         Dynamic SVG DOM updates (ie. "someUse.href.baseVal = '#rect'") with these types
2927         didn't work. Existing gradient updating examples relied on calling setAttribute
2928         after a SVG DOM update - that was the only reason it worked, added a new test
2929         only using SVG DOM updates (js-update-stop.svg).
2930
2931         Added test: js-update-stop.svg
2932         Added test: use-property-changes-through-dom.svg (change xlink:href, x/y attributes using setAttribute)
2933         Added test: use-property-changes-through-svg-dom.svg (change xlink:href, x/y attributes using SVG DOM)
2934
2935         * bindings/js/JSSVGPODTypeWrapper.h:
2936         (WebCore::JSSVGPODTypeWrapper::commitChange):
2937         (WebCore::JSSVGPODTypeWrapperCreator::commitChange):
2938         (WebCore::JSSVGPODTypeWrapperCreatorForList::commitChange):
2939         * bindings/js/JSSVGPathSegListCustom.cpp:
2940         (WebCore::updatePathSegContextMap):
2941         (WebCore::removeFromPathSegContextMap):
2942         * bindings/scripts/CodeGeneratorJS.pm:
2943         * ksvg2/misc/SVGDocumentExtensions.h:
2944         (WebCore::SVGDocumentExtensions::baseValueMap):
2945         (WebCore::SVGDocumentExtensions::genericContextMap):
2946         (WebCore::SVGDocumentExtensions::baseValue):
2947         (WebCore::SVGDocumentExtensions::setBaseValue):
2948         (WebCore::SVGDocumentExtensions::removeBaseValue):
2949         (WebCore::SVGDocumentExtensions::hasBaseValue):
2950         (WebCore::SVGDocumentExtensions::genericContext):
2951         (WebCore::SVGDocumentExtensions::setGenericContext):
2952         (WebCore::SVGDocumentExtensions::removeGenericContext):
2953         (WebCore::SVGDocumentExtensions::hasGenericContext):
2954         (WebCore::String):
2955         (WebCore::FloatRect):
2956         (WebCore::bool):
2957         (WebCore::double):
2958         * ksvg2/svg/SVGClipPathElement.h:
2959         * ksvg2/svg/SVGElement.h:
2960         (WebCore::SVGElement::notifyAttributeChange):
2961         * ksvg2/svg/SVGPathSegList.cpp:
2962         (WebCore::SVGPathSegList::SVGPathSegList):
2963         (WebCore::SVGPathSegList::context):
2964         * ksvg2/svg/SVGPathSegList.h:
2965         * ksvg2/svg/SVGPatternElement.h:
2966         * ksvg2/svg/SVGPointList.cpp:
2967         (SVGPointList::SVGPointList):
2968         (SVGPointList::context):
2969         * ksvg2/svg/SVGPointList.h:
2970         * ksvg2/svg/SVGStopElement.cpp:
2971         (WebCore::SVGStopElement::parseMappedAttribute):
2972         (WebCore::SVGStopElement::notifyAttributeChange):
2973         * ksvg2/svg/SVGStopElement.h:
2974         * ksvg2/svg/SVGUseElement.cpp:
2975         (WebCore::SVGUseElement::notifyAttributeChange):
2976
2977 2007-01-20  Rob Buis  <buis@kde.org>
2978
2979         Reviewed by Sam.
2980
2981         http://bugs.webkit.org/show_bug.cgi?id=12334
2982         Respect <text> boundaries for svg text selecting
2983
2984         Make sure the text selection for svg stays inside
2985         containing blocks.
2986         Added one manual test since html selection does not
2987         seem to work for SVG and selectSubString for SVG
2988         is not implemented yet.
2989
2990         * manual-tests/svg-text-selection.svg: Added.
2991         * page/EventHandler.cpp:
2992         (WebCore::EventHandler::handleMouseMoveEvent):
2993         * rendering/RenderObject.h:
2994         (WebCore::RenderObject::isSVGText):
2995         * rendering/RenderSVGInlineText.h:
2996         (WebCore::RenderSVGInlineText::isSVGText):
2997         * rendering/RenderSVGText.h:
2998         (WebCore::RenderSVGText::isSVGText):
2999
3000 2007-01-19  Adele Peterson  <adele@apple.com>
3001
3002         Reviewed by Hyatt.
3003
3004         Fix for: <rdar://problem/4697438> REGRESSION: select menu lists match the wrong css rule on www.chainreaction.com
3005
3006         Update the size attribute value for select elements to match the numeric value.  This is a special case since this
3007         attribute is used to determine which control to use.  We want to make sure that the size attribute is valid when we match
3008         CSS rules.
3009
3010         Test: fast/forms/select-size.html
3011
3012         * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::parseMappedAttribute): If the attribute string value is not the
3013           same as its integer value, then update the attribute value to match the integer.
3014         * dom/Attribute.h: Made setValue and setPrefix public.
3015
3016 2007-01-19  John Sullivan  <sullivan@apple.com>
3017
3018         Reviewed by Darin
3019
3020         - WebCore part of fix for: <rdar://problem/4451715> REGRESSION: On some sites, have to 
3021           type a character before username/password autofill kicks in
3022
3023         * loader/FrameLoaderClient.h:
3024         new dispatchDidFinishDocumentLoad call
3025
3026         * loader/FrameLoader.cpp:
3027         (WebCore::FrameLoader::finishedParsing):
3028         call dispatchDidFinishDocumentLoad
3029         
3030         * platform/graphics/svg/SVGImageEmptyClients.h:
3031         (WebCore::SVGEmptyFrameLoaderClient::dispatchDidFinishDocumentLoad):
3032         empty implementation for dispatchDidFinishDocumentLoad
3033
3034 2007-01-19  Adele Peterson  <adele@apple.com>
3035
3036         Reviewed by Hyatt.
3037
3038         Fix for <rdar://problem/4760280> REGRESSION: Bottom portion of text hangs off edge of SELECT element at http://macreviewzone.com/index.php
3039         
3040         Test: fast/forms/control-restrict-line-height.html
3041
3042         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize): Don't honor line-height for controls that
3043           have restricted font size.
3044
3045 2007-01-19  Darin Adler  <darin@apple.com>
3046
3047         Reviewed by Adele.
3048
3049         - fix http://bugs.webkit.org/show_bug.cgi?id=11999
3050           <rdar://problem/4940442> REGRESSION: Incomplete listing in TVListings window (11999)
3051           Fix was to use the actual size of the renderer in the RenderListBox
3052           case, instead of always using the size specified by the select element.
3053
3054         Test: fast/forms/select-list-box-with-height.html
3055
3056         - fix http://bugs.webkit.org/show_bug.cgi?id=11995
3057           <rdar://problem/4901834> REGRESSION(NativeListBox): Focus is not placed on
3058           SELECT after mousing down on OPTION
3059
3060         Test: fast/forms/select-list-box-mouse-focus.html
3061
3062         - fix bug where auto-scrolling was not working in list box select elements
3063
3064         No test yet.
3065
3066         - fix a missing semicolon in the radio/checkbox section of html4.css
3067
3068         Test: fast/forms/radio-no-theme-padding.html
3069
3070         - fix bug where the scroll bars for select elements were pixel-type scroll
3071           bars even though the scrolling is line at a time scrolling
3072
3073         No test.
3074
3075         * html/HTMLSelectElement.cpp:
3076         (WebCore::HTMLSelectElement::selectAll): Removed an explicit call
3077         to repaint, since the RenderListBox now does that in selectionChanged.
3078         (WebCore::HTMLSelectElement::notifyOptionSelected): Call the new
3079         selectionChanged instead of the old setSelectionChanged.
3080         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Added a call
3081         to focus. Removed an explicit call to repaint and added a call to the
3082         new setMouseDownMayStartAutoscroll function in EventHandler. Removed an
3083         explicit call to repaint as above.
3084         (WebCore::HTMLSelectElement::updateListBoxSelection): Call the new
3085         selectionChanged instead of the old setSelectionChanged.
3086
3087         * page/EventHandler.h: Added setMouseDownMayStartAutoscroll, needed
3088         because the existing code to set that flag won't get triggered when
3089         the select element's default event handler handles the event.
3090
3091         * rendering/RenderListBox.h: Made ScrollbarClient a private base class.
3092         Removed setSelectionChanged and m_selectionChanged. Added selectionChanged,
3093         which is really just a synonym for repaint for now. Moved valueChanged,
3094         the ScrollbarClient function implementations, and itemHeight into the
3095         private part of the class. Added numVisibleItems() and listHeight() to
3096         the private section. Changed m_vBar to be a RefPtr.
3097
3098         * rendering/RenderListBox.cpp: Removed unneeded includes. Moved all
3099         the constants to the top of the file.
3100         (WebCore::RenderListBox::RenderListBox): Removed initialization of
3101         m_selectionChanged because it was removed and of m_vBar because it's
3102         now a RefPtr which is automaticall initialized.
3103         (WebCore::RenderListBox::~RenderListBox): Removed the explicit deref of
3104         m_vBar because it's a RefPtr. Added null checking for FrameView.
3105         (WebCore::RenderListBox::updateFromElement): Use numItems().
3106         (WebCore::RenderListBox::calcMinMaxWidth): Added null checking for
3107         FrameView and used RefPtr for the newly-created scroll bar.
3108         (WebCore::RenderListBox::size): Tweaked formatting. Also renamed the
3109         misleading minDefaultSize to maxDefaultSize, since it's a maximum.
3110         (WebCore::RenderListBox::numVisibleItems): Added. Used in many places
3111         where size() was used before. This computes the number of rows we have
3112         room for. We don't need a row space after the last row, and this takes
3113         that into account.
3114         (WebCore::RenderListBox::numItems): Tweaked to remove the local variable.
3115         (WebCore::RenderListBox::listHeight): Added. Total height of all the rows
3116         and spaces between them.
3117         (WebCore::RenderListBox::calcHeight): Changed to call itemHeight for the
3118         row height, and to subtract the last row spacing off since we don't need
3119         a space after the last row. Changed the scroll bar setup to make it
3120         correspond to row numbers, not pixel numbers.
3121         (WebCore::RenderListBox::baselinePosition): Moved the comment to the
3122         constant declaration at the top of the file.
3123         (WebCore::RenderListBox::itemBoundingBoxRect): Simplified by using
3124         the itemHeight() function.
3125         (WebCore::RenderListBox::paintObject): Changed to use numItems and
3126         to use numVisibleItems instead of size.
3127         (WebCore::RenderListBox::isPointInScrollbar): Added get() call since
3128         m_vBar is now a RefPtr.
3129         (WebCore::RenderListBox::listIndexAtOffset): Changed to use numItems(),
3130         itemHeight(), and rearranged a min/max combo so it starts with the low,
3131         then the value, then the high value for pinning.
3132         (WebCore::RenderListBox::autoscroll): Use numVisibleItems() instead of
3133         size().
3134         (WebCore::RenderListBox::stopAutoscroll): Removed an unneeded nil check
3135         of the element.
3136         (WebCore::RenderListBox::scrollToRevealElementAtListIndex): Changed
3137         to use numItems() and to use numVisibleItems() instead of size().
3138         Also changed scroll bar code to work more simply now that the scroll
3139         bar is row-based.
3140         (WebCore::RenderListBox::listIndexIsVisible): Changed to use
3141         numVisibleItems() instead of size().
3142         (WebCore::RenderListBox::valueChanged): Simplified since the scrollbar
3143         is now row-based. Also removed an unnecessary null check.
3144         (WebCore::RenderListBox::itemHeight): Updated for name change from
3145         optionsSpacingMiddle to rowSpacing.
3146         (WebCore::RenderListBox::scrollHeight): Changed to use listHeight().
3147         (WebCore::RenderListBox::setScrollTop): Simplified, and removed the code
3148         that does nothing if the computed list index is visible (which did not
3149         make sense for this function and seemed a cut and paste error from the
3150         scrollToReveal function). The scrollbar part is simpler now that it's
3151         row-based.
3152         (WebCore::RenderListBox::windowClipRect): Changed to use document()->view()
3153         so we don't have to include RenderView.h.
3154
3155         * css/html4.css: Added a semicolon I noticed was missing.
3156
3157 2007-01-19  Beth Dakin  <bdakin@apple.com>
3158
3159         Reviewed by Maciej and Darin.
3160
3161         Fix for <rdar://problem/4702420> REGRESSION: Null characters need 
3162         to be stripped from text nodes (townhall.com)
3163
3164         This was a regression from the fix for <rdar://problem/3727939>
3165         Safari strips \0 characters from HTML tags making them valid, which
3166         was fixed with r12652. We still need to strip null characters in
3167         text nodes.
3168
3169         * html/HTMLTokenizer.cpp:
3170         (WebCore::HTMLTokenizer::write): No behavior change here, this is
3171         just to make Darin happy.
3172         (WebCore::HTMLTokenizer::processToken): Call into StringImpl's new 
3173         createStrippingNull function instead of the normal StringImpl 
3174         constructor.
3175         * platform/StringImpl.cpp:
3176         (WebCore::StringImpl::createStrippingNull): Strip null.
3177         * platform/StringImpl.h:
3178
3179 2007-01-19  David Kilzer  <ddkilzer@webkit.org>
3180
3181         Reviewed by NOBODY (no-svg build fix).
3182
3183         * ksvg2/svg/SVGMPathElement.cpp: Added #ifdef SVG_SUPPORT/#endif guards.
3184
3185 2007-01-19  Anders Carlsson  <acarlsson@apple.com>
3186         
3187         Build fix.
3188         
3189         * platform/graphics/svg/SVGImageEmptyClients.h:
3190         (WebCore::SVGEmptyChromeClient::setStatusbarText):
3191
3192 2007-01-18  Anders Carlsson  <acarlsson@apple.com>
3193
3194         Reviewed by Adam.
3195
3196         Move JavaScript alert and status bar functions to the chrome.
3197         
3198         * bindings/js/kjs_window.cpp:
3199         (KJS::WindowFunc::callAsFunction):
3200         * page/Chrome.cpp:
3201         (WebCore::Chrome::runJavaScriptAlert):
3202         (WebCore::Chrome::runJavaScriptConfirm):
3203         (WebCore::Chrome::runJavaScriptPrompt):
3204         (WebCore::Chrome::setStatusBarText):
3205         * page/Chrome.h:
3206         * page/ChromeClient.h:
3207         * page/Frame.cpp:
3208         (WebCore::Frame::setJSStatusBarText):
3209         (WebCore::Frame::setJSDefaultStatusBarText):
3210         * page/Frame.h:
3211         * page/mac/FrameMac.h:
3212         * page/mac/FrameMac.mm:
3213         * page/mac/WebCoreFrameBridge.h:
3214         * platform/graphics/svg/SVGImageEmptyClients.h:
3215         (WebCore::SVGEmptyChromeClient::runJavaScriptAlert):
3216         (WebCore::SVGEmptyChromeClient::runJavaScriptConfirm):
3217         (WebCore::SVGEmptyChromeClient::runJavaScriptPrompt):
3218         (WebCore::SVGEmptyChromeClient::setStatusBarText):
3219
3220 2007-01-19  Zack Rusin  <zack@kde.org>
3221
3222         Fix the build.
3223
3224         * WebCore.pro: Add missing files
3225
3226 2007-01-19  Eric Seidel  <eric@webkit.org>
3227
3228         Reviewed by rwlbuis.
3229
3230         More cleanup to SVGAnimated* classes.
3231
3232         No tests possible (only code cleanup)
3233
3234         * ksvg2/svg/SVGAnimateMotionElement.cpp:
3235         (WebCore::SVGAnimateMotionElement::applyAnimationToValue):
3236         * ksvg2/svg/SVGAnimateMotionElement.h:
3237         * ksvg2/svg/SVGAnimationElement.cpp:
3238         (WebCore::SVGAnimationElement::parseBeginOrEndValue):
3239         (WebCore::SVGAnimationElement::parseMappedAttribute):
3240         (WebCore::SVGAnimationElement::parseClockValue):
3241         (WebCore::SVGAnimationElement::isIndefinite):
3242         * ksvg2/svg/SVGAnimationElement.h:
3243
3244 2007-01-19  Nikolas Zimmermann  <zimmermann@kde.org>
3245
3246         Not reviewed.
3247
3248         Remove accidently commited debug output. Shame on me :-)
3249
3250         * ksvg2/svg/SVGUseElement.cpp:
3251         (WebCore::SVGUseElement::notifyAttributeChange):
3252
3253 2007-01-19  Nikolas Zimmermann  <zimmermann@kde.org>
3254
3255         Reviewed by Eric.
3256
3257         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10410 (SVG Slider example renders completely wrong (inserting <use> dynamically doesn't work))
3258         Fixes: http://bugs.webkit.org/show_bug.cgi?id=11660 (SVG: creation of <use/> elements through scripting/DOM doesn't work)
3259
3260         Added test: svg/custom/use-instanceRoot-modifications.svg
3261         Added test: svg/custom/use-on-g.svg
3262         Added test: svg/custom/use-on-rect.svg
3263         Added test: svg/custom/use-on-symbol-inside-pattern.svg
3264         Added test: svg/custom/use-on-symbol.svg
3265         Added test: svg/custom/use-on-text.svg
3266         Added test: svg/custom/use-transform.svg
3267
3268         Fixes: svg/W3C-SVG-1.1/text-text-04-t.svg (missing use elements)
3269         Fixes: svg/carto.net/button.svg (image buttons didn't appear)
3270         Fixes: svg/carto.net/colourpicker.svg (slider handles finally show up)
3271         Fixes: svg/carto.net/slider.svg (slider handles finally show up)
3272         Fixes: svg/carto.net/window.svg (window decorations show up) 
3273         Fixes: svg/custom/use-forward-refs.svg (missing use elements)
3274
3275         Rewrite <use> support with a real-shadow tree (as the spec demands), and implement SVGElementInstance.
3276         AFAIK we're the first implementing this SVG feature - after ASV3 (!).
3277
3278         * DerivedSources.make:
3279         * WebCore.xcodeproj/project.pbxproj:
3280         * bindings/objc/DOMInternal.h:
3281         * bindings/objc/DOMSVG.h:
3282         * ksvg2/misc/SVGDocumentExtensions.cpp:
3283         (WebCore::SVGDocumentExtensions::reportWarning):
3284         (WebCore::SVGDocumentExtensions::reportError):
3285         (WebCore::SVGDocumentExtensions::addPendingResource):
3286         (WebCore::SVGDocumentExtensions::isPendingResource):
3287         (WebCore::SVGDocumentExtensions::removePendingResource):
3288         (WebCore::SVGDocumentExtensions::mapInstanceToElement):
3289         (WebCore::SVGDocumentExtensions::removeInstanceMapping):
3290         (WebCore::SVGDocumentExtensions::instancesForElement):
3291         * ksvg2/misc/SVGDocumentExtensions.h:
3292         * ksvg2/svg/SVGCircleElement.cpp:
3293         (WebCore::SVGCircleElement::notifyAttributeChange):
3294         * ksvg2/svg/SVGElement.cpp:
3295         (WebCore::SVGElement::insertedIntoDocument):
3296         * ksvg2/svg/SVGElement.h:
3297         (WebCore::SVGElement::buildPendingResource):
3298         * ksvg2/svg/SVGElementInstance.cpp:
3299         (WebCore::SVGElementInstance::SVGElementInstance):
3300         (WebCore::SVGElementInstance::~SVGElementInstance):
3301         (WebCore::SVGElementInstance::clonedElement):
3302         (WebCore::SVGElementInstance::correspondingElement):
3303         (WebCore::SVGElementInstance::correspondingUseElement):
3304         (WebCore::SVGElementInstance::parentNode):
3305         (WebCore::SVGElementInstance::childNodes):
3306         (WebCore::SVGElementInstance::previousSibling):
3307         (WebCore::SVGElementInstance::nextSibling):
3308         (WebCore::SVGElementInstance::firstChild):
3309         (WebCore::SVGElementInstance::lastChild):
3310         (WebCore::SVGElementInstance::appendChild):
3311         (WebCore::SVGElementInstance::updateInstance):
3312         * ksvg2/svg/SVGElementInstance.h:
3313         * ksvg2/svg/SVGElementInstance.idl: Added.
3314         * ksvg2/svg/SVGElementInstanceList.cpp:
3315         (WebCore::SVGElementInstanceList::SVGElementInstanceList):
3316         (WebCore::SVGElementInstanceList::length):
3317         (WebCore::SVGElementInstanceList::item):
3318         * ksvg2/svg/SVGElementInstanceList.h:
3319         * ksvg2/svg/SVGElementInstanceList.idl: Added.
3320         * ksvg2/svg/SVGEllipseElement.cpp:
3321         (WebCore::SVGEllipseElement::notifyAttributeChange):
3322         * ksvg2/svg/SVGGElement.cpp:
3323         * ksvg2/svg/SVGGElement.h:
3324         (WebCore::SVGGElement::contextElement):
3325         * ksvg2/svg/SVGGradientElement.cpp:
3326         * ksvg2/svg/SVGGradientElement.h:
3327         * ksvg2/svg/SVGHiddenElement.h: Added.
3328         (WebCore::SVGHiddenElement::Type):
3329         (WebCore::SVGHiddenElement::~SVGHiddenElement):
3330         (WebCore::SVGHiddenElement::localName):
3331         * ksvg2/svg/SVGImageElement.cpp:
3332         (WebCore::SVGImageElement::notifyAttributeChange):
3333         * ksvg2/svg/SVGLineElement.cpp:
3334         (WebCore::SVGLineElement::notifyAttributeChange):
3335         * ksvg2/svg/SVGPathElement.cpp:
3336         (WebCore::SVGPathElement::notifyAttributeChange):
3337         * ksvg2/svg/SVGPatternElement.cpp:
3338         * ksvg2/svg/SVGPatternElement.h:
3339         * ksvg2/svg/SVGPolyElement.cpp:
3340         (WebCore::SVGPolyElement::notifyAttributeChange):
3341         * ksvg2/svg/SVGRectElement.cpp:
3342         (WebCore::SVGRectElement::notifyAttributeChange):
3343         * ksvg2/svg/SVGStyledElement.cpp:
3344         (WebCore::SVGStyledElement::notifyAttributeChange):
3345         (WebCore::SVGStyledElement::updateElementInstance):
3346         * ksvg2/svg/SVGStyledElement.h:
3347         * ksvg2/svg/SVGUseElement.cpp:
3348         (WebCore::SVGUseElement::instanceRoot):
3349         (WebCore::SVGUseElement::animatedInstanceRoot):
3350         (WebCore::SVGUseElement::hasChildNodes):
3351         (WebCore::SVGUseElement::insertedIntoDocument):
3352         (WebCore::SVGUseElement::buildPendingResource):
3353         (WebCore::SVGUseElement::createRenderer):
3354         (WebCore::SVGUseElement::buildShadowTree):
3355         (WebCore::SVGUseElement::recursiveShadowTreeBuilder):
3356         (WebCore::dumpShadowTree):
3357         (WebCore::SVGUseElement::addShadowTree):
3358         * ksvg2/svg/SVGUseElement.h:
3359         * ksvg2/svg/SVGUseElement.idl:
3360
3361 2007-01-19  Eric Seidel  <eric@webkit.org>
3362
3363         Reviewed by rwlbuis.
3364
3365         Add support for SVGMPathElement parsing.
3366
3367         No test cases possible (SVGAnimateMotion doesn't work yet)
3368
3369         * WebCore.xcodeproj/project.pbxproj:
3370         * ksvg2/svg/SVGAnimateMotionElement.cpp:
3371         (WebCore::SVGAnimateMotionElement::animationPath):
3372         * ksvg2/svg/SVGMPathElement.cpp: Added.
3373         (WebCore::SVGMPathElement::SVGMPathElement):
3374         (WebCore::SVGMPathElement::~SVGMPathElement):
3375         (WebCore::SVGMPathElement::parseMappedAttribute):
3376         (WebCore::SVGMPathElement::pathElement):
3377         * ksvg2/svg/SVGMPathElement.h: Added.
3378         * ksvg2/svg/SVGNumberList.cpp:
3379         (WebCore::SVGNumberList::parse): fix typo in comment
3380         * ksvg2/svg/svgtags.in: add back mpath
3381
3382 2007-01-19  Eric Seidel  <eric@webkit.org>
3383
3384         Reviewed by rwlbuis.
3385
3386         Implement better parsing for keyTimes, keySplines and keyPoints.
3387
3388         Unfortunately none of this code is used much yet, thus isn't very testable.
3389
3390         * ksvg2/svg/SVGAnimateMotionElement.cpp:
3391         (WebCore::SVGAnimateMotionElement::parseMappedAttribute):
3392         * ksvg2/svg/SVGAnimationElement.cpp:
3393         (WebCore::SVGAnimationElement::parseKeyNumbers):
3394         (WebCore::parseKeySplines):
3395         (WebCore::SVGAnimationElement::parseMappedAttribute):
3396         * ksvg2/svg/SVGAnimationElement.h:
3397         * ksvg2/svg/SVGNumberList.cpp:
3398         (WebCore::SVGNumberList::parse):
3399
3400 2007-01-18  Adam Roben  <aroben@apple.com>
3401
3402         Reviewed by Beth.
3403
3404         Fix: <rdar://problem/4939672> REGRESSION: With text selected that is
3405         not a link, the "Remove Link" contextual menu item remains active
3406
3407         * platform/ContextMenuItem.h: Added enabled method.
3408         * platform/qt/ContextMenuItemQt.cpp:
3409         (WebCore::ContextMenuItem::enabled): Implemented.
3410         * platform/mac/ContextMenuItemMac.mm:
3411         (WebCore::ContextMenuItem::enabled): Ditto.
3412         * platform/mac/ContextMenuMac.mm:
3413         (-[WebCoreMenuTarget validateMenuItem:]): Implemented to fulfill the
3414         NSMenuValidation protocol.
3415         
3416 2007-01-18  Beth Dakin  <bdakin@apple.com>
3417
3418         Reviewed by Adele.
3419
3420         Fix for <rdar://problem/4939558> REGRESSION: "Search in Google", 
3421         "Search in Spotlight" and "Look up in Dictionary" are missing 
3422         initially from the contextual menu
3423
3424         The bug here is that we select the we were selecting the word after 
3425         the context menu event was dispatched and after the context menu 
3426         was built up.
3427
3428         * page/EventHandler.cpp:
3429         (WebCore::EventHandler::sendContextMenuEvent): Select the word 
3430         before dispatching the event. It is safe to remove the check for 
3431         swallowEvent since WebCore context menus ensure that we always 
3432         swallow the event anyway.
3433
3434 2007-01-18  Mark Rowe  <mrowe@apple.com>
3435
3436         Reviewed by Tim H.
3437
3438         Fix for http://bugs.webkit.org/show_bug.cgi?id=7926
3439         Bug 7926: Crash using -callWebScriptMethod to access offsetTop property
3440
3441         * bindings/objc/WebScriptObject.mm:
3442         (-[WebScriptObject callWebScriptMethod:withArguments:]): Bail out early if function value is an immediate,
3443         or if the function object is not callable.
3444
3445 2007-01-18  Sam Weinig  <sam@webkit.org>
3446
3447         Reviewed by Maciej.
3448
3449         Patch for http://bugs.webkit.org/show_bug.cgi?id=11853
3450         REGRESSION (r17352): Whitespace in <title> is rendered
3451
3452         * loader/DocumentLoader.cpp:
3453         (WebCore::canonicalizedTitle): Changed to also collapse internal
3454         whitespace.  This required removing an optimization that is no
3455         longer possible.
3456         * manual-tests/title-internal-whitespace.html: Added.
3457
3458 2007-01-18  Mitz Pettel  <mitz@webkit.org>
3459
3460         Reviewed by Maciej.
3461
3462         - fix http://bugs.webkit.org/show_bug.cgi?id=12039
3463           Assertion failure in WebCore::Font::primaryFont
3464
3465         Test: fast/text/font-initial.html
3466
3467         * css/cssstyleselector.cpp:
3468         (WebCore::CSSStyleSelector::applyProperty): Give 'font: initial' the
3469         Standard generic family. This makes the FontDescription different from
3470         that of the initial font of a GraphicsContext, ensuring that the latter
3471         will not be used.
3472
3473 2007-01-18  Mitz Pettel  <mitz@webkit.org>
3474
3475         Reviewed by Darin.
3476
3477         - fix http://bugs.webkit.org/show_bug.cgi?id=11451
3478           REGRESSION: Dell.com does not render correctly in ToT (stylesheet not loaded)
3479
3480         Test: http/tests/misc/css-accept-any-type.html
3481
3482         * loader/CachedCSSStyleSheet.cpp:
3483         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Changed the accept header
3484         for stylesheets to "text/css,*/*;q=0.1" to match Firefox, accepting CSS served
3485         as any type.
3486
3487 2007-01-18  Mitz Pettel  <mitz@webkit.org>
3488
3489         Reviewed by Darin.
3490
3491         - fix http://bugs.webkit.org/show_bug.cgi?id=11271
3492         REGRESSION (r12358): Text in display: table unselectable
3493
3494         Test: editing/selection/display-table-text.html
3495
3496         * editing/htmlediting.cpp:
3497         (WebCore::isTableElement): Changed to return false for text nodes.
3498
3499 2007-01-18  Mitz Pettel  <mitz@webkit.org>
3500
3501         Reviewed by Darin.
3502
3503         - fix http://bugs.webkit.org/show_bug.cgi?id=6218
3504           CSS1: WebTextRenderer caches and re-uses fallback renderers that are based on family lists
3505
3506         This patch takes character-to-glyph mapping out of FontData and instead makes
3507         each Font keep its own mapping, using a shared set of glyph page fallback trees.
3508
3509         For each page number there is (at most) one tree. A path from the root to a
3510         node in the tree corresponds to a fallback list of FontDatas. The node points to
3511         a page (which may be shared with other nodes) that maps each character in its range
3512         to a glyph in the first FontData in the fallback list that has it, or to 0 if none of
3513         the FontDatas has a glyph for that character. A special kind of node, that can
3514         only occur as a leaf, corresponds to using system fallback fonts after the list
3515         has been exhausted. This prevents system fallback from polluting non-leaf
3516         nodes.
3517
3518         Nodes and pages are initialized lazily and employ "copy on write".
3519
3520         * CMakeLists.txt:
3521         * WebCore.pro:
3522         * WebCore.vcproj/WebCore/WebCore.vcproj:
3523         * WebCore.xcodeproj/project.pbxproj:
3524         * WebCoreSources.bkl:
3525         * platform/Font.cpp:
3526         (WebCore::WidthIterator::WidthIterator): Removed substituteFontData.
3527         (WebCore::WidthIterator::advance): Moved all character-to-glyph mapping logic out
3528         of here and replaced it with a call to Font::glyphDataForCharacter().
3529         (WebCore::Font::Font):
3530         (WebCore::Font::operator=):
3531         (WebCore::Font::glyphDataForCharacter): Added. This method performs the lookup in the
3532         page fallback trees, triggering lazy initialization as needed, and caching pointers to
3533         the retrieved page tree nodes in the font.
3534         (WebCore::Font::update):
3535         (WebCore::Font::drawSimpleText):
3536         (WebCore::Font::floatWidth):
3537         (WebCore::Font::floatWidthForSimpleText): Removed substituteFont argument.
3538         (WebCore::Font::offsetForPositionForSimpleText):
3539         * platform/Font.h:
3540         * platform/FontData.cpp:
3541         (WebCore::FontData::FontData):
3542         * platform/FontData.h:
3543         (WebCore::FontData::missingGlyphData): Added. Returns the "missing glyph" GlyphData for
3544         this FontData.
3545         * platform/GlyphMap.cpp: Removed.
3546         * platform/GlyphMap.h: Removed.
3547         * platform/GlyphPageTreeNode.cpp: Renamed GlyphMap.cpp to this.
3548         (WebCore::GlyphPageTreeNode::getRoot): Added. Returns the root of the page fallback tree for
3549         the given page number.
3550         (WebCore::GlyphPageTreeNode::initializePage): Added. Helper method that initializes the page
3551         pointer of a node, possibly to a pointer to another node's page or to 0.
3552         (WebCore::GlyphPageTreeNode::getChild): Added.