370842a530b99ce74ea7ca21c4247fbb930cdb9d
[WebKit-https.git] / WebCore / ChangeLog
1 2007-05-14  Justin Garcia  <justin.garcia@apple.com>
2
3         Reviewed by ggaren
4         
5         <http://bugs.webkit.org/show_bug.cgi?id=13716>
6         REGRESSION: Three new layout test failures
7         
8         Two failures are correct.  Updated their expected results.
9         
10         In fast/events/frame-tab-focus.html, as we advance
11         through focusable nodes, we descend into a subframe
12         to focus a node and then ascend out of it into the
13         main frame to focus the next.  When we focus the main 
14         frame, the node in that frame that was previously 
15         focused and contains an inactive selection is focused 
16         momentarily because setCaretVisible tries to focus the 
17         node containing the caret.
18
19         * page/Frame.cpp:
20         (WebCore::Frame::setCaretVisible): Don't focus the
21         node containing the caret. FocusController will focus
22         the previously focused node (which will contain the
23         caret) if necessary when the frame gains focus.
24         
25 2007-05-14  Maciej Stachowiak  <mjs@apple.com>
26
27         Reviewed by Brady.
28
29         - fixed <rdar://problem/5203036> REGRESSION: Assertion failure in WebCore::FrameLoader::restoreScrollPositionAndViewState() going back from fark.com Photoshop contest (13684)
30
31         Test: http/tests/navigation/back-to-slow-frame.html
32         
33         * loader/FrameLoader.cpp:
34         (WebCore::FrameLoader::restoreScrollPositionAndViewState): Add needed early return.
35
36 2007-05-14  Mitz Pettel  <mitz@webkit.org>
37
38         Reviewed by Dave Hyatt.
39
40         - fix http://bugs.webkit.org/show_bug.cgi?id=13603
41           style leaks in washingtonpost.com
42           also known as http://bugs.webkit.org/show_bug.cgi?id=8750
43           w3c.org: incorrect recovery from unclosed <a> elements
44           also known as http://bugs.webkit.org/show_bug.cgi?id=12808
45           Handling of misnested tags results in entire page appearing as link
46           also known as http://bugs.webkit.org/show_bug.cgi?id=12861
47           Post text renders as link
48
49         Test: fast/parser/residual-style-close-across-n-blocks.html
50
51         * html/HTMLParser.cpp:
52         (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): Changed to
53         deal with multiple block crossings instead of bailing out, by doing multiple
54         reparenting passes, starting from the outermost block.
55
56 2007-05-14  Mitz Pettel  <mitz@webkit.org>
57
58         Reviewed by Darin.
59
60         - fix http://bugs.webkit.org/show_bug.cgi?id=13711
61           REGRESSION - Bookmark Bar text rendering changed
62
63         No test possible since this patch affects only Safari chrome.
64
65         * platform/Font.cpp:
66         (WebCore::Font::Font): Initialize m_isPlatformFont according to whether
67         the Font object is derived from a FontPlatformData or not.
68         * platform/Font.h:
69         (WebCore::Font::isPlatformFont): Added. Returns whether this Font was
70         derived from a platform font.
71         * platform/mac/FontCacheMac.mm:
72         (WebCore::FontCache::getFontDataForCharacters): Changed to not enable
73         synthetic bold and italic in the fallback fonts if the original font
74         was derived from a platform font.
75
76 2007-05-14  Sam Weinig  <sam@webkit.org>
77
78         Reviewed by Alice!
79
80         - Patch for http://bugs.webkit.org/show_bug.cgi?id=13541
81           REGRESSION: Setting a DOMString attribute to JS null in the 
82           JS bindings should default to converting to the empty string
83
84           Convert JS null to the empty string when passing it to an attribute that takes
85           a DOMString.
86
87         Test: fast/dom/document-attribute-js-null.html
88         Test: fast/dom/element-attribute-js-null.html
89
90         * bindings/js/kjs_dom.cpp:
91         (KJS::DOMNode::putValueProperty):
92         * bindings/js/kjs_html.cpp:
93         (KJS::JSHTMLDocument::putValueProperty):
94         (KJS::JSHTMLElement::objectSetter):
95         (KJS::JSHTMLElement::embedSetter):
96         (KJS::JSHTMLElement::tableSetter):
97         (KJS::JSHTMLElement::tableCaptionSetter):
98         (KJS::JSHTMLElement::tableColSetter):
99         (KJS::JSHTMLElement::tableSectionSetter):
100         (KJS::JSHTMLElement::tableRowSetter):
101         (KJS::JSHTMLElement::tableCellSetter):
102         (KJS::JSHTMLElement::frameSetSetter):
103         (KJS::JSHTMLElement::frameSetter):
104         (KJS::JSHTMLElement::iFrameSetter):
105         (KJS::JSHTMLElement::marqueeSetter):
106         (KJS::JSHTMLElement::putValueProperty):
107         * bindings/js/kjs_html.h:
108         * dom/Document.idl:
109         * dom/Node.idl:
110         * html/HTMLAnchorElement.idl:
111         * html/HTMLAppletElement.idl:
112         * html/HTMLAreaElement.idl:
113         * html/HTMLBRElement.idl:
114         * html/HTMLBaseElement.idl:
115         * html/HTMLBaseFontElement.idl:
116         * html/HTMLBlockquoteElement.idl:
117         * html/HTMLBodyElement.idl:
118         * html/HTMLButtonElement.idl:
119         * html/HTMLDivElement.idl:
120         * html/HTMLDocument.idl:
121         * html/HTMLElement.idl:
122         * html/HTMLEmbedElement.idl:
123         * html/HTMLFontElement.idl:
124         * html/HTMLFormElement.idl:
125         * html/HTMLFrameElement.idl:
126         * html/HTMLFrameSetElement.idl:
127         * html/HTMLHRElement.idl:
128         * html/HTMLHeadElement.idl:
129         * html/HTMLHeadingElement.idl:
130         * html/HTMLHtmlElement.idl:
131         * html/HTMLIFrameElement.idl:
132         * html/HTMLImageElement.idl:
133         * html/HTMLInputElement.idl:
134         * html/HTMLIsIndexElement.idl:
135         * html/HTMLLIElement.idl:
136         * html/HTMLLabelElement.idl:
137         * html/HTMLLegendElement.idl:
138         * html/HTMLLinkElement.idl:
139         * html/HTMLMapElement.idl:
140         * html/HTMLMetaElement.idl:
141         * html/HTMLModElement.idl:
142         * html/HTMLOListElement.idl:
143         * html/HTMLObjectElement.idl:
144         * html/HTMLOptGroupElement.idl:
145         * html/HTMLOptionElement.idl:
146         * html/HTMLParagraphElement.idl:
147         * html/HTMLParamElement.idl:
148         * html/HTMLQuoteElement.idl:
149         * html/HTMLScriptElement.idl:
150         * html/HTMLSelectElement.idl:
151         * html/HTMLStyleElement.idl:
152         * html/HTMLTableCaptionElement.idl:
153         * html/HTMLTableCellElement.idl:
154         * html/HTMLTableColElement.idl:
155         * html/HTMLTableElement.idl:
156         * html/HTMLTableRowElement.idl:
157         * html/HTMLTableSectionElement.idl:
158         * html/HTMLTextAreaElement.idl:
159         * html/HTMLTitleElement.idl:
160         * html/HTMLUListElement.idl:
161
162 2007-05-14  Geoffrey Garen  <ggaren@apple.com>
163
164         Trying to fix the Qt build.
165
166         * WebCore.pro:
167
168 2007-05-14  Geoffrey Garen  <ggaren@apple.com>
169
170         Reviewed by Oliver Hunt.
171         
172         Some improvements on my last patch, suggested by Darin.
173
174         * history/PageCache.cpp:
175         (WebCore::PageCache::autoreleaseNow): Swap with an empty set instead of 
176         building up an array and then calling clear(). This is slightly more 
177         efficient and the code is cleaner.
178
179 2007-05-14  Justin Garcia  <justin.garcia@apple.com>
180
181         Reviewed by darin
182         
183         <rdar://problem/5136696> Selection is removed when focusing a node in another frame
184         <rdar://problem/5192388> WordPress: Can't insert links/images
185         
186         Don't clear a selection when changing focus if the new
187         focus node is in a different frame than the old selection.
188
189         * dom/Document.cpp:
190         (WebCore::Document::setFocusedNode): Moved code to clear 
191         selections to the FocusController, since it is Page level 
192         and will know about the frame/document that contained the 
193         old selection. Moved code to call shouldEndEditing to the 
194         FocusController because selections are now cleared before
195         calling Document::setFocusedNode and shouldEndEditing must
196         be called before selections are cleared.
197         * dom/Element.cpp:
198         (WebCore::Element::blur): Call FocusController::setFocusNode
199         instead of Document::setFocusNode, if possible.
200         * page/EventHandler.cpp:
201         (WebCore::EventHandler::dispatchMouseEvent): Ditto.
202         * page/FocusController.cpp:
203         (WebCore::relinquishesEditingFocus): Moved from Document.cpp.
204         (WebCore::clearSelectionIfNeeded): Ditto.  Don't clear if
205         the old selection is in a frame that's different than the 
206         one that contains the new focus node.
207         (WebCore::FocusController::setFocusedNode): Moved code
208         here from Document::setFocusedNode.
209         * page/Frame.cpp:
210         (WebCore::Frame::setFocusedNodeIfNeeded): Call
211         FocusController::setFocusNode.
212
213 2007-05-14  Geoffrey Garen  <ggaren@apple.com>
214
215         Reviewed by Darin Adler.
216         
217         Next step toward fixing <rdar://problem/5055182> The back cache has no 
218         global cap.
219         
220         Created a PageCache singleton. Right now, it only handles the timer-based
221         deallocation of cached pages. I plan to add HistoryItem->CachedPage tracking
222         and eviction logic in later patches.
223
224         Updated for renames and file changes:
225
226         * WebCore.exp:
227         * WebCore.xcodeproj/project.pbxproj:
228         * history/BackForwardList.cpp:
229         (WebCore::BackForwardList::setPageCacheSize):
230         (WebCore::BackForwardList::clearPageCache):
231
232         Removed global timed release code, moved into new PageCache class, since
233         it's eventually going to be in charge of deciding when things are released:
234         
235         * history/HistoryItem.cpp:
236         (WebCore::HistoryItem::setCachedPage):
237         * history/HistoryItem.h:
238
239         Folded into PageCache:
240         
241         * history/HistoryItemTimer.cpp: Removed.
242         * history/HistoryItemTimer.h: Removed.
243
244         New singleton. Right now, it just handles timed release of cached pages:
245         
246         * history/PageCache.cpp: Added.
247         (WebCore::pageCache):
248         (WebCore::PageCache::PageCache):
249         (WebCore::PageCache::autoreleaseNowOrReschedule):
250         (WebCore::PageCache::autoreleaseNow):
251         (WebCore::PageCache::autorelease):
252         * history/PageCache.h: Added.
253
254 2007-05-14  Adele Peterson  <adele@apple.com>
255
256         Reviewed by Darin.
257
258         Fix for <rdar://problem/5200081> Repro crash in PopupMenu::show clicking popup menu button after reload
259
260         * platform/mac/PopupMenuMac.mm: (WebCore::PopupMenu::show): Added call to dismissPopup so the cell gets unattached properly.
261
262 2007-05-14  Adele Peterson  <adele@apple.com>
263
264         Reviewed by Darin.
265
266         Remove incorrect assertion.
267
268         * page/FrameView.cpp: (WebCore::FrameView::setContentsPos):
269
270 2007-05-14  Anders Carlsson  <andersca@apple.com>
271
272         Reviewed by Geoff.
273
274         <rdar://problem/5172056> Regression: cannot open txt file, get broken image
275
276         Never let plug-ins override text/plain.
277         
278         * dom/DOMImplementation.cpp:
279         (WebCore::DOMImplementation::createDocument):
280
281 2007-05-14  Zack Rusin  <zrusin@trolltech.com>
282
283         Reviewed by Simon.
284
285         Do some magic to get better dependency tracking for header
286         files in the qmake project files.
287
288         * ChangeLog:
289
290 2007-05-14  Lars Knoll <lars@trolltech.com>
291
292         Reviewed by Zack
293
294         Required updates after Maciej's frame change.
295
296         * loader/FrameLoader.cpp:
297         (WebCore::FrameLoader::mainReceivedCompleteError):
298               Call checkLoadCompleted() at the end of the method. Without it
299               we never get the loadDone() signal on the Qt port.
300         * platform/network/qt/ResourceHandleManagerQt.cpp:
301         (WebCore::ResourceHandleManager::receivedFinished):
302               Don't pass a null error to didFail().
303
304 2007-05-14  Darin Adler  <darin@apple.com>
305
306         Reviewed by Antti.
307
308         - fix <rdar://problem/3109180> VIP: after go back, page jumps after loading even if I scrolled while loading
309
310         * history/CachedPage.cpp: (WebCore::CachedPage::clear): Call clearFrame rather than
311         clearPart -- the "part" term was leftover prehistoric terminology.
312
313         * loader/FrameLoader.cpp:
314         (WebCore::FrameLoader::open): Call setWasScrolledByUser(false) on the page, so that we
315         can detect any user scrolling that happens during the "go back" process.
316         (WebCore::FrameLoader::restoreScrollPositionAndViewState): Don't scroll if the view's
317         wasScrolledByUser flag is set.
318         (WebCore::FrameLoader::loadItem): Call setWasScrolledByUser(false) false when we do
319         a new "load" (actually just a scroll) using the same frame. Also moved the line of code that
320         sets m_currentHistoryItem to make this code path mroe similar to recursiveGoToItem.
321         (WebCore::FrameLoader::recursiveGoToItem): Ditto.
322
323         * page/Frame.cpp:
324         (WebCore::Frame::~Frame): Call clearFrame rather than stting m_frame directly.
325         (WebCore::Frame::sendScrollEvent): Call setWasScrolledByUser(true) on FrameView. The FrameView
326         itself knows to ignore this if the scrolling is being done programmatically instead of by the user.
327
328         * page/FrameView.h: Added wasScrolledByUser and setWasScrolledByUser. Also removed unneeded
329         include and class forward declarations, renamed clearPart to clearFrame, removed uneeded function
330         haveDelayedLayoutScheduled, and removed unneeded friend declarations.
331         * page/FrameView.cpp:
332         (WebCore::FrameViewPrivate::FrameViewPrivate): Added m_inProgrammaticScroll and m_wasScrolledByUser.
333         (WebCore::FrameViewPrivate::reset): Set m_wasScrolledByUser to false.
334         (WebCore::FrameView::clearFrame): Renamed from clearPart.
335         (WebCore::FrameView::scrollRectIntoViewRecursively): Added code to set the m_inProgrammaticScroll flag.
336         (WebCore::FrameView::setContentsPos): Ditto.
337         (WebCore::FrameView::wasScrolledByUser): Added.
338         (WebCore::FrameView::setWasScrolledByUser): Added. Does nothing if called when m_inProgrammaticScroll
339         is true.
340
341 2007-05-14  Darin Adler  <darin@apple.com>
342
343         Reviewed by Antti.
344
345         - <rdar://problem/4865655> REGRESSION: find function does not work for the character ß
346
347         The trick was to fold case consistently in the CircularSearchBuffer class.
348
349         The problem was that we were folding the search target string with full case folding and
350         the characters of the text we were searching with simple case folding. We now use full
351         case folding in both cases.
352
353         * editing/TextIterator.cpp:
354         (WebCore::CircularSearchBuffer::CircularSearchBuffer): Changed the buffer to be a
355         Vector<UChar>. Added a Vector<bool> to record which characters were starts of characters
356         in the text we are searching. Changed the cursor to be an int rather than a pointer.
357         (WebCore::CircularSearchBuffer::append): New function that knows how to append multiple
358         characters when folding case turns one character into many -- uses the full foldCase
359         rather than the simplified single-character foldCase. Also removed the append function
360         that did multiple characters at once; that was part of an optimization we don't need.
361         (WebCore::CircularSearchBuffer::isMatch): Instead of asserting that the buffer is full,
362         changed this to return false if it's not full, which lets us fill up the buffer with
363         the normal loop. Also return false if the start of the buffer is half-way through a
364         case-folded character and updated this since m_cursor is now an integer.
365         (WebCore::CircularSearchBuffer::length): This returns the length in non-case-folded
366         characters of the characters that were appended, which may not be the same as the length
367         of the original target string. To do that we have to total up the character start
368         booleans for the current state of the circular buffer.
369         (WebCore::findPlainText): Streamlined the logic in a few ways: 1) Moved more of the
370         return value setup to the top of the function so it could be shared with the early
371         error exit. 2) Removed the separate "fill the buffer" logic, which allowed me to
372         remove some of the functions from CircularSearchBuffer and eliminated the need for
373         two nested loops. 3) Replaced the CharacterIterator and bool that were used to record
374         the location we found with integers matchStart and matchLength. 4) Got rid of the use
375         of goto since we don't have two nested loops any more.
376
377 2007-05-14  Andrew Wellington  <proton@wiretapped.net>
378
379         Reviewed by Darin.
380
381         Fix http://bugs.webkit.org/show_bug.cgi?id=13275
382         Safari crashed when trying to login using the windows live contact control
383
384         Check for cleared windowObj in JSAbstractEventListener::handleEvent
385
386         * bindings/js/kjs_events.cpp:
387         (KJS::JSAbstractEventListener::handleEvent):
388
389 2007-05-13  Alexey Proskuryakov  <ap@webkit.org>
390
391         Reviewed by Darin.
392
393         http://bugs.webkit.org/show_bug.cgi?id=13690
394         JavaScript Form Validation issue on Banco do Brasil site
395
396         Test: fast/forms/input-setvalue-selection.html
397
398         * html/HTMLInputElement.cpp:
399         (WebCore::HTMLInputElement::setValue): In other browsers, changing textInput.value
400         always moves the insertion point past the text. In 10.4.9 WebKit, this only worked
401         for inactive controls, and it never worked in ToT.
402
403 2007-05-13  Brady Eidson  <beidson@apple.com>
404
405         Reviewed by Mitz
406
407         http://bugs.webkit.org/show_bug.cgi?id=13701
408
409         Since HTMLInputElements register themselves with their Document for special handling, if their document
410         ever changes then bad things can happen.
411
412         Unfortunately, with adoptNode, the document can change.  This has been a long standing crasher with all 
413         input fields but was given recent high visibility by r21430
414
415         The solution is to add functionality for a Node to react to its owner document changing via a pair of 
416         virtual callbacks.  Then we can tap into those callbacks in HTMLInputElement.
417
418         No layout test possible until http://bugs.webkit.org/show_bug.cgi?id=13672 is resolved
419
420         * dom/Node.cpp:
421         (WebCore::Node::setDocument): Call willMoveToNewOwnerDocument and didMoveToNewOwnerDocument
422
423         * dom/Node.h:
424         (WebCore::Node::willMoveToNewOwnerDocument): Virtual callback to a node for before an owner document change
425         (WebCore::Node::didMoveToNewOwnerDocument): Virtual callback to a node for after an owner document change
426
427         * html/HTMLInputElement.cpp:
428         (WebCore::HTMLInputElement::~HTMLInputElement): Unconditionally unregister both for both form state
429           and the cache restoration callback
430         (WebCore::HTMLInputElement::setInputType): Change registration with the document only if we're in one
431         (WebCore::HTMLInputElement::attach): Don't bother registering for the callback here - that will be
432           handled by setInputType() or by a change in owner document
433         (WebCore::HTMLInputElement::willMoveToNewOwnerDocument): Unregister with the old owner document
434         (WebCore::HTMLInputElement::didMoveToNewOwnerDocument): Register with the new owner document
435         * html/HTMLInputElement.h:
436
437 2007-05-13  Darin Adler  <darin@apple.com>
438
439         * platform/mac/TextBreakIteratorInternalICUMac.mm: Fix comment typo.
440
441 2007-05-13  Rob Buis  <buis@kde.org>
442
443         Reviewed by Darin.
444
445         http://bugs.webkit.org/show_bug.cgi?id=13529
446         DOM3 keyIdentifier text is incorrect
447
448         Use 4 digits for the Unicode based key identifiers.
449
450         * html/HTMLButtonElement.cpp:
451         (WebCore::HTMLButtonElement::defaultEventHandler):
452         * html/HTMLInputElement.cpp:
453         (WebCore::HTMLInputElement::defaultEventHandler):
454         * html/HTMLSelectElement.cpp:
455         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
456         * page/EventHandler.cpp:
457         (WebCore::EventHandler::defaultKeyboardEventHandler):
458         * page/gdk/EventHandlerGdk.cpp:
459         (WebCore::isKeyboardOptionTab):
460         * page/mac/EventHandlerMac.mm:
461         (WebCore::isKeyboardOptionTab):
462         * page/qt/EventHandlerQt.cpp:
463         (WebCore::isKeyboardOptionTab):
464         * platform/gdk/KeyEventGdk.cpp:
465         (WebCore::keyIdentifierForGdkKeyCode):
466         * platform/mac/KeyEventMac.mm:
467         (WebCore::keyIdentifierForKeyEvent):
468         * platform/qt/PlatformKeyboardEventQt.cpp:
469         (WebCore::keyIdentifierForQtKeyCode):
470         * platform/win/KeyEventWin.cpp:
471         (WebCore::keyIdentifierForWindowsKeyCode):
472         * platform/wx/KeyEventWin.cpp:
473         (WebCore::keyIdentifierForWindowsKeyCode):
474         * platform/wx/KeyboardEventWx.cpp:
475         (WebCore::keyIdentifierForWxKeyCode):
476
477 2007-05-12  Darin Adler  <darin@apple.com>
478
479         Reviewed by Antti.
480
481         - fix <rdar://problem/5174903> Safari crashes opening the attached webarchive (made by OmniWeb)
482
483         * loader/icon/IconLoader.cpp:
484         (WebCore::IconLoader::didReceiveResponse): Check ResourceHandle for nil before calling url() on it.
485         (WebCore::IconLoader::didFail): Ditto.
486         (WebCore::IconLoader::didFinishLoading): Ditto.
487
488 2007-05-12  Rob Buis  <buis@kde.org>
489
490         Reviewed by Oliver.
491
492         Cleanup, get rid of the SVGStyledElement::view() call.
493
494         * ksvg2/svg/SVGClipPathElement.cpp:
495         (WebCore::SVGClipPathElement::canvasResource):
496         * ksvg2/svg/SVGFEFloodElement.cpp:
497         (WebCore::SVGFEFloodElement::filterEffect):
498         * ksvg2/svg/SVGGradientElement.cpp:
499         (WebCore::SVGGradientElement::buildStops):
500         * ksvg2/svg/SVGStyledElement.cpp:
501         * ksvg2/svg/SVGStyledElement.h:
502
503 2007-05-12  Mitz Pettel  <mitz@webkit.org>
504
505         Reviewed by Hyatt.
506
507         - fix http://bugs.webkit.org/show_bug.cgi?id=13680
508           Incomplete repaint of focus ring around continuation
509
510         Test: fast/repaint/continuation-after-outline.html
511
512         * rendering/RenderFlow.cpp:
513         (WebCore::RenderFlow::absoluteClippedOverflowRect):
514
515 2007-05-12  Oliver Hunt  <oliver@apple.com>
516
517         Reviewed by Hyatt.
518
519         <rdar://problem/4728842> Can't drag-and-drop files onto <input type="file">
520         
521         This patch allows a file to be dropped on to a file input field.  There
522         are a few changes for data handling and a  few to allow the data to be
523         threaded to the appropriate places.
524
525         * page/DragController.cpp:
526         (WebCore::asFileInput):
527            When dropping a file onto a file input we may mouse over either 
528            the element itself, or the contained button element.  This method
529            returns the base element for the file input in either of these
530            cases.
531         (WebCore::DragController::tryDocumentDrag):
532            Don't try to set the drag caret to a file input.
533         (WebCore::DragController::concludeDrag):
534            Handle dropping onto a file input element.
535         (WebCore::DragController::canProcessDrag):
536            We can now process a file being dragged onto a file input element.
537            
538         * platform/DragData.h:
539            New accessors
540            
541         * platform/gdk/DragDataGdk.cpp:
542         (WebCore::DragData::containsFiles):
543         (WebCore::DragData::asFilenames):
544            Link stubs.
545            
546         * platform/mac/DragDataMac.mm:
547         (WebCore::DragData::containsFiles):
548         (WebCore::DragData::asFilenames):
549            Implement new accessors
550         (WebCore::DragData::containsCompatibleContent):
551            Update containsCompatibleContent to allow standalone files.
552           
553         * platform/qt/DragDataQt.cpp:
554         (WebCore::DragData::containsFiles):
555         (WebCore::DragData::asFilenames):
556            Link stubs
557                       
558         * rendering/RenderFileUploadControl.cpp:
559         (WebCore::RenderFileUploadControl::receiveDroppedFile):
560         * rendering/RenderFileUploadControl.h:
561            For security reasons we don't have an api to allow us to set 
562            a value directly on a file input -- attempts to do so are
563            blocked.  By adding a method to set the target through the 
564            render we bypass such restrictions, and ensure the renderer
565            is updated correctly.
566
567 2007-05-12  Mitz Pettel  <mitz@webkit.org>
568
569         Reviewed by Hyatt.
570
571         - fix http://bugs.webkit.org/show_bug.cgi?id=13695
572           REGRESSION (r21387): Replaced elements' highlight rects are wrongly positioned
573
574         Test: fast/replaced/selection-rect.html
575
576         Also fixes the same problem with list markers, covered by existing test
577         fast/lists/markers-in-selection.html.
578
579         * rendering/RenderListMarker.cpp:
580         (WebCore::RenderListMarker::selectionRect):
581         * rendering/RenderReplaced.cpp:
582         (WebCore::RenderReplaced::selectionRect):
583
584 2007-05-12  Mitz Pettel  <mitz@webkit.org>
585
586         Reviewed by Darin.
587
588         - fix http://bugs.webkit.org/show_bug.cgi?id=13685
589           REGRESSION (r21368-r21388): Highlighting text in scrolled textareas behaves oddly
590
591         Test: fast/repaint/text-selection-rect-in-overflow.html
592
593         * rendering/RenderText.cpp:
594         (WebCore::RenderText::selectionRect):
595
596 2007-05-12  Brady Eidson  <beidson@apple.com>
597
598         Rubber stamped by Mitz
599
600         * html/HTMLInputElement.cpp:
601         (WebCore::HTMLInputElement::attach): unregister->register - I screwed this one up in last minute renaming
602           before committing  :(
603
604 2007-05-11  Brady Eidson  <beidson@apple.com>
605
606         Reviewed by Darin and Geoff
607
608         Fix for http://bugs.webkit.org/show_bug.cgi?id=13630
609         and
610         <rdar://problem/4873628>
611
612         Back/Forward cache should work with pages with login fields.
613
614         First change is to relocate the "useSecureKeyboardEntry" flag to the document.  This lets
615         it persist through page cache transitions and it is truly a per-document concept more than
616         per-frame anyways since its the document that has a password field, not the frame.
617
618         Second change is to introduce the concept of an Element getting a "didRestoreFromCache()" callback.
619         The idea is for elements to register with the document if they need work to be done when the
620         page comes out of the back/forward cache.  Currently the only client of this service is 
621         HTMLInputElements that are input type == PASSWORD.  Such an element's implementation for this
622         method is to call reset()
623
624         Finally, after a page is restored from the cache we have the document send the didRestoreFromCache()
625         callback to its registered Elements.  The whole design is to clear the password fields after 
626         restoring the page instead of when caching the page because we want to defer work for the common
627         case - there shouldn't be extra work here just to navigate away from a page when the common case
628         is that you'll never go back!
629
630         No layout tests possible until http://bugs.webkit.org/show_bug.cgi?id=13672 is resolved
631
632         * dom/Document.cpp:
633         (WebCore::Document::Document):
634         (WebCore::Document::registerForDidRestoreFromCacheCallback): Add an Element to the special page-restoration callback list
635         (WebCore::Document::unregisterForDidRestoreFromCacheCallback): Remove such an element
636         (WebCore::Document::didRestoreFromCache): Called by FrameLoader - dispatch to all the registered elements
637         (WebCore::Document::setUseSecureKeyboardEntryWhenActive): Set the local flag and call updateSecureKeyboardEntryIfActive
638           on the Frame
639         (WebCore::Document::useSecureKeyboardEntryWhenActive): Return the flag
640
641         * dom/Document.h:
642         (WebCore::Document::unregisterFormElementWithState): Renamed
643
644         * dom/Element.h:
645         (WebCore::Element::didRestoreFromCache): Added virtual base method
646
647         * html/HTMLInputElement.cpp:
648         (WebCore::HTMLInputElement::~HTMLInputElement): Deregister from the document if inputType == PASSWORD
649         (WebCore::HTMLInputElement::dispatchFocusEvent): Set the flag on the document, not the frame
650         (WebCore::HTMLInputElement::dispatchBlurEvent): Ditto
651         (WebCore::HTMLInputElement::setInputType): If changing to/from PASSWORD, register/deregister in the document accordingly
652         (WebCore::HTMLInputElement::attach): Call registerForDidRestoreFromCacheCallback(this) instead of passwordFieldAdded()
653         (WebCore::HTMLInputElement::didRestoreFromCache): Call reset();
654         * html/HTMLInputElement.h:
655
656         * html/HTMLSelectElement.cpp:
657         (WebCore::HTMLSelectElement::~HTMLSelectElement): Renamed deregisterFormElementWithState to unregisterFormElementWithState
658         * html/HTMLTextAreaElement.cpp:
659         (WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Ditto
660
661         * loader/FrameLoader.cpp:
662         (WebCore::FrameLoader::canCachePage): Remove the check for password fields - they're allowed now!
663         (WebCore::FrameLoader::opened): Tell the document to dispatch to the registered elements
664         (WebCore::FrameLoader::saveDocumentState): Remove the check for password fields.  Turns out that when we grab a copy a the
665           form state we're only copying the state of form elements that are registered with the Document - and that set 
666           explicitly excludes Password elements
667
668         * page/Frame.cpp:
669         (WebCore::Frame::setDocument): If the frame is active, set the setUseSecureKeyboardEntry based on the setting contained
670           in the new document
671         (WebCore::Frame::updateSecureKeyboardEntryIfActive): Notification for the secure entry flag changing - if the Frame is
672           active, then update to the new setting from the document
673         (WebCore::Frame::setIsActive): Grab the useSecureKeyboardEntry flag from the document instead of FramePrivate
674         (WebCore::FramePrivate::FramePrivate):
675         * page/Frame.h:
676         * page/FramePrivate.h:
677
678 2007-05-12  David Hyatt  <hyatt@apple.com>
679
680         FIx for 13696.  Rework residual style to be much more aggressive about reopening.  Added
681         a comprehensive test case of HTML tags to guarantee we match Firefox.  We now have an exclusion
682         set rather than an inclusion set, so unknown future tags will also participate in residual style.
683
684         Reviewed by olliej
685
686         fast/invalid/residual-style.html
687
688 2007-05-12  David Hyatt  <hyatt@apple.com>
689
690         Fix for bug 12740, bmw.com doesn't work.  We were missing a rule that is covered by the HTML5
691         parsing spec.  A <table> encountered while inside stray table content should close up the
692         table responsible for the stray content and start the new table as a sibling of the first.
693
694         Reviewed by mjs
695
696         fast/invalid/table-inside-stray-table-content.html
697
698 2007-05-12  Eric Seidel  <eric@webkit.org>
699
700         Reviewed by mjs.
701
702         Crash starting Safari with JavaScript disabled.
703         http://bugs.webkit.org/show_bug.cgi?id=13691
704         
705         Test: none possible.
706
707         * page/mac/FrameMac.mm:
708         (WebCore::Frame::cleanupPlatformScriptObjects): NULL check d->m_script
709
710 2007-05-11  David Hyatt  <hyatt@apple.com>
711
712         Fix for http://bugs.webkit.org/show_bug.cgi?id=13688, Colloquy is broken!
713
714         Make sure to adjust the baseline of a percentage height table cell's row if the
715         cell flexes (and lowers the baseline).
716
717         Reviewed by olliej
718
719         fast/tables/vertical-align-baseline-readjust.html
720
721         (WebCore::RenderTableSection::calcRowHeight):
722         (WebCore::RenderTableSection::layoutRows):
723         * rendering/RenderTableSection.h:
724         (WebCore::RenderTableSection::getBaseline):
725         
726 2007-05-11  David Hyatt  <hyatt@apple.com>
727
728         Make sure focus rings are always using the exterior style, regardless
729         of what the OS default is.
730
731         Reviewed by beth
732
733         * rendering/RenderThemeMac.mm:
734         (WebCore::RenderThemeMac::checkbox):
735         (WebCore::RenderThemeMac::radio):
736         (WebCore::RenderThemeMac::popupButton):
737         (WebCore::RenderThemeMac::search):
738         (WebCore::RenderThemeMac::sliderThumbHorizontal):
739         (WebCore::RenderThemeMac::sliderThumbVertical):
740
741 2007-05-11  Oliver Hunt  <oliver@apple.com>
742
743         Reviewed by Hyatt.
744         
745         <rdar://problem/5195473> REGRESSION: "Curly quote" fails to 
746         be displayed correctly even when META tag specifies charset=x-mac-roman
747
748
749         * platform/TextCodecICU.cpp:
750         (WebCore::TextCodecICU::registerExtendedEncodingNames):
751         Register the xmacroman encoding
752
753 2007-05-11  Maciej Stachowiak  <mjs@apple.com>
754
755         Reviewed by Hyatt.
756
757         REGRESSION (r21367): Crash due to null document deref when closing bookmarks
758         http://bugs.webkit.org/show_bug.cgi?id=13662
759
760         * loader/FrameLoader.cpp:
761         (WebCore::FrameLoader::provisionalLoadStarted): Remove some useless and now harmful
762         code - there's no need to clear in this case.
763
764 2007-05-11  Oliver Hunt  <oliver@apple.com>
765
766         GDK Build fix
767
768         * ChangeLog:
769         * dom/Document.cpp:
770         (WebCore::Document::importNode):
771
772 2007-05-11  Maciej Stachowiak  <mjs@apple.com>
773
774         Reviewed by Geoff.
775         
776         - fixed <rdar://problem/5197621> closing second window crashed webkit (13660)
777         http://bugs.webkit.org/show_bug.cgi?id=13660
778
779         No test case; not testable.
780
781         * page/mac/FrameMac.mm:
782         (WebCore::Frame::cleanupPlatformScriptObjects): Check if the interpreter is null;
783         if so, we don't want to do work that may lazily create it while the Frame is being
784         destroyed.
785
786 2007-05-11  Oliver Hunt  <oliver@apple.com>
787
788         Reviewed by Brady.
789         
790         <rdar://problem/5017375> WebKit should disable SVG in Dashboard
791         
792         Prevents an SVG document or element from being created when in
793         dashboard compatibility mode.
794         
795         Manually parsing, or using XHR to created a document removes our 
796         ability to detect Dashboard compatibility mode, so we also perform
797         the check when importing nodes from one document into another.
798
799         * dom/DOMImplementation.cpp:
800         (WebCore::DOMImplementation::createDocument):
801           Don't create an SVGDocument if we're in dashboard compatibility mode
802           
803         * dom/Document.cpp:
804         (WebCore::Document::importNode):
805           Don't import SVG nodes if we're in dashboard compatibility mode
806           
807         * ksvg2/scripts/make_names.pl:
808           Don't create SVG elements for documents that are in dashboard
809           compatibility mode
810
811 2007-05-11  Holger Hans Peter Freyther  <zecke@selfish.org>
812
813         Reviewed by Maciej.
814
815         Bug 13676: [cairo/gdk] Provide implementation for ImageBufferCairo
816         http://bugs.webkit.org/show_bug.cgi?id=13676
817
818         There are no test cases that explicitly cover platform/graphics at present.
819
820         * platform/graphics/ImageBuffer.h: Add cairo bits
821         * platform/graphics/cairo/ImageBufferCairo.cpp: Untested implementation of the ImagerBuffer using the image_surface
822         (WebCore::ImageBuffer::create): Create a reasonable sized surface
823         (WebCore::ImageBuffer::ImageBuffer): Use a cairo_surface and create a GraphicsContext. GraphicsContext takes the cairo_t ownership
824         (WebCore::ImageBuffer::~ImageBuffer): Unref the surface
825         (WebCore::ImageBuffer::context): simply return the GraphicsContext, it should be possible to directly draw on it.
826
827 2007-05-11  Mitz Pettel  <mitz@webkit.org>
828
829         Release build fix.
830
831         * platform/mac/ShapeArabic.c:
832         (shapeArabic):
833
834 2007-05-11  Geoffrey Garen  <ggaren@apple.com>
835
836         Reviewed by Darin Adler.
837
838         Removed +[WebScriptObject scriptObjectForJSObject:frame:] because the
839         WebScriptObject API has some serious limitations that make it not ready
840         to be used everywhere the C API is used. Hopefully we can add a good
841         ObjC API in the future that doesn't suffer from this problem.
842         
843         Preliminary notes about these limitations are in <rdar://problem/4876466>.
844
845         * bindings/objc/WebScriptObject.mm:
846         * bindings/objc/WebScriptObjectPendingPublic.h:
847
848 2007-05-11  Mitz Pettel  <mitz@webkit.org>
849
850         Reviewed by Darin.
851
852         - fix http://bugs.webkit.org/show_bug.cgi?id=13635
853           REGRESSION: Cannot log in to webmail.co.za account
854
855         Test: fast/dom/HTMLOptionElement/option-text.html
856
857         Despite the specification that the 'text' attribute of HTMLOptionElement
858         is "the text contained within the option element", other browsers return
859         the text as displayed in the list box or popup, which is without leading,
860         trailing and collapsible whitespace.
861
862         * html/HTMLOptionElement.cpp:
863         (WebCore::HTMLOptionElement::text): Moved the code to trim and collapse
864         whitespace and replace backslashes with the currency symbol into this
865         function.
866         (WebCore::HTMLOptionElement::optionText): Left only the code that adds
867         the leading spaces for grouped options. Removed code that, in quirks mode,
868         displayed the label if the option element contained no text. That behavior
869         did not match WinIE and the description of the expected behavior in
870         fast/forms/HTMLOptionElement_label06.html.
871
872 2007-05-11  Mitz Pettel  <mitz@webkit.org>
873
874         Reviewed by Darin.
875
876         - fix http://bugs.webkit.org/show_bug.cgi?id=13572
877           Arabic characters are not correctly joined when using Arial
878
879         No tests added because standard fonts do not use the character-based shaping
880         code path.
881
882         Added shapeArabic(), a private version of u_shapeArabic() from ICU,
883         patched to shape Arabic characters used in Persian, Urdu, Sindhi, etc.
884         (whose contextual forms belong to the Arabic Presentation Forms-A block).
885
886         * WebCore.xcodeproj/project.pbxproj: Added ShapeArabic.{c,h}.
887         * platform/mac/FontMac.mm:
888         (WebCore::shapeArabic): Changed to call shapeArabic() instead of u_shapeArabic().
889         * platform/mac/ShapeArabic.c: Added. Based on ushape.c from ICU, with
890         additional shaping data and logic for Arabic Presentation Forms-A. Removed
891         many options that are not used in WebKit and code that malloc()ed a temporary
892         buffer and reversed the string.
893         (changeLamAlef):
894         (specialChar):
895         (getLink):
896         (isTashkeelChar):
897         (shapeUnicode):
898         (shapeArabic):
899         * platform/mac/ShapeArabic.h: Added.
900
901 2007-05-11  Darin Adler  <darin@apple.com>
902
903         Reviewed by Mitz.
904
905         - fix http://bugs.webkit.org/show_bug.cgi?id=7452
906           <rdar://problem/3211749> line breaks ignored after <wbr> in <pre> block (affects livejournal.com)
907
908         - fix http://bugs.webkit.org/show_bug.cgi?id=10657
909           <rdar://problem/4274588> <wbr> tags are ignored
910
911         - fix http://bugs.webkit.org/show_bug.cgi?id=12689
912           <wbr> :before/:after content causes line break
913
914         - fix <rdar://problem/5127366> DOM tree isn't correct when parsing with <wbr>
915
916         Test: fast/text/wbr-pre.html
917         Test: fast/text/wbr.html
918         Test: fast/css-generated-content/wbr-with-before-content.html
919         Test: fast/parser/parse-wbr.html
920
921         * html/HTMLElement.h:
922         * html/HTMLElement.cpp:
923         (WebCore::HTMLElement::endTagRequirement): Use the same end tag requirement for a <wbr>
924         element as for a <br> element, TagStatusForbidden.
925         (WebCore::HTMLElement::tagPriority): Use the same priority for a <wbr> element as for a
926         <br> element, 0.
927         (WebCore::HTMLElement::createRenderer): Added. Create a RenderWordBreak to trigger the
928         new rendering code paths.
929
930         * rendering/RenderFlow.h: Add a virtual isWordBreak so we can detect RenderWordBreak.
931
932         * rendering/RenderWordBreak.h: Added.
933         * rendering/RenderWordBreak.cpp: Added.
934
935         * WebCore.pro: Added new files.
936         * WebCore.xcodeproj/project.pbxproj: Added new files.
937         * WebCoreSources.bkl: Added new files.
938
939         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::calcInlinePrefWidths): Reset the
940         line when we hit a <wbr>.
941         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Add a line break when
942         we hit a <wbr>.
943
944         * dom/Node.cpp: (Node::createRendererIfNeeded): Fix a null check for the case where
945         createRenderer returns 0 even though rendererIsNeeded returned true. I can't reproduce
946         it on demand, but while running layout tests I hit this once. Since there was already
947         a null check here, I rearranged it so it guards all the code that uses the renderer.
948         Later we might want to figure out under exactly what circumstances rendererIsNeeded
949         will return true but createRenderer return 0 and consider eliminating them.
950
951 2007-05-11  David Hyatt  <hyatt@apple.com>
952
953         Fix for bug 13675, focus rings don't repaint properly on editable
954         continuations.
955
956         Reviewed by olliej
957
958         (WebCore::InlineFlowBox::paint):
959         * rendering/RenderBlock.cpp:
960         (WebCore::RenderBlock::paintObject):
961         (WebCore::continuationOutlineTable):
962         (WebCore::RenderBlock::addContinuationWithOutline):
963         (WebCore::RenderBlock::paintContinuationOutlines):
964         * rendering/RenderBlock.h:
965         * rendering/RenderBox.cpp:
966         (WebCore::RenderBox::absoluteClippedOverflowRect):
967         * rendering/RenderObject.cpp:
968         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
969         (WebCore::RenderObject::absoluteOutlineBox):
970
971 2007-05-11  Rob Buis  <buis@kde.org>
972
973         Reviewed by Oliver.
974
975         Cleanups mostly inspired by Coverage results.
976
977         * ksvg2/css/SVGCSSParser.cpp:
978         (WebCore::CSSParser::parseSVGValue):
979         (WebCore::CSSParser::parseSVGStrokeDasharray):
980         * ksvg2/css/SVGRenderStyleDefs.cpp:
981         (StyleFillData::operator==):
982         * ksvg2/svg/SVGColor.cpp:
983         (WebCore::SVGColor::colorFromRGBColorString):
984
985 2007-05-11  Holger Freyther <freyther@kde.org>
986
987         Reviewed by Mark Rowe.
988
989         Move libcurl configuration into WebKit.pri so it will be used by GdkLauncher.
990
991         * WebCore.pro:
992
993 2007-05-10  David Hyatt  <hyatt@apple.com>
994
995         <rdar://problem/5015522> Bounds rectangle of unloaded images is 
996         drawn briefly while loading
997         
998         When the image is null and has no size, don't draw the grey
999         rectangles or alt text any more.  Wait for an actual error to
1000         occur with the image before we start showing alt text and borders.
1001
1002         (Images with no source set at all will continue to show alt text and
1003         borders immediately.)
1004
1005         Reviewed by bradee-oh
1006
1007         * rendering/RenderImage.cpp:
1008         (WebCore::RenderImage::paint):
1009
1010 2007-05-10  Mitz Pettel  <mitz@webkit.org>
1011
1012         Reviewed by Darin.
1013
1014         - fix http://bugs.webkit.org/show_bug.cgi?id=13655
1015           Incomplete repaint when text-shadow is used in a render layer with explicit height
1016
1017         Test: fast/repaint/layer-full-repaint.html
1018
1019         Removed custom repaint logic from RenderLayer. repaintAfterLayoutIfNeeded()
1020         knows how to do everything we need now. The only catch is that we cannot
1021         rely on its "do a full repaint if the object needs layout" behavior, since
1022         by the time we call it, the needs layout flag has been reset. The solution
1023         is to cache the need for a full repaint in the layer.
1024
1025         * page/FrameView.cpp:
1026         (WebCore::FrameView::layout): Removed call to checkForRepaintOnResize().
1027         * rendering/RenderLayer.cpp:
1028         (WebCore::RenderLayer::checkForRepaintOnResize): Removed.
1029         (WebCore::RenderLayer::RenderLayer): Replaced the m_repaintOverflowOnResize
1030         flag with a m_needsFullRepaint flag, which indicates that the layer needs
1031         to do a full repaint in the next call to updateLayerPositions().
1032         (WebCore::RenderLayer::updateLayerPositions): Simplified the repaint logic.
1033         Either call repaintAfterLayoutIfNeeded() or do a full repaint, depending on
1034         m_needsFullRepaint.
1035         * rendering/RenderLayer.h:
1036         (WebCore::RenderLayer::setNeedsFullRepaint):
1037         * rendering/RenderObject.cpp:
1038         (WebCore::RenderObject::setNeedsLayout): Mark the layer for full repaint.
1039
1040 2007-05-10  Justin Garcia  <justin.garcia@apple.com>
1041
1042         Reviewed by ggaren
1043
1044         <rdar://problem/5195166> Incorrect proposedRange DOMRange passed to WebViewEditing delegate
1045         
1046         In setModifyBias, we must cache the start and the end 
1047         because the calls to setBase and setExtent can modify 
1048         them (added a testcase).
1049         The temporary SelectionController that we use in modify() to
1050         produce the proposed range that will be passed to 
1051         shouldChangeSelectedDOMRange must have the same m_modifyBias
1052         as the original SelectionController, or else when the 
1053         modification is performed, setModifyBias can swap the base 
1054         and the extent incorrectly (added a testcase).
1055         Renamed m_modifyBias to m_lastChangeWasHorizontalExtension.
1056         Renamed setModifyBias to willBeModified.
1057
1058         * editing/SelectionController.cpp:
1059         (WebCore::SelectionController::SelectionController):
1060         (WebCore::SelectionController::setSelection):
1061         (WebCore::SelectionController::willBeModified):
1062         (WebCore::SelectionController::modify):
1063         * editing/SelectionController.h:
1064         (WebCore::SelectionController::setLastChangeWasHorizontalExtension):
1065         * page/EventHandler.cpp:
1066         (WebCore::EventHandler::handleMousePressEventSingleClick):
1067         (WebCore::EventHandler::updateSelectionForMouseDragOverPosition):
1068
1069 2007-05-10  Geoffrey Garen  <ggaren@apple.com>
1070
1071         Reviewed by Darin Adler.
1072
1073         "IconDatabase::sharedIconDatabase()" => "iconDatabase()" for terseness,
1074         in the style of WebCore::cache().
1075
1076         * WebCore.exp:
1077         * history/HistoryItem.cpp: Removed retainIconInDatabase because calling
1078         "retain" in order to release something is really confusing and, now that
1079         iconDatabase() is more terse, we don't need this helper to shorten the
1080         syntax. (The isEmpty() check is also done by the database, so we don't 
1081         need it either.)
1082
1083         (WebCore::IconDatabase::~IconDatabase): ASSERT that our destructor isn't
1084         called. We're a singleton, so it's confusing to have tear-down code.
1085
1086 2007-05-10  Adele Peterson  <adele@apple.com>
1087
1088         Reviewed by Hyatt.
1089
1090         WebCore part of fix for <rdar://problem/4100616> Doing a "find" in RSS doesn't scroll to result
1091
1092         Test: fast/overflow/scroll-nested-positioned-layer-in-overflow.html
1093
1094         Merged visibleSelectionRect into selectionRect.  selectionRect() now takes an argument to determine
1095         whether or not to return a rect that clips to the visible content.  This change makes all of the implementations of selectionRect
1096         consistent by having them all consider the repaint rect when clipping to visible content.
1097
1098         * page/Frame.cpp:
1099         (WebCore::Frame::revealSelection): Call selectionRect with clipToVisibleContent = false, so we can get a rect that's not visible to reveal.
1100         (WebCore::Frame::selectionRect): Added clipToVisibleContent argument, and merged visibleSelectionRect into this method.
1101         (WebCore::Frame::setIsActive): Use selectionRect instead of visibleSelectionRect.
1102         * page/Frame.h:
1103         * page/mac/FrameMac.mm: (WebCore::Frame::selectionImage): Update layout before creating the image.  Use selectionRect instead of visibleSelectionRect.
1104         * page/DragController.cpp: (WebCore::dragLocForSelectionDrag): Use selectionRect instead of visibleSelectionRect.
1105
1106         * rendering/RenderBR.h: (WebCore::RenderBR::selectionRect): Updated argument.
1107         * rendering/RenderBlock.h: (WebCore::RenderBlock::selectionRect): ditto.
1108         * rendering/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::selectionRect): ditto.
1109         * rendering/RenderSVGInlineText.h: ditto.
1110         * rendering/RenderObject.h: 
1111         (WebCore::RenderObject::selectionRect): ditto.
1112         (WebCore::RenderObject::SelectionInfo::SelectionInfo): ditto.
1113         * rendering/RenderView.cpp:
1114         (WebCore::RenderView::selectionRect): ditto.
1115         (WebCore::RenderView::setSelection): ditto.
1116         * rendering/RenderView.h:
1117
1118         * rendering/RenderText.h:
1119         * rendering/RenderText.cpp: (WebCore::RenderText::selectionRect): Only call computeAbsoluteRepaintRect when clipping to visible content.
1120         Otherwise, just adjust the rect to the correct position.
1121         * rendering/RenderListMarker.h:
1122         * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::selectionRect):
1123           To match what we do in RenderText, if we're trying to clip to visible content, just call computeAbsoluteRepaintRect.
1124         * rendering/RenderReplaced.h:
1125         * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::selectionRect): ditto.
1126
1127         * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Check for a parent layer at the beginning, so we can try to scroll all of our parent layers 
1128           first, before trying to scroll the top level view.  Also, don't try to scroll overflow layers that have -webkit-line-clamp restricting the height.
1129           This will prevent us from revealing text hidden by the slider in Safari RSS.
1130
1131         * WebCore.exp: Update symbols for WebKit.
1132
1133 2007-05-10  David Hyatt  <hyatt@apple.com>
1134
1135         Fix for:
1136
1137         <rdar://problem/5195272> REGRESSION: broke outline rings for continuations 
1138         with empty inline containers
1139         
1140         http://bugs.webkit.org/show_bug.cgi?id=13667
1141
1142         Make sure to only include collapsed top/bottom margins of the block portion
1143         of the continuation if we know for sure that we have inline line boxes before
1144         and after that would prevent the collapse from going further.
1145
1146         In plain English: the focus rings were too tall. :)
1147
1148         Reviewed by beth
1149
1150         * rendering/RenderFlow.cpp:
1151         (WebCore::RenderFlow::addFocusRingRects):
1152
1153 2007-05-10  David Hyatt  <hyatt@apple.com>
1154
1155         Fix for:
1156
1157         <rdar://problem/5067235> REGRESSION: Excessively wide table, impossible to resize
1158
1159         The table used white-space: pre-wrap, which is supported only by WebKit.  There
1160         was a bug with the computation of min pref width for pre-wrap text.
1161
1162         Reviewed by mitzpettel
1163
1164         fast/text/white-space/pre-wrap-line-test.html
1165
1166         * rendering/RenderText.cpp:
1167         (WebCore::RenderText::calcPrefWidths):
1168
1169 2007-05-10  Brady Eidson  <beidson@apple.com>
1170
1171         Reviewed by Oliver
1172
1173         Cleanup from my earlier Java Applet patch.  We should keep a central location to query if 
1174         a mime type counts as a Java Applet
1175
1176         * html/HTMLObjectElement.cpp:
1177         (WebCore::HTMLObjectElement::containsJavaApplet): Query MimeTypeRegistry on the type
1178
1179         * platform/MimeTypeRegistry.cpp:
1180         (WebCore::MimeTypeRegistry::isSupportedImageMIMEType): Update style
1181         (WebCore::MimeTypeRegistry::isSupportedImageResourceMIMEType): Ditto
1182         (WebCore::MimeTypeRegistry::isSupportedNonImageMIMEType): Ditto
1183         (WebCore::MimeTypeRegistry::isJavaAppletMIMEType): Perform the Java Applet check
1184         * platform/MimeTypeRegistry.h:
1185
1186         * rendering/RenderPartObject.cpp:
1187         (WebCore::RenderPartObject::updateWidget): Query MimeTypeRegistry on the type
1188
1189 2007-05-10  Patti Hoa  <patti@apple.com>
1190
1191         Reviewed by Darin.
1192         
1193         <rdar://problem/4720109> Sentence textMarker methods do not work well with empty lines
1194         
1195         * bridge/mac/WebCoreAXObject.mm:
1196         (-[WebCoreAXObject doAXNextSentenceEndTextMarkerForTextMarker:]):
1197         (-[WebCoreAXObject doAXPreviousSentenceStartTextMarkerForTextMarker:]):
1198         When a marker position is given, the sentence ax methods automatically shift position by one to make sure
1199         not to ask for the current sentence again.  This is generally fine except when the position
1200         shift over an empty line break, which is should be considered a separate sentence. In this case, 
1201         if we used the shifted position to ask for sentence boundary, ICU parser is not given the text data
1202         containing the newline to correctly determine the sentence boundary.  Since the ax sentence method is 
1203         explicitly shifting the position to ask for sentence boundary, it should make sure not to skip over important
1204         character that can be a standalone sentence.
1205         * editing/visible_units.cpp:
1206         (WebCore::nextBoundary):
1207         When determining boundary, don't stop on a collapsed range, such as newline.  
1208         Just pick the next valid position to use as boundary.
1209
1210 2007-05-10  Maciej Stachowiak  <mjs@apple.com>
1211
1212         Reviewed by Oliver.
1213
1214         - WebCore part of fix for:
1215         <rdar://problem/5063277> blank screen after login to Citibank Online (accessing document before frame starts loading cancels load)
1216         <rdar://problem/5159541> REGRESSION (r20972): Wall Street Journal pages replaced by advertisements (13465)
1217
1218         The basic approach is to have Frames start out containing an empty document instead of absolutely nothing,
1219         so there is no need to initialize them on demand. Various side effects of that cause both of these bugs.
1220         
1221         However, this caused many regressions so I had to fix the fallout.
1222         
1223         * WebCore.exp: fix symbol exports
1224         * bindings/js/kjs_window.cpp:
1225         (KJS::createNewWindow): useless "created" bool (we don't need it here)
1226         (KJS::WindowFunc::callAsFunction): detect if we created a new frame, because if so,
1227         we need to initialize the domain (can't count on it not having a document), also
1228         don't try to make a new document for it.
1229         Also, stop properly.
1230         * css/cssstyleselector.cpp:
1231         (WebCore::CSSStyleSelector::CSSStyleSelector): don't count on document having a view here
1232         * html/HTMLObjectElement.cpp:
1233         (WebCore::HTMLObjectElement::isImageType): Ask client, to match how other <object> renderer
1234         decisions are made.
1235         * loader/FrameLoader.cpp:
1236         (WebCore::FrameLoader::FrameLoader): Initialize new data members
1237         (WebCore::FrameLoader::init): Do the slightly tricky sequence of steps to properly make
1238         an empty document with everything hooked up.
1239         (WebCore::FrameLoader::createWindow): Added "created" bool.
1240         (WebCore::FrameLoader::stopLoading): (whitespace change)
1241         (WebCore::FrameLoader::begin): Don't try to create an empty document.
1242         (WebCore::FrameLoader::finishedParsing): If creating an initial empty document, don't
1243         do any of this work.
1244         (WebCore::FrameLoader::checkCompleted): Do checkLoadComplete() as well.
1245         (WebCore::FrameLoader::baseURL): don't check for null document
1246         (WebCore::FrameLoader::baseTarget): ditto
1247         (WebCore::FrameLoader::completeURL): ditto
1248         (WebCore::FrameLoader::didTellBridgeAboutLoad): ditto
1249         (WebCore::FrameLoader::scheduleLocationChange): determine duringLoad differently; doc won't
1250         be null.
1251         (WebCore::FrameLoader::gotoAnchor): don't check for null document
1252         (WebCore::FrameLoader::canTarget): don't check for null document
1253         (WebCore::FrameLoader::stopForUserCancel): new method for explicit stops like window.stop().
1254         (WebCore::FrameLoader::transitionToCommitted): check for pre-loaded state properly
1255         (WebCore::FrameLoader::createEmptyDocument): removed
1256         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): don't send delegate callbacks when making initial
1257         doc.
1258         (WebCore::FrameLoader::tokenizerProcessedData): Assume document; just checkCompleted now that it
1259         does checkLoadComplete.
1260         (WebCore::FrameLoader::receivedMainResourceError): assume document
1261         (WebCore::FrameLoader::saveDocumentState): Assume there's a document except during initial load
1262         (WebCore::FrameLoader::mainReceivedCompleteError): do checkCompleted, not checkLoadComplete
1263         (WebCore::FrameLoader::continueLoadWithData): assume document
1264         * loader/FrameLoader.h:
1265         * loader/MainResourceLoader.cpp:
1266         (WebCore::MainResourceLoader::receivedError): Add more ref protection and do things in a slightly
1267         different order.
1268         * page/DOMWindow.cpp:
1269         (WebCore::DOMWindow::document): don't force document creation, just assert there is one.
1270         * page/Frame.cpp:
1271         (WebCore::Frame::init): Added init method.
1272         (WebCore::Frame::pageDestroyed): when a frame is removed, make sure to check if the parent is
1273         done loading.
1274         * page/Frame.h:
1275         * page/mac/WebCoreFrameBridge.mm:
1276         (-[WebCoreFrameBridge stringByEvaluatingJavaScriptFromString:forceUserGesture:]): No need to force
1277         document.
1278         (-[WebCoreFrameBridge aeDescByEvaluatingJavaScriptFromString:]): ditto
1279         * platform/graphics/svg/SVGImage.cpp:
1280         (WebCore::SVGImage::dataChanged): init the frame
1281         * rendering/RenderPart.cpp:
1282         (WebCore::RenderPart::updateWidgetPosition): If a subframe needs layout, then lay it out even
1283         if the bounds did not change; the content size might be wrong.
1284         * rendering/RenderTreeAsText.cpp:
1285         (WebCore::externalRepresentation): Don't crash if the frame lacks a view.
1286
1287 2007-05-10  David Hyatt  <hyatt@apple.com>
1288
1289         Fix for:
1290
1291         <rdar://problem/5146757> REGRESSION: div that wrapped to screen width in 
1292         tiger no longer wraps
1293         
1294         http://bugs.webkit.org/show_bug.cgi?id=13654
1295
1296         Reviewed by mitz
1297
1298         fast/text/whitespace/normal-after-nowrap-breaking.html
1299
1300         * rendering/RenderBlock.cpp:
1301         (WebCore::RenderBlock::calcInlinePrefWidths):
1302
1303 2007-05-10  David Hyatt  <hyatt@apple.com>
1304
1305         Fix for:
1306
1307         <rdar://problem/4778099> Links with nested continuations fail to 
1308         paint their outlines (11255)
1309         
1310         http://bugs.webkit.org/show_bug.cgi?id=11255
1311
1312         Fix multiple bugs with outline painting of continuations to ensure that
1313         all combos work (empty/full inline - block with/without margins - 
1314         empty/full inline).
1315
1316         Reviewed by mitz
1317
1318         fast/inline/continuation-outlines.html
1319
1320         * rendering/RenderBlock.cpp:
1321         (WebCore::RenderBlock::paintObject):
1322         * rendering/RenderFlow.cpp:
1323         (WebCore::RenderFlow::addFocusRingRects):
1324
1325 2007-05-10  David Hyatt  <hyatt@apple.com>
1326
1327         Fix for:
1328
1329         <rdar://problem/5193529> REGRESSION: RTL Overflows scrollbar not showing 
1330         when they should be
1331         
1332         Fallout from fix for bug 11926.  Make sure to restrict the fix to the
1333         RenderView for now, since the full-blown overflow case is pretty involved.
1334
1335         Reviewed by mitzpettel
1336
1337         fast/overflow/unreachable-content-bug-rtl.html
1338
1339         * rendering/RenderBlock.cpp:
1340         (WebCore::RenderBlock::lowestPosition):
1341         (WebCore::RenderBlock::rightmostPosition):
1342         (WebCore::RenderBlock::leftmostPosition):
1343
1344 2007-05-10  Brady Eidson <beidson@apple.com>
1345
1346         Reviewed by Oliver
1347
1348         Fix for http://bugs.webkit.org/show_bug.cgi?id=13636 and <rdar://problem/5190816>
1349
1350         When creating the applets collection, be sure to only count Objects if they contain
1351         a java applet
1352
1353         * html/HTMLCollection.cpp:
1354         (WebCore::HTMLCollection::traverseNextItem): Add the qualifier for Objects that 
1355           containsJavaApplet() must be true
1356
1357         * html/HTMLObjectElement.cpp:
1358         (WebCore::HTMLObjectElement::containsJavaApplet): Check this Object element and inner
1359           nodes for any Java applets
1360         * html/HTMLObjectElement.h: 
1361
1362 2007-05-10  David Hyatt  <hyatt@apple.com>
1363
1364         Fix for:
1365
1366         <rdar://problem/4694859> SAP: HTML tags with overflow:hidden consume
1367         space on page, do not consume space in Firefox (11926)
1368
1369         http://bugs.webkit.org/show_bug.cgi?id=11926
1370
1371         Make sure that unreachable objects along one axis (e.g., top/left) do not
1372         contribute to the scrollable area in the opposite axis (e.g., right/bottom).
1373
1374         Reviewed by olliej
1375
1376         fast/overflow/unreachable-content-test.html
1377
1378         * rendering/RenderBlock.cpp:
1379         (WebCore::RenderBlock::lowestPosition):
1380         (WebCore::RenderBlock::rightmostPosition):
1381         (WebCore::RenderBlock::leftmostPosition):
1382
1383 2007-05-10  David Hyatt  <hyatt@apple.com>
1384
1385         Fix for:
1386
1387         <rdar://problem/4656825> REGRESSION: Japanese TV time table widget:
1388         part of the number in background has been cut off.
1389
1390         Now that opacity uses a tight bounding box to clip, we need to make sure
1391         to factor spillout caused by negative letter spacing into our right
1392         overflow.  Latch on to the code that does this already for text-stroke
1393         and text-shadow.
1394
1395         Reviewed by olliej
1396
1397         fast/text/letter-spacing-negative-opacity.html
1398
1399        * rendering/InlineFlowBox.cpp:
1400         (WebCore::InlineFlowBox::placeBoxesHorizontally):
1401
1402 2007-05-10  Geoffrey Garen  <ggaren@apple.com>
1403
1404         Reviewed by Maciej Stachowiak.
1405         
1406         More fix-ups to the WebScriptObject/WebScripting APIs, related to
1407         <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView 
1408         or WebFrame
1409
1410         * bindings/objc/WebScriptObject.h: Fully specified the surprising rules for
1411         type conversion between JavaScript and ObjC.
1412         * bindings/objc/WebScriptObject.mm: Added up-call accessor to WebFrame.
1413         This is kind of stinky, but I'm OK with it because eventually all of this
1414         code should move up into WebKit.
1415         (+[WebScriptObject scriptObjectForJSObject:frame:]):
1416         (-[WebScriptObject valueForKey:]):
1417         (-[WebScriptObject JSObject]): 
1418             - Added _rootObject check because if _rootObject returns NULL it means 
1419             that _imp is no longer GC protected, so it's not safe to use. 
1420             - Added _isSafeScript check because that's what WebScriptObject methods
1421             typically do, even though the value of doing so isn't clear to me.
1422         * bindings/objc/WebScriptObjectPendingPublic.h: Added WebFrame* parameter
1423         to -scriptObjectForJSObject:. This is required to wrap JS objects that
1424         are not already in the wrapper cache. It would be nice to remove this
1425         limitation of WebScriptObject some day.
1426         * page/mac/FrameMac.mm:
1427         (WebCore::Frame::cleanupPlatformScriptObjects): Force removal of m_windowScriptObject
1428         from the cache, to avoid retrieving the m_windowScriptObject from the previous
1429         page on a new page load. (It would be non-functional in that case.)
1430
1431 2007-05-10  David Hyatt  <hyatt@apple.com>
1432
1433         Fix for <rdar://problem/5183697>.
1434
1435         http://bugs.webkit.org/show_bug.cgi?id=13576
1436
1437         Make sure verticalPositionHint is not called on an inline-block from
1438         content inside the inline-block (like text).
1439
1440         Reviewed by olliej
1441
1442         fast/inline-block/inline-block-vertical-align.html
1443
1444         * rendering/RenderObject.cpp:
1445         (WebCore::RenderObject::verticalPositionHint):
1446         * rendering/RenderText.cpp:
1447         (WebCore::RenderText::verticalPositionHint):
1448         * rendering/RenderThemeMac.mm:
1449         (WebCore::RenderThemeMac::setFontFromControlSize):
1450
1451 2007-05-09  Holger Freyther <zecke@selfish.org>
1452
1453         Reviewed by Mark Rowe.
1454
1455         Gdk build fix with SVG enabled.  Stub out ImageBufferCairo.
1456
1457         * WebCore.pro: Build ImageBufferCairo.cpp
1458         * platform/graphics/cairo/ImageBufferCairo.cpp: Added.
1459         (WebCore::ImageBuffer::create):
1460         (WebCore::ImageBuffer::~ImageBuffer):
1461         (WebCore::ImageBuffer::context):
1462
1463 2007-05-08  Justin Garcia  <justin.garcia@apple.com>
1464
1465         Reviewed by darin
1466         
1467         <rdar://problem/5017613> Style changes don't effect fully selected ToDo content
1468
1469         * editing/ApplyStyleCommand.cpp:
1470         (WebCore::ApplyStyleCommand::applyInlineStyle):
1471         Use a for loop instead of while(1).
1472         Simplify loop termination using Range::pastEndNode.
1473         Don't handle the start.node() == end.node() case 
1474         specially, it's unnecessary.
1475         Apply the style change to fully selected plaintext-only
1476         regions, not with wrapper spans inside the region, but 
1477         by changing the element's inline style declaration.
1478         Don't descend into nodes whose children we should ignore.
1479
1480 2007-05-09  Adele Peterson  <adele@apple.com>
1481
1482         Reviewed by Hyatt.
1483
1484         Fix for <rdar://problem/5113578> REGRESSION: textfields that set the height but not the font 
1485         look different from IE & FF because the font is small
1486
1487         For plain text fields, don't stretch the inner text box.  Center it vertically in the field.
1488
1489         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::layout):
1490
1491 2007-05-09  Atul Mehrotra  <atul.mehrotra@celunite.com>
1492
1493         Gdk build fix.
1494
1495         * platform/gdk/TemporaryLinkStubs.cpp:
1496         (Editor::newGeneralClipboard):
1497
1498 2007-05-09  Mitz Pettel  <mitz@webkit.org>
1499
1500         Reviewed by Dave Hyatt.
1501
1502         - fix http://bugs.webkit.org/show_bug.cgi?id=13037
1503           REGRESSION: Copy-on-scroll not reset properly after back/forward navigation
1504
1505         * page/FrameView.cpp:
1506         (WebCore::FrameViewPrivate::FrameViewPrivate): Moved initialization of
1507         m_slowRepaintObjectCount here.
1508         (WebCore::FrameViewPrivate::reset): Do not reset the slow repaint object
1509         count here.
1510         (WebCore::FrameView::useSlowRepaints):
1511         (WebCore::FrameView::addSlowRepaintObject):
1512         (WebCore::FrameView::removeSlowRepaintObject): Added an assertion that the
1513         object count is positive.
1514         * rendering/RenderObject.cpp:
1515         (WebCore::RenderObject::setStyle): Corrected a mix up between old and new
1516         style, which caused the object count to be decremented when it was supposed
1517         to be incremented and vice versa.
1518
1519 2007-05-09  Peter Müller <pm@one.com>
1520
1521         Reviewed by Dave Hyatt.
1522
1523         Changed the hardcoded colors that are used for CSS 2.1 system colors.
1524         Previous colors had numerous conflicts in semantic pairs, which
1525         made text invisible in highlight, info and menu colored areas.
1526         The new hardcoded colors are inspired by Aqua.
1527
1528         Ideally these colors should be fetched through AppKit instead,
1529         though I am not sure if it is possible to make a 1:1 mapping
1530         between CSS2.1 system colors and Mac OS X.
1531
1532         * css/cssstyleselector.cpp:
1533         (WebCore::):
1534
1535 2007-05-09  Lars Knoll <lars@trolltech.com>
1536
1537         Fix the Qt build.
1538
1539         * editing/qt/EditorQt.cpp:
1540
1541 2007-05-08  Geoffrey Garen  <ggaren@apple.com>
1542
1543         Reviewed by Darin Adler.
1544         
1545         More fix-ups to the WebScriptObject/WebScripting APIs, related to
1546         <rdar://problem/5140447> API for fetching JSGlobalContextRef from WebView 
1547         or WebFrame
1548         
1549         1. Added -scriptObjectForJSObject: SPI so you can bridge back from JavaScriptCore
1550         to WebScriptObject.
1551         
1552         2. Fixed WebScriptObject bridging so that you always get the same WebScriptObject
1553         for a JSObject (like in the DOM). This makes -scriptObjectForJSObject: a
1554         lot more coherent as an API.
1555
1556         * bindings/objc/DOMInternal.mm: Renamed wrapperCache to DOMWrapperCache
1557         to distinguish from the JSWrapperCache. Added typedef for readability.
1558         (WebCore::getDOMWrapper):
1559         (WebCore::addDOMWrapper):
1560         (WebCore::removeDOMWrapper):
1561         * bindings/objc/WebScriptObject.mm: Added JSWrapperCache, which works just
1562         like the DOMWrapperCache.
1563         (WebCore::getJSWrapper):
1564         (WebCore::addJSWrapper):
1565         (WebCore::removeJSWrapper):
1566         (WebCore::createJSWrapper):
1567         (+[WebScriptObject scriptObjectForJSObject:]): This is the new API. It attempts
1568         to return a specific DOM wrapper object, or, barring that, it returns a 
1569         generic WebScriptObject.
1570         (+[WebScriptObject scriptObjectForJSObject:originRootObject:rootObject:]):
1571         Added this method to support our old WebScriptObject security and leak 
1572         checking model, even though it doesn't work very well. 
1573         (-[WebScriptObject _setImp:originRootObject:rootObject:]):
1574         (-[WebScriptObject dealloc]):
1575         (-[WebScriptObject finalize]):
1576         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
1577         * bindings/objc/WebScriptObjectPendingPublic.h:
1578         * bindings/objc/WebScriptObjectPrivate.h:
1579         * page/mac/FrameMac.mm:
1580         (WebCore::Frame::windowScriptObject): Changed to use the new API. This
1581         fixes a bug where the object sent to -windowScriptObjectAvailable: and returned
1582         from -windowScriptObject could not be round-tripped.
1583
1584 2007-05-09  Mark Rowe  <mrowe@apple.com>
1585
1586         Build fix.
1587
1588         * editing/Editor.cpp:
1589         (WebCore::findFirstGrammarDetailInRange): Use unsigned rather than int.
1590         (WebCore::findFirstBadGrammarInRange): Cast to unsigned in assertion.
1591         (WebCore::isRangeUngrammatical): Remove unused variables.
1592
1593 2007-05-08  Oliver Hunt  <oliver@apple.com>
1594
1595         Reviewed by Darin.
1596         
1597         Fix <rdar://problem/5188938> arc method on Canvas causes hang or crash
1598         
1599         Workaround bad behaviour of CGPathAddArc when passed inf as start or
1600         end angles.
1601
1602         * platform/graphics/cg/PathCG.cpp:
1603         (WebCore::Path::addArc):
1604
1605 2007-05-08  Darin Adler  <darin@apple.com>
1606
1607         Reviewed by Hyatt and Hatcher.
1608
1609         - fix auto-activation code path so Tiger and Leopard aren't different
1610
1611         * platform/mac/WebFontCache.mm: (+[WebFontCache fontWithFamily:traits:size:]):
1612         Do the auto-activation dance first before doing anything else, and ignore the
1613         font that it returns.
1614
1615 2007-05-08  Steve Falkenburg  <sfalken@apple.com>
1616
1617         Reviewed by Darin.
1618
1619         Moved most spelling/grammar logic to C++.  Now calls through to
1620         WebKit to actually invoke NSSpellChecker.
1621
1622         * editing/Editor.cpp:
1623         (WebCore::Editor::ignoreSpelling): Added (ported from EditorMac).
1624         (WebCore::Editor::learnSpelling): Added (ported from EditorMac).
1625         (WebCore::findFirstMisspellingInRange): Added (ported from EditorMac).
1626         (WebCore::paragraphAlignedRangeForRange): Added (ported from EditorMac).
1627         (WebCore::findFirstGrammarDetailInRange): Added (ported from EditorMac).
1628         (WebCore::findFirstBadGrammarInRange): Added (ported from EditorMac).
1629         (WebCore::Editor::advanceToNextMisspelling): Added (ported from EditorMac).
1630         (WebCore::Editor::isSelectionMisspelled): Added (ported from EditorMac).
1631         (WebCore::isRangeUngrammatical): Added (ported from EditorMac).
1632         (WebCore::Editor::isSelectionUngrammatical): Added (ported from EditorMac).
1633         (WebCore::Editor::guessesForUngrammaticalSelection): Added (ported from EditorMac).
1634         (WebCore::Editor::guessesForMisspelledSelection): Added (ported from EditorMac).
1635         (WebCore::Editor::showSpellingGuessPanel): Added (ported from EditorMac).
1636         (WebCore::Editor::spellingPanelIsShowing): Added (ported from EditorMac).
1637         (WebCore::Editor::markMisspellingsAfterTypingToPosition): Added (ported from EditorMac).
1638         (WebCore::markAllMisspellingsInRange): Added (ported from EditorMac).
1639         (WebCore::markAllBadGrammarInRange): Added (ported from EditorMac).
1640         (WebCore::markMisspellingsOrBadGrammar): Added (ported from EditorMac).
1641         (WebCore::Editor::markMisspellings): Added (ported from EditorMac).
1642         (WebCore::Editor::markBadGrammar): Added (ported from EditorMac).
1643         * editing/mac/EditorMac.mm: Removed Objective C version of spelling/grammar calls.
1644
1645 2007-05-08  Steve Falkenburg  <sfalken@apple.com>
1646
1647         Reviewed by Ada.
1648
1649         Slight modification to last editor method fix.
1650
1651         * bridge/EditorClient.h:
1652         * platform/gdk/EditorClientGdk.cpp:
1653         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
1654         * platform/gdk/EditorClientGdk.h:
1655         * platform/graphics/svg/SVGImageEmptyClients.h:
1656         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
1657
1658 2007-05-08  Alexey Proskuryakov  <ap@webkit.org>
1659
1660         Reviewed by Hyatt.
1661
1662         http://bugs.webkit.org/show_bug.cgi?id=13480
1663         window.Attr is undefined
1664
1665         Test: fast/dom/Window/attr-constructor.html
1666
1667         * dom/Attr.idl:
1668         * dom/CDATASection.idl:
1669         * dom/CharacterData.idl:
1670         * dom/Comment.idl:
1671         * dom/DOMImplementation.idl:
1672         * dom/DocumentType.idl:
1673         * dom/Entity.idl:
1674         * dom/EntityReference.idl:
1675         * dom/Notation.idl:
1676         * dom/ProcessingInstruction.idl:
1677         * dom/Text.idl:
1678         Added GenerateConstructor.
1679
1680         * page/DOMWindow.idl: Added constructor properties for DOM interfaces.
1681
1682 2007-05-07  Geoffrey Garen  <ggaren@apple.com>
1683
1684         Reviewed by Maciej Stachowiak.
1685
1686         Fixed <rdar://problem/5140447> API for fetching JSGlobalContextRef from 
1687         WebView or WebFrame
1688         
1689         Added support for new -[WebScriptObject JSObject] and -[WebFrame globalContext]
1690         APIs.
1691         
1692         Also fixed some more cases of <rdar://problem/4395622> API: 
1693         WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript 
1694         returns NO by default, and generally cleaned up that documentation.
1695
1696         * WebCore.exp: A lot of the diff here is from sorting.
1697         * WebCore.xcodeproj/project.pbxproj:
1698         * bindings/objc/WebScriptObject.h:
1699         * bindings/objc/WebScriptObject.mm:
1700         (-[WebScriptObject JSObject]):
1701         * bindings/objc/WebScriptObjectPendingPublic.h: Added.
1702
1703 2007-05-08  Lars Knoll <lars@trolltech.com>
1704
1705         Reviewed by Hyatt.
1706
1707         Fix valgrind reported uninitialized memory read.
1708
1709         * rendering/RenderText.cpp:
1710         (WebCore::RenderText::RenderText):
1711
1712 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
1713
1714         Reviewed by oliver
1715
1716         <rdar://problem/4895428> Can't drag selected ToDo
1717         
1718         The user tries to drag a selection by mousing down
1719         on the editable part of a ToDo, which is focusable,
1720         since it is an editable node within non-editable 
1721         content.  But we focus focusable elements on mouse 
1722         down, and focusing the editable piece blows away 
1723         the selection and prevents the drag. This is how 
1724         IE behaves, but content seems generally difficult 
1725         to drag in IE, so this doesn't make it any worse.
1726         
1727         Since focus doesn't appear to be cancelable, either
1728         with a DOM event or an editing delegate, I fixed this
1729         by delaying the focus of focusable nodes that are 
1730         selected and inside an already focused node.  The 
1731         node will be focused if the user mouses up without 
1732         doing any dragging because the mouse up sets a
1733         selection, which calls setFocusNodeIfNeeded.
1734
1735         * page/EventHandler.cpp:
1736         (WebCore::EventHandler::dispatchMouseEvent):
1737
1738 2007-05-07  Atul Mehrotra <atul.mehrotra@celunite.com>
1739
1740         Reviewed by Maciej.
1741
1742         GDK Build fix
1743
1744         * platform/gdk/TemporaryLinkStubs.cpp:
1745
1746 2007-05-07  Oliver Hunt  <oliver@apple.com>
1747
1748         Reviewed by Maciej.
1749
1750         Correcting comparisons to handle NaN in the same manner
1751         as other Canvas methods.
1752
1753         * html/CanvasRenderingContext2D.cpp:
1754         (WebCore::CanvasRenderingContext2D::arcTo):
1755         (WebCore::CanvasRenderingContext2D::arc):
1756           Correcting arc/arcTo to match the WHAT WG draft.
1757         (WebCore::CanvasRenderingContext2D::rect):
1758         (WebCore::CanvasRenderingContext2D::clearRect):
1759         (WebCore::CanvasRenderingContext2D::fillRect):
1760         (WebCore::CanvasRenderingContext2D::strokeRect):
1761
1762 2007-05-07  David Hyatt  <hyatt@apple.com>
1763
1764         Add some comments to the glyph/font code (patch from MarvinD, tweaked by
1765         me to correct a few bits and to make it forward-compatible with the work
1766         going on in 3315.
1767
1768         Reviewed by me
1769
1770         * ChangeLog:
1771         * platform/Font.cpp:
1772         (WebCore::Font::glyphDataForCharacter):
1773         * platform/GlyphPageTreeNode.cpp:
1774         (WebCore::GlyphPageTreeNode::initializePage):
1775         * platform/GlyphPageTreeNode.h:
1776
1777 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
1778
1779         Fix layout test failures.
1780
1781         * editing/SelectionController.cpp:
1782         (WebCore::SelectionController::contains): Use comparePositions
1783         instead of Range::comparePoint, because comparePositions can
1784         handle positions inside shadow trees.
1785
1786 2007-05-07  Justin Garcia  <justin.garcia@apple.com>
1787
1788         Reviewed by darin
1789         
1790         <rdar://problem/4895428> Can't drag selected To Do if it is not showing a due date
1791         
1792         The code in SelectionController::contains returned false 
1793         incorrectly if the selection end just after a table 
1794         and the position was inside that table.
1795
1796         * editing/SelectionController.cpp:
1797         (WebCore::SelectionController::contains): Compare the position with the
1798         ends of the selection and then use Range::comparePoint.
1799
1800 2007-05-07  Darin Adler  <darin@apple.com>
1801
1802         - rolling out setInnerHTML optimization until I can figure out why tests are failing
1803
1804 2007-05-07  Darin Adler  <darin@apple.com>
1805
1806         Reviewed by Hyatt.
1807
1808         - fix http://bugs.webkit.org/show_bug.cgi?id=13602
1809           Amazon product pages keep repainting over and over again
1810
1811         Optimize setInnerHTML, setOuterHTML, and setInnerText so they don't change the DOM at all
1812         if they don't need to.
1813
1814         Test: fast/dom/HTMLElement/set-inner-outer-optimization.html
1815
1816         * html/HTMLElement.cpp:
1817         (WebCore::equal): Added. Helper function that compares two Text nodes or two NamedAttrMap
1818         attribute maps.
1819         (WebCore::shallowEqual): Added. Helper function that compares two Element nodes or two
1820         arbitrary nodes.
1821         (WebCore::replaceChildrenWithFragment): Added. Helper function used by setInnerHTML and
1822         setInnerText. Optimizes the cases where all the nodes are the same, where both the current
1823         and the new content are single text nodes, and where the current content is a single node
1824         that can be replaced with replaceChild.
1825         (WebCore::replaceChildrenWithText): Added. Helper function used by setInnerText. Optimizes
1826         the case where the current content is a single text node or a single node that can be
1827         replaced with replaceChild.
1828         (WebCore::HTMLElement::setInnerHTML): Changed to call replaceChildrenWithFragment.
1829         (WebCore::HTMLElement::setOuterHTML): Added special case to optimize when the new content
1830         exactly matches the current node.
1831         (WebCore::HTMLElement::setInnerText): Changed to call replaceChildrenWithText in a few
1832         cases instead of doing removeChildren/appendChild. Changed code that was using
1833         DeprecatedString to instead use String. Changed general case to use a document fragment
1834         and replaceChildrenWithFragment.
1835
1836         * dom/CharacterData.cpp: (WebCore::CharacterData::dispatchModifiedEvent):
1837         Fixed bug where we would not dispatch the DOMSubtreeModified event unless someone
1838         was registered for the DOMCharacterDataModified event. Caused trouble in the test.
1839
1840 2007-05-06  Darin Adler  <darin@apple.com>
1841
1842         - blind try at fixing the Qt build
1843
1844         * platform/qt/TextBreakIteratorQt.cpp: (WebCore::sentenceBreakIterator):
1845         Added a placeholder.
1846
1847 2007-05-06  Darin Adler  <darin@apple.com>
1848
1849         Reviewed by Hyatt.
1850
1851         - fix http://bugs.webkit.org/show_bug.cgi?id=13537
1852           Canvex example starts rendering strangely after a while
1853
1854         * html/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawImage):
1855         Don't raise an exception if the source or destination rectangle is empty.
1856
1857 2007-05-06  Darin Adler  <darin@apple.com>
1858
1859         Reviewed by Hyatt.
1860
1861         - fix <rdar://problem/4585593> REGRESSION: Some 2-byte characters in printed page
1862           header are drawn with too-large font and clipped
1863
1864         Doesn't affect text within web pages, so no layout test.
1865
1866         * platform/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters):
1867         Base the substitute font on the FontPlatformData rather than the FontDescription.
1868         Before, it was a mix of both. This works properly for fonts where we have no
1869         FontDescription and is also more internally consistent.
1870
1871 2007-05-06  Darin Adler  <darin@apple.com>
1872
1873         Reviewed by Hyatt.
1874
1875         - http://bugs.webkit.org/show_bug.cgi?id=13606
1876           some functions are virtual that don't need to be
1877
1878         * dom/Node.h: Made first/lastChild be inline functions that call virtual functions.
1879         This lets us hide the functions with another inline function in a derived class,
1880         yet still override the behavior here in the base class by overriding the virtual
1881         functions too.
1882         * dom/Node.cpp:
1883         (WebCore::Node::virtualFirstChild): Renamed virtual functions. There are now
1884         non-virtual inline functions that call these virtual functions.
1885         (WebCore::Node::virtualLastChild): Ditto.
1886
1887         * dom/ContainerNode.h: Added non-virtual first/lastChild functions that hide the ones
1888         inherited from the Node class; these also replace the fastFirst/LastChild functions,
1889         and transparently give callers the faster form if they have a pointer of the right
1890         type. But still override the virtual functions named virtualFirst/LastChild, because
1891         those can still be called through a Node*. Removed the "fast" from the names of
1892         fastSetFirst/LastChild.
1893         * dom/ContainerNode.cpp:
1894         (WebCore::ContainerNode::virtualFirstChild): Renamed virtual functions. There are now
1895         also non-virtual inline versions.
1896         (WebCore::ContainerNode::virtualLastChild): Ditto.
1897
1898         * dom/CharacterData.cpp: Removed implementations of data and length functons.
1899         * dom/CharacterData.h: Made data, setData, length, substringData, appendData,
1900         insertData, deleteData, and replaceData all non-virtual, and made data and length
1901         both be inline.
1902
1903         * dom/NamedAttrMap.h: (WebCore::NamedAttrMap::attributeItem): Removed a null check
1904         from this function. If the length of the map is known to be greater than 0, then
1905         the null check isn't needed. But if the length of the map hasn't been checked at all,
1906         then it's unsafe to call this function since it doesn't range check the array
1907         index. Thus the null check is never needed. I also looked at all callers.
1908
1909         * dom/Attr.cpp: (WebCore::Attr::createTextChild):
1910         * dom/Document.cpp: (WebCore::Document::recalcStyle):
1911         * dom/Element.cpp: (WebCore::Element::recalcStyle):
1912         * ksvg2/svg/SVGElement.cpp:
1913         (WebCore::SVGElement::haveLoadedRequiredResources):
1914         Removed "fast" prefix from calls to fastFirst/LastChild and fastSetFirst/LastChlld.
1915         It's not needed any more -- you still get fast behavior if the pointer has a type
1916         that's ContainerNode or derived from it.
1917
1918 2007-05-06  Mitz Pettel  <mitz@webkit.org>
1919
1920         Reviewed by Hyatt.
1921
1922         - fix http://bugs.webkit.org/show_bug.cgi?id=13557
1923           Crash when dragging selection over absolutely positioned generated content on block element
1924
1925         Test: fast/css-generated-content/positioned-background-hit-test-crash.html
1926
1927         * rendering/RenderLayer.cpp:
1928         (WebCore::RenderLayer::enclosingElement): Added. Factored out of hitTestLayer().
1929         (WebCore::RenderLayer::hitTestLayer): Implemented the fix for <rdar://problem/3552346>
1930         from r6106 to the self hit test as well, namely: return the enclosing element
1931         for generated positioned content.
1932         * rendering/RenderLayer.h:
1933
1934 2007-05-06  Alexey Proskuryakov  <ap@webkit.org>
1935
1936         Reviewed by Darin.
1937
1938         http://bugs.webkit.org/show_bug.cgi?id=13584
1939         <script> code wrongly assumes requests can't fail
1940
1941         Test: fast/loader/unloadable-script.html
1942
1943         * html/HTMLScriptElement.cpp:
1944         (WebCore::HTMLScriptElement::parseMappedAttribute):
1945         (WebCore::HTMLScriptElement::insertedIntoDocument):
1946         Check the return value of requestScript().
1947
1948 2007-05-06  Alexey Proskuryakov  <ap@webkit.org>
1949
1950         Reviewed by Darin.
1951
1952         http://bugs.webkit.org/show_bug.cgi?id=13304
1953         REGRESSION(14784): WebKit doesn't dynamically reflect changes to the highlight color in System Preferences
1954
1955         Implemented a notification observer that invalidates cached system colors.
1956
1957         No automated test possible.
1958
1959         * rendering/RenderTheme.cpp:
1960         (WebCore::RenderTheme::activeSelectionBackgroundColor):
1961         (WebCore::RenderTheme::inactiveSelectionBackgroundColor):
1962         (WebCore::RenderTheme::platformColorsDidChange):
1963         * rendering/RenderTheme.h:
1964         * rendering/RenderThemeMac.h:
1965         * rendering/RenderThemeMac.mm:
1966         (-[WebCoreRenderThemeNotificationObserver initWithTheme:WebCore::]):
1967         (-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]):
1968         (WebCore::theme):
1969         (WebCore::RenderThemeMac::RenderThemeMac):
1970         (WebCore::RenderThemeMac::~RenderThemeMac):
1971         (WebCore::RenderThemeMac::checkbox):
1972         (WebCore::RenderThemeMac::radio):
1973         (WebCore::RenderThemeMac::button):
1974         (WebCore::RenderThemeMac::popupButton):
1975         (WebCore::RenderThemeMac::search):
1976         (WebCore::RenderThemeMac::sliderThumbHorizontal):
1977         (WebCore::RenderThemeMac::sliderThumbVertical):
1978
1979 2007-05-05  Rob Buis  <buis@kde.org>
1980
1981         Reviewed by Oliver.
1982
1983         http://bugs.webkit.org/show_bug.cgi?id=13592
1984         parseMappedAttribute inconsistency
1985
1986         Do not use local vars in parseMappedAttribute for attr name and value.
1987
1988         * ksvg2/svg/SVGAnimateMotionElement.cpp:
1989         (WebCore::SVGAnimateMotionElement::parseMappedAttribute):
1990         * ksvg2/svg/SVGAnimateTransformElement.cpp:
1991         (WebCore::SVGAnimateTransformElement::parseMappedAttribute):
1992         * ksvg2/svg/SVGAnimationElement.cpp:
1993         (WebCore::SVGAnimationElement::parseMappedAttribute):
1994         * ksvg2/svg/SVGCircleElement.cpp:
1995         (WebCore::SVGCircleElement::parseMappedAttribute):
1996         * ksvg2/svg/SVGClipPathElement.cpp:
1997         (WebCore::SVGClipPathElement::parseMappedAttribute):
1998         * ksvg2/svg/SVGCursorElement.cpp:
1999         (WebCore::SVGCursorElement::parseMappedAttribute):
2000         * ksvg2/svg/SVGEllipseElement.cpp:
2001         (WebCore::SVGEllipseElement::parseMappedAttribute):
2002         * ksvg2/svg/SVGExternalResourcesRequired.cpp:
2003         (WebCore::SVGExternalResourcesRequired::parseMappedAttribute):
2004         * ksvg2/svg/SVGGradientElement.cpp:
2005         (WebCore::SVGGradientElement::parseMappedAttribute):
2006         * ksvg2/svg/SVGImageElement.cpp:
2007         (WebCore::SVGImageElement::parseMappedAttribute):
2008         * ksvg2/svg/SVGLineElement.cpp:
2009         (WebCore::SVGLineElement::parseMappedAttribute):
2010         * ksvg2/svg/SVGLinearGradientElement.cpp:
2011         (WebCore::SVGLinearGradientElement::parseMappedAttribute):
2012         * ksvg2/svg/SVGMarkerElement.cpp:
2013         (WebCore::SVGMarkerElement::parseMappedAttribute):
2014         * ksvg2/svg/SVGMaskElement.cpp:
2015         (WebCore::SVGMaskElement::parseMappedAttribute):
2016         * ksvg2/svg/SVGPathElement.cpp:
2017         (WebCore::SVGPathElement::parseMappedAttribute):
2018         * ksvg2/svg/SVGPatternElement.cpp:
2019         (WebCore::SVGPatternElement::parseMappedAttribute):
2020         * ksvg2/svg/SVGRadialGradientElement.cpp:
2021         (WebCore::SVGRadialGradientElement::parseMappedAttribute):
2022         * ksvg2/svg/SVGRectElement.cpp:
2023         (WebCore::SVGRectElement::parseMappedAttribute):
2024         * ksvg2/svg/SVGSVGElement.cpp:
2025         (WebCore::SVGSVGElement::parseMappedAttribute):
2026         * ksvg2/svg/SVGScriptElement.cpp:
2027         (WebCore::SVGScriptElement::parseMappedAttribute):
2028         * ksvg2/svg/SVGStopElement.cpp:
2029         (WebCore::SVGStopElement::parseMappedAttribute):
2030         * ksvg2/svg/SVGTests.cpp:
2031         (WebCore::SVGTests::parseMappedAttribute):
2032         * ksvg2/svg/SVGTextContentElement.cpp:
2033         (WebCore::SVGTextContentElement::parseMappedAttribute):
2034         * ksvg2/svg/SVGTextPositioningElement.cpp:
2035         (WebCore::SVGTextPositioningElement::parseMappedAttribute):
2036         * ksvg2/svg/SVGUseElement.cpp:
2037         (WebCore::SVGUseElement::parseMappedAttribute):
2038         * ksvg2/svg/SVGViewElement.cpp:
2039         (WebCore::SVGViewElement::parseMappedAttribute):
2040         * ksvg2/svg/SVGZoomAndPan.cpp:
2041         (WebCore::SVGZoomAndPan::parseMappedAttribute):
2042
2043 2007-05-05  Oliver Hunt  <oliver@apple.com>
2044
2045         Reviewed by Hyatt.
2046
2047         Initialise default fill with Color::black rather than parsing
2048         the string "black"
2049
2050         * ksvg2/svg/SVGPaint.cpp:
2051         (WebCore::SVGPaint::defaultFill):
2052
2053 2007-05-04  Steve Falkenburg  <sfalken@apple.com>
2054
2055         Reviewed by Oliver.
2056
2057         Use TextBreakIterator for sentence breaking instead of TextBoundaries.
2058
2059         * WebCore.xcodeproj/project.pbxproj: Added TextBreakIeratorInternalICUMac.mm
2060         * editing/visible_units.cpp:
2061         (WebCore::startSentenceBoundary): Call TextBreakIterator instead of TextBoundaries.
2062         (WebCore::endSentenceBoundary): Call TextBreakIterator instead of TextBoundaries.
2063         (WebCore::previousSentencePositionBoundary): Call TextBreakIterator instead of TextBoundaries.
2064         (WebCore::nextSentencePositionBoundary): Call TextBreakIterator instead of TextBoundaries.
2065         * platform/TextBoundaries.h: Removed findSentenceBoundary, findNextSentenceFromIndex.
2066         * platform/TextBreakIterator.h: Added sentenceBreakIterator.
2067         * platform/TextBreakIteratorICU.cpp:
2068         (WebCore::setUpIterator): Add locale parameter (needed to maintain functionality that TextBoundaries code had).
2069         (WebCore::characterBreakIterator): Pass en_us for locale (same as old code).
2070         (WebCore::wordBreakIterator): Pass en_us for locale (same as old code).
2071         (WebCore::lineBreakIterator): Pass en_us for locale (same as old code).
2072         (WebCore::sentenceBreakIterator): Added.
2073         * platform/TextBreakIteratorInternalICU.h: Added.
2074         * platform/gdk/TemporaryLinkStubs.cpp: Removed findNextSentenceFromIndex, findSentenceBoundary.
2075         (WebCore::currentTextBreakLocaleID): Added stub.
2076         * platform/mac/TextBoundaries.mm: Removed currentTextBreakLocaleID, findSentenceBoundary, findNextSentenceFromIndex.
2077         * platform/mac/TextBreakIteratorInternalICUMac.mm: Added.
2078         (WebCore::currentTextBreakLocaleID): Moved from TextBoundaries.mm
2079         * platform/qt/TextBoundaries.cpp: Removed findNextSentenceFromIndex, findSentenceBoundary.
2080
2081 2007-05-04  Adele Peterson  <adele@apple.com>
2082
2083         Reviewed by Hyatt.
2084
2085         Fix for <rdar://problem/5116871> REGRESSION: Can't select options in widget's listbox
2086
2087         Don't use user-select to determine whether or not options can be selected in listboxes.
2088         This will match Firefox behavior for -moz-user-select.
2089
2090         * html/HTMLSelectElement.cpp:
2091         (WebCore::HTMLSelectElement::canSelectAll):
2092         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2093
2094 2007-05-04  Geoffrey Garen  <ggaren@apple.com>
2095
2096         Reviewed by Tim Hatcher.
2097
2098         First step in fixing <rdar://problem/5055182> The back cache has no global cap
2099
2100         Stop giving SnapBack infinite cache-ability. Instead, make SnapBack rely
2101         on the underlying back cache.
2102
2103         * WebCore.exp:
2104         * history/HistoryItem.cpp:
2105         (WebCore::HistoryItem::HistoryItem):
2106         * history/HistoryItem.h:
2107         * loader/FrameLoader.cpp:
2108         (WebCore::FrameLoader::purgePageCache):
2109
2110 2007-05-04  Geoffrey Garen  <ggaren@apple.com>
2111
2112         Reviewed by Brady Eidson.
2113         
2114         Removed export of clearPageCache(), since it was unused externally. I plan
2115         to remove its use from WebCore eventually, too.
2116
2117         Removed usesPageCache(), since it was unused and it duplicated pageCacheSize().
2118
2119         * WebCore.exp:
2120         * history/BackForwardList.cpp:
2121         * history/BackForwardList.h: Moved statics to the top of the class definition.
2122         * loader/FrameLoader.cpp:
2123         (WebCore::FrameLoader::canCachePage):
2124
2125 2007-05-04  Anders Carlsson  <andersca@apple.com>
2126
2127         Reviewed by Antti.
2128
2129         <rdar://problem/5179977> Use the correct URLs when dispatching delegate methods for data loads.
2130
2131         Restore behavior to matching release WebKit by adding a response URL to SubstituteData. If a nil base URL is
2132         passed, set the _request_ URL to "about:blank", but the response URL to a generated "applewebdata" URL.
2133
2134         * loader/FrameLoader.cpp:
2135         (WebCore::FrameLoader::commitProvisionalLoad):
2136         First, check for the SubstituteData's response URL.
2137
2138         (WebCore::FrameLoader::continueAfterNavigationPolicy):
2139         No need to special case applewebdata URLs here, they're only used in the response.
2140
2141         * loader/MainResourceLoader.cpp:
2142         (WebCore::MainResourceLoader::handleDataLoadNow):
2143         If the substitute data has a response URL, use it.
2144
2145         (WebCore::MainResourceLoader::loadNow):
2146         Only load "about:blank" as an empty document if there's no substitute data.
2147
2148         * loader/SubstituteData.h:
2149         (WebCore::SubstituteData::SubstituteData):
2150         (WebCore::SubstituteData::responseURL):
2151         Add responseURL member to SubstituteData.
2152
2153 2007-05-03  Steve Falkenburg  <sfalken@apple.com>
2154
2155         Reviewed by Oliver.
2156
2157         Add missing user description parameter to spelling-related editor client method.
2158
2159         * bridge/EditorClient.h:
2160         * platform/gdk/EditorClientGdk.cpp:
2161         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
2162         * platform/gdk/EditorClientGdk.h:
2163         * platform/graphics/svg/SVGImageEmptyClients.h:
2164         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
2165
2166 2007-05-03  Brady Eidson  <beidson@apple.com>
2167
2168         Reviewed by Oliver
2169
2170         Resolve an outstanding FIXME in Loader::numRequests()
2171
2172         Before, numRequests() would iterate through the list of requests pending load and the list of currently
2173         loading requests and tally up a count matching the current DocLoader.
2174
2175         I noticed while studying and cleaning up the loader code that numRequests() is potentially very hot!
2176         Indeed load a complex site with many resources and multiple frames, and this method gets called very often,
2177         tallying up this number every time.
2178
2179         The FIXME was to keep a collection of Requests mapped to each DocLoader.  In reality, since this map would
2180         simply be used for retrieving a count, that was overkill.  Keeping a request count in the DocLoader itself
2181         along with maintaining that count in Loader as requests come and go is a much better way to do this.
2182
2183         * loader/DocLoader.cpp:
2184         (WebCore::DocLoader::DocLoader):
2185         (WebCore::DocLoader::incrementRequestCount):
2186         (WebCore::DocLoader::decrementRequestCount):
2187         (WebCore::DocLoader::requestCount): Emulate the defunct Loader::numRequests()
2188         * loader/DocLoader.h:
2189
2190         * loader/FrameLoader.cpp:
2191         (WebCore::numRequests): Call DocLoader::requestCount() directly
2192         (WebCore::FrameLoader::checkCompleted): Use numRequests()
2193
2194         * loader/loader.cpp:
2195         (WebCore::Loader::load): Increment the DocLoader's request count
2196         (WebCore::Loader::servePendingRequests): If the SubresourceLoader failed to create, decrement the count
2197         (WebCore::Loader::didFinishLoading): If the Request is not Multipart, decrement the count
2198         (WebCore::Loader::didFail): If the Request is not Multipart, decrement the count
2199         (WebCore::Loader::didReceiveResponse): If the Request becomes Multipart, decrement the count
2200         (WebCore::Loader::cancelRequests): Decrement the count for the pending requests being tossed, and ASSERT the
2201           count is zero after all requests have been cancelled
2202         * loader/loader.h:
2203
2204 2007-05-03  Geoffrey Garen  <ggaren@apple.com>
2205
2206         Reviewed by Brady Eidson.
2207         
2208         Some cleanup in preparation for fixing <rdar://problem/5055182> The 
2209         back/forward cache has no global cap
2210
2211         * loader/FrameLoader.cpp:
2212         (WebCore::FrameLoader::provisionalLoadStarted): Moved "Can I cache this
2213         page?" logic to canCachePage(). Moved "I am caching this page" logic to
2214         cachePageToHistoryItem().
2215         (WebCore::FrameLoader::canCachePage): Moved above logic here.
2216         (WebCore::FrameLoader::cachePageToHistoryItem): Removed bogus NULL check
2217         and failure return value. Moved above logic here. Don't call setCachedPage()
2218         until the CachedPage is fully constructed.
2219         (WebCore::FrameLoader::purgePageCache): Removed comment that duplicated
2220         the function name.
2221         * loader/FrameLoader.h:
2222
2223 2007-05-03  Justin Garcia  <justin.garcia@apple.com>
2224
2225         Reviewed by harrison.
2226
2227         <rdar://problem/5120281> CrashTracer: [USER] 1 crash in Mail at WebCore::CSSComputedStyleDeclaration::copyInheritableProperties() const
2228
2229         Problem is that checkAncestor and lastClosed can be nil when createMarkup is called unrendered nodes, and that was not checked for.
2230         
2231         * editing/markup.cpp:
2232         (WebCore::createMarkup):
2233         Nil-check checkAncestor and lastClosed.
2234
2235 2007-05-03  Timothy Hatcher  <timothy@apple.com>
2236
2237         Reviewed by Kevin.
2238
2239         <rdar://problem/5016318> Contextual menu item for opening links is missing in compose windows but present in viewer
2240
2241         Add the Open Link, Open Link in New Window, Download Linked File and Copy Link menu
2242         items to the content editable context menu.
2243
2244         * platform/ContextMenu.cpp:
2245         (WebCore::ContextMenu::populate):
2246
2247 2007-05-03  Holger Freyther <freyther@kde.org>
2248
2249         Reviewed by Zack, landed by Simon.
2250         This is bugzilla bug 13499.
2251
2252         * WebCore.pro: Place the Qt port into the qt-port scope, add the Gdk port
2253
2254 2007-05-03  Adele Peterson  <adele@apple.com>
2255
2256         Use BUILDING_ON_TIGER.
2257
2258         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
2259
2260 2007-05-03  Brady Eidson  <beidson@apple.com>
2261
2262         Reviewed by Darin
2263
2264         Some more minor cleanup that resolves a FIXME and ditches another pointless method
2265
2266         No change in functionality == no layout test
2267
2268         * loader/FrameLoader.cpp:
2269         (WebCore::FrameLoader::commitProvisionalLoad):  Updated a comment
2270         (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): Folded startLoading() into this method
2271         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): continueAfterWillSubmitForm becomes continueLoadAfterWillSubmitForm
2272         * loader/FrameLoader.h: Removed startLoading()
2273
2274 2007-05-03  Adele Peterson  <adele@apple.com>
2275
2276         Reviewed by Tim Hatcher.
2277
2278         Fix for <rdar://problem/4727607> REGRESSION: KeyScript is deprecated, need a new solution for forcing Roman input for password fields on Leopard
2279
2280         * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
2281         Use TSMSetDocumentProperty and TSMRemoveDocumentProperty on Leopard disable and enable non-ascii input sources.
2282
2283 2007-05-03  Brady Eidson  <beidson@apple.com>
2284
2285         Reviewed by Anders
2286
2287         commitProvisionalLoad() was the name of two methods.
2288         One of them was private and only called from one other private place.
2289         This was driving me crazy.  I had to change that.
2290
2291         No change in functionality == no layout test
2292
2293         * loader/FrameLoader.cpp:
2294         (WebCore::FrameLoader::transitionToCommitted): roll commitProvisionalLoad() into this method
2295         * loader/FrameLoader.h: Removed commitProvisionalLoad()
2296
2297 2007-05-03  Darin Adler  <darin@apple.com>
2298
2299         Reviewed by Anders.
2300
2301         - make ICU initialization lazy to speed up application start-up time
2302           (when it includes an initial webpage load)
2303
2304         * platform/TextCodecICU.h: Replaced registerEncodingNames and
2305         registerCodecs with registerBaseEncodingNames, registerBaseCodecs,
2306         registerExtendedEncodingNames, and registerExtendedCodecs.
2307         * platform/TextCodecICU.cpp:
2308         (WebCore::newTextCodecICU): Moved up to the top of the file.
2309         (WebCore::TextCodecICU::registerBaseEncodingNames): Added. Registers
2310         just UTF-8.
2311         (WebCore::TextCodecICU::registerBaseCodecs): Ditto.
2312         (WebCore::TextCodecICU::registerExtendedEncodingNames): Renamed.
2313         (WebCore::TextCodecICU::registerExtendedCodecs): Ditto.
2314         (WebCore::TextCodecICU::createICUConverter): Compare with the name
2315         "GBK" in a way that does not require extending the maps.
2316
2317         * platform/TextEncoding.cpp:
2318         (WebCore::TextEncoding::usesVisualOrdering): Added code so this will
2319         just return false if we haven't used any extended encoding names yet.
2320         The result will be correct, and we won't ask for an encoding name that
2321         will require registering the extended encoding names.
2322         (WebCore::TextEncoding::isJapanese): Ditto.
2323         (WebCore::TextEncoding::backslashAsCurrencySymbol): Ditto, but return
2324         a backslash instead of false.
2325
2326         * platform/TextEncodingRegistry.h: Added a new function named
2327          noExtendedTextEncodingNameUsed.
2328         * platform/TextEncodingRegistry.cpp:
2329         (WebCore::buildBaseTextCodecMaps): Added. Registers the base encodings,
2330         including Latin-1 because it's the default, and the UTF encodings.
2331         (WebCore::extendTextCodecMaps): Added. Registers all the other encodings.
2332         (WebCore::newTextCodec): Removed the all to buildTextCodecMap because
2333         we always build the map when making the canonical encoding name.
2334         (WebCore::atomicCanonicalTextEncodingName): Changed code to build only
2335         the base maps at first, then extend the maps the first time we run into
2336         a name we don't know.
2337         (WebCore::noExtendedTextEncodingNameUsed): Added.
2338
2339 2007-05-03  Mark Rowe  <mrowe@apple.com>
2340
2341         Qt build fix.  In r21185 the Qt version of WebCore::scaleDragImage was
2342         updated to have the incorrect signature.
2343
2344         * platform/qt/DragImageQt.cpp:
2345         (WebCore::scaleDragImage):
2346
2347 2007-05-02  Beth Dakin  <bdakin@apple.com>
2348
2349         * dom/Node.h: Just fixing a variable name because it's driving me 
2350         mad.
2351
2352 2007-05-02  Beth Dakin  <bdakin@apple.com>
2353
2354         Reviewed by Hyatt.
2355
2356         Fix for <rdar://problem/4513966> Never-ending identical repaint @ 
2357         orbitz.com (Safari eating 85% CPU)
2358
2359         We need to be a little bit more savvy about when we do a FULL style 
2360         recalc since it can be unnecessary and expensive.
2361
2362         * css/CSSMutableStyleDeclaration.cpp:
2363         (WebCore::CSSMutableStyleDeclaration::setChanged): Now takes a 
2364         StyleChangeType as a parameter.
2365         (WebCore::CSSMutableStyleDeclaration::setProperty): Send 
2366         InlineStyleChange as the paramter. This is the optimization!
2367         * css/CSSMutableStyleDeclaration.h: setChanged takes a 
2368         StyleChangeType as a parameter.
2369         * dom/Document.cpp: setChanged now takes a StyleChangeType instead 
2370         of a bool.
2371         (WebCore::Document::recalcStyle): Same.
2372         * dom/Element.cpp: 
2373         (WebCore::Element::recalcStyle): This is the fix!! Only set change 
2374         to Force is we use descendant rules AND it's a FullStyleChange.
2375         * dom/Node.cpp: m_hasStyle was an unused bit on Node, so this patch 
2376         gets rid of it and uses that extra bit for m_changed to be a 
2377         StyleChangeType instead of a bool.
2378         (WebCore::Node::Node):
2379         (WebCore::Node::setChanged):
2380         (WebCore::Node::dump):
2381         * dom/Node.h: Same.
2382         (WebCore::): Define the StyleChangeType enum.
2383         (WebCore::Node::hasClass):
2384         (WebCore::Node::changed):
2385         (WebCore::Node::styleChangeType):
2386         (WebCore::Node::setHasClass):
2387         * dom/StyledElement.cpp:
2388         (WebCore::StyledElement::parseMappedAttribute): Don't bother 
2389         calling setHasStyle() since m_hasStyle is gone now. It was never 
2390         used, and this was the only place it was set.
2391         * dom/Text.cpp:
2392         (WebCore::Text::recalcStyle): setChanged now takes a 
2393         StyleChangeType instead of a bool.
2394         * html/HTMLFrameSetElement.cpp:
2395         (WebCore::HTMLFrameSetElement::recalcStyle): Same.
2396         * html/HTMLSelectElement.cpp:
2397         (WebCore::HTMLSelectElement::restoreState): Same.
2398         (WebCore::HTMLSelectElement::reset): Same.
2399         * html/HTMLTextAreaElement.cpp:
2400         (WebCore::HTMLTextAreaElement::setValue): Same.
2401         * ksvg2/misc/SVGTimer.cpp:
2402         (WebCore::SVGTimer::applyAnimations): Same.
2403         * ksvg2/svg/SVGUseElement.cpp:
2404         (WebCore::SVGUseElement::recalcStyle): Same.
2405         * platform/graphics/svg/SVGResource.cpp:
2406         (WebCore::SVGResource::repaintClients): Same.
2407
2408 2007-05-02  David Harrison  <harrison@apple.com>
2409
2410         Reviewed by Antti.
2411
2412         <rdar://problem/4859132> Grammar must always be checked in entire-sentence chunks, and shouldn't show markers for current sentence
2413
2414         Restore the remainder of the original fix now that blocking bug rdar://5174862 is addressed.
2415
2416         John made the original patch on 2007-04-10, but this fell prey to rdar://5157329.
2417         Justin backed out the whole patch on 2007-04-30 to avoid the crash.
2418         Justin then restored most of the original patch, but used word granularity instead, to keep the build working.
2419         I just addressed the root cause of rdar://5157329 in rdar://5174862.
2420         This patch switches the temp uses of word granularity back to sentence granularity.
2421         
2422         * editing/mac/EditorMac.mm:
2423         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
2424         * page/Frame.cpp:
2425         (WebCore::Frame::respondToChangedSelection):
2426
2427 2007-05-02  David Harrison  <harrison@apple.com>
2428
2429         Reviewed by Antti.
2430
2431         <rdar://problem/5174862> Crash resulting from DeprecatedString::insert()
2432         
2433         Test added: editing/selection/move-by-sentence-001.html
2434
2435         * editing/visible_units.cpp:
2436         (WebCore::previousBoundary):
2437         (WebCore::nextBoundary):
2438         Use a UChar Vector instead of DeprecatedString.
2439         Avoid creating an extra string for secure bullet replacement unless it is actually needed.
2440         
2441         * platform/DeprecatedString.cpp:
2442         (WebCore::DeprecatedString::insert):
2443         Call forceUnicode() before setLength(), so that only the unicode buffer is resized.
2444
2445        (WebCore::DeprecatedString::setLength):
2446         Adjust the unicode buffer even if the ascii buffer is valid.
2447         
2448 2007-05-02  Mitz Pettel  <mitz@webkit.org>
2449
2450         Reviewed by Brady.
2451
2452         - http://bugs.webkit.org/show_bug.cgi?id=13564
2453           Remove friend class FrameLoader from Frame
2454
2455         No test added since there is no change in functionality.
2456
2457         * loader/FrameLoader.cpp:
2458         (WebCore::FrameLoader::didOpenURL):
2459         (WebCore::FrameLoader::begin):
2460         (WebCore::FrameLoader::open):
2461         * loader/FrameLoader.h: Made clear() private.
2462         * page/Frame.cpp:
2463         (WebCore::Frame::setDocument): Changed the argument into a PassRefPtr.
2464         * page/Frame.h:
2465         * xml/XSLTProcessor.cpp:
2466         (WebCore::XSLTProcessor::createDocumentFromSource):
2467
2468 2007-05-02  Mitz Pettel  <mitz@webkit.org>
2469
2470         Reviewed by Dave Hyatt.
2471
2472         - fix http://bugs.webkit.org/show_bug.cgi?id=9276
2473           Quirksmode: Image swap resize bug
2474
2475         Test: fast/replaced/image-resize-width.html
2476
2477         * rendering/RenderImage.cpp:
2478         (WebCore::RenderImage::imageChanged): Moved the call to dirtyPrefWidths()
2479         before the call to calcWidth().
2480
2481 2007-05-02  David Hyatt  <hyatt@apple.com>
2482
2483         Fix for bug 13566, broken Dashboard widgets.  setPrefWidthsDirty did
2484         the wrong thing for text children of a positioned element.
2485
2486         Reviewed by mitz
2487
2488         fast/block/positioning/pref-width-change.html
2489
2490         * rendering/RenderObject.cpp:
2491         (WebCore::RenderObject::setPrefWidthsDirty):
2492
2493 2007-05-01  Darin Adler  <darin@apple.com>
2494
2495         * rendering/RenderReplaced.cpp: Fix typo in a comment.
2496
2497 2007-05-01  David Hyatt  <hyatt@apple.com>
2498
2499         Fix for 13558, crash when using absolutely positioned generated content
2500         inside an inline.
2501
2502         Reviewed by darin
2503
2504         fast/css-generated-content/absolute-position-inside-inline.html
2505
2506         * rendering/RenderContainer.cpp:
2507         (WebCore::RenderContainer::updateBeforeAfterContentForContainer):
2508
2509 2007-05-01  Justin Garcia  <justin.garcia@apple.com>
2510
2511         Reviewed by darin
2512
2513         <rdar://problem/5002441> 
2514         Pressing space key does nothing above quoted content or a signature
2515         
2516         Inserting a space under these circumstances inserts a single 
2517         text node containing a regular space and then does a layout. 
2518         That space isn't rendered (which is correct).  Whitespace 
2519         rebalancing is supposed to correct it but failed.  It replaces 
2520         the space with a non-breaking space, but that change doesn't 
2521         dirty line boxes (9441) and so the space isn't rendered.
2522         
2523         This workaround turns all incoming spaces into non-breaking 
2524         spaces before they're inserted (they're rebalanced after 
2525         insertion and turned back into regular spaces if possible).
2526
2527         * editing/InsertTextCommand.cpp:
2528         (WebCore::InsertTextCommand::prepareForTextInsertion): Removed
2529         an old irrelevant FIXME.
2530         (WebCore::InsertTextCommand::input): Turn incoming spaces into
2531         non breaking spaces before inserting them.
2532         
2533 2007-05-01  Darin Adler  <darin@apple.com>
2534
2535         Reviewed by Hyatt.
2536
2537         - fix http://bugs.webkit.org/show_bug.cgi?id=13559
2538           REGRESSION: Canvas aspect ratio is incorrect
2539
2540         - remove intrinsicWidth/Height functions from RenderObject
2541
2542         Test: fast/canvas/canvas-size-change-after-layout.html
2543
2544         * html/HTMLCanvasElement.cpp:
2545         (WebCore::HTMLCanvasElement::createRenderer): Removed code to set
2546         the intrinsic size, because the renderer now takes care of this
2547         in its constructor.
2548         (WebCore::HTMLCanvasElement::reset): Instead of calling the
2549         setIntrinsicWidth/Height functions, call canvasSizeChanged, which
2550         takes care of layout, but only if the size actually changed. Also
2551         call repaint if the contents of the canvas changed.
2552
2553         * rendering/RenderApplet.h:
2554         * rendering/RenderApplet.cpp: (WebCore::RenderApplet::intrinsicSize):
2555         Override the new intrinsicSize function. This override still doesn't
2556         make sense, so left a FIXME in here.
2557
2558         * rendering/RenderBox.h: Added an intrinsicSize function here to replace
2559         the intrinsicWidth/Height functions removed from RenderObject.
2560         * rendering/RenderBox.cpp:
2561         (WebCore::RenderBox::calcReplacedWidthUsing): Use intrinsicSize instead
2562         of intrinsicWidth.
2563         (WebCore::RenderBox::calcReplacedHeightUsing): Ditto, but for height.
2564
2565         * rendering/RenderHTMLCanvas.h: Changed the constructor parameter to be
2566         an HTMLCanvasElement* instead of Node*. Also added a canvasSizeChanged
2567         function.
2568         * rendering/RenderHTMLCanvas.cpp:
2569         (WebCore::RenderHTMLCanvas::RenderHTMLCanvas): Pass an initial intrinsic
2570         size based on the current size of the canvas element. This is now the
2571         responsibility of the renderer and the DOM element calls the canvasSizeChanged
2572         function when the size changes.
2573         (WebCore::RenderHTMLCanvas::paint): Removed checks of the type of the element,
2574         and used the node() function because we don't have to worry about the anonymous
2575         case in this class.
2576         (WebCore::RenderHTMLCanvas::canvasSizeChanged): Added. Changes the size and
2577         then calls setNeedsLayout and setPrefWidthsDirty as needed. I based the logic
2578         here on careful reading of RenderImage::imageChanged.
2579
2580         * rendering/RenderImage.cpp:
2581         (WebCore::RenderImage::RenderImage): Pass a default intrinsic size of 0,0
2582         instead of calling setIntrinsicWidth/Height.
2583         (WebCore::RenderImage::setImageSizeForAltText): Call the new intrinsic size
2584         functions instead of the width/height ones. Simplifies the logic since we
2585         handle both dimensions at once.
2586         (WebCore::RenderImage::imageChanged): Ditto.
2587         (WebCore::RenderImage::layout): Ditto.
2588         (WebCore::RenderImage::calcAspectRatioWidth): Ditto.
2589         (WebCore::RenderImage::calcAspectRatioHeight): Ditto.
2590
2591         * rendering/RenderObject.h: Removed intrinsicWidth/Height virtual functions.
2592
2593         * rendering/RenderReplaced.h: Replaced intrinsicWidth, intrinsicHeight,
2594         setIntrinsicWidth, setIntrinsicHeight, m_intrinsicWidth, and m_intrinsicHeight
2595         with intrinsicSize, setIntrinsicSize, and m_intrinsicSize.
2596         * rendering/RenderReplaced.cpp:
2597         (WebCore::RenderReplaced::RenderReplaced): Added a second contructor that takes
2598         an intrinsic size parameter. Also updated constructor since the intrinsic size
2599         is now an IntSize instead of two integers.
2600         (WebCore::RenderReplaced::intrinsicSize): Added. No point in making this inline
2601         because it's a virtual function.
2602         (WebCore::RenderReplaced::setIntrinsicSize): Added. Didn't make this inline,
2603         partly because in the future we might want this to be more than just a simple
2604         setter function, factoring in common code used in both RenderImage and
2605         RenderHTMLCanvas.
2606
2607         * rendering/RenderWidget.h: Removed a stray using declaration that wasn't needed.
2608
2609 2007-05-01  David Hyatt  <hyatt@apple.com>
2610
2611         Fix for hang when incorrectly trying to add before/after content to
2612         a <select>.  Disallow generated content in all selects and also turn it
2613         off for <input> buttons.
2614
2615         Reviewed by aroben
2616
2617         * rendering/RenderBlock.cpp:
2618         (WebCore::RenderBlock::setStyle):
2619         * rendering/RenderButton.cpp:
2620         (WebCore::RenderButton::canHaveChildren):
2621         * rendering/RenderButton.h:
2622
2623 2007-05-01  Darin Adler  <darin@apple.com>
2624
2625         Reviewed by Hyatt.
2626
2627         - removed the m_implicit bit from Node, freeing up a bit
2628
2629         - fixed <rdar://problem/5172607> XML parser is creating implicit tbody elements
2630         - fixed <rdar://problem/5172596> HTML-parser-created tbody elements are being
2631           ignored when processing CSS child rules
2632
2633         Test: fast/css/child-selector-implicit-tbody.html
2634
2635         * css/cssstyleselector.cpp: (WebCore::CSSStyleSelector::checkSelector):
2636         Removed code that used to look at implicitNode(), which no longer exists.
2637
2638         * css/html4.css: Added a style rule to handle cases where we have a tr
2639         inside a table with no intervening table section.
2640
2641         * dom/Node.h: Removed the bit.
2642         * dom/Node.cpp:
2643         (WebCore::Node::Node): Don't initialize the bit.
2644         (WebCore::Node::dump): Don't dump the bit.
2645
2646         * dom/XMLTokenizer.cpp:
2647         (WebCore::XMLTokenizer::startElementNs): Remove the code that made a
2648         table body element. This is handled in the render tree, the DOM tree
2649         should not be mangled.
2650         (WebCore::XMLTokenizer::endElementNs): Removed code that used to look at
2651         implicitNode(), which no longer exists.
2652
2653         * html/HTMLElementFactory.cpp: (WebCore::tableSectionConstructor):
2654         Removed boolean parameter that was passed to the HTMLTableSectionElement
2655         constructor.
2656         * html/HTMLParser.cpp: (WebCore::HTMLParser::handleError): Ditto.
2657         * html/HTMLTableElement.cpp:
2658         (WebCore::HTMLTableElement::createTHead): Ditto.
2659         (WebCore::HTMLTableElement::createTFoot): Ditto.
2660         (WebCore::HTMLTableElement::insertRow): Changed to return a PassRefPtr,
2661         because it's possible the row could be removed from the table by JavaScript
2662         code responding to DOM mutation events before the function returns. Just
2663         something I noticed by code inspection.
2664
2665         * html/HTMLTableSectionElement.cpp:
2666         (WebCore::HTMLTableSectionElement::HTMLTableSectionElement): Removed
2667         boolean "implicit" parameter to the constructor.
2668         (WebCore::HTMLTableSectionElement::insertRow): Changed to return a
2669         PassRefPtr for the same reason cited above.
2670
2671         * html/HTMLTableElement.h: Changed the return value of insertRow to be
2672         a PassRefPtr.
2673         * html/HTMLTableSectionElement.h: Ditto.
2674
2675 2007-04-30  David Hyatt  <hyatt@apple.com>
2676
2677         Fix for bug 12691, generated content and display: table-cell duplicates
2678         content on a size change.  Make sure that the code to update before/after
2679         content is smart enough to drill into anonymous containers to find the
2680         old child.
2681
2682         Reviewed by olliej
2683
2684         Added fast/css-generated-content/table-cell-before-content.html
2685
2686         * rendering/RenderBlock.cpp:
2687         (WebCore::RenderBlock::setStyle):
2688         * rendering/RenderButton.cpp:
2689         (WebCore::RenderButton::updateBeforeAfterContent):
2690         * rendering/RenderButton.h:
2691         * rendering/RenderContainer.cpp:
2692         (WebCore::RenderContainer::beforeAfterContainer):
2693         (WebCore::RenderContainer::updateBeforeAfterContent):
2694         (WebCore::RenderContainer::updateBeforeAfterContentForObject):
2695         * rendering/RenderContainer.h:
2696         * rendering/RenderInline.cpp:
2697         (WebCore::RenderInline::setStyle):
2698         (WebCore::RenderInline::addChildToFlow):
2699         (WebCore::RenderInline::splitInlines):
2700
2701 2007-04-30  Jungshik Shin <jungshik.shin@gmail.com>
2702
2703         Reviewed by justin
2704         
2705         <http://bugs.webkit.org/show_bug.cgi?id=13552>
2706         comment to Range::comparePoint in dom/Range.cpp has 
2707         '0xD0' in place of '-': leading to a compiler warning
2708
2709         * dom/Range.cpp:
2710         (WebCore::Range::comparePoint):
2711
2712 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2713
2714         Reviewed by darin
2715
2716         <rdar://problem/4875189> List gets deleted when replacing contents
2717
2718         * editing/ReplaceSelectionCommand.cpp:
2719         (WebCore::ReplaceSelectionCommand::doApply): Don't expand
2720         to include elements, like lists, when deleting a selection 
2721         to replace it.
2722
2723 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2724
2725         Reviewed by ggaren
2726         
2727         Buildfix.  Leave in grammar checking machinery to 
2728         keep WebKit building on other platforms but don't
2729         operate on sentence sized chunks so that we don't
2730         re-introduce 5157329.
2731
2732         * editing/Editor.h:
2733         * editing/mac/EditorMac.mm:
2734         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
2735         (WebCore::markMisspellingsOrBadGrammar):
2736         (WebCore::Editor::markMisspellings):
2737         (WebCore::Editor::markBadGrammar):
2738         * page/Frame.cpp:
2739         (WebCore::Frame::respondToChangedSelection):
2740
2741 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2742
2743         Reviewed by darin
2744
2745         <rdar://problem/5168598> 
2746         Crash when deleting a link inside an input field
2747         
2748         Deletion code tries to update one of its positions to keep 
2749         it valid and nullifies it.  Later in mergeParagraphs we try 
2750         to find out if it's valid by checking to see if it's still in 
2751         the document and crash.
2752         
2753         The fix is just to not bother keeping the position, 
2754         m_upstreamStart, valid, since after the point in the code 
2755         under examination, it doesn't need to be valid anymore.  
2756         Besides, code to update DeleteSelectionCommand's positions 
2757         should go in the functions that handle the content removal 
2758         that might invalid them (there are already FIXMEs about this).
2759         
2760         Also, users shouldn't be able to insert links (or any rich content)
2761         into plaintext-only regions like text fields, even if those
2762         text fields are inside richly editable regions.  This is a 
2763         separate bug and is filed as 5171552.
2764
2765         * editing/DeleteSelectionCommand.cpp:
2766         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Don't
2767         bother updating m_upstreamStart.
2768
2769 2007-04-30  Patti Hoa  <patti@apple.com>
2770
2771         Reviewed by Dave Hyatt.
2772         
2773         <rdar://problem/5108546> REGRESSION: Zoom follows keyboard focus does not work
2774
2775         * WebCore.xcodeproj/project.pbxproj:
2776         Add new file SelectionControllerMac.mm
2777         * dom/Document.cpp:
2778         (WebCore::Document::updateSelection):
2779         Move the code to fire off AXSelectedTextChanged notification to a new method notifyAccessibilityForSelectionChange in SelectionControllerMac.mm
2780         * editing/SelectionController.cpp:
2781         (WebCore::SelectionController::setSelection):
2782         call notifyAccessibilityForSelectionChange to handle firing of accessibility notification and zoomFocusChange
2783         * editing/SelectionController.h:
2784         Add notifyAccessibilityForSelectionChange method for Mac platform
2785         * platform/Widget.h:
2786         * platform/mac/WidgetMac.mm:
2787         (WebCore::Widget::convertToScreenCoordinate):
2788         Add a helper routine that takes IntPoint in local coordinate and convert that to screen coordinate
2789
2790 2007-04-30  Justin Garcia  <justin.garcia@apple.com>
2791
2792         Reviewed by harrison
2793
2794         <rdar://problem/5157329> 
2795         REGRESSION: Crash at WTF::fastFree() when arrowing or deleting backward through editable text (13493)
2796         
2797         Backing out the changes for 4859132.
2798
2799         * editing/Editor.h:
2800         * editing/mac/EditorMac.mm:
2801         (WebCore::Editor::markMisspellingsAfterTypingToPosition):
2802         (WebCore::Editor::markMisspellings):
2803         * page/Frame.cpp:
2804         (WebCore::Frame::respondToChangedSelection):
2805
2806 2007-04-29  Antti Koivisto  <antti@apple.com>
2807
2808         Reviewed by Oliver.
2809
2810         Fix <rdar://problem/5169261>
2811         REGRESSION: Google Maps zooming too sensitive when using two fingers on trackpad
2812         
2813         Use line based delta values when generating DOM wheel events, use pixel deltas
2814         for scrolling only.
2815         
2816         No test case, requires user interaction and specific hardware.
2817
2818         * page/EventHandler.cpp:
2819         (WebCore::EventHandler::handleWheelEvent):
2820         * platform/PlatformWheelEvent.h:
2821         (WebCore::PlatformWheelEvent::continuousDeltaX):
2822         (WebCore::PlatformWheelEvent::continuousDeltaY):
2823         * platform/mac/WheelEventMac.mm:
2824         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2825
2826 2007-04-29  Oliver Hunt  <oliver@apple.com>
2827
2828         Reviewed by Brady.
2829
2830         Build fix for experimental features build
2831
2832         * rendering/RenderForeignObject.cpp:
2833
2834 2007-04-29  Mitz Pettel  <mitz@webkit.org>
2835
2836         Reviewed by Dave Hyatt.
2837
2838         - fix http://bugs.webkit.org/show_bug.cgi?id=13544
2839           REGRESSION (r21120): Member profile frame not erased at Yahoo! Answers
2840
2841         Test: fast/repaint/layer-hide-when-needs-layout.html
2842
2843         * rendering/RenderObject.cpp:
2844         (WebCore::RenderObject::setStyle): If we get a layout hint, we count on
2845         layout() or updateLayerPositions() to repaint. In the case of a layer
2846         going invisible, however, we need to repaint here since neither of the
2847         above will do it.
2848
2849 2007-04-29  Oliver Hunt  <oliver@apple.com>
2850
2851         Reviewed by Steve.
2852
2853         Fix for <rdar://problem/5126393> REGRESSION (r19672-19697): Safari drag image drags at original size (13261)
2854
2855         Added logic to ensure that when we create the drag image
2856         we're looking at the rendered image size.
2857
2858         * page/DragController.cpp:
2859         (WebCore::DragController::doImageDrag):
2860           Pass the rendered image size to fitDragImageToMaxSize
2861
2862         * platform/DragImage.cpp:
2863         (WebCore::fitDragImageToMaxSize):
2864            Need to do scaling relative to rendered image size
2865
2866         * platform/DragImage.h:
2867            scaleDragImage needs x and y scales to allow for them to be
2868            scaled seperately on a page
2869
2870         * platform/gdk/DragImageGdk.cpp:
2871         (WebCore::scaleDragImage):
2872            Prevent build bustage
2873
2874         * platform/mac/DragImageMac.mm:
2875         (WebCore::scaleDragImage):
2876            scale width and height independently
2877
2878         * platform/qt/DragImageQt.cpp:
2879         (WebCore::scaleDragImage):
2880            Prevent build bustage
2881
2882 2007-04-29  Darin Adler  <darin@apple.com>
2883
2884         Reviewed by Adele.
2885
2886         - fix the Gmail part of http://bugs.webkit.org/show_bug.cgi?id=12798
2887           and <rdar://problem/4118559>
2888
2889         This patch changes things so that resizing can make things larger than their
2890         initial size, but not smaller. I believe this resolves the problem for Gmail,
2891         but you can still get strange behavior if you have a small right-aligned <textarea>.
2892
2893         * rendering/RenderLayer.cpp:
2894         (WebCore::RenderLayer::resize): Rewrote to use more IntPoint and IntSize and add
2895         in a new minimum-size algorithm. This function now has the side effect of storing
2896         a new minimumSizeForResizing in the element being resized, and respects any existing
2897         minimum as well.
2898         (WebCore::RenderLayer::offsetFromResizeCorner): Reversed this so it converts the
2899         point into coordinates relative to the resize corner, hence negative numbers mean
2900         the point is above and to the left. This is used only in the algorithm above.
2901
2902         * dom/Element.h: Removed unneeded include of Attr.h, and added forward declarations
2903         as needed. Removed all friend declarations; there was no need for any of them.
2904         Tweaked formatting of various declarations and removed unneeded parameter names.
2905         Made as much as possible private, and a couple things public to avoid the need for
2906         friend classes. Added minimumSizeForResizing, setMinimumSizeForResizing, rareData,
2907         and createRareData functions.
2908
2909         * dom/Element.cpp:
2910         (WebCore::rareDataMap): Added. Function to return the single global map.
2911         (WebCore::rareDataFromMap): Added. For use by inlined functions to get the
2912         data from the map in the case where it's present.
2913         (WebCore::ElementRareData::ElementRareData): Added.
2914         (WebCore::Element::~Element): Added code to delete the element from the rare
2915         data map when appropriate.
2916         (WebCore::Element::rareData): Added.
2917         (WebCore::Element::createRareData): Added.
2918         (WebCore::Element::setAttributeNodeNS): Got rid of the old inline version of this,
2919         since it was the sole reason we had to include Attr.h in Element.h.
2920         (WebCore::Element::minimumSizeForResizing): Added. Accesses rare data.
2921         (WebCore::Element::setMinimumSizeForResizing): Ditto.
2922
2923         * dom/Node.h: Renamed the m_specified bit since it's now used for two purposes.
2924         Its new long name is m_attrWasSpecifiedOrElementHasRareData.
2925
2926         * dom/Attr.cpp: (WebCore::Attr::Attr): Updated for bit name change.
2927         * dom/Attr.h:
2928         (WebCore::Attr::specified): Ditto.
2929         (WebCore::Attr::setSpecified): Added, since setting the bit directly is pretty ugly now.
2930         * dom/Document.cpp: (WebCore::Document::adoptNode): Updated for bit name change.
2931         * dom/Node.cpp:
2932         (WebCore::Node::Node): Ditto.
2933         (WebCore::Node::dump): Ditto.
2934
2935         * dom/NamedAttrMap.cpp: (WebCore::NamedAttrMap::isReadOnlyNode): Moved out of line,
2936         since this was the sole reason we had to include Element.h in NamedAttrMap.h.
2937
2938         * html/HTMLElement.cpp:
2939         (WebCore::HTMLElement::nodeName): Changed to use tagQName() since that's a public
2940         way to do something that's now private.
2941         (WebCore::HTMLElement::cloneNode): Ditto.
2942
2943         * dom/Attribute.cpp:
2944         * dom/NamedAttrMap.h:
2945         * dom/NamedMappedAttrMap.cpp:
2946         * dom/StyledElement.h:
2947         * html/HTMLTokenizer.h:
2948         * xml/XPathFunctions.cpp:
2949         * xml/XPathStep.cpp:
2950         Updated includes, and other administrivia.
2951
2952 2007-04-29  Mitz Pettel  <mitz@webkit.org>
2953
2954         Reviewed by Darin and Hyatt.
2955
2956         - http://bugs.webkit.org/show_bug.cgi?id=13487
2957           Implement O(1) absoluteClippedOverflowRect and absoluteOutlineBox during layout for a possible speed gain
2958
2959         Test for a bug fixed by this patch: fast/repaint/intermediate-layout-position-clip.html
2960
2961         By keeping track of the total translation and clip during layout, absolutePosition and
2962         computeAbsoluteRepaintRect become O(1).
2963
2964         * WebCore.pro: Added LayoutState.cpp
2965         * WebCore.vcproj/WebCore/WebCore.vcproj: Added LayoutState.{cpp,h}
2966         * WebCore.xcodeproj/project.pbxproj: Added LayoutState.{cpp,h}
2967         * WebCoreSources.bkl: Added LayoutState.cpp
2968         * page/FrameView.cpp:
2969         (WebCore::FrameView::layout): When doing subtree layout, push an initial layout state for the
2970         layout root.
2971         * rendering/LayoutState.cpp: Added. A LayoutState corresponding to a box consists of the origin of
2972         its coordinate system in view coordinates and possibly the clip rect, in view coordinates, which
2973         applies to its children.
2974         (WebCore::LayoutState::LayoutState):
2975         (WebCore::LayoutState::destroy):
2976         (WebCore::throw):
2977         (WebCore::LayoutState::operator delete):
2978         * rendering/LayoutState.h: Added.
2979         (WebCore::LayoutState::LayoutState):
2980         * rendering/RenderBlock.cpp:
2981         (WebCore::RenderBlock::layoutBlock): Factored out the "only positioned objects" case into
2982         layoutOnlyPositionedObjects(). Added code to push/pop LayoutState, unless we have columns, in
2983         which case we disable/enable LayoutState. Removed the translation by the layout delta
2984         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
2985         absoluteOutlineBox().
2986         (WebCore::RenderBlock::layoutOnlyPositionedObjects): Added this helper function that checks for
2987         and handles the case where only positioned objects need layout. Returns true in that case.
2988         (WebCore::RenderBlock::repaintOverhangingFloats): Disabled LayoutState when repainting floats, since
2989         they may belong to other containers.
2990         (WebCore::RenderBlock::updateFirstLetter): Disabled LayoutState when adding and removing from the
2991         first letter container, since it may be different than ourselves.
2992         * rendering/RenderBlock.h:
2993         * rendering/RenderBox.cpp:
2994         (WebCore::RenderBox::setStyle): Minor cleanup: changed element()->document() to the equivalent document().
2995         (WebCore::RenderBox::offsetForPositionedInContainer): Added. Factored out common code from
2996         absolutePosition, computeAbsoluteRepaintRect and RenderLayer::updateLayerPosition into this function.
2997         (WebCore::RenderBox::absolutePosition): Added an O(1) code path when this function is called during
2998         layout (and LayoutState has not been disabled). Factored out some code into
2999         offsetForPositionedInContainer.
3000         (WebCore::RenderBox::absoluteClippedOverflowRect): Added the layout delta here, so callers don't need
3001         to.
3002         (WebCore::RenderBox::computeAbsoluteRepaintRect): Added an O(1) code path when this function is called
3003         during layout (and LayoutState has not been disabled). Factored out some code into
3004         offsetForPositionedInContainer.
3005         * rendering/RenderContainer.cpp:
3006         (WebCore::RenderContainer::layout): Added LayoutState push/pop.
3007         * rendering/RenderFlexibleBox.cpp:
3008         (WebCore::RenderFlexibleBox::layoutBlock): Factored out the "only positioned objects" case into
3009         layoutOnlyPositionedObjects(). Added LayoutState push/pop. Removed the translation by the layout delta
3010         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
3011         absoluteOutlineBox().
3012         * rendering/RenderFlow.cpp:
3013         (WebCore::RenderFlow::absoluteClippedOverflowRect): Added an ASSERT.
3014         * rendering/RenderForeignObject.cpp:
3015         (WebCore::RenderForeignObject::layout): Disabled LayoutState because it is incompatible with arbitrary
3016         affine transforms.
3017         * rendering/RenderHTMLCanvas.cpp:
3018         (WebCore::RenderHTMLCanvas::layout): Removed the translation by the layout delta of the old absolute
3019         rects, since that is now integral to absoluteClippedOverflowRect() and absoluteOutlineBox().
3020         * rendering/RenderImage.cpp:
3021         (WebCore::RenderImage::layout): Ditto.
3022         * rendering/RenderLayer.cpp:
3023         (WebCore::RenderLayer::updateLayerPositions): Added ASSERTs. Factored out some code into
3024         RenderBox::offsetForPositionedInContainer.
3025         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Disabled LayoutState around the call to
3026         scrollToOffset.
3027         * rendering/RenderListItem.cpp:
3028         (WebCore::RenderListItem::updateMarkerLocation): Disabled LayoutState when moving the list marker, since
3029         it can trigger repainting in other containers.
3030         * rendering/RenderObject.cpp:
3031         (WebCore::RenderObject::isRoot): Minor cleanup: changed element()->document() to the equivalent
3032         document().
3033         (WebCore::RenderObject::computeAbsoluteRepaintRect): Removed 'return' at the end of the function.
3034         (WebCore::RenderObject::container): Reordered to avoid calling isText() twice.
3035         (WebCore::RenderObject::absoluteOutlineBox): Added the layout delta here, so callers don't need to.
3036         * rendering/RenderSVGContainer.cpp:
3037         (WebCore::RenderSVGContainer::layout): Disabled LayoutState because it is incompatible with arbitrary
3038         affine transforms.
3039         * rendering/RenderTable.cpp:
3040         (WebCore::RenderTable::layout):  Factored out the "only positioned objects" case into
3041         layoutOnlyPositionedObjects(). Added LayoutState push/pop. Removed the translation by the layout delta
3042         of the old absolute rects, since that is now integral to absoluteClippedOverflowRect() and
3043         absoluteOutlineBox().
3044         * rendering/RenderTableCell.cpp:
3045         (WebCore::RenderTableCell::absoluteClippedOverflowRect): Added the layout delta here, so callers
3046         don't need to.
3047         (WebCore::RenderTableCell::computeAbsoluteRepaintRect): For the O(1) code path, skipped the correction
3048         for the parent row, because RenderTableRow doesn't push a translation into LayoutState.
3049         (WebCore::RenderTableCell::absolutePosition): Ditto.
3050         * rendering/RenderTableRow.cpp:
3051         (WebCore::RenderTableRow::layout): Added LayoutState push/pop.
3052         * rendering/RenderTableSection.cpp:
3053         (WebCore::RenderTableSection::setCellWidths): Added LayoutState push/pop if cells are repainted or
3054         receive layout.
3055         (WebCore::RenderTableSection::calcRowHeight): Ditto.
3056         (WebCore::RenderTableSection::layoutRows): Added LayoutState push/pop.
3057         * rendering/RenderView.cpp:
3058         (WebCore::RenderView::RenderView):
3059         (WebCore::RenderView::layout): Added initial LayoutState setup for the layout.
3060         (WebCore::RenderView::paintBoxDecorations): Minor cleanup: changed element()->document() to the
3061         equivalent document().
3062         (WebCore::RenderView::repaintViewRectangle): Ditto.
3063         (WebCore::RenderView::pushLayoutState): Added. Pushes initial layout state for subtree layout.
3064         * rendering/RenderView.h:
3065         (WebCore::RenderView::pushLayoutState):
3066         (WebCore::RenderView::popLayoutState):
3067         (WebCore::RenderView::layoutState):
3068         (WebCore::RenderView::disableLayoutState):
3069         (WebCore::RenderView::enableLayoutState):
3070
3071 2007-04-29  David Hyatt  <hyatt@apple.com>
3072
3073         Fix for bugzilla 13535, regression from positioning cleanup a while
3074         back.  Some code got added to compute available width for a relpositioned
3075         inline, only the code meant to be used for inline flows and not inline blocks.
3076
3077         Reviewed by mjs
3078
3079         fast/block/positioning/inline-block-relposition.html
3080
3081         * rendering/RenderBox.cpp:
3082         (WebCore::RenderBox::containingBlockWidthForPositioned):
3083
3084 2007-04-29  Oliver Hunt  <oliver@apple.com>
3085
3086         Reviewed by Zack.
3087
3088         Implement basic drag and drop support for qt
3089         this allows content and link dragging but does not
3090         provide the DOM data access methods.
3091
3092         * platform/DragData.h:
3093         * platform/qt/ClipboardQt.cpp:
3094         (WebCore::ClipboardQt::ClipboardQt):
3095         (WebCore::ClipboardQt::~ClipboardQt):
3096         (WebCore::ClipboardQt::clearData):
3097         (WebCore::ClipboardQt::clearAllData):
3098         (WebCore::ClipboardQt::setData):
3099         (WebCore::ClipboardQt::declareAndWriteDragImage):
3100         (WebCore::ClipboardQt::writeURL):
3101         (WebCore::ClipboardQt::writeRange):
3102         (WebCore::ClipboardQt::hasData):
3103         * platform/qt/ClipboardQt.h:
3104         (WebCore::ClipboardQt::clipboardData):
3105         (WebCore::ClipboardQt::invalidateWritableData):
3106         * platform/qt/DragDataQt.cpp:
3107         (WebCore::DragData::canSmartReplace):
3108         (WebCore::DragData::containsPlainText):
3109         (WebCore::DragData::asPlainText):
3110         (WebCore::DragData::createClipboard):
3111         (WebCore::DragData::containsCompatibleContent):
3112         (WebCore::DragData::containsURL):
3113         (WebCore::DragData::asURL):
3114         (WebCore::DragData::asFragment):
3115
3116 2007-04-28  Maciej Stachowiak  <mjs@apple.com>
3117
3118         Reviewed by Darin and Oliver.
3119
3120         - change Document to hold onto Frame* instead of FrameView*
3121         
3122         This is an architectural cleanup and a prerequisite to fixing citibank login
3123         in an architecturally sound way.
3124
3125         Some fixups for the page cache:
3126         
3127         * history/CachedPage.cpp:
3128         (WebCore::CachedPage::restore): Add an assert that the document's view
3129         matches the cached page's view - this needs to be true by the time this
3130         function is called.
3131         (WebCore::CachedPage::clear): Change assert to require frame matching, not
3132         view matching.
3133         * history/CachedPage.h:
3134         (WebCore::CachedPage::view): Add a way to get the view out.
3135         * loader/FrameLoader.cpp:
3136         (WebCore::FrameLoader::begin): pass Frame, not FrameView, when creating document
3137         (WebCore::FrameLoader::open): restore view based on CachedPage, not Document. 
3138
3139         Remaining changes are just straightforward updates based on which
3140         pointer is held or passed:
3141         
3142         * dom/DOMImplementation.cpp:
3143         (WebCore::DOMImplementation::createDocument):
3144         (WebCore::DOMImplementation::createHTMLDocument):
3145         * dom/DOMImplementation.h:
3146         * dom/Document.cpp:
3147         (WebCore::Document::Document):
3148         (WebCore::Document::view):
3149         (WebCore::Document::frame):
3150         (WebCore::Document::recalcStyle):
3151         (WebCore::Document::updateLayout):
3152         (WebCore::Document::attach):
3153         (WebCore::Document::detach):
3154         (WebCore::Document::createTokenizer):
3155         (WebCore::Document::recalcStyleSelector):
3156         (WebCore::Document::setInPageCache):
3157         (WebCore::Document::applyXSLTransform):
3158         * dom/Document.h:
3159         * html/HTMLDocument.cpp:
3160         (WebCore::HTMLDocument::HTMLDocument):
3161         * html/HTMLDocument.h:
3162         * html/HTMLViewSourceDocument.cpp:
3163         (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
3164         * html/HTMLViewSourceDocument.h:
3165         * ksvg2/svg/SVGDocument.cpp:
3166         (WebCore::SVGDocument::SVGDocument):
3167         * ksvg2/svg/SVGDocument.h:
3168         * loader/ImageDocument.cpp:
3169         (WebCore::ImageDocument::ImageDocument):
3170         * loader/ImageDocument.h:
3171         * loader/PluginDocument.cpp:
3172         (WebCore::PluginDocument::PluginDocument):
3173         * loader/PluginDocument.h:
3174         * loader/TextDocument.cpp:
3175         (WebCore::TextDocument::TextDocument):
3176         * loader/TextDocument.h:
3177         * xml/XSLTProcessor.cpp:
3178         (WebCore::XSLTProcessor::createDocumentFromSource):
3179         (WebCore::XSLTProcessor::transformToDocument):
3180         * xml/XSLTProcessor.h:
3181
3182 2007-04-28  Adele Peterson  <adele@apple.com>
3183
3184         RS by Darin.
3185
3186         Update to fix for <rdar://problem/5152299>
3187
3188         Test: fast/events/no-blur-on-enter-button.html
3189
3190         * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::defaultEventHandler):
3191         Don't blur the button when handling the enter key.  This matches our new behavior for input elements.
3192
3193 2007-04-28  Adele Peterson  <adele@apple.com>
3194
3195         Fix by Darin, reviewed by me.
3196
3197         Fix for <rdar://problem/5152299> REGRESSION: <button> elements do not respond to space and return key as similar <input> elements do
3198
3199         Tests:
3200         fast/forms/button-spacebar-click.html
3201         fast/forms/button-enter-click.html
3202
3203         * html/HTMLButtonElement.h: (WebCore::HTMLButtonElement::): Made type enum private.
3204         Removed unnecessary m_value and m_currValue, and unused m_dirty.
3205         * html/HTMLButtonElement.cpp:
3206         (WebCore::HTMLButtonElement::HTMLButtonElement): Removed initialization of m_dirty.
3207         (WebCore::HTMLButtonElement::parseMappedAttribute): Removed case to parse value and accesskey attributes, which don't do anything.
3208         (WebCore::HTMLButtonElement::defaultEventHandler): Removed unnecessary check for button type.
3209          Added cases to handle spacebar and enter keys in the same way that they're handled for <input type=button/reset/submit> buttons.
3210         (WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Shortened comment.
3211         (WebCore::HTMLButtonElement::appendFormData): Use value() instead of m_currValue.  Renamed encoding argument to formData.
3212
3213 2007-04-28  Mitz Pettel  <mitz@webkit.org>
3214
3215         Reviewed by Darin.
3216
3217         - fix http://bugs.webkit.org/show_bug.cgi?id=13501
3218           REGRESSION (r21093): Pasting into text field fails and makes the caret disappear
3219
3220         Test: fast/dynamic/anonymous-block-layer-lost.html
3221
3222         * rendering/RenderBlock.cpp:
3223         (WebCore::RenderBlock::removeChild): Avoid cutting off layers when removing
3224         the anonymous block.
3225
3226 2007-04-28  Mitz Pettel  <mitz@webkit.org>
3227
3228         Reviewed by Darin.
3229
3230         - fix http://bugs.webkit.org/show_bug.cgi?id=13471
3231           REGRESSION (r21045): Secure keyboard entry mode remains in effect after leaving a password field by submitting
3232
3233         * loader/FrameLoader.cpp:
3234         (WebCore::FrameLoader::clear): Replaced direct access to Frame's d->m_doc
3235         with a call to Frame::setDocument.
3236         (WebCore::FrameLoader::begin): Ditto.
3237         (WebCore::FrameLoader::open): Ditto.
3238         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady): Ditto.
3239         (WebCore::FrameLoader::canCachePage): Added a comment.
3240         * manual-tests/secure-keyboard-enabled-after-submit.html: Added.
3241         * page/Frame.cpp:
3242         (WebCore::Frame::setDocument): Reset secure keyboard entry, in case the
3243         old document's focused node has set it.
3244
3245 2007-04-28  Mitz Pettel  <mitz@webkit.org>
3246
3247         Reviewed by Adele.
3248
3249         - fix http://bugs.webkit.org/show_bug.cgi?id=13379
3250           REGRESSION: Cannot add an option to a selected popup
3251
3252         * manual-tests/update-empty-popup.html: Added.
3253         * platform/mac/PopupMenuMac.mm:
3254         (WebCore::PopupMenu::show): Added a call to the client's hidePopup()
3255         callback before returning in the case that the menu is empty. Otherwise
3256         the client thinks that the menu stayed open.
3257
3258 2007-04-28  Adele Peterson  <adele@apple.com>
3259
3260         Reviewed by Darin.
3261
3262         Fix for <rdar://problem/4806988> REGRESSION: history.go(0) doesn't reload page (affects buttons at facebook.com)
3263
3264         Test: fast/history/history_reload.html
3265
3266         * loader/FrameLoader.cpp: (WebCore::FrameLoader::scheduleHistoryNavigation):
3267         We avoid doing a redirection when going to the same url in a history navigation, but we have to still
3268         schedule a redirection when the number of steps is zero so we can force a reload.
3269
3270 2007-04-28  Alexey Proskuryakov  <ap@webkit.org>
3271
3272         Reviewed by Darin.
3273
3274         http://bugs.webkit.org/show_bug.cgi?id=13514
3275         REGRESSION (r20997-21003): Crash in WebCore::Node::document
3276
3277         Test: fast/dom/NodeList/childNodes-reset-cache.html
3278
3279         * dom/Node.cpp:
3280         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Reset the common caches for child node
3281         lists. We cannot rely on notifications, since there may be no list objects left around.
3282
3283         * dom/ChildNodeList.cpp:
3284         (WebCore::ChildNodeList::rootNodeChildrenChanged):
3285         * dom/ChildNodeList.h:
3286         Override rootNodeChildrenChanged() with an empty implementation, now that caches are reset
3287         in Node::notifyLocalNodeListsChildrenChanged().
3288
3289 2007-04-28  Mark Rowe  <mrowe@apple.com>
3290
3291         Build fix.  Change use of nil to 0 in C++ source file.
3292
3293         * editing/Editor.cpp:
3294         (WebCore::Editor::increaseSelectionListLevel):
3295         (WebCore::Editor::increaseSelectionListLevelOrdered):
3296         (WebCore::Editor::increaseSelectionListLevelUnordered):
3297
3298 2007-04-28  Darin Adler  <darin@apple.com>
3299
3300         Reviewed by Adele.
3301
3302         - fix http://bugs.webkit.org/show_bug.cgi?id=6216
3303           REGRESSION: getElementsByTagNameNS with empty namespace doesn't work
3304
3305         * dom/Node.cpp:
3306         (WebCore::TagNodeList::TagNodeList): Changed parameter to PassRefPtr, tweaked formatting.
3307         (WebCore::TagNodeList::item): Tweaked formatting.
3308         (WebCore::TagNodeList::nodeMatches): Tweaked formatting.
3309         (WebCore::Node::setPrefix): Tweaked formatting.
3310         (WebCore::Node::getElementsByTagNameNS): Added special case to turn empty namespaces into
3311         null namespaces.
3312
3313 2007-04-28  Darin Adler  <darin@apple.com>
3314
3315         Reviewed by Kevin Decker.
3316
3317         - fix <rdar://problem/5148271> Chinese numbers are incorrect in numbered lists
3318           (including pasting from TextEdit to Mail)
3319
3320         Covered by an existing regression test, which had wrong results checked in.
3321
3322         Hyatt told me not to use the algorithm in the CSS 3 specification, but I didn't listen!
3323         This corrects mistakes there and makes our results match current Firefox.
3324
3325         * rendering/RenderListMarker.cpp:
3326         (WebCore::toCJKIdeographic): Added code to strip off trailing zero digits.
3327         Added special case for zero, since that's the one case where we don't want
3328         to strip off trailing zero digits. Fixed mixed-up logic that would put the
3329         digits in each group backwards.
3330         (WebCore::listMarkerText): Corrected character values for the CJK_IDEOGRAPHIC case.
3331
3332 2007-04-28  Darin Adler  <darin@apple.com>
3333
3334         Reviewed by Oliver.
3335
3336         - fix <rdar://problem/5138250> REGRESSION (r18245): Changing any one aspect
3337           of a font applies all the aspects to selected text
3338
3339         Since this bug is only visible with the font panel, I don't
3340         think there's any way to make a DumpRenderTree-driven test.
3341
3342         * editing/Editor.cpp: (WebCore::Editor::fontForSelection):
3343         Set hasMultipleFonts properly. The old code had an early exit
3344         that was left over from when hasMultipleFonts was a pointer.
3345
3346 2007-04-27  Mitz Pettel  <mitz@webkit.org>
3347
3348         Reviewed by Dave Hyatt.
3349
3350         - fix http://bugs.webkit.org/show_bug.cgi?id=13525
3351           Repainting a listbox schedules a relayout
3352
3353         No test possible as there is no change to functionality.
3354
3355         - fix the root cause of http://bugs.webkit.org/show_bug.cgi?id=10862
3356           REGRESSION: Collapsing form input on www.myspace.com
3357
3358         No test possible since text fields are no longer implemented as flexboxes.
3359
3360         * rendering/RenderObject.cpp:
3361         (WebCore::RenderObject::scheduleRelayout): Added a check that the subtree
3362         root is in the tree and not free-floating.
3363         * rendering/bidi.cpp:
3364         (WebCore::RenderBlock::bidiReorderCharacters): Changed addChild and removeChild
3365         to appendChildNode and removeChildNode to save some unnecessary overhead.
3366         These calls still mark the tree for relayout, but the change in scheduleRelayout 
3367         ensures that a layout won't be scheduled.
3368
3369 2007-04-27  Patti Hoa  <patti@apple.com>
3370
3371         Reviewed by Darin.
3372         
3373         <rdar://problem/5153017> REPRODUCIBLE ASSERT: range != nil in WebViewFactory.mm:415 -[WebViewFactory startOfTextMarkerRange:] (13354)
3374         
3375         * bridge/mac/WebCoreAXObject.mm:
3376         (-[WebCoreAXObject textMarkerRangeForRange:]):
3377         Fix the range length check.  It was incorrectly assuming that the max range requested cannot be equal
3378         to the length of the string.  Since NSRange location is index based, it's perfectly valid to have the max
3379         range equal to the the text length.
3380
3381 2007-04-27  David Harrison  <harrison@apple.com>
3382
3383         Reviewed by Darin.
3384
3385         <rdar://problem/5160627> Export JS list creation support as ObjC SPI for Mail
3386
3387         * WebCore.exp:
3388         * editing/Editor.h:
3389         * editing/Editor.cpp:
3390         (WebCore::Editor::insertOrderedList):
3391         (WebCore::Editor::insertUnorderedList):
3392         (WebCore::Editor::canIncreaseSelectionListLevel):
3393         (WebCore::Editor::canDecreaseSelectionListLevel):
3394         (WebCore::Editor::increaseSelectionListLevel):
3395         (WebCore::Editor::increaseSelectionListLevelOrdered):
3396         (WebCore::Editor::increaseSelectionListLevelUnordered):
3397         (WebCore::Editor::decreaseSelectionListLevel):
3398         Add insertOrderedList() and insertUnorderedList().
3399         Move existing list management functions from WebCoreFrameBridge.
3400         The level increasing functions now return a PassRefPtr<Node> instead of Node.
3401         Add check for canEditRichly.
3402         
3403         - in many other functions, condense the check for nil client().
3404         
3405         * editing/InsertListCommand.h:
3406         * editing/InsertListCommand.cpp:
3407         (WebCore::InsertListCommand::insertList):
3408         (WebCore::InsertListCommand::fixOrphanedListChild):
3409         (WebCore::InsertListCommand::doApply):
3410         Add insertList(), which returns the new list element.
3411         Don't set the list element's ID if the specified ID was an empty string.
3412                 
3413         * editing/ModifySelectionListLevel.h:
3414         * editing/ModifySelectionListLevel.cpp:
3415         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelWithType):
3416         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
3417         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
3418         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
3419         Return PassRefPtr<Node> instead of Node.
3420
3421         * page/mac/WebCoreFrameBridge.h:
3422         * page/mac/WebCoreFrameBridge.mm:
3423         Move list management functions to Editor.h and Editor.cpp.
3424
3425
3426 2007-04-27  David Hyatt  <hyatt@apple.com>
3427
3428         Fix for <rdar://problem/5134254>, toolbar buttons don't work in gmail after double-click.  Make sure
3429         to clear out the capturing frame, since you don't get a second up when a double-click happens.
3430
3431         Reviewed by mjs
3432
3433         * page/EventHandler.cpp:
3434         (WebCore::EventHandler::handleMouseDoubleClickEvent):
3435
3436 2007-04-27  Justin Garcia  <justin.garcia@apple.com>
3437
3438         Reviewed by oliver
3439
3440         <rdar://problem/5164796> 
3441         Enable execCommand("CreateLink", ...) for caret selections
3442
3443         * editing/CreateLinkCommand.cpp:
3444         (WebCore::CreateLinkCommand::doApply): For a caret
3445         selection, insert a link at the caret position
3446         with the url as the link text.
3447         * editing/JSEditor.cpp: Enable CreateLink for caret 
3448         selections.
3449
3450 2007-04-27  Antti Koivisto  <antti@apple.com>
3451
3452         Reviewed by Darin, Hyatt.
3453         
3454         Fix http://bugs.webkit.org/show_bug.cgi?id=13081
3455         Empty table cells not handled correctly
3456         <rdar://problem/5067926>
3457         
3458         To match Firefox and IE, empty table cells with variable width need to be
3459         treated as special case. They generally get zero width.
3460
3461         * rendering/AutoTableLayout.cpp:
3462         (WebCore::AutoTableLayout::recalcColumn):
3463         (WebCore::AutoTableLayout::calcEffectiveWidth):
3464         (WebCore::AutoTableLayout::layout):
3465         * rendering/AutoTableLayout.h:
3466         (WebCore::AutoTableLayout::Layout::Layout):
3467         * rendering/RenderStyle.h:
3468         (WebCore::RenderStyle::hasPadding):
3469
3470 2007-04-27  Rob Buis  <buis@kde.org>
3471
3472         Reviewed by Oliver.
3473
3474         http://bugs.webkit.org/show_bug.cgi?id=13052
3475         Text not rendered in a second inline SVG element
3476
3477         Correct the rendering of svg text when embedded in non-svg container.
3478
3479         * rendering/RenderSVGText.cpp:
3480         (WebCore::RenderSVGText::paint):
3481
3482 2007-04-27  Mark Rowe  <mrowe@apple.com>
3483
3484         Reviewed by Maciej.
3485
3486         * WebCore.pro: Remove non-existent paths from qmake files.
3487
3488 2007-04-25  Lars Naesbye Christensen <lars@naesbye.dk>
3489
3490         Reviewed by Timothy Hatcher.
3491
3492         http://bugs.webkit.org/show_bug.cgi?id=13477
3493         Bug 13477: Help and context menu cursors need dropshadows.
3494
3495         * Resources/cellCursor.png:
3496         * Resources/contextMenuCursor.png:
3497         * Resources/helpCursor.png:
3498         * platform/mac/CursorMac.mm:
3499         (WebCore::contextMenuCursor):
3500         (WebCore::copyCursor):
3501         (WebCore::progressCursor):
3502         (WebCore::noDropCursor):
3503
3504 2007-04-27  Holger Freyther <freyther@kde.org>
3505
3506         Reviewed by Maciej.
3507
3508         Remove unmaintained CMake build system.
3509
3510         * CMakeLists.txt: Removed.
3511
3512 2007-04-26  Matt Perry  <mpComplete@gmail.com>
3513
3514         Reviewed by Maciej.
3515
3516         Added a version check to hackAroundLibXMLEntityBug, since that bug has
3517         been fixed in recent versions of libxml2.
3518
3519         * dom/XMLTokenizer.cpp:
3520         (WebCore::hackAroundLibXMLEntityBug):
3521
3522 2007-04-26  Christopher Brichford  <chrisb@adobe.com>
3523
3524         Reviewed by Timothy Hatcher.
3525
3526         - Fix for Bug 13204: Submit initial version of mac project files for apollo
3527           port of WebCore
3528           http://bugs.webkit.org/show_bug.cgi?id=13204
3529
3530         * WebCore.apolloproj/mac/WebCore.Debug.xcconfig: Added.
3531         * WebCore.apolloproj/mac/WebCore.Release.xcconfig: Added.
3532         * WebCore.apolloproj/mac/WebCore.xcconfig: Added.
3533         * WebCore.apolloproj/mac/WebCore.xcodeproj/project.pbxproj: Added.
3534
3535 2007-04-26  Alp Toker  <alp@atoker.com>
3536
3537         Reviewed by Maciej.
3538
3539         http://bugs.webkit.org/show_bug.cgi?id=13505
3540         Cast loses precision on x86_64
3541
3542         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3543         (WebCore::GraphicsContext::beginTransparencyLayer):
3544         (WebCore::GraphicsContext::endTransparencyLayer):
3545         Use a stack of opacity values instead of Cairo user data.
3546
3547 2007-04-26  Mitz Pettel  <mitz@webkit.org>
3548
3549         Reviewed by Darin.
3550
3551         - fix http://bugs.webkit.org/show_bug.cgi?id=13500
3552           REGRESSION: Listbox scrollbar does not reflect actual scrolled position when selected option is added after layout
3553
3554         Test: fast/forms/listbox-scrollbar-incremental-load.html
3555
3556         The scroller position was not updated correctly during insertion, since
3557         scrollbar proportions are updated only during layout
3558
3559         * rendering/RenderListBox.cpp:
3560         (WebCore::RenderListBox::selectionChanged): Delay scrolling to reveal the
3561         selection until after layout if m_optionsChanged is set. Layout is
3562         guaranteed to happen soon when the flag is set.
3563
3564 2007-04-26  David Hyatt  <hyatt@apple.com>
3565
3566         Fix for 13511, crash on a counters page.  Make sure that RenderTexts
3567         never get a null StringImpl.  I would have added an assert that the length
3568         had to be nonzero also, but unfortunately editing creates empty RenderTexts
3569         because of its EditingText DOM subclass that always forces renderers to be
3570         made.  I suppose there is a good reason for this...
3571
3572         Reviewed by aroben
3573
3574         * dom/CharacterData.cpp:
3575         (WebCore::CharacterData::setData):
3576         (WebCore::CharacterData::appendData):
3577         (WebCore::CharacterData::insertData):
3578         (WebCore::CharacterData::deleteData):
3579         (WebCore::CharacterData::replaceData):
3580         * rendering/RenderCounter.cpp:
3581         (WebCore::RenderCounter::RenderCounter):
3582         * rendering/RenderText.cpp:
3583         (WebCore::RenderText::RenderText):
3584         (WebCore::RenderText::trimmedPrefWidths):
3585         (WebCore::RenderText::setTextWithOffset):
3586         (WebCore::RenderText::setTextInternal):
3587         (WebCore::RenderText::setText):
3588
3589 2007-04-26  Alice Liu  <alice.liu@apple.com>
3590
3591         Reviewed by Oliver.
3592
3593         * editing/SelectionController.cpp:
3594         (WebCore::SelectionController::selectAll):
3595         adding null check
3596
3597 2007-04-26  Justin Garcia  <justin.garcia@apple.com>
3598
3599         Reviewed by oliver
3600
3601         <rdar://problem/5120591> 
3602         Crash when creating a link in Leopard wiki server
3603
3604         * editing/CreateLinkCommand.cpp:
3605         (WebCore::CreateLinkCommand::doApply): Use a RefPtr,
3606         setting the anchor's href can destroy it if there is
3607         an ancestor with a subtree modified event listener.
3608
3609 2007-04-26  Mitz Pettel  <mitz@webkit.org>
3610
3611         Reviewed by hyatt
3612
3613         - http://bugs.webkit.org/show_bug.cgi?id=13496
3614           Eliminate repaintObjectsBeforeLayout
3615
3616         No tests added since there is no change to functionality. Several
3617         tests in fast/repaint test repainting of objects that move during layout.
3618
3619         * page/FrameView.cpp:
3620         (WebCore::FrameView::layout):
3621         * rendering/RenderBlock.cpp:
3622         (WebCore::RenderBlock::layoutBlockChildren): Removed an early
3623         setNeedsLayout(false). Resetting the bit here prevents the full repaint
3624         that we rely on when we decide not to repaint children that move.
3625         * rendering/RenderBlock.h:
3626         * rendering/RenderObject.cpp:
3627         * rendering/RenderObject.h:
3628         * rendering/RenderTableSection.cpp:
3629         (WebCore::RenderTableSection::setCellWidths): Replaced the call to
3630         repaintObjectsBeforeLayout() if the cell didn't need layout with
3631         an unconditional repaint(). We don't bother with repainting only the
3632         delta between the old and new widths, since by marking the cell for
3633         layout results in a full repaint with the new width anyway.
3634
3635 2007-04-26  David Hyatt  <hyatt@apple.com>
3636
3637         Fix for 13509.  Don't recur to parent inline flows if they have been
3638         marked as needing layout themselves.
3639
3640         Reviewed by adele
3641
3642         * rendering/RenderFlow.cpp:
3643         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
3644
3645 2007-04-26  Matt Perry  <mpComplete@gmail.com>
3646
3647         Reviewed and landed by Alexey.
3648
3649         http://bugs.webkit.org/show_bug.cgi?id=13495
3650         Crash when referencing an undefined entity in an XHTML document
3651
3652         Test: fast/parser/badentity.xhtml
3653
3654         * dom/XMLTokenizer.cpp:
3655         (WebCore::getEntityHandler): Check for a NULL returned from getXHTMLEntity
3656
3657 2007-04-26  Anders Carlsson  <andersca@apple.com>
3658
3659         Reviewed by Hyatt.
3660
3661         <rdar://problem/4851944>
3662         REGRESSION: With TOT, BMP images can no longer be opened in the browser window
3663         
3664         On Tiger, the MIME type for the com.microsoft.bmp UTI isn't in the registry, so add it manually.
3665         
3666         * platform/MimeTypeRegistry.cpp:
3667         (WebCore::initialiseSupportedImageMIMETypes):
3668
3669 2007-04-26  David Hyatt  <hyatt@apple.com>
3670
3671         Fix for bug 13503, invalidateContainingBlockPrefWidths is 15% of the
3672         nesting PLT.  Avoid O(n^2) behavior by including inlines in the minmax
3673         dirty chain.
3674
3675         Reviewed by kevin
3676
3677         * rendering/RenderBlock.cpp:
3678         (WebCore::RenderBlock::calcInlinePrefWidths):
3679         * rendering/RenderObject.cpp:
3680         (WebCore::RenderObject::setPrefWidthsDirty):
3681         (WebCore::RenderObject::invalidateContainerPrefWidths):
3682         * rendering/RenderObject.h:
3683
3684 2007-04-26  Anders Carlsson  <andersca@apple.com>
3685
3686         Reviewed by Darin.
3687
3688         <rdar://problem/5067925>
3689         Reproducible crash (infinite recursion) with a layout test that submits on unload (13078)
3690         
3691         Ask the document loader whether it's loading the main resource, since there are cases where the frame 
3692         loader's variable isn't updated correctly.
3693         
3694         In the distant future, the frame loader shouldn't have an instance variable but this is the least intrusive fix for now.
3695         
3696         I couldn't come up with a good test case for this since it requires running three tests in a row and scheduleLoad didn't work. Also,
3697         calling submit in the onunload prevents any new tests from loading!
3698         
3699         * loader/FrameLoader.cpp:
3700         (WebCore::FrameLoader::isLoading):
3701
3702 2007-04-26  Anders Carlsson  <andersca@apple.com>
3703
3704         ... and fix the build.
3705         
3706         * loader/FrameLoader.cpp:
3707         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3708
3709 2007-04-26  Anders Carlsson  <andersca@apple.com>
3710
3711         Revert the previous change - activeDocumentLoader never returns the policy document loader.
3712         Instead, add a null check for the policy document loader.
3713         
3714         * loader/FrameLoader.cpp:
3715         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3716
3717 2007-04-26  Anders Carlsson  <andersca@apple.com>
3718
3719         Use the active document loader instead of the policy document loader.
3720         
3721         * loader/FrameLoader.cpp:
3722         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3723
3724 2007-04-26  Anders Carlsson  <andersca@apple.com>
3725
3726         Reviewed by Maciej.
3727
3728         <rdar://problem/5049099> documents no longer have a default base URL
3729
3730         Don't call canHandleRequest if we have valid substitute data and the protocol is "applewebdata".
3731         
3732         * loader/FrameLoader.cpp:
3733         (WebCore::FrameLoader::continueAfterNavigationPolicy):
3734
3735 2007-04-25  Stephanie Lewis <slewis@apple.com>
3736
3737         Reviewed by Darin.
3738
3739         Fix the build for platforms that overload the abs function.        
3740
3741         * dom/ChildNodeList.cpp:
3742         (WebCore::ChildNodeList::item):
3743
3744 2007-04-25  David Hyatt  <hyatt@apple.com>
3745
3746         Fix for bug 13373, make sure to invalidate the pref widths for objects
3747         with percentage padding.
3748
3749         Reviewed by beth
3750
3751         * rendering/RenderBlock.cpp:
3752         (WebCore::RenderBlock::layoutBlockChildren):
3753         (WebCore::RenderBlock::layoutPositionedObjects):
3754         * rendering/bidi.cpp:
3755         (WebCore::RenderBlock::layoutInlineChildren):
3756
3757 2007-04-25  David Harrison  <harrison@apple.com>
3758
3759         Comment change. Correct the header name in the endif comment.
3760         
3761         * editing/FormatBlockCommand.h:
3762         Change InsertListCommand_h to FormatBlockCommand_h.
3763
3764 2007-04-25  Darin Adler  <darin@apple.com>
3765
3766         Reviewed by Hyatt.
3767
3768         * platform/AtomicString.cpp: (WebCore::AtomicString::add):
3769         Removed unnecessary use of strlen to check if a string is empty.
3770
3771 2007-04-25  Mitz Pettel  <mitz@webkit.org>
3772
3773         Build fix.
3774
3775         * rendering/RenderListMarker.h: Undeleted the m_text member.
3776
3777 2007-04-25  David Hyatt  <hyatt@apple.com>
3778
3779         Rearchitect calcPrefWidths.  The calculation is now done lazily only when minPrefWidth
3780         or maxPrefWidth are asked for.  The result of the calculation is cached.
3781
3782         The new invalidation scheme for pref width invalidation follows the
3783         containing block hierarchy and knows to halt at positioned objects, since
3784         they cannot influence the size of their containers.
3785
3786         Reviewed by darin
3787
3788         * css/cssstyleselector.cpp:
3789         (WebCore::CSSStyleSelector::init):
3790         (WebCore::CSSStyleSelector::initForStyleResolve):
3791         * page/FrameView.cpp:
3792         (WebCore::FrameView::layout):
3793         * rendering/RenderApplet.cpp:
3794         (WebCore::RenderApplet::layout):
3795         * rendering/RenderBlock.cpp:
3796         (WebCore::RenderBlock::makeChildrenNonInline):
3797         (WebCore::RenderBlock::removeChild):
3798         (WebCore::RenderBlock::layout):
3799         (WebCore::RenderBlock::layoutBlock):
3800         (WebCore::RenderBlock::calcPrefWidths):
3801         (WebCore::InlineMinMaxIterator::endOfInline):
3802         (WebCore::shouldGrowTableCellForImage):
3803         (WebCore::RenderBlock::calcInlinePrefWidths):
3804         (WebCore::RenderBlock::calcBlockPrefWidths):
3805         * rendering/RenderBlock.h:
3806         * rendering/RenderBox.cpp:
3807         (WebCore::RenderBox::setStyle):
3808         (WebCore::RenderBox::minPrefWidth):
3809         (WebCore::RenderBox::maxPrefWidth):
3810         (WebCore::RenderBox::calcWidth):
3811         (WebCore::RenderBox::calcWidthUsing):
3812         (WebCore::RenderBox::calcAbsoluteHorizontal):
3813         (WebCore::RenderBox::calcAbsoluteHorizontalValues):
3814         * rendering/RenderBox.h:
3815         * rendering/RenderContainer.cpp:
3816         (WebCore::RenderContainer::removeChildNode):
3817         (WebCore::RenderContainer::appendChildNode):
3818         (WebCore::RenderContainer::insertChildNode):
3819         (WebCore::RenderContainer::layout):
3820         * rendering/RenderContainer.h:
3821         (WebCore::RenderContainer::moveChildNode):
3822         * rendering/RenderCounter.cpp:
3823         (WebCore::RenderCounter::dirtyLineBoxes):
3824         (WebCore::RenderCounter::calcPrefWidths):
3825         * rendering/RenderCounter.h:
3826         * rendering/RenderFileUploadControl.cpp:
3827         (WebCore::RenderFileUploadControl::calcPrefWidths):
3828         * rendering/RenderFlexibleBox.cpp:
3829         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
3830         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
3831         (WebCore::RenderFlexibleBox::calcPrefWidths):
3832         (WebCore::RenderFlexibleBox::layoutBlock):
3833         * rendering/RenderForeignObject.cpp:
3834         (WebCore::RenderForeignObject::layout):
3835         * rendering/RenderFrameSet.cpp:
3836         (WebCore::RenderFrameSet::layout):
3837         * rendering/RenderHTMLCanvas.cpp:
3838         (WebCore::RenderHTMLCanvas::layout):
3839         * rendering/RenderImage.cpp:
3840         (WebCore::RenderImage::layout):
3841         * rendering/RenderInline.cpp:
3842         * rendering/RenderInline.h:
3843         * rendering/RenderListBox.cpp:
3844         (WebCore::RenderListBox::updateFromElement):
3845         (WebCore::RenderListBox::calcPrefWidths):
3846         * rendering/RenderListItem.cpp:
3847         (WebCore::firstNonMarkerChild):
3848         (WebCore::RenderListItem::updateMarkerLocation):
3849         (WebCore::RenderListItem::calcPrefWidths):
3850         (WebCore::RenderListItem::layout):
3851         * rendering/RenderListMarker.cpp:
3852         (WebCore::RenderListMarker::layout):
3853         (WebCore::RenderListMarker::calcPrefWidths):
3854         (WebCore::RenderListMarker::updateMargins):
3855         * rendering/RenderListMarker.h:
3856         * rendering/RenderObject.cpp:
3857         (WebCore::RenderObject::RenderObject):
3858         (WebCore::RenderObject::removeChildNode):
3859         (WebCore::RenderObject::moveChildNode):
3860         (WebCore::RenderObject::appendChildNode):
3861         (WebCore::RenderObject::insertChildNode):
3862         (WebCore::RenderObject::setPrefWidthsDirty):
3863         (WebCore::RenderObject::invalidateContainingBlockPrefWidths):
3864         (WebCore::RenderObject::information):
3865         (WebCore::RenderObject::setStyle):
3866         * rendering/RenderObject.h:
3867         (WebCore::RenderObject::layer):
3868         (WebCore::RenderObject::hasLayer):
3869         (WebCore::RenderObject::prefWidthsDirty):
3870         (WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc):
3871         (WebCore::RenderObject::setHasLayer):
3872         * rendering/RenderPartObject.cpp:
3873         (WebCore::RenderPartObject::layout):
3874         * rendering/RenderSVGContainer.cpp:
3875         (WebCore::RenderSVGContainer::layout):
3876         * rendering/RenderSVGContainer.h:
3877         * rendering/RenderSVGHiddenContainer.cpp:
3878         * rendering/RenderSVGHiddenContainer.h:
3879         * rendering/RenderSVGText.cpp:
3880         (WebCore::RenderSVGText::layout):
3881         * rendering/RenderTable.cpp:
3882         (WebCore::RenderTable::calcWidth):
3883         (WebCore::RenderTable::layout):
3884         (WebCore::RenderTable::removeChildNode):
3885         * rendering/RenderTable.h:
3886         * rendering/RenderTableRow.cpp:
3887         (WebCore::RenderTableRow::layout):
3888         * rendering/RenderTableSection.cpp:
3889         (WebCore::RenderTableSection::removeChildNode):
3890         * rendering/RenderTableSection.h:
3891         * rendering/RenderText.cpp:
3892         (WebCore::RenderText::trimmedPrefWidths):
3893         (WebCore::isSpaceAccordingToStyle):
3894         (WebCore::RenderText::minPrefWidth):
3895         (WebCore::RenderText::maxPrefWidth):
3896         (WebCore::RenderText::calcPrefWidths):
3897         (WebCore::RenderText::width):
3898         * rendering/RenderText.h:
3899         * rendering/RenderView.cpp:
3900         (WebCore::RenderView::RenderView):
3901         (WebCore::RenderView::calcPrefWidths):
3902         (WebCore::RenderView::layout):
3903         * rendering/RenderWidget.cpp:
3904         (WebCore::RenderWidget::layout):
3905
3906 2007-04-25  Steve Falkenburg  <sfalken@apple.com>
3907
3908         Reviewed by Adam.
3909
3910         Fix spelling error in spelling method name.
3911         Expose new spelling callback methods to all platforms.
3912
3913         * bridge/EditorClient.h:
3914         * platform/gdk/EditorClientGdk.cpp:
3915         (WebCore::EditorClientGdk::updateSpellingUIWithGrammarString):
3916         * platform/gdk/EditorClientGdk.h:
3917         * platform/graphics/svg/SVGImageEmptyClients.h:
3918         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithGrammarString):
3919         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
3920
3921 2007-04-24  Geoffrey Garen  <ggaren@apple.com>
3922
3923         Reviewed by Darin Adler, Tim Hatcher.
3924
3925         Fixed a few NSAutoreleasePool issues I noticed while reviewing Brady's patch.
3926
3927         * platform/graphics/mac/GraphicsContextMac.mm:
3928         (WebCore::GraphicsContext::setCompositeOperation): Call -drain instead of 
3929         -release, since -release is a no-op in a GC world.
3930
3931 2007-04-25  Alexey Proskuryakov  <ap@webkit.org>
3932
3933         Reviewed by Darin.
3934
3935         http://bugs.webkit.org/show_bug.cgi?id=13445
3936         NodeList access by index is slow
3937
3938         * dom/ChildNodeList.cpp:
3939         (WebCore::ChildNodeList::item): Support iterating backwards from the last accessed node
3940         or from the last child.
3941         * dom/NodeList.h: Make cachedLength unsigned.
3942
3943 2007-04-26  Mark Rowe  <mrowe@apple.com>
3944
3945         Gdk build fix.  Add missing stub.
3946
3947         * platform/gdk/TemporaryLinkStubs.cpp:
3948         (Editor::advanceToNextMisspelling):
3949
3950 2007-04-25  Rob Buis  <buis@kde.org>
3951
3952         Reviewed by Darin.
3953
3954         http://bugs.webkit.org/show_bug.cgi?id=12163
3955         SVG text does not appear in a scrolling <div>
3956
3957         Make sure SVG text is painted when scrolling by taking into account the relative offset of the non-SVG parent in the paintInfo rect.
3958
3959         * rendering/RenderSVGContainer.cpp:
3960         (WebCore::RenderSVGContainer::paint):
3961
3962 2007-04-26  Mark Rowe  <mrowe@apple.com>
3963
3964         Fix non-Mac builds after r21081.
3965
3966         Stub out new Editor methods for Qt and Gdk, and new SVGEmptyEditorClient methods
3967         for all non-Mac builds.
3968
3969         * editing/qt/EditorQt.cpp:
3970         (WebCore::Editor::showSpellingGuessPanel):
3971         (WebCore::Editor::spellingPanelIsShowing):
3972         * page/qt/EventHandlerQt.cpp:
3973         (WebCore::EventHandler::passWheelEventToWidget):
3974         (WebCore::EventHandler::passMousePressEventToScrollbar):
3975         * platform/gdk/TemporaryLinkStubs.cpp:
3976         (Editor::showSpellingGuessPanel):
3977         (Editor::spellingPanelIsShowing):
3978         * platform/graphics/svg/SVGImageEmptyClients.h:
3979         (WebCore::SVGEmptyEditorClient::ignoreWordInSpellDocument):
3980         (WebCore::SVGEmptyEditorClient::learnWord):
3981         (WebCore::SVGEmptyEditorClient::checkSpellingOfString):
3982         (WebCore::SVGEmptyEditorClient::checkGrammarOfString):
3983         (WebCore::SVGEmptyEditorClient::udpateSpellingUIWithGrammarString):
3984         (WebCore::SVGEmptyEditorClient::updateSpellingUIWithMisspelledWord):
3985         (WebCore::SVGEmptyEditorClient::showSpellingUI):
3986         (WebCore::SVGEmptyEditorClient::spellingUIIsShowing):
3987         (WebCore::SVGEmptyEditorClient::getGuessesForWord):
3988
3989 2007-04-25  Anders Carlsson  <andersca@apple.com>
3990
3991         Reviewed by Ada.
3992
3993         <rdar://problem/5122153>
3994         Crash occurs at WebCore::Frame::loader() when switching to Bookmarks view while loading standalone image
3995
3996         Don't call writeRawData if the data length is 0. (This is checked by the decoder for the non-raw case).
3997
3998         * loader/FrameLoader.cpp:
3999         (WebCore::FrameLoader::write):
4000
4001 2007-04-26  Mark Rowe  <mrowe@apple.com>
4002
4003         Gdk build fix courtesy of Alp Toker.
4004
4005         * make-generated-sources.sh:  Remove conditional logic to ensure the
4006         script exits with the correct exit code.
4007
4008 2007-04-24  Anders Carlsson  <andersca@apple.com>
4009
4010         Reviewed by Mitz.
4011
4012         <rdar://problem/4869095> 
4013         default content type for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
4014         
4015         Use the right MIME type.
4016         
4017         * xml/xmlhttprequest.cpp:
4018         (WebCore::XMLHttpRequest::send):
4019
4020 2007-04-24  Darin Adler  <darin@apple.com>
4021
4022         Reviewed by Maciej.
4023
4024         - second round of preparation for Hyatt's "lazy minMaxWidth" change
4025           http://bugs.webkit.org/show_bug.cgi?id=13431
4026
4027         These are small changes that are either safe to do first, or unrelated to the main
4028         change in Hyatt's patch.
4029
4030         - Preallocate 4 entries each in m_layoutStruct and m_spanCells to save allocation
4031           in AutoTableLayout.
4032         - Add an early exit to RenderFlow::dirtyLinesFromChangedChild.
4033         - Change InlineBox::hasTextChildren() to use a bit directly and never a virtual function.
4034         - Save a virtual function call by using a local bool variable for isTableCell().
4035
4036         - Fix containingBlock() so it returns 0 for table cells with no parent.
4037
4038         - Change all callers who are getting at layer() as a boolean to use hasLayer().
4039         - Change if statements to max() function calls (only the ones Hyatt had in his patch).
4040         - Remove some old kdDebug calls.
4041         - Tweak formatting of some code.
4042         - Add const in one place.
4043
4044         * bindings/js/kjs_html.cpp:
4045         (KJS::HTMLElementFunction::callAsFunction):
4046         * page/EventHandler.cpp:
4047         (WebCore::EventHandler::eventMayStartDrag):
4048         * page/Frame.cpp:
4049         (WebCore::Frame::clearTimers):
4050         * rendering/AutoTableLayout.cpp:
4051         (WebCore::AutoTableLayout::recalcColumn):
4052         * rendering/AutoTableLayout.h:
4053         * rendering/InlineBox.h:
4054         (WebCore::InlineBox::InlineBox):
4055         (WebCore::InlineBox::hasTextChildren):
4056         * rendering/InlineFlowBox.cpp:
4057         (WebCore::InlineFlowBox::nodeAtPoint):
4058         * rendering/InlineFlowBox.h:
4059         (WebCore::InlineFlowBox::InlineFlowBox):
4060         * rendering/RenderBlock.cpp:
4061         (WebCore::RenderBlock::layoutBlock):
4062         (WebCore::RenderBlock::repaintOverhangingFloats):
4063         (WebCore::RenderBlock::paintChildren):
4064         (WebCore::RenderBlock::paintFloats):
4065         (WebCore::RenderBlock::fillBlockSelectionGaps):
4066         (WebCore::RenderBlock::insertFloatingObject):
4067         (WebCore::RenderBlock::floatRect):
4068         (WebCore::RenderBlock::lowestPosition):
4069         (WebCore::RenderBlock::rightmostPosition):
4070         (WebCore::RenderBlock::leftmostPosition):
4071         (WebCore::RenderBlock::addOverhangingFloats):
4072         (WebCore::RenderBlock::nodeAtPoint):
4073         (WebCore::RenderBlock::hitTestContents):
4074         (WebCore::RenderBlock::calcPrefWidths):
4075         (WebCore::InlineMinMaxIterator::next):
4076         (WebCore::getBorderPaddingMargin):
4077         (WebCore::RenderBlock::calcInlinePrefWidths):
4078         (WebCore::RenderBlock::calcBlockPrefWidths):
4079         * rendering/RenderContainer.cpp:
4080         (WebCore::RenderContainer::appendChildNode):
4081         (WebCore::RenderContainer::insertChildNode):
4082         * rendering/RenderFlexibleBox.cpp:
4083         (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
4084         (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
4085         * rendering/RenderFlow.cpp:
4086         (WebCore::RenderFlow::dirtyLinesFromChangedChild):
4087         * rendering/RenderLayer.cpp:
4088         (WebCore::RenderLayer::updateVisibilityStatus):
4089         (WebCore::RenderLayer::updateLayerPosition):
4090         * rendering/RenderObject.cpp:
4091         (WebCore::RenderObject::containingBlock):
4092         * rendering/RenderTable.cpp:
4093         (WebCore::RenderTable::paint):
4094         * rendering/RenderTableCell.cpp:
4095         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
4096         * rendering/RenderTableRow.cpp:
4097         (WebCore::RenderTableRow::nodeAtPoint):
4098         (WebCore::RenderTableRow::paint):
4099         * rendering/RenderTableSection.cpp:
4100         (WebCore::RenderTableSection::nodeAtPoint):
4101         * rendering/RenderTreeAsText.cpp:
4102         (WebCore::write):
4103
4104 2007-04-24  Steve Falkenburg  <sfalken@apple.com>
4105
4106         Reviewed by Darin, Oliver.
4107
4108         Refactor spelling codepaths
4109
4110         * bridge/EditorClient.h:
4111         * page/ContextMenuController.cpp:
4112         (WebCore::ContextMenuController::contextMenuItemSelected):
4113         * platform/ContextMenu.cpp:
4114         (WebCore::ContextMenu::populate):
4115         (WebCore::ContextMenu::checkOrEnableIfNeeded):
4116         * platform/gdk/EditorClientGdk.cpp:
4117         (WebCore::EditorClientGdk::ignoreWordInSpellDocument):
4118         (WebCore::EditorClientGdk::learnWord):
4119         (WebCore::EditorClientGdk::checkSpellingOfString):
4120         (WebCore::EditorClientGdk::checkGrammarOfString):
4121         (WebCore::EditorClientGdk::udpateSpellingUIWithGrammarString):
4122         (WebCore::EditorClientGdk::updateSpellingUIWithMisspelledWord):
4123         (WebCore::EditorClientGdk::showSpellingUI):
4124         (WebCore::EditorClientGdk::spellingUIIsShowing):
4125         (WebCore::EditorClientGdk::getGuessesForWord):
4126         * platform/gdk/EditorClientGdk.h:
4127
4128 2007-04-24  Darin Adler  <darin@apple.com>
4129
4130         Reviewed by Adele.
4131
4132         - first round of preparation for Hyatt's