Reviewed by darin
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
2
3         Reviewed by darin
4         
5         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
6
7         * dom/Document.cpp:
8         (WebCore::Document::inDesignMode): Removed some spaces.
9         * page/Frame.cpp:
10         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
11         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
12         it eventually.
13
14 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
15
16         Reviewed by Darin.
17
18         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
19           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
20
21         No test added because there is no change in functionality.
22
23         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
24         * bindings/js/kjs_binding.h: Ditto.
25         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
26         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
27         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
28           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
29         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
30
31 2006-07-24  Dan Waylonis  <waylonis@google.com>
32
33         Reviewed and tweaked a bunch by Darin.
34
35         Test: plugins/bindings-test.html
36
37         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
38           jsNull and NSNull not properly converted between JS and ObjC
39
40         * bindings/objc/WebScriptObject.mm:
41         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
42         Added case that converts jsNull to NSNull.
43
44 2006-07-24  Darin Adler  <darin@apple.com>
45
46         Reviewed by Adele and Justin.
47
48         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
49           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
50         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
51           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
52         - removed some uses of DeprecatedPtrList in the markup code
53
54         Test: fast/forms/textarea-type-spaces.html
55         Test: fast/forms/textarea-paste-newline.html
56
57         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
58         Updated call to pass a range -- in this case it is the range of the entire document,
59         so this will not handle the whitespace properly.
60
61         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
62         documentFragmentWithText: method, so we can handle whitespace properly.
63         * bridge/mac/WebCoreFrameBridge.mm:
64         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
65         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
66         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
67         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
68         parameter -- pass it on to createFragmentFromText.
69         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
70         DeprecatedPtrList to Vector.
71         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
72         Pass the range of the current selection as context when creating the fragment.
73
74         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
75         a call to the new containsCaretOffset function -- helps make the caret work right when
76         it is past the end of the last line in a textarea.
77
78         * editing/CompositeEditCommand.cpp:
79         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
80         style does not call for collapsing whitespace.
81         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
82         to share code, including the new logic mentioned above.
83
84         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
85         Use a text node instead of a break element when inserting and the style is preserveNewline.
86
87         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
88         to createFragmentFromText.
89
90         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
91         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
92         not to call otherwise.
93
94         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
95         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
96         Also changed the constructor to take a selection rather than a pointer to the root
97         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
98         unused parameter from shouldMergeEnd.
99         * editing/ReplaceSelectionCommand.cpp:
100         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
101         Compute root editable element from passed-in selection. Used the start of the selection
102         as a base node for style purposes for the test rendering. Removed the special case
103         "single text node" alternative to createFragmentFromText in the plain text case, since
104         createFragmentFromText now handles that correctly.
105         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
106         property from the source location when creating a temporary element for test rendering.
107         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
108         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
109         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
110         change code to not remove end BR when it can be re-used instead, don't call the
111         paragraph separator insertion when the position is at the start of a paragraph already,
112         removed redundant computation of identical "next" value, removed unneeded boolean
113         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
114         a newline character, removed unneeded code to set insertionPos after all code that uses
115         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
116         context is one where we do not collapse white space.
117         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
118         a boolean instead of doing the removal.
119
120         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
121         createFragmentFromText function to take a range for context instead of a document.
122         * editing/markup.cpp:
123         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
124         (WebCore::createMarkup): Ditto.
125         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
126         and changed a couple places to use isEmpty instead of comparing with "".
127         (WebCore::createFragmentFromText): Given the new context parameter, if the context
128         is one that preserves newlines, then use "\n" instead of <br> elements.
129         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
130
131         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
132         elements if the context of this node is one where we preserve newlines.
133
134         * rendering/InlineTextBox.h:
135         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
136         Added. Implements the appropriate rule for determining if a caret position is
137         in this line or not. Returns true for both one line and the next in cases where
138         affinity must be considered to determine which line the caret is on.
139
140         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
141         * rendering/RenderText.cpp:
142         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
143         which will no longer apply due to the new containsCaretOffset function logic.
144         (WebCore::RenderText::caretRect): Use containsCaretOffset.
145         (WebCore::RenderText::inlineBox): Ditto.
146
147         * rendering/RenderTextControl.cpp:
148         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
149         after calling setInnerText so that the last newline in the string has the effect
150         we expect outside the HTML world (an additional line).
151         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
152         too. The layout tests caught this problem, which needs a better solution long term.
153         (WebCore::RenderTextControl::text): Call textContent with the parameter false
154         so it will not include newlines for <br> elements. Now the only <br> element
155         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
156         that one should not show up in the text value.
157
158         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
159         that specifically called out the pre whitespace mode and made it work for all
160         the modes that preserve newlines. This makes sure we get a last line box for
161         text after the last "\n" even in cases where there is no <br> afterward.
162
163         * editing/DeleteSelectionCommand.cpp:
164         (WebCore::DeleteSelectionCommand::fixupWhitespace):
165         * editing/InsertParagraphSeparatorCommand.cpp:
166         (WebCore::InsertParagraphSeparatorCommand::doApply):
167         Added assertions to make sure we don't do anything when we're not collapsing
168         whitespace.
169
170         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
171         Changed to use Vector instead of DeprecatedPtrList.
172
173         * editing/HTMLInterchange.cpp: Removed obsolete comment.
174
175         * loader/Cache.h: Removed a stray include.
176
177 2006-07-24  Adele Peterson  <adele@apple.com>
178
179         Reviewed by Justin.
180
181         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
182
183         Test: * editing/style/apple-style-editable-mix.html
184
185         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
186           checks the user modify property of its own renderer, since that is inherited.
187         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
188         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
189
190 2006-07-24  Darin Adler  <darin@apple.com>
191
192         Reviewed by Hyatt.
193
194         - implement String::createCFString
195
196         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
197
198         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
199
200         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
201         and added the CFStringRef ones.
202         * platform/mac/StringMac.mm: Added. Ditto.
203
204 2006-07-24  David Hyatt  <hyatt@apple.com>
205
206         Two bug fixes.
207
208         (1) Make sure to mark positioned objects that depend on line position to
209         mark themselves as needing layout when their line box placeholder gets
210         repositioned.
211
212         * rendering/RenderBox.cpp:
213         (WebCore::RenderBox::position):
214        
215         (2) Improve highlighting to factor the inflation into overflow so that
216         invalidation and repainting will work properly.
217
218         * rendering/RootInlineBox.cpp:
219         (WebCore::RootInlineBox::addHighlightOverflow):
220         * rendering/RootInlineBox.h:
221         * rendering/bidi.cpp:
222         (WebCore::RenderBlock::layoutInlineChildren):
223
224 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
225
226         Reviewed by Adele.
227
228         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
229         
230         * html/HTMLInputElement.cpp:
231         (WebCore::HTMLInputElement::defaultEventHandler):
232         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
233         that onsearch can be invoked.
234         
235         * manual-tests/onsearch-enter.html: Added.
236
237 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
238
239         Reviewed by Darin and Alexey.
240         
241         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
242         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
243
244         Test: svg/custom/non-opaque-filters.svg
245
246         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
247         (WebCore::KCanvasFilterQuartz::prepareFilter):
248         We create an autorelease pool so we can control the deallocation of the
249         CIContext that we're creating. The CIContext retains the CGContext that 
250         you pass it internally so when the CIContext is released, the 
251         CGContext is released as well.
252         This is all fine and dandy unless you wrap the creation of the CIFilter
253         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
254         out from underneath you. So if you start with context A, 
255         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
256         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
257         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
258         release on A, but A never got the refcount in the first place. B did. BOOM!
259         So we create a pool, then do a retain, then release the pool so that we 
260         don't have to worry about the pool releasing it at a later time.
261         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
262
263 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
264
265         Reviewed by Hyatt.
266
267         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
268           Incomplete repaint when changing an inline's border
269
270         Test: fast/repaint/line-overflow.html
271
272         * rendering/RenderBlock.h:
273         * rendering/bidi.cpp:
274         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
275         variables to track the vertical edges of the area that changed, accounting for
276         lines that were deleted, inserted or moved. Removed unnecessary updating of
277         m_overflowHeight.
278         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
279         m_overflowHeight.
280         (WebCore::RenderBlock::determineEndPosition):
281         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
282         arguments, which this method updates to account for deleted lines.
283         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
284
285 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
286
287         Reviewed by Darin.
288
289         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
290           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
291
292         Test: fast/forms/select-visual-hebrew.html
293
294         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
295
296 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
297
298         Reviewed by Darin.
299
300         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
301         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
302
303         * page/Frame.cpp:
304         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
305         claims it.
306
307 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
308
309         Reviewed by Darin.
310
311         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
312           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
313
314         * rendering/RenderBlock.cpp:
315         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
316         for bug 9312: For coordinates outside a replaced object, return the position
317         just before (after) the element if the coordinates are above or to the left (below
318         or to the right).
319
320 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
321
322         Reviewed by maciej.
323
324         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
325         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
326
327         WebCore portion of the fix.
328
329         * bridge/mac/WebCoreScriptDebugger.h:
330         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
331         * bridge/mac/WebCoreScriptDebugger.mm:
332         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
333
334 2006-07-23  Alice Liu  <alice.liu@apple.com>
335
336         Reviewed by Adele.
337         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
338
339         * editing/visible_units.cpp:
340         (WebCore::previousLinePosition):
341         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
342         (WebCore::nextLinePosition):
343         same as above
344
345 2006-07-23  David Harrison  <harrison@apple.com>
346
347         Reviewed by timo.
348
349         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
350         
351         * Test: editing/deleting/delete-mixed-editable-content-001.html
352
353         * editing/visible_units.cpp:
354         (WebCore::startOfParagraph):
355         Respect editable boundary the same way endOfParagraph does.
356
357 2006-07-23  Beth Dakin  <bdakin@apple.com>
358
359         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
360
361         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
362         text - WebCore::InlineBox::root()
363
364         The initial rendering crash was due to a render object having a 
365         stale reference to an inline box that had already been deleted and 
366         then recreated in the exact same location in memory. (Crazy, I 
367         know.) The situation seemed pretty specific to list markers 
368         according to Hyatt according to Maciej, so that is what I patched 
369         specifically. Fixing this crash unearthed a separate editing crash 
370         where we were trying to insert a block into itself. I worked on 
371         that with Maciej and Harrison, and Harrison came up with a fix.
372
373         * editing/CompositeEditCommand.cpp:
374         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
375         node, insert the new block into the parent instead.
376         * rendering/InlineBox.cpp:
377         (WebCore::InlineBox::isChildOfParent): This function is for 
378         posterity. It will help keep the linebox tree in check.
379         * rendering/InlineBox.h:
380         * rendering/InlineFlowBox.cpp:
381         (WebCore::InlineFlowBox::addToLine): Added assert.
382         (WebCore::InlineFlowBox::deleteLine): Added assert.
383         * rendering/ListMarkerBox.cpp:
384         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
385         removeChild on this.
386         (WebCore::ListMarkerBox::operator delete):
387         * rendering/ListMarkerBox.h:
388
389 2006-07-23  Alice Liu  <alice.liu@apple.com>
390
391         Reviewed by Darin.
392
393         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
394
395         * rendering/RenderBlock.cpp:
396         (WebCore::RenderBlock::positionForCoordinates):
397         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
398         * rendering/RenderTextControl.cpp:
399         (WebCore::RenderTextControl::nodeAtPoint):
400         added implementation
401         * rendering/RenderTextControl.h:
402         added function protocol
403
404 2006-07-23  Adele Peterson  <adele@apple.com>
405
406         Reviewed by Darin.
407
408         Updating fix from last checkin.
409
410         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
411         Only tell the view about this flexbox if there isn't another flexbox already cached.
412
413 2006-07-23  Adele Peterson  <adele@apple.com>
414
415         Reviewed by Maciej.
416
417         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
418
419         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
420         its first layout.
421         * rendering/RenderFlexibleBox.cpp:
422         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
423         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
424
425         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
426         * rendering/RenderView.h:
427         (WebCore::RenderView::setFlexBoxInFirstLayout):
428         (WebCore::RenderView::flexBoxInFirstLayout):
429
430 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
431
432         Reviewed by Darin.
433
434         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
435         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
436         of registered mime types
437
438         * bindings/js/kjs_navigator.cpp:
439         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
440         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
441         from even being called.
442
443 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
444
445         Reviewed by Adele and Tim Omernick.
446
447         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
448
449         Couldn't figure out how to make layout test, here's a manual test:
450         * manual-tests/remove-select-onchange.html: Added.
451         
452         * rendering/RenderMenuList.cpp:
453         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
454         tree so it doesn't get destroyed if we do.
455         
456         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
457         to be in the render tree:
458         
459         * rendering/RenderPopupMenu.cpp:
460         (WebCore::RenderPopupMenu::RenderPopupMenu):
461         * rendering/RenderPopupMenu.h:
462         (WebCore::RenderPopupMenu::menuList):
463         * rendering/RenderPopupMenuMac.h:
464         * rendering/RenderPopupMenuMac.mm:
465         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
466         * rendering/RenderPopupMenuWin.h:
467         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
468         * rendering/RenderTheme.h:
469         * rendering/RenderThemeMac.h:
470         * rendering/RenderThemeMac.mm:
471         (WebCore::RenderThemeMac::createPopupMenu):
472         * rendering/RenderThemeWin.cpp:
473         (WebCore::RenderThemeWin::createPopupMenu):
474         * rendering/RenderThemeWin.h:
475
476 2006-07-21  Adele Peterson  <adele@apple.com>
477
478         Reviewed by Darin.
479
480         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
481
482         Test: fast/forms/textarea-scrolled-endline-caret.html
483
484         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
485         When looking for the closest line box, take the scroll offset into account.
486
487 2006-07-21  Tim Omernick  <timo@apple.com>
488
489         Reviewed by Geoff & Maciej.
490
491         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
492
493         Geoff is working on a layout test for this.
494
495         * bridge/mac/FrameMac.mm:
496         (WebCore::FrameMac::focusWindow):
497         (WebCore::FrameMac::unfocusWindow):
498         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
499         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
500         crasher.
501         
502 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
503
504         Reviewed by Darin.
505
506         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
507
508         * rendering/RenderTextControl.cpp:
509         (WebCore::RenderTextControl::updateFromElement): Clear the undo
510         chain when the text control contents have been set
511         programmatically.
512         * bridge/mac/FrameMac.mm:
513         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
514         stack, close all open undo groups and then open an equal number,
515         since otherwise NSUndoManager ends up in an inconsistent state
516         leading to uncaught ObjC exceptions.
517
518 2006-07-21  Beth Dakin  <bdakin@apple.com>
519         
520         Reviewed by Darin.
521
522         Just moving this assertion down a couple of lines. It was hitting 
523         every time you try to print a page because we put it too early in 
524         the function.
525
526         * bridge/mac/WebCoreFrameBridge.mm:
527         (-[WebCoreFrameBridge drawRect:]):
528
529 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
530
531         Reviewed by levi
532         
533         <rdar://problem/4548238>
534         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
535
536         * editing/CompositeEditCommand.cpp:
537         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
538         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
539         * editing/CompositeEditCommand.h:
540         * editing/InsertParagraphSeparatorCommand.cpp:
541         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
542         * editing/TypingCommand.cpp:
543         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
544         the endingSelection is at the start of an editable region.
545         * editing/htmlediting.cpp:
546         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
547         (WebCore::appendedSublist): Ditto.
548         (WebCore::enclosingEmptyListItem): Ditto.
549         * editing/htmlediting.h:
550
551 === Safari-521.20 ===
552
553 2006-07-21  Tim Omernick  <timo@apple.com>
554
555         Reviewed by Beth Dakin & John Sullivan.
556
557         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
558
559         Beth is in the middle of making a layout test for this; she will land it soon.
560
561         * platform/mac/ScrollBarMac.mm:
562         (ScrollBar::~ScrollBar):
563         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
564         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
565         in view-based widgets to prevent their destruction while the tracking is in progress.
566         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
567         than using removeFromSuperview().
568
569 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
570
571         Reviewed by Darin.
572
573         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
574           REGRESSION: Selection bug in new text fields when selecting past the first letter
575
576         Test: editing/selection/select-from-textfield-outwards.html
577
578         * editing/Selection.cpp:
579         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
580         where the selection starts (resp. ends) in the last (resp. first) visual position
581         inside an editable root.
582         * editing/htmlediting.cpp:
583         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
584         tree with a position in the shadow ancestor.
585         * rendering/RenderBlock.cpp:
586         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
587         object, return the position just before (after) the element if the coordinates are above or
588         to the left (below or to the right).
589         * rendering/RenderObject.cpp:
590         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
591         * rendering/RenderText.cpp:
592         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
593         in the lowest text box if the y coordinate is below all text boxes.
594
595 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
596
597         Reviewed by Darin.
598         
599         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
600         HousingMaps.com (Google Maps-based site)
601         
602         - Made style.filter undetectable, like document.all.
603         
604         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
605         which conflicts with IE's custom CSS attribute by the same name. Web programs 
606         like the Google maps API test for style.filter, and assume it's the IE 
607         style.filter if they find it, so we need to make style.filter undetectable 
608         to avoid breaking them.
609         
610         An alternative solution would be to hotwire a delorean, go back in time,
611         and beg the web standards makers to make standards that work on the web.
612
613         * bindings/js/kjs_css.cpp:
614         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
615
616 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
617
618         Reviewed by john
619         
620         <rdar://problem/4641033>
621         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
622         
623         * editing/markup.cpp:
624         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
625         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
626         at those ancestors.  We assumed that any ancestors of the current node not in the 
627         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
628         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
629         currently accumulated markup with markup for render-less containers.  Most of the
630         content at apple.com was being put inside an <optgroup> inside a <select> element.  
631         Then on Paste createContextualFragment would drop it.
632
633 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
634
635         Reviewed by Geoff.
636
637         * dom/Document.h:
638         (WebCore::Document::):
639         * dom/EventTargetNode.cpp:
640         (WebCore::EventTargetNode::addEventListener):
641         * page/FrameView.cpp:
642         (WebCore::FrameView::layout):
643         * rendering/RenderLayer.cpp:
644         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
645         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
646
647 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
648
649         Reviewed by Geoff.
650
651         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
652
653         * xml/XSLTProcessor.cpp:
654         (WebCore::xsltParamArrayFromParameterMap):
655         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
656         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
657         This also works around a bug in libxslt where a hash table isn't allocated.
658
659 2006-07-20  Alice Liu  <alice.liu@apple.com>
660
661         Reviewed by Tim Omernick.
662
663         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
664         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
665
666         * manual-tests/remove-input-file-onchange.html: Added.
667         * platform/mac/FileButtonMac.mm:
668         (-[WebFileChooserButton chooseFilename:]):
669         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
670
671 2006-07-20  Alice Liu  <alice.liu@apple.com>
672
673         Reviewed by Adele.
674
675         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
676         added a manual test because of the need to use AutoFill.
677
678         * dom/Node.h:
679         (WebCore::Node::aboutToUnload):
680         added virtual function prototype
681         * html/HTMLInputElement.cpp:
682         (WebCore::HTMLInputElement::aboutToUnload):
683         added implementation that sends textFieldDidEndEditing notification
684         * html/HTMLInputElement.h:
685         added virtual function prototype
686         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
687         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
688         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
689         * page/Frame.cpp:
690         (WebCore::Frame::stopLoading):
691         before unloading, call aboutToUnload on the current focused node
692
693 2006-07-20  Brady Eidson  <beidson@apple.com>
694
695         Reviewed by Maciej
696
697         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
698         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
699         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
700
701         * dom/Document.cpp:
702         (WebCore::Document::Document):
703         (WebCore::Document::clear):
704         (WebCore::Document::handleWindowEvent):
705         (WebCore::Document::getHTMLWindowEventListener):
706         (WebCore::Document::removeHTMLWindowEventListener):
707         (WebCore::Document::removeWindowEventListener):
708         (WebCore::Document::hasWindowEventListener):
709         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
710
711         * dom/Document.h:
712         Changed the EventListener list to be a vanilla pointer list to a refptr list
713
714 2006-07-20  John Sullivan  <sullivan@apple.com>
715
716         Reviewed by Maciej
717
718         - WebCore part of fix for:
719         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
720         closing tabs after clicking in a web page
721         
722         * bridge/mac/WebCoreFrameBridge.h:
723         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
724         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
725         * bridge/mac/FrameMac.mm:
726         (WebCore::FrameMac::passMouseDownEventToWidget):
727         updated for name change
728
729 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
730
731         Reviewed by Darin.
732
733         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
734         Use of window.open & window.close can cause crash
735
736         * platform/PlatformMouseEvent.h:
737         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
738         * platform/mac/PlatformMouseEventMac.mm:
739         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
740         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
741
742         * bridge/mac/FrameMac.mm:
743         (WebCore::FrameMac::handleMouseMoveEvent):
744         * rendering/RenderFormElement.cpp:
745         (WebCore::RenderFormElement::clicked): 
746         Updated for the above changes.
747
748         * platform/gdk/MouseEventGdk.cpp:
749         * platform/gdk/TemporaryLinkStubs.cpp:
750         (PlatformMouseEvent::PlatformMouseEvent):
751         * platform/win/MouseEventWin.cpp:
752         * platform/win/TemporaryLinkStubs.cpp:
753         (PlatformMouseEvent::PlatformMouseEvent):
754         Trying not to break other platforms.
755
756         * manual-tests/invalid-mouse-event.html: Added.
757
758 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
759         
760         Reviewed by Anders.
761
762         - delete line that I only commented in the last patch - meant to do this before landing
763
764         * html/HTMLFrameElement.cpp:
765         (WebCore::HTMLFrameElement::close): 
766
767 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
768
769         Reviewed by Geoff.
770
771         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
772         
773         I couldn't figure out how to make an automated test case for this,
774         or even a manual one. It seems to be timing-related in some way.
775
776         * html/HTMLFrameElement.cpp:
777         (WebCore::HTMLFrameElement::close): detach the child frame from
778         its element, not the frame containing this element.
779
780 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
781
782         Reviewed by Darin.
783
784         * bridge/mac/FrameMac.mm:
785         (WebCore::FrameMac::nextKeyViewInFrame):
786         Hold a ref to the node in case it gets destroyed by an event handler.
787
788 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
789
790         Reviewed by Darin.
791
792         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
793         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
794         Image::checkForSolidColor
795
796         * platform/Image.cpp:
797         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
798         the frame was decoded successfully.
799
800 2006-07-19  Adele Peterson  <adele@apple.com>
801
802         Reviewed by Maciej.
803
804         - Fix for: 
805         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
806         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
807
808         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
809         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
810
811         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
812
813         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
814         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
815         which will cause the correct selection & scrolling behavior to occur. 
816
817         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
818         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
819         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
820         a layout to happen, and we don't want that to happen in the middle of attach().
821
822         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
823         * bindings/objc/DOMPrivate.h:
824
825         * dom/Element.cpp:
826         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
827         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
828         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
829         and only requiring the element to be focusable now before updating focus appearance.
830         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
831         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
832         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
833         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
834         (WebCore::Element::blur): ditto.
835         * dom/Element.h:
836         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
837         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
838
839         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
840         * html/HTMLAnchorElement.h: Added supportsFocus.
841         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
842         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
843         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
844         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
845
846         * html/HTMLInputElement.cpp:
847         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
848         and only requiring the element to be focusable now before updating focus appearance.
849         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
850         * html/HTMLInputElement.h:
851
852         * html/HTMLTextAreaElement.cpp:
853         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
854         and only requiring the element to be focusable now before updating focus appearance.
855         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
856         * html/HTMLTextAreaElement.h:
857
858 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
859
860         Reviewed by levi
861         
862         <rdar://problem/4631972>
863         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
864
865         * dom/Position.cpp:
866         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
867         (WebCore::Position::downstream): Ditto.
868         * editing/CompositeEditCommand.cpp:
869         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
870         * editing/htmlediting.cpp:
871         (WebCore::canHaveChildrenForEditing): Added !iframe.
872         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
873         (WebCore::enclosingBlock): Added.
874         * editing/htmlediting.h:
875
876 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
877
878         Reviewed by Adele.
879
880         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
881         
882         * bridge/mac/FrameMac.mm:
883         (WebCore::FrameMac::nextKeyViewInFrame):
884         Take into account that focus handlers can cause a node's renderer to be destroyed.
885         
886 2006-07-19  David Hyatt  <hyatt@apple.com>
887
888         Fix for 4638376.  The 1x1 solid color image optimization was broken when
889         I re-architected image.  This patch restores the optimization for CG.  Cairo
890         will still need the optimization.
891
892         Reviewed by darin
893
894         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
895
896         * platform/Image.cpp:
897         (WebCore::Image::Image):
898         (WebCore::Image::invalidateData):
899         (WebCore::Image::cacheFrame):
900         * platform/Image.h:
901         (WebCore::Image::setIsPDF):
902         * platform/cairo/ImageCairo.cpp:
903         (WebCore::Image::checkForSolidColor):
904         * platform/mac/ImageMac.mm:
905         (WebCore::Image::initNativeData):
906         (WebCore::Image::invalidateNativeData):
907         (WebCore::Image::checkForSolidColor):
908         (WebCore::Image::draw):
909         (WebCore::Image::drawTiled):
910
911 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
912
913         Reviewed by levi
914         
915         <rdar://problem/4613519>
916         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
917
918         * editing/InsertParagraphSeparatorCommand.cpp:
919         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
920         if the enclosingBlockFlowElement doesn't have a parent.
921
922 2006-07-19  David Harrison  <harrison@apple.com>
923
924         Reviewed by Tim Hatcher.
925
926         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
927         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
928         
929         Better patch than previous checkin.
930
931         * test: editing/pasteboard/paste-table-003.html
932         
933         * editing/markup.cpp:
934         (WebCore::createMarkup):
935         Make sure to include the table when including a tbody.
936
937 === Safari-521.19 ===
938
939 2006-07-19  David Harrison  <harrison@apple.com>
940
941         Reviewed by Tim Hatcher.
942
943         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
944
945         No test case as this can only be reproduced through ObjC APIs.
946
947         * editing/markup.cpp:
948         (WebCore::createMarkup):
949         Adjust the range for ancestor markup handling when main loop skips first node.
950
951 2006-07-18  David Hyatt  <hyatt@apple.com>
952
953         Fix for radar 4611287, make resizable text fields opt-in rather than
954         opt-out.  Open source users will need to write the pref into their defaults
955         to see the resizers on textareas now.
956
957         Reviewed by mjs and adele
958
959         * WebCore.xcodeproj/project.pbxproj:
960         * bridge/mac/WebCoreSettings.mm:
961         (-[WebCoreSettings setTextAreasAreResizable:]):
962         * css/cssparser.cpp:
963         (WebCore::CSSParser::parseValue):
964         * css/cssstyleselector.cpp:
965         (WebCore::CSSStyleSelector::applyProperty):
966         * css/html4.css:
967
968 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
969
970         Reviewed by Darin.
971
972         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
973         REGRESSION: iframes stop rendering after 200th one on successive reloads
974         
975         * html/HTMLFrameElement.cpp:
976         (WebCore::HTMLFrameElement::attach):
977         (WebCore::HTMLFrameElement::close):
978         * html/HTMLIFrameElement.cpp:
979         (WebCore::HTMLIFrameElement::insertedIntoDocument):
980         (WebCore::HTMLIFrameElement::willRemove):
981         Remove calls to incrementFrameCount and decrementFrameCount.
982         
983         * page/Frame.cpp:
984         (WebCore::Frame::Frame):
985         Call incrementFrameCount here.
986         
987         (WebCore::Frame::~Frame):
988         Call disconnectOwnerElement.
989         
990         (WebCore::Frame::disconnectOwnerElement):
991         Call decrementFrameCount here.
992         
993 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
994
995         Reviewed by Darin.
996
997         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
998         Let correct CSS custom cursor declarations parse
999
1000         * css/cssparser.cpp:
1001         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1002         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1003         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1004
1005         * manual-tests/custom-cursors.html: Added a test for this issue.
1006         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1007
1008 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1009
1010         Reviewed by Anders.
1011         
1012         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1013         
1014         WebCore needs to add -sub_library libobjc to maintain
1015         backwards compatibility with binaries linked with WebKit
1016         before JavaScriptCore moved out of WebKit.
1017
1018         * WebCore.xcodeproj/project.pbxproj:
1019
1020 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1021
1022         Reviewed by Justin.
1023
1024         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1025           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1026
1027         Test: editing/selection/click-start-of-line.html
1028
1029         * rendering/RenderText.cpp:
1030         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1031         affinity if the x coordinate is to the left of the middle of the first character
1032         in the text box.
1033
1034 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1035
1036         Reviewed by Darin.
1037
1038         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1039         <rdar://problem/4614085> 
1040         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1041         
1042         * editing/SelectionController.cpp:
1043         (WebCore::SelectionController::modifyExtendingRightForward):
1044         (WebCore::SelectionController::modifyMovingRightForward):
1045         (WebCore::SelectionController::modifyExtendingLeftBackward):
1046         (WebCore::SelectionController::modifyMovingLeftBackward):
1047         If the caret is inside an editable region, the beginning/end of the document should actually be the
1048         beginning/end of the editable region.
1049
1050 2006-07-17  Tim Omernick  <timo@apple.com>
1051
1052         Reviewed by Maciej.
1053
1054         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1055         by script
1056
1057         * bridge/mac/WebCoreFrameBridge.h:
1058         * bridge/mac/WebCoreFrameBridge.mm:
1059         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1060         * page/Frame.cpp:
1061         (WebCore::Frame::prohibitsScrolling):
1062         (WebCore::Frame::setProhibitsScrolling):
1063         * page/Frame.h:
1064         * page/FramePrivate.h:
1065         (WebCore::FramePrivate::FramePrivate):
1066         * page/FrameView.cpp:
1067         (WebCore::FrameView::scrollPointRecursively):
1068         (WebCore::FrameView::setContentsPos):
1069         * page/FrameView.h:
1070         * platform/ScrollView.h:
1071
1072 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1073
1074         Reviewed by Dave Harrison.
1075         
1076         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1077
1078         * editing/htmlediting.cpp:
1079         (WebCore::editingIgnoresContent):
1080
1081 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1082
1083         Reviewed by levi
1084         
1085         <rdar://problem/4621728>
1086         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1087         <rdar://problem/4604932>
1088         REGRESSION: Dragging too far left on a line will select all lines above it.
1089  
1090         No layout test because of 9980.
1091
1092         * rendering/RenderBlock.cpp:
1093         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1094         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1095         editable.
1096
1097 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1098
1099         Reviewed by Darin.
1100
1101         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1102
1103         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1104         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1105         * html/CanvasRenderingContext2D.cpp:
1106         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1107
1108 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1109
1110         Reviewed by Maciej.
1111
1112         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1113
1114         Moves WebScriptObject and WebUndefined to WebCore.
1115
1116         * WebCore.exp:
1117         * WebCore.xcodeproj/project.pbxproj:
1118         * bindings/objc/DOM.mm:
1119         * bindings/objc/DOMCore.h:
1120         * bindings/objc/DOMInternal.mm:
1121         * bindings/objc/DOMUtility.mm:
1122         * bindings/objc/WebScriptObject.mm: Added.
1123         (+[WebUndefined allocWithZone:]):
1124         (-[WebUndefined initWithCoder:]):
1125         (-[WebUndefined encodeWithCoder:]):
1126         (-[WebUndefined copyWithZone:]):
1127         * bindings/objc/WebScriptObjectPrivate.h: Added.
1128         * bridge/mac/FrameMac.mm:
1129         * bridge/mac/WebCoreScriptDebugger.mm:
1130
1131 2006-07-17  David Hyatt  <hyatt@apple.com>
1132
1133         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1134         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1135         font parsing as a means of also correcting IE's incorrect font size rules.
1136
1137         This fixes Yahoo.com.
1138
1139         Reviewed by darin
1140
1141         * css/cssparser.cpp:
1142         (WebCore::CSSParser::parseFont):
1143
1144 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1145
1146         Reviewed by levi
1147         
1148         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1149         
1150         * dom/Document.cpp:
1151         (WebCore::Document::updateSelection):
1152
1153 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1154
1155         Reviewed by Beth.
1156         
1157         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1158
1159         * html/HTMLInputElement.cpp:
1160         (WebCore::HTMLInputElement::setChecked):
1161         (WebCore::HTMLInputElement::preDispatchEventHandler):
1162         * html/HTMLInputElement.h:
1163
1164 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1165
1166         Reviewed by Darin.
1167
1168         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1169           REGRESSION: document.dir should return empty string in <head>
1170
1171         Test: fast/dom/document-dir-property.html
1172
1173         * bindings/js/kjs_html.cpp:
1174         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1175         undefined value for an unset document.dir property.
1176
1177 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1178
1179         Reviewed by Darin.
1180
1181         * dom/NodeFilter.idl:
1182         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1183         * manual-tests/input-empty-on-focus.html:
1184         Removed "Property changes" that snuck in as part of the "apply patch" process.
1185
1186 2006-07-16  Darin Adler  <darin@apple.com>
1187
1188         Reviewed by John Sullivan.
1189
1190         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1191           <rdar://problem/4590613>
1192           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1193
1194         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1195         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1196         Presumably some other bug that we fixed had been compensating.
1197
1198         Test: fast/html/body-offset-properties.html
1199
1200         * rendering/RenderObject.cpp:
1201         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1202         (WebCore::RenderObject::offsetTop): Ditto.
1203         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1204
1205 2006-07-16  Beth Dakin  <bdakin@apple.com>
1206
1207         Reviewed by Maciej.
1208
1209         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1210         clock widget clock hand motion on 9A211 + 4604574
1211
1212         The second hand on the widget was jiggling because the rotation was 
1213         messing up the use of the affine transformation matrix while 
1214         rounding to pixel boundaries in device space. We are mainly 
1215         concerned with rounding to pixel boundaries with the scale in mind, 
1216         so this patch extracts the scale to device space from the matrix, 
1217         and rounds to pixel boundaries using only the scale. This doesn't 
1218         seem like it is a perfect solution, but it definitely solves the 
1219         immediate problem. We will probably need to re-address what should 
1220         happen to avoid pixel cracks with rotations at non-integral scale 
1221         factors. 
1222
1223         * platform/cg/GraphicsContextCG.cpp:
1224         (WebCore::GraphicsContext::roundToDevicePixels):
1225
1226 2006-07-15  Darin Adler  <darin@apple.com>
1227
1228         - fix mistake from fix for 8952 that was breaking layout tests
1229
1230         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1231         Justin was right! I changed the behavior of the function by accident. Changed it
1232         back so that it doesn't blow away the selection on the DOM side in the case where
1233         it didn't before.
1234
1235         I will write 100 times on the blackboard: "When Justin says something about editing,
1236         assume he is right."
1237
1238 2006-07-15  Darin Adler  <darin@apple.com>
1239
1240         - try to fix Windows build
1241
1242         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1243
1244 2006-07-15  Darin Adler  <darin@apple.com>
1245
1246         Reviewed by John Sullivan.
1247
1248         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1249           <rdar://problem/4575185>
1250           REGRESSION: crash on drag of highlighted Google custom home page modules
1251
1252         Test: fast/dynamic/move-node-with-selection.html
1253
1254         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1255         Call updateRendering before calling clearSelection(), since it's important to do any
1256         work beforehand, and there are calls inside clearSelection that will indirectly do an
1257         updateRendering. Also change code to make fewer assumptions about object lifetime.
1258
1259 2006-07-15  Darin Adler  <darin@apple.com>
1260
1261         Reviewed by John Sullivan.
1262
1263         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1264           <rdar://problem/4631844>
1265           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1266
1267         Test: fast/lists/numeric-markers-outside-list.html
1268
1269         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1270         Look for list items, even when we're outside any list.
1271
1272 2006-07-15  Adele Peterson  <adele@apple.com>
1273
1274         Reviewed by John.
1275
1276         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1277
1278         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1279         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1280         part of an editing command to replace the selected text.
1281
1282         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1283           part of a composite command to replace the text being deleted.
1284         * editing/DeleteSelectionCommand.cpp:
1285         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1286         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1287         * editing/CompositeEditCommand.h:
1288         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1289           Added replace argument to construct DeleteSelectionCommand.
1290           
1291         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1292         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1293
1294 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1295
1296         Reviewed by Maciej, tweaked to match Darin's patch.
1297         
1298         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1299         FCKeditor demo (9911)
1300         
1301         * WebCore.xcodeproj/project.pbxproj:
1302         * bindings/js/kjs_html.cpp:
1303         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1304         forwarding the put request to it. I confirmed that no other parts of the 
1305         file use 'body' or 'bodyElement' without checking for null. 
1306         
1307         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1308         any element, not just HTMLBodyElement.
1309
1310 2006-07-15  Darin Adler  <darin@apple.com>
1311
1312         Reviewed by Adele.
1313
1314         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1315           <rdar://problem/4575417>
1316           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1317
1318         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1319           <rdar://problem/4614228>
1320           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1321
1322         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1323         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1324         enough for the future.
1325
1326         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1327         Consume Enter key keypress events even if the element is not in a form.
1328
1329         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1330         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1331         the Macintosh, but in layout tests we can use \n, and everything other than the
1332         code path here works, so worth fixing.
1333
1334 2006-07-15  Darin Adler  <darin@apple.com>
1335
1336         Reviewed by John Sullivan.
1337
1338         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1339           <rdar://problem/4631821>
1340           REGRESSION: NativePopups don't work correctly in some forum software
1341
1342         Test: fast/forms/select-selected.html
1343
1344         * rendering/RenderMenuList.h:
1345         * rendering/RenderMenuList.cpp:
1346         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1347         index to a list index before using it to index into the list.
1348         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1349         to a list index before passing it to the menu renderer.
1350         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1351         option index before calling setSelectedIndex (that function takes an option index).
1352
1353 2006-07-15  Darin Adler  <darin@apple.com>
1354
1355         Reviewed by John Sullivan.
1356
1357         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1358           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1359
1360         * bindings/objc/DOM.mm:
1361         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1362         (-[DOMNode removeEventListener:::]): Ditto.
1363         (-[DOMNode dispatchEvent:]): Ditto.
1364
1365         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1366
1367 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1368
1369         Reviewed by Anders.
1370
1371         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1372
1373         * rendering/RenderTable.cpp:
1374         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1375         just table sections!
1376
1377 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1378
1379         Reviewed by Darin.
1380
1381         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1382         <rdar://problem/4631561>
1383         REGRESSION: Repro crash from mangleme using iframe, only from server.
1384         
1385         * html/HTMLIFrameElement.cpp:
1386         (WebCore::HTMLIFrameElement::attach):
1387         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1388
1389 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1390
1391         Reviewed by Darin.
1392
1393         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1394         REGRESSION: KOI8-U encoding no longer supported.
1395
1396         Tests:
1397         * http/tests/misc/BOM-override.pl
1398         * http/tests/misc/BOM-override-script.html
1399         * fast/encoding/charset-koi8-u.html
1400         * fast/encoding/charset-x-nextstep.html
1401
1402         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1403         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1404         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1405         makes little sense now.
1406
1407         * WebCore.exp:
1408         * bridge/mac/WebCoreTextDecoder.h: Removed.
1409         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1410         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1411
1412         * loader/Decoder.cpp:
1413         (Decoder::Decoder):
1414         (Decoder::setEncodingName):
1415         (Decoder::decode):
1416         Use StreamingTextDecoder::create().
1417
1418         * platform/StreamingTextDecoder.cpp:
1419         (WebCore::StreamingTextDecoder::create):
1420         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1421         * platform/StreamingTextDecoder.h:
1422         StreamingTextDecoder is just an abstract interface to implementations now.
1423
1424         * platform/StreamingTextDecoderICU.cpp: Added.
1425         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1426         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1427         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1428         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1429         (WebCore::StreamingTextDecoderICU::convertUTF16):
1430         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1431         (WebCore::StreamingTextDecoderICU::createICUConverter):
1432         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1433         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1434         (WebCore::StreamingTextDecoderICU::convert):
1435         (WebCore::StreamingTextDecoderICU::toUnicode):
1436         (WebCore::StreamingTextDecoderICU::fromUnicode):
1437         * platform/StreamingTextDecoderICU.h: Added.
1438         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1439         supported by the decoder; minor cleanup.
1440
1441         * platform/TextEncoding.cpp:
1442         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1443         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1444         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1445         
1446         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1447
1448         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1449         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1450         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1451         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1452         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1453         (WebCore::StreamingTextDecoderMac::convertUTF16):
1454         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1455         (WebCore::StreamingTextDecoderMac::createTECConverter):
1456         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1457         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1458         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1459         (WebCore::StreamingTextDecoderMac::convert):
1460         (WebCore::StreamingTextDecoderMac::toUnicode):
1461         (WebCore::StreamingTextDecoderMac::fromUnicode):
1462         * platform/mac/StreamingTextDecoderMac.h: Added.
1463         (WebCore::StreamingTextDecoderMac::convert):
1464         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
1465
1466         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
1467
1468         * WebCore.xcodeproj/project.pbxproj:
1469
1470 === Safari-521.17 ===
1471
1472 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1473
1474         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
1475
1476         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
1477         DOMEventTarget protocol that works with GCC 5412.
1478
1479         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
1480
1481         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
1482         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
1483
1484         * WebCore.xcodeproj/project.pbxproj:
1485         * bindings/objc/DOMCore.h:
1486         * bindings/objc/DOMEvents.h:
1487         * bridge/mac/FormDataMac.h:
1488         * bridge/mac/WebCoreAXObject.h:
1489         * bridge/mac/WebCoreCache.h:
1490         * bridge/mac/WebCoreEncodings.h:
1491         * bridge/mac/WebCoreFrameBridge.h:
1492         * bridge/mac/WebCoreFrameNamespaces.h:
1493         * bridge/mac/WebCoreJavaScript.h:
1494         * bridge/mac/WebCorePageBridge.h:
1495         * bridge/mac/WebCorePageState.h:
1496         * bridge/mac/WebCoreResourceLoader.h:
1497         * bridge/mac/WebCoreScriptDebugger.h:
1498         * bridge/mac/WebCoreSettings.h:
1499         * bridge/mac/WebCoreStringTruncator.h:
1500         * bridge/mac/WebCoreStringTruncator.mm:
1501         * bridge/mac/WebCoreTextDecoder.h:
1502         * bridge/mac/WebDashboardRegion.h:
1503         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1504         * platform/mac/CookieJar.mm:
1505         * platform/mac/DeprecatedStringMac.mm:
1506         * platform/mac/FontDataMac.mm:
1507         * platform/mac/FoundationExtras.h:
1508         * platform/mac/TextBoundaries.mm:
1509         * platform/mac/WebCoreHistory.h:
1510         * platform/mac/WebCoreHistory.m:
1511         * platform/mac/WebCoreKeyGenerator.h:
1512         * platform/mac/WebCoreTextArea.h:
1513         * platform/mac/WebCoreTextField.h:
1514         * platform/mac/WebCoreTextRenderer.h:
1515         * platform/mac/WebCoreView.h:
1516         * platform/mac/WebCoreWidgetHolder.h:
1517
1518 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1519
1520         Reviewed by Maciej.
1521
1522         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
1523         JavaScriptCore.
1524
1525         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
1526         manual delete.
1527
1528 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
1529
1530         Reviewed by Adele and Justin.
1531
1532         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
1533         <rdar://problem/4613948>
1534         REGRESSION: Check Spelling does not work in textarea elements
1535         
1536         * bridge/mac/FrameMac.mm:
1537         (WebCore::FrameMac::advanceToNextMisspelling):
1538         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
1539         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
1540         indices respectively.
1541         
1542         * dom/Range.cpp:
1543         (WebCore::Range::checkNodeBA):
1544         Allow range operations on shadow trees.
1545
1546         * manual-tests/form-element-spelling.html: Added.
1547
1548 2006-07-14  Beth Dakin  <bdakin@apple.com>
1549
1550         Reviewed by Hyatt.
1551
1552         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
1553         WebCore::FrameView::updateOverflowStatus
1554
1555         m_viewportRenderer is never initialized for framesets, and it 
1556         shouldn't be. So we just need to nil-check for it in 
1557         updateOverflowStatus() and return early.
1558
1559         * page/FrameView.cpp:
1560         (WebCore::FrameView::updateOverflowStatus): Nil check.
1561
1562 2006-07-14  Adele Peterson  <adele@apple.com>
1563
1564         RS by Darin.
1565
1566         Backing out fix for <rdar://problem/4604703> 
1567         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1568
1569         Darin had a better fix in WebKit for this.
1570
1571         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1572
1573 2006-07-14  Adele Peterson  <adele@apple.com>
1574
1575         Reviewed by Darin.
1576
1577         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
1578
1579         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
1580         * bridge/mac/FrameMac.h: ditto.
1581         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
1582         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
1583         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
1584         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
1585
1586 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1587
1588         Reviewed by Darin.
1589
1590         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
1591           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
1592
1593         * rendering/RenderText.cpp:
1594         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
1595         position.
1596
1597 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1598
1599         Reviewed by Darin.
1600
1601         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
1602           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
1603
1604         Test: editing/deleting/delete-at-start-or-end.html
1605
1606         * editing/TypingCommand.cpp:
1607         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
1608         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1609
1610 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
1611
1612         Reviewed by Geoffrey.
1613
1614         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
1615           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
1616
1617         No test cases since there is no change in functionality.
1618
1619         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1620         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
1621         no-argument getNumber() method.
1622
1623 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1624
1625         Reviewed by Adele.
1626
1627         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
1628         one surrounding this function, and the nested one makes the compiler
1629         think our local variable is volatile (seems like a compiler bug to me).
1630         
1631         * bridge/mac/FrameMac.mm:
1632         (WebCore::FrameMac::sendContextMenuEvent):
1633
1634 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1635
1636         Reviewed by Maciej.
1637
1638         Make JavaScriptCore a public framework. Adjusted the paths.
1639
1640         * WebCore.xcodeproj/project.pbxproj:
1641
1642 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
1643
1644         Reviewed by Hyatt.
1645
1646         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
1647         
1648         I also fixed all the similar crash / assertion failure cases I could think of.
1649
1650         * dom/Node.cpp:
1651         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
1652         * dom/Node.h:
1653         * rendering/RenderTable.cpp:
1654         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
1655         an HTML document, since we don't need that quirk and because parsing won't
1656         do certain render tree fixups. Also watch out for case when inserting before
1657         the renderer of a misnested child.
1658         * rendering/RenderTableRow.cpp:
1659         (WebCore::RenderTableRow::addChild): ditto
1660         * rendering/RenderTableSection.cpp:
1661         (WebCore::RenderTableSection::addChild): ditto
1662
1663 2006-07-13  Adele Peterson  <adele@apple.com>
1664
1665         Reviewed by Maciej.
1666
1667         - Fix for <rdar://problem/4604703> 
1668         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1669
1670         Test:
1671         * manual-tests/password-ctrl-click-lose-focus.html: Added.
1672
1673         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1674         If we're about to set a selection in the current view, make sure its the first responder.
1675         In this case, this will cause the password field to resign first responder at the right time.
1676
1677 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1678
1679         Reviewed by Hyatt.
1680
1681         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
1682           REGRESSION: RTL white-space:pre-wrap text is offset to the right
1683
1684         Test: fast/text/international/rtl-white-space-pre-wrap.html
1685
1686         * rendering/RenderText.cpp:
1687         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
1688         of clipping the caret position to the text box when the caret is after
1689         the trailing space of an autowrapped line.
1690         * rendering/bidi.cpp:
1691         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
1692         to-fit the logically last text box if it contains the trailing spaces of an
1693         autowrapped line. 
1694         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
1695         In the case of autowrapped text with white space that overflows beyond the line,
1696         the last text run is the one containing the overflowing white space.
1697         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
1698         line that autowraps only after white space into a separate text run.
1699
1700 2006-07-13  David Harrison  <harrison@apple.com>
1701
1702         Reviewed by Dave Hyatt.
1703
1704         <rdar://problem/4624203> -webkit-highlight should be behind images
1705
1706         * rendering/RenderImage.cpp:
1707         (WebCore::RenderImage::paint):
1708         * rendering/RenderListMarker.cpp:
1709         (WebCore::RenderListMarker::paint):
1710         * rendering/RenderWidget.cpp:
1711         (WebCore::RenderWidget::paint):
1712         Call custom highlighter before painting the image, marker, or widget.
1713
1714 2006-07-13  David Harrison  <harrison@apple.com>
1715
1716         Reviewed by Justin and Levi.
1717
1718         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
1719
1720         * Tests:
1721         editing/deleting/delete-by-word-001.html
1722         editing/deleting/delete-by-word-002.html
1723
1724         * editing/TypingCommand.cpp:
1725         (WebCore::TypingCommand::deleteKeyPressed):
1726         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1727         (WebCore::TypingCommand::doApply):
1728         * editing/TypingCommand.h:
1729         Delete and forward delete to use specified granularity.
1730         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
1731         
1732         * page/Frame.cpp:
1733         (WebCore::Frame::setSelection):
1734         Close typing and end style even if selection is not changing.
1735         * page/Frame.h:
1736         Remove unused setSelection parameter keepTypingStyle.
1737
1738 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
1739
1740         Reviewed by justin
1741
1742         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
1743
1744         * editing/DeleteSelectionCommand.cpp:
1745         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
1746         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
1747         instead of enclosingBlockFlowElement.
1748         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
1749         when the start or end block is removed.
1750         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
1751         to keep things like HRs from being given children.
1752         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
1753         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
1754         * editing/TypingCommand.cpp:
1755         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
1756         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1757         * editing/htmlediting.cpp:
1758         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
1759         * editing/visible_units.cpp:
1760         (WebCore::startOfParagraph): Fix for HRs and tables.
1761         (WebCore::endOfParagraph): Ditto.
1762
1763 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
1764
1765         Reviewed by Darin.
1766
1767         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
1768           Memory leaks running DOM-Hanoi
1769
1770         No change in behavior, thus no test included.
1771
1772         * bridge/mac/FrameMac.mm:
1773         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
1774         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
1775
1776 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1777
1778         Reviewed by Adele.
1779
1780         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
1781           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
1782         - see also <rdar://problem/4622407>
1783
1784         Test: fast/frames/repaint-display-none-crash.html
1785
1786         * rendering/RenderView.cpp:
1787         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
1788         renderer, which can be null if the iframe is set to display:none.
1789
1790 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
1791
1792         Reviewed by levi
1793         
1794         <rdar://problem/4509393>
1795         selected DOM range starts with <object>, 0 offset but selection should include the <object>
1796
1797         * editing/ReplaceSelectionCommand.cpp:
1798         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
1799         Don't pull content out of a table cell.
1800         * editing/htmlediting.cpp:
1801         (WebCore::editingIgnoresContent): Added <select> nodes.
1802         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
1803         for more types of nodes.
1804         * rendering/RenderContainer.cpp:
1805         (WebCore::RenderContainer::positionForCoordinates): 
1806         Fix a crasher when right clicking on an anonymous table.
1807
1808 2006-07-12  John Sullivan  <sullivan@apple.com>
1809
1810         Reviewed by Brady Eidson
1811         
1812         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
1813         misspelled words (WebCore::RenderObject::repaint(bool)
1814
1815         * dom/Document.cpp:
1816         (WebCore::Document::removeMarkers):
1817         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
1818         happening. One of the cases like this was fixed a while back, but other cases were
1819         either missed at that time or crept in since. 
1820
1821 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
1822
1823         Reviewed by Justin.
1824
1825         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
1826         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
1827         
1828         * dom/Document.cpp:
1829         (WebCore::Document::updateSelection):
1830         Don't return early if the selection is empty.
1831
1832 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
1833
1834         Reviewed by Adele.
1835
1836         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
1837         
1838         * bridge/mac/FrameMac.mm:
1839         (WebCore::FrameMac::dispatchCPPEvent):
1840         If the element is a shadow node, dispatch the event to its real parent.
1841
1842         * manual-tests/textarea-onpaste.html: Added.
1843
1844 2006-07-12  Beth Dakin  <bdakin@apple.com>
1845
1846         Reviewed by Anders.
1847
1848         Fix for layout test regressions after my check-in last night. Just 
1849         a silly mistake where I should have asked if we were NOT printing 
1850         instead of if we were in the listbox code.
1851
1852         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
1853         XCode 2.3
1854         * platform/mac/ListBoxMac.mm:
1855         (itemTextRenderer): Inverted check.
1856         (groupLabelTextRenderer): Inverted check.
1857
1858 2006-07-12  Darin Adler  <darin@apple.com>
1859
1860         Reviewed by Maciej.
1861
1862         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
1863           <rdar://problem/4622622>
1864           REGRESSION: Large rowspan causes WebKit to call abort()
1865
1866         Test: fast/table/large-rowspan-crash.html
1867
1868         * rendering/RenderTableSection.cpp:
1869         (WebCore::RenderTableSection::ensureRows):
1870         Use sizeof(RowStruct) instead of sizeof(int).
1871         Clearly we'll need something better to solve this completely.
1872         I expect another smaller, but still huge, value will still cause a problem.
1873
1874 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
1875
1876         Reviewed by Maciej.
1877
1878         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
1879
1880         * bridge/mac/FrameMac.h:
1881         Add focusCallResultedInViewBeingCreated argument. 
1882         
1883         * bridge/mac/FrameMac.mm:
1884         (WebCore::FrameMac::nextKeyViewInFrame):
1885         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
1886         
1887         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
1888         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
1889         a text field as the first responder if its field editor already is the current first responder.
1890         
1891         * page/FrameView.cpp:
1892         (WebCore::FrameView::handleMousePressEvent):
1893         In some cases, get the event target node again after dispatching the mouse event.
1894
1895 2006-07-12  Beth Dakin  <bdakin@apple.com>
1896
1897         Reviewed by Adele.
1898
1899         Fix for <rdar://problem/4615765> Input[type='search' fields 
1900         initially render too large in Widgets
1901
1902         Fundamentally, the problem here is that we were miscalculating 
1903         things because [NSGraphicsContext currentContextDrawingToScreen] 
1904         was evaluating to false when widgets first load. We only ever used 
1905         this check, however, to determine if we were printing or not, so it 
1906         should not have evaluated to false for loading in Dashbaord. 
1907         Instead, if we query the RenderView about whether or not we are 
1908         printing, we will get the right answer.
1909
1910         No test case added since this appears only to affect Dashboard.
1911
1912         * bridge/mac/WebCoreFrameBridge.mm:
1913         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
1914         printing instead. This is not part of the actual bug fix, but it 
1915         seems wise to get rid of all calls to [NSGraphicsContext 
1916         currentContextDrawingToScreen] when we are just trying to determine 
1917         if we are printing or not.
1918         * platform/mac/ListBoxMac.mm:
1919         (itemTextRenderer):This function now takes a boolean, isPrinting.
1920         (groupLabelTextRenderer): Same as above.
1921         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
1922         printing.
1923         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
1924         * platform/mac/PopUpButtonMac.mm:
1925         (PopUpButton::sizeHint): Same as above.
1926         * platform/mac/TextFieldMac.mm:
1927         (-[NSSearchFieldCell _addStringToRecentSearches:]):
1928         * rendering/RenderLineEdit.cpp: Same as above.
1929
1930 2006-07-12  Adele Peterson  <adele@apple.com>
1931
1932         Reviewed by Maciej.
1933
1934         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
1935         OPTION text can paint over select element's scrollbar
1936
1937         Test: fast/forms/option-text-clip.html
1938
1939         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
1940         When calculating the clip to apply to the button text, also consider padding.
1941         In the future, we may have separate renderers for the text part, and the arrow part
1942         of the control, and then the separation should be natural.  For now, we use padding.
1943
1944 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
1945
1946         Windows build fix.  Reviewed by NOBODY.
1947
1948         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
1949         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
1950
1951 2006-07-11  Darin Adler  <darin@apple.com>
1952
1953         Reviewed by Adele.
1954
1955         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
1956           <rdar://problem/4619515>
1957           focus ring fails to appear on select element after choosing item from popup
1958
1959         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
1960           improvements to select element, including some storage leak fixes
1961
1962         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
1963         reference for the list items, so we don't have to copy a vector.
1964         * html/HTMLSelectElement.cpp:
1965         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
1966         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
1967         (WebCore::HTMLSelectElement::length): Ditto.
1968         (WebCore::HTMLSelectElement::remove): Ditto.
1969         (WebCore::HTMLSelectElement::value): Ditto.
1970         (WebCore::HTMLSelectElement::setValue): Ditto.
1971         (WebCore::HTMLSelectElement::stateValue): Ditto.
1972         (WebCore::HTMLSelectElement::restoreState): Ditto.
1973         (WebCore::HTMLSelectElement::appendFormData): Ditto.
1974         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
1975         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
1976         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
1977         fields mutable.
1978         (WebCore::HTMLSelectElement::reset): Use a const reference for
1979         the list items, so we don't have to copy the vector. Remove the call to
1980         setSelectionChanged for the RenderMenuList case.
1981         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
1982         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
1983         the pop-up.
1984         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
1985         Changed the listItems function to return a const reference to the vector so
1986         it no longer copies the vector. Removed the const_cast to the call to
1987         recalcListItems and changed it to a const member function. Made m_recalcListItems
1988         mutable.
1989         * rendering/DeprecatedRenderSelect.cpp:
1990         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
1991         to recalcListItems, which is called automatically. Use a const reference for the
1992         list items so we don't have to copy a vector.
1993         (WebCore::DeprecatedRenderSelect::layout): Ditto.
1994         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
1995         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
1996         * rendering/RenderMenuList.cpp:
1997         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
1998         (WebCore::RenderMenuList::createInnerBlock): Ditto.
1999         (WebCore::RenderMenuList::addChild): Ditto.
2000         (WebCore::RenderMenuList::removeChild): Ditto.
2001         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2002         on the pop-up menu, because it's created with the correct style and destroyed
2003         before it a style change could occur.
2004         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2005         maximum width in a simpler fashion, and to not bother trying to maintain
2006         the "selected" flags on the elements, since the HTMLSelectElement class
2007         takes care of that. Store the width as an int. Call setText to set the text
2008         based on the selected element's option text.
2009         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2010         up the clip -- always set up the clip.
2011         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2012         instead of calling ceilf on m_longestWidth.
2013         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2014         menu -- instead keep the pointer in a local variable. Get the selected
2015         index from the HTMLSelectElement.
2016         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2017         to do most of the work.
2018         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2019         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2020         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2021         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2022         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2023         hasPopupMenu functions. Removed extra includes.
2024         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2025         Change to iterate the list items instead of iterating all children
2026         of the select node.
2027         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2028         * rendering/RenderPopupMenuMac.mm:
2029         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2030         the pop-up here from the caller. Removed an extra retain that would cause
2031         the NSPopUpButtonCell to leak.
2032         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2033         create the pop-up, which is now in populate, and also the call to the
2034         clear function, for the same reason. Reorganized code to make it a bit
2035         more readable. Removed an unnecessary if to check if frame is nil.
2036         Used a RefPtr to make sure we don't make a call on a frame after it's
2037         deleted. As part of the reorganization fixed a problem where we'd retain
2038         the event and then return early without releasing it in one case.
2039         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2040         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2041         manage the NSMenu at the bottom of the function.
2042         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2043
2044 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2045
2046         Reviewed by levi
2047         
2048         <rdar://problem/4620686>
2049         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2050
2051         * bridge/mac/FrameMac.mm:
2052         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2053         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2054         
2055
2056 2006-07-11  Tim Omernick  <timo@apple.com>
2057
2058         Reviewed by NOBODY (build fix)
2059
2060         * bindings/objc/DOMPrivate.h:
2061         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2062         there is of a different type.
2063         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2064         before landing.
2065
2066 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2067
2068         Reviewed by Geoff.
2069
2070         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2071         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2072         
2073         * html/HTMLTokenizer.cpp:
2074         (WebCore::HTMLTokenizer::scriptHandler):
2075         Don't load external scripts if the parser is stopped.
2076         
2077         * manual-tests/open-close-tokenizer-crash.html: Added.
2078         * manual-tests/resources/empty-file.js: Added.
2079         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2080         Add manual test.
2081
2082 2006-07-11  John Sullivan  <sullivan@apple.com>
2083
2084         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2085
2086         - added support for creating a selection image with white text
2087
2088         * rendering/RenderObject.h:
2089         (WebCore::):
2090         add PaintRestriction enum
2091         (WebCore::RenderObject::PaintInfo::PaintInfo):
2092         add forceWhiteText boolean to PaintInfo struct
2093
2094         * page/FramePrivate.h:
2095         (WebCore::FramePrivate::FramePrivate):
2096         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2097         text to white
2098
2099         * page/Frame.cpp:
2100         (WebCore::Frame::paint):
2101         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2102
2103         * bridge/mac/FrameMac.h:
2104         * bridge/mac/FrameMac.mm:
2105         (WebCore::FrameMac::selectionImage):
2106         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2107
2108         * bridge/mac/WebCoreFrameBridge.h:
2109         * bridge/mac/WebCoreFrameBridge.mm:
2110         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2111         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2112         down into Frame
2113
2114         * rendering/RenderLayer.h:
2115         * rendering/RenderLayer.cpp:
2116         (WebCore::RenderLayer::paint):
2117         use a PaintRestriction value where we used to use a selectionOnly bool
2118         (WebCore::RenderLayer::paintLayer):
2119         ditto; also stores forceWhiteText in PaintInfo struct
2120
2121         * kcanvas/KCanvasResources.cpp:
2122         (WebCore::KCanvasMarker::draw):
2123         updated for changed signature of PaintInfo constructor
2124
2125         * ksvg2/svg/SVGMaskElement.cpp:
2126         (WebCore::SVGMaskElement::drawMaskerContent):
2127         ditto
2128
2129         * ksvg2/svg/SVGPatternElement.cpp:
2130         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2131         ditto
2132
2133         * rendering/InlineTextBox.cpp:
2134         (WebCore::InlineTextBox::paint):
2135         paint with white text color if forceWhiteText is set in PaintInfo struct
2136
2137 2006-07-11  Tim Omernick  <timo@apple.com>
2138
2139         Reviewed by Anders.
2140
2141         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2142         Give Netscape plug-ins access to their own DOM element
2143
2144         * html/HTMLPlugInElement.h:
2145         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2146         Changed __APPLE__ to PLATFORM(MAC).
2147         Added m_NPObject ivar.
2148         * html/HTMLPlugInElement.cpp:
2149         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2150         Initialize the NPObject.
2151         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2152         Release the NPObject when the element is destroyed.
2153         (WebCore::HTMLPlugInElement::createNPObject):
2154         Creates an NPObject for the element.
2155         (WebCore::HTMLPlugInElement::getNPObject):
2156         Returns the NPObject for the element, creating and caching it if necessary.
2157
2158         * html/HTMLAppletElement.h:
2159         Changed __APPLE__ to PLATFORM(MAC).
2160         * html/HTMLAppletElement.cpp:
2161         ditto
2162         * html/HTMLEmbedElement.h:
2163         ditto
2164         * html/HTMLEmbedElement.cpp:
2165         ditto
2166         * html/HTMLObjectElement.h:
2167         ditto
2168         * html/HTMLObjectElement.cpp:
2169         ditto
2170
2171         * bindings/objc/DOMPrivate.h:
2172         Added -[DOMElement _NPObject].
2173
2174         * bindings/objc/DOM.mm:
2175         (-[DOMElement _NPObject]):
2176         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2177         the NPObject for applet, embed, and object elements.
2178         
2179 2006-07-11  Adele Peterson  <adele@apple.com>
2180
2181         Reviewed by Hyatt.
2182
2183         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2184         REGRESSION: Can't dynamically change list box to popup
2185         
2186         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2187         REGRESSION: Can't dynamically change popup to list box
2188
2189         The original fix for 9859 was in the renderer, and I think we can catch the change
2190         earlier in the element to detach and reattach.
2191
2192         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2193
2194         Test: fast/forms/select-change-listbox-to-popup.html
2195
2196         * html/HTMLSelectElement.cpp:
2197         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2198         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2199         when we attach.
2200         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2201         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2202         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2203         (WebCore::HTMLSelectElement::createRenderer): ditto.
2204         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2205         (WebCore::HTMLSelectElement::reset): ditto.
2206         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2207         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2208
2209         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2210         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2211         to determine whether or not to use the new menu list implementation.
2212
2213         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2214         * rendering/DeprecatedRenderSelect.cpp:
2215         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2216         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2217         (WebCore::DeprecatedRenderSelect::updateFromElement):
2218         (WebCore::DeprecatedRenderSelect::baselinePosition):
2219         (WebCore::DeprecatedRenderSelect::layout):
2220         (WebCore::DeprecatedRenderSelect::updateSelection):
2221
2222         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2223         Backed out previous fix since this is now done in HTMLSelectElement.
2224
2225 2006-07-11  Adele Peterson  <adele@apple.com>
2226
2227         Reviewed by Hyatt.
2228
2229         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2230         REGRESSION: Can't dynamically change popup to list box
2231
2232         Test: fast/forms/select-change-popup-to-listbox.html
2233
2234         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2235         If the select element has the multiple property set, or has a size > 1, then it
2236         really should be a list box, so we detach and attach the element so it creates the
2237         correct type of renderer.
2238
2239 2006-07-11  John Sullivan  <sullivan@apple.com>
2240
2241         Reviewed by Beth Dakin and Tim Omernick
2242
2243         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2244         at non-integral scale factors
2245
2246         * bridge/mac/FrameMac.mm:
2247         (WebCore::FrameMac::imageFromRect):
2248         round image rect in window coordinate space
2249
2250 2006-07-10  Darin Adler  <darin@apple.com>
2251
2252         Reviewed by Geoff.
2253
2254         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2255           rdar://problem/4619572
2256           OPTION text contained in OPTGROUP appears at the wrong size
2257
2258         * dom/Node.h:
2259         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2260         The derived classes were overriding with const member functions, and I could
2261         change either this or the derived -- decided to do this.
2262
2263 2006-07-10  Darin Adler  <darin@apple.com>
2264
2265         Reviewed by Geoff.
2266
2267         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2268           rdar://problem/4619534
2269           OPTGROUP label text is using the default font instead of Lucida Grande
2270
2271         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2272         Code wants the family name, but was calling fontName, which is not the same thing.
2273         Also removed the unneeded conversion to DeprecatedString.
2274
2275 === Safari-521.16 ===
2276
2277 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2278
2279         Reviewed by Darin.
2280
2281         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2282           Implement select.options.add() method
2283
2284         Tests:
2285         - fast/dom/select-selectedIndex-multiple.html
2286         - fast/dom/select-selectedIndex.html
2287         - fast/js/select-options-add.html
2288
2289         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2290         * ForwardingHeaders/kjs/operations.h: Added.
2291         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2292         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2293         (WebCore::JSHTMLOptionsCollection::length):
2294         (WebCore::JSHTMLOptionsCollection::setLength):
2295         (WebCore::JSHTMLOptionsCollection::indexSetter):
2296         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2297         Renamed classes and methods for consistency.
2298         (KJS::JSHTMLElement::selectGetter):
2299         (KJS::JSHTMLElement::put):
2300         (KJS::JSHTMLElement::selectSetter):
2301         (KJS::JSHTMLCollection::JSHTMLCollection):
2302         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2303         (KJS::getHTMLOptionsCollection):
2304         * bindings/js/kjs_html.h: Ditto.
2305         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2306         Added support for Optional parameter attribute, which makes generated code assume overloaded
2307         implementation methods are available for a JavaScript function with optional arguments.  Changed
2308         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2309         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2310         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2311         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2312         (WebCore::HTMLOptionsCollection::add):
2313         (WebCore::HTMLOptionsCollection::selectedIndex):
2314         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2315         (WebCore::HTMLOptionsCollection::setLength):
2316         * html/HTMLOptionsCollection.h: Ditto.
2317         * html/HTMLOptionsCollection.idl: Added.
2318
2319 2006-07-10  David Harrison  <harrison@apple.com>
2320
2321         Reviewed by Dave Hyatt.
2322
2323         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2324
2325         * rendering/RenderBox.cpp:
2326         (WebCore::RenderBox::paintCustomHighlight):
2327         * rendering/RenderBox.h:
2328         Utility for subclasses.
2329         
2330         * rendering/RenderImage.cpp:
2331         (WebCore::RenderImage::paint):
2332         Custom highlight in front of images.
2333         
2334         * rendering/RenderListMarker.cpp:
2335         (WebCore::RenderListMarker::paint):
2336         Custom highlight in front of list markers.
2337
2338         * rendering/RenderWidget.cpp:
2339         (WebCore::RenderWidget::paint):
2340         Custom highlight in front of objects.
2341
2342 2006-07-10  David Hyatt  <hyatt@apple.com>
2343
2344         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2345         correctly after choosing Redo Typing
2346
2347         Better fix for repainting issue with positioned objects when height
2348         changes.  Optimize when only a positioned child changes so that we don't
2349         incorrectly do normal flow layout.
2350
2351         Reviewed by darin
2352
2353         * WebCore.xcodeproj/project.pbxproj:
2354         * rendering/RenderBlock.cpp:
2355         (WebCore::RenderBlock::layoutBlock):
2356         * rendering/RenderFlexibleBox.cpp:
2357         (WebCore::RenderFlexibleBox::layoutBlock):
2358         * rendering/RenderTable.cpp:
2359         (WebCore::RenderTable::layout):
2360         * rendering/RenderView.cpp:
2361         (WebCore::RenderView::layout):
2362         * rendering/bidi.cpp:
2363         (WebCore::RenderBlock::layoutInlineChildren):
2364
2365 2006-07-10  Adele Peterson  <adele@apple.com>
2366
2367         Reviewed by Beth.
2368
2369         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2370
2371         Test: fast/forms/select-style.html
2372
2373         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2374         Don't let popups be style-able for now.  We'll allow it later, when we
2375         have a good way to handle border & backgrounds and still having it look like a control.
2376
2377 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2378
2379         Reviewed by harrison
2380         
2381         <rdar://problem/4619260>
2382         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2383         <rdar://problem/4619841>
2384         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2385
2386         * WebCore.xcodeproj/project.pbxproj:
2387         * editing/Selection.cpp:
2388         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2389         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2390         Migrate to isEditablePosition instead of isContentEditable.
2391         
2392
2393 2006-07-10  Beth Dakin  <bdakin@apple.com>
2394
2395         Reviewed by Adele.
2396
2397         Shuffling comments around from my last check-in to make things read 
2398         more clearly.
2399
2400         * page/DOMWindow.h:
2401         * page/DOMWindow.idl:
2402
2403 2006-07-10  Beth Dakin  <bdakin@apple.com>
2404
2405         Reviewed by Darin.
2406
2407         Fix for <rdar://problem/4621095> The should be a way to 
2408         access the user interface scale factor through the DOM
2409
2410         window.devicePixelRatio returns the user interface scale factor.
2411
2412         * page/DOMWindow.cpp:
2413         (WebCore::DOMWindow::devicePixelRatio):
2414         * page/DOMWindow.h:
2415         * page/DOMWindow.idl:
2416
2417 2006-07-10  Brady Eidson  <beidson@apple.com>
2418
2419         Reviewed by Alexey
2420
2421         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2422
2423         * icon/IconDatabase.cpp:
2424         (WebCore::IconDatabase::pruneUnreferencedIcons):
2425         (WebCore::IconDatabase::pruneUnretainedIcons):
2426         Added quick check to bail if the DB isn't open
2427
2428 2006-07-10  David Harrison  <harrison@apple.com>
2429
2430         Reviewed by Tim Hatcher
2431
2432         Partial fix for...
2433         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2434         
2435         * editing/Selection.cpp:
2436         (WebCore::Selection::adjustForEditableContent):
2437         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2438
2439 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2440
2441         Reviewed by Darin.
2442
2443         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2444           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2445
2446         * manual-tests/ATSU-bad-layout.html: Added.
2447         * platform/mac/FontMac.mm:
2448         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2449
2450 2006-07-10  Darin Adler  <darin@apple.com>
2451
2452         - try to fix the no-SVG build
2453
2454         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2455
2456 2006-07-10  Darin Adler  <darin@apple.com>
2457
2458         Reviewed by Anders.
2459
2460         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2461           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2462
2463         * manual-tests/empty-title-popup.html: Added.
2464
2465         * rendering/RenderMenuList.h: Add createInnerBlock.
2466         * rendering/RenderMenuList.cpp:
2467         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
2468         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
2469         (WebCore::RenderMenuList::setText): Changed parameter type.
2470         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
2471         the parent class's addChild.
2472
2473 2006-07-10  Rob Buis  <buis@kde.org>
2474
2475         Reviewed by Maciej via IRC.
2476
2477         Make sure the attributes are calculated against viewport width value,
2478         as defined in the spec.  http://paste.lisp.org/display/22342
2479
2480         * ksvg2/svg/SVGEllipseElement.cpp:
2481         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
2482         * ksvg2/svg/SVGLineElement.cpp:
2483         (SVGLineElement::x2): Ditto.
2484
2485 2006-07-10  Beth Dakin  <bdakin@apple.com>
2486
2487         Reviewed by Maciej.
2488
2489         Fix for <rdar://problem/4610314> Support the CSS3 content property 
2490         for images
2491
2492         This patch provides initial support for the CSS3 content property. 
2493         It lacks support for any content other than images, and only allows 
2494         content for elements that seemed safe for now.
2495
2496         * css/cssstyleselector.cpp:
2497         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
2498         just :before and :after
2499         * html/HTMLBRElement.cpp:
2500         (WebCore::HTMLBRElement::createRenderer):
2501         * html/HTMLFrameSetElement.cpp:
2502         (WebCore::HTMLFrameSetElement::createRenderer):
2503         * html/HTMLImageElement.cpp:
2504         (WebCore::HTMLImageElement::createRenderer):
2505         * html/HTMLLegendElement.cpp:
2506         (WebCore::HTMLLegendElement::createRenderer):
2507         * rendering/RenderImage.cpp:
2508         (WebCore::RenderImage::RenderImage):
2509         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
2510         set this way if it was already set with the content property.
2511         * rendering/RenderImage.h:
2512         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
2513         those set through the content property.
2514         (WebCore::RenderImage::isAnonymousImage):
2515         * rendering/RenderObject.cpp:
2516         (WebCore::RenderObject::createObject): If there is content 
2517         specified, create a RenderImage with the content and initialize the 
2518         cached image to whatever was specified in the CSS.
2519
2520 2006-07-10  Brady Eidson  <beidson@apple.com>
2521
2522         Reviewed by NOBODY (Build Fix!)
2523
2524         * icon/SiteIcon.cpp:
2525         (SiteIcon::getImage):
2526         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
2527
2528 2006-07-10  Brady Eidson  <beidson@apple.com>
2529
2530         Reviewed by Maciej
2531
2532         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
2533         information out to keep down disk usage.  For now, it is still off by default, as the critical
2534         feature of importing old icons into the new DB is still unrealized.
2535         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
2536
2537         * icon/IconDatabase.cpp:
2538         (WebCore::IconDatabase::IconDatabase):
2539         (WebCore::IconDatabase::open):
2540           -Sets up a timer for initial pruning
2541         (WebCore::IconDatabase::iconForPageURL):
2542           -Switched away from "dirty blob hack" as the problem is provisionally solved
2543         (WebCore::IconDatabase::retainIconForURL):
2544         (WebCore::IconDatabase::releaseIconForURL):
2545           -Same as found in WebKit
2546         (WebCore::IconDatabase::totalRetainCountForIconURL):
2547           -Adds up all retainers of icon
2548         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
2549           -Wipes an Icon table entry out
2550         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
2551         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
2552         (WebCore::IconDatabase::establishIconIDForIconURL):
2553         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
2554           -Added ability to get an iconID without creating a new one if a lookup is all
2555            that is genuinely wanted
2556         (WebCore::IconDatabase::pruneUnreferencedIcons):
2557         (WebCore::IconDatabase::pruneUnretainedIcons):
2558           -Called on a timer on DB startup to clean it out
2559         * icon/IconDatabase.h:
2560         * icon/SiteIcon.cpp:
2561         (SiteIcon::SiteIcon):
2562         (SiteIcon::~SiteIcon):
2563           -Deletes the image on deletion
2564         (SiteIcon::getImage):
2565           -Cut down on no-longer-necessary debug info
2566
2567 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
2568
2569         Reviewed by Adele.
2570
2571         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
2572         Quirksmode: Incorrect handling of disabled BUTTON elements
2573
2574         * html/HTMLButtonElement.cpp:
2575         (WebCore::HTMLButtonElement::defaultEventHandler):
2576         Don't call prepareSubmit if the element is disabled.
2577
2578         * html/HTMLInputElement.cpp:
2579         (WebCore::HTMLInputElement::defaultEventHandler):
2580         Don't call prepareSubmit if the element is disabled.
2581
2582 2006-07-10  Darin Adler  <darin@apple.com>
2583
2584         - try to fix Windows build
2585
2586         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
2587         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
2588
2589 2006-07-10  Darin Adler  <darin@apple.com>
2590
2591         Reviewed by Geoff.
2592
2593         - fix failures seen in layout tests
2594
2595         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
2596         that really needed to be there -- because we have two classes named JSHTMLDocument
2597         at the moment! (One in KJS and one in WebCore namespace.)
2598
2599 2006-07-10  Darin Adler  <darin@apple.com>
2600
2601         - try to fix Windows build
2602
2603         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
2604
2605 2006-07-09  Adele Peterson  <adele@apple.com>
2606
2607         Reviewed by Maciej.
2608
2609         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
2610
2611         * css/html4.css: Added style for new selects, and for list boxes.
2612         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
2613    
2614         * rendering/RenderMenuList.cpp:
2615         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
2616         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
2617         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
2618
2619         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
2620         so RenderThemeMac will compute its baseline.
2621         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
2622         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
2623         Removed sizeOfArrowControl. 
2624         * rendering/RenderThemeMac.mm:
2625         (WebCore::): Added enum for padding.
2626         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
2627         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
2628         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
2629         (WebCore::RenderThemeMac::popupButtonSizes): Added.
2630         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
2631         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
2632         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
2633         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
2634         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
2635         (WebCore::RenderThemeMac::minimumTextSize): Added.
2636
2637 2006-07-09  Darin Adler  <darin@apple.com>
2638
2639         - add back "unused code" for plain text fields, still used by <isindex>!
2640
2641         * platform/TextField.h:
2642         * platform/mac/TextFieldMac.mm:
2643         * platform/mac/WebCoreTextField.h:
2644         * platform/mac/WebCoreTextField.mm:
2645         * rendering/RenderLineEdit.cpp:
2646
2647 2006-07-09  Darin Adler  <darin@apple.com>
2648
2649         Reviewed by Tim Hatcher.
2650
2651         - put more into the WebCore namespace
2652         - removed unused code for plain text fields
2653
2654         Put more classes, class templates, enums, functions, and constants into
2655         the WebCore namespace, including all the headers in the platform directory.
2656
2657         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
2658
2659         Added some "WebCore::" qualifiers in a few places.
2660
2661         Removed "uses WebCore::" in headers that we said we'd remove "when
2662         everything is in the WebCore namespace".
2663
2664         * bindings/js/JSDOMParser.cpp:
2665         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2666         * bindings/js/JSXSLTProcessor.cpp:
2667         * bindings/js/kjs_binding.cpp:
2668         * bindings/js/kjs_css.cpp:
2669         * bindings/js/kjs_dom.cpp:
2670         * bindings/js/kjs_dom.h:
2671         * bindings/js/kjs_events.cpp:
2672         * bindings/js/kjs_proxy.h:
2673         * bindings/js/kjs_window.h:
2674         * bindings/objc/DOM.mm:
2675         * bridge/History.h:
2676         * bridge/JavaAppletWidget.h:
2677         * bridge/mac/FormDataMac.h:
2678         * bridge/mac/FormDataMac.mm:
2679         * bridge/mac/WebCoreAXObject.mm:
2680         * bridge/mac/WebCoreEncodings.mm:
2681         * bridge/mac/WebCoreFrameBridge.h:
2682         * bridge/mac/WebCoreIconDatabaseBridge.mm:
2683         * bridge/mac/WebCorePageState.h:
2684         * bridge/mac/WebCoreScriptDebugger.mm:
2685         * bridge/mac/WebCoreSettings.h:
2686         * css/CSSGrammar.y:
2687         * css/CSSPageRule.cpp:
2688         * css/CSSPageRule.h:
2689         * css/MediaList.cpp:
2690         * css/cssstyleselector.h:
2691         * dom/Clipboard.h:
2692         * dom/Document.cpp:
2693         * dom/Document.h:
2694         * dom/EventTargetNode.h:
2695         * dom/Node.cpp:
2696         * dom/Node.h:
2697         * dom/Position.h:
2698         * dom/Range.cpp:
2699         * dom/XMLTokenizer.cpp:
2700         * editing/AppendNodeCommand.h:
2701         * editing/ApplyStyleCommand.cpp:
2702         * editing/BreakBlockquoteCommand.cpp:
2703         * editing/BreakBlockquoteCommand.h:
2704         * editing/CompositeEditCommand.cpp:
2705         * editing/CompositeEditCommand.h:
2706         * editing/CreateLinkCommand.h:
2707         * editing/DeleteFromTextNodeCommand.h:
2708         * editing/DeleteSelectionCommand.h:
2709         * editing/FormatBlockCommand.h:
2710         * editing/HTMLInterchange.cpp:
2711         * editing/HTMLInterchange.h:
2712         * editing/IndentOutdentCommand.h:
2713         * editing/InsertIntoTextNodeCommand.h:
2714         * editing/InsertLineBreakCommand.h:
2715         * editing/InsertListCommand.h:
2716         * editing/InsertNodeBeforeCommand.h:
2717         * editing/InsertTextCommand.cpp:
2718         * editing/InsertTextCommand.h:
2719         * editing/JSEditor.cpp:
2720         * editing/JSEditor.h:
2721         * editing/JoinTextNodesCommand.h:
2722         * editing/MergeIdenticalElementsCommand.cpp:
2723         * editing/MergeIdenticalElementsCommand.h:
2724         * editing/ModifySelectionListLevel.h:
2725         * editing/MoveSelectionCommand.h:
2726         * editing/RebalanceWhitespaceCommand.h:
2727         * editing/RemoveNodeAttributeCommand.h:
2728         * editing/RemoveNodeCommand.h:
2729         * editing/RemoveNodePreservingChildrenCommand.h:
2730         * editing/ReplaceSelectionCommand.h:
2731         * editing/SetNodeAttributeCommand.h:
2732         * editing/SplitElementCommand.cpp:
2733         * editing/SplitElementCommand.h:
2734         * editing/SplitTextNodeCommand.cpp:
2735         * editing/SplitTextNodeCommand.h:
2736         * editing/SplitTextNodeContainingElementCommand.h:
2737         * editing/TypingCommand.cpp:
2738         * editing/TypingCommand.h:
2739         * editing/UnlinkCommand.h:
2740         * editing/VisiblePosition.cpp:
2741         * editing/WrapContentsInDummySpanCommand.cpp:
2742         * editing/WrapContentsInDummySpanCommand.h:
2743         * editing/markup.cpp:
2744         * editing/markup.h:
2745         * html/HTMLAnchorElement.cpp:
2746         * html/HTMLBodyElement.cpp:
2747         * html/HTMLButtonElement.h:
2748         * html/HTMLCollection.h:
2749         * html/HTMLDocument.h:
2750         * html/HTMLEmbedElement.cpp:
2751         * html/HTMLFormElement.cpp:
2752         * html/HTMLFormElement.h:
2753         * html/HTMLFrameElement.cpp:
2754         * html/HTMLFrameSetElement.cpp:
2755         * html/HTMLKeygenElement.cpp:
2756         * html/HTMLLabelElement.cpp:
2757         * html/HTMLObjectElement.cpp:
2758         * html/HTMLObjectElement.h:
2759         * html/HTMLTableElement.cpp:
2760         * html/HTMLTablePartElement.cpp:
2761         * icon/IconDatabase.h:
2762         * kcanvas/KCanvasPath.h:
2763         * kcanvas/KCanvasResources.cpp:
2764         * kcanvas/KCanvasResources.h:
2765         * kcanvas/KCanvasTreeDebug.cpp:
2766         * kcanvas/KCanvasTreeDebug.h:
2767         * kcanvas/RenderSVGContainer.cpp:
2768         * kcanvas/RenderSVGText.h:
2769         * kcanvas/device/KRenderingPaintServer.h:
2770         * kcanvas/device/KRenderingPaintServerGradient.h:
2771         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2772         * ksvg2/misc/SVGImageLoader.cpp:
2773         * ksvg2/svg/SVGElement.cpp:
2774         * ksvg2/svg/SVGElement.h:
2775         * ksvg2/svg/SVGForeignObjectElement.cpp:
2776         * ksvg2/svg/SVGForeignObjectElement.h:
2777         * ksvg2/svg/SVGImageElement.cpp:
2778         * ksvg2/svg/SVGPoint.h:
2779         * ksvg2/svg/SVGStylable.h:
2780         * ksvg2/svg/SVGTRefElement.cpp:
2781         * ksvg2/svg/SVGTRefElement.h:
2782         * ksvg2/svg/SVGTSpanElement.cpp:
2783         * ksvg2/svg/SVGTSpanElement.h:
2784         * ksvg2/svg/SVGTextElement.h:
2785         * ksvg2/svg/svgpathparser.cpp:
2786         * ksvg2/svg/svgpathparser.h:
2787         * loader/Cache.h:
2788         * loader/DocLoader.h:
2789         * loader/LoaderFunctions.h:
2790         * loader/mac/LoaderFunctionsMac.mm:
2791         * page/Frame.h:
2792         * page/FrameView.h:
2793         * page/Page.h:
2794         * page/Settings.h:
2795         * platform/AffineTransform.cpp:
2796         * platform/AffineTransform.h:
2797         * platform/Arena.cpp:
2798         * platform/Arena.h:
2799         * platform/CookieJar.h:
2800         * platform/DeprecatedCString.cpp:
2801         * platform/DeprecatedCString.h:
2802         * platform/DeprecatedPtrList.h:
2803         * platform/DeprecatedPtrListImpl.cpp:
2804         * platform/DeprecatedPtrListImpl.h:
2805         * platform/DeprecatedPtrQueue.h:
2806         * platform/DeprecatedString.cpp:
2807         * platform/DeprecatedString.h:
2808         * platform/DeprecatedStringList.cpp:
2809         * platform/DeprecatedStringList.h:
2810         * platform/DeprecatedValueList.h:
2811         * platform/DeprecatedValueListImpl.cpp:
2812         * platform/DeprecatedValueListImpl.h:
2813         * platform/FileButton.h:
2814         * platform/FloatPoint.h:
2815         * platform/FloatRect.h:
2816         * platform/FloatSize.h:
2817         * platform/FontData.h:
2818         * platform/FontFallbackList.h:
2819         * platform/GraphicsContext.h:
2820         * platform/IntPoint.h:
2821         * platform/IntRect.h:
2822         * platform/IntSize.h:
2823         * platform/KURL.cpp:
2824         * platform/KURL.h:
2825         * platform/ListBox.h:
2826         * platform/Logging.cpp:
2827         * platform/Logging.h:
2828         * platform/Pen.h:
2829         * platform/PopUpButton.h:
2830         * platform/RegularExpression.cpp:
2831         * platform/RegularExpression.h:
2832         * platform/SSLKeyGenerator.h:
2833         * platform/ScrollBar.h:
2834         * platform/SegmentedString.h:
2835         * platform/Shared.h:
2836         * platform/Slider.h:
2837         * platform/StringImpl.h:
2838         * platform/TextBox.h:
2839         * platform/TextField.h:
2840         * platform/TextStream.cpp:
2841         * platform/TextStream.h:
2842         * platform/TransferJob.h:
2843         * platform/TransferJobClient.h:
2844         * platform/Widget.h:
2845         * platform/cg/AffineTransformCG.cpp:
2846         * platform/mac/ClipboardMac.h:
2847         * platform/mac/ClipboardMac.mm:
2848         * platform/mac/DeprecatedStringListMac.mm:
2849         * platform/mac/FontCacheMac.mm:
2850         * platform/mac/KURLMac.mm:
2851         * platform/mac/ListBoxMac.mm:
2852         * platform/mac/PopUpButtonMac.mm:
2853         * platform/mac/SSLKeyGeneratorMac.mm:
2854         * platform/mac/TextBoxMac.mm:
2855         * platform/mac/TextFieldMac.mm:
2856         * platform/mac/WebCoreTextArea.h:
2857         * platform/mac/WebCoreTextArea.mm:
2858         * platform/mac/WebCoreTextField.h:
2859         * platform/mac/WebCoreTextField.mm:
2860         * rendering/DeprecatedRenderSelect.h:
2861         * rendering/RenderArena.cpp:
2862         * rendering/RenderArena.h:
2863         * rendering/RenderBlock.cpp:
2864         * rendering/RenderBox.cpp:
2865         * rendering/RenderContainer.cpp:
2866         * rendering/RenderFlexibleBox.cpp:
2867         * rendering/RenderFlow.cpp:
2868         * rendering/RenderLayer.cpp:
2869         * rendering/RenderLineEdit.cpp:
2870         * rendering/RenderObject.h:
2871         * rendering/RenderStyle.cpp:
2872         * rendering/RenderStyle.h:
2873         * rendering/RenderText.cpp:
2874         * rendering/RenderTextFragment.cpp:
2875         * rendering/RenderTheme.h:
2876         * rendering/RenderTreeAsText.cpp:
2877         * rendering/RenderTreeAsText.h:
2878         * rendering/RenderView.h:
2879         * rendering/bidi.h:
2880         * xml/XSLStyleSheet.cpp:
2881         * xml/XSLTProcessor.cpp:
2882
2883 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
2884
2885         Reviewed by Beth.
2886
2887         * bindings/js/kjs_window.cpp:
2888         (KJS::Window::clear): Garbage collect after reinitalizing the global
2889         object, not before, since the reinitialization tends to create garbage.
2890
2891 2006-07-09  Timothy Hatcher  <timothy@apple.com>
2892
2893         Reviewed by Darin.
2894
2895         Bug 9820: Move new DOM API that has been through API review to public headers
2896         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
2897
2898         * bindings/objc/DOM.mm:
2899         (-[DOMElement focus]):
2900         (-[DOMElement blur]):
2901         (-[DOMRange text]):
2902         (-[DOMRange _text]):
2903         * bindings/objc/DOMCSS.mm:
2904         (-[DOMRGBColor color]):
2905         (-[DOMRGBColor _color]):
2906         * bindings/objc/DOMCore.h:
2907         * bindings/objc/DOMEvents.h:
2908         * bindings/objc/DOMExtensions.h:
2909         * bindings/objc/DOMHTML.mm:
2910         (-[DOMHTMLElement titleDisplayString]):
2911         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
2912         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
2913         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
2914         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
2915         * bindings/objc/DOMPrivate.h:
2916         * bindings/objc/DOMXPath.h:
2917         * bindings/objc/DOMXPath.mm:
2918
2919 2006-07-09  Beth Dakin  <bdakin@apple.com>
2920
2921         Reviewed by Maciej.
2922
2923         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
2924         nested content editable div causes unnecessary screen redraws.
2925         
2926         We were repainting too much because we were deciding that we needed 
2927         a full layout because we didn't have a first line box. Our code 
2928         used to hold a lot of assumptions that positioned elements would 
2929         always have line boxes, but I fixed a few bugs a while back that 
2930         appeared because this assumption isn't true. This assumption was 
2931         also causing the extra redraws because the check meant that we 
2932         would decide to do a full layout for any positioned element that 
2933         did not have any line boxes in the first place. Maciej and I talked 
2934         about this, and we couldn't figure out why the check for line boxes 
2935         was part of determining if we need a full layout in the first 
2936         place. After hunting around the code, we decided to assume that 
2937         this check is antiquated. Removing it fixes the bug and doesn't 
2938         seem to break any layout tests. So, fingers crossed!
2939
2940         Will add layout test so soon.
2941
2942         * rendering/bidi.cpp:
2943         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
2944         check.
2945
2946 2006-07-09  David Harrison  <harrison@apple.com>
2947
2948         Reviewed by John Sullivan.
2949
2950         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
2951
2952         Test: fast/dom/delete-contents.html
2953         
2954         * dom/Range.cpp:
2955         (WebCore::Range::processContents):
2956
2957 2006-07-09  Darin Adler  <darin@apple.com>
2958
2959         - another round of renaming; and KWQ is dead
2960
2961         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
2962         Move files to their new locations. Did rename.
2963         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
2964         * WebCoreSources.bkl: Did rename.
2965         * webcore-base.bkl: Removed kwq.
2966
2967         * kwq/AccessibilityObjectCache.h: Removed.
2968         * kwq/AccessibilityObjectCache.mm: Removed.
2969         * kwq/FormDataMac.h: Removed.
2970         * kwq/FormDataMac.mm: Removed.
2971         * kwq/WebCoreAXObject.h: Removed.
2972         * kwq/WebCoreAXObject.mm: Removed.
2973         * kwq/WebCoreEditCommand.h: Removed.
2974         * kwq/WebCoreEditCommand.mm: Removed.
2975         * kwq/WebCorePageState.h: Removed.
2976         * kwq/WebCorePageState.mm: Removed.
2977         * kwq/WebCoreResourceLoaderImp.h: Removed.
2978         * kwq/WebCoreResourceLoaderImp.mm: Removed.
2979
2980         * bridge/AXObjectCache.h: Added.
2981         * bridge/mac/AXObjectCacheMac.mm: Added.
2982         * bridge/mac/WebCoreAXObject.h: Added.
2983         * bridge/mac/WebCoreAXObject.mm: Added.
2984
2985         * loader/CachedObject.cpp: Removed.
2986         * loader/CachedObject.h: Removed.
2987         * loader/CachedObjectClient.h: Removed.
2988         * loader/CachedObjectClientWalker.cpp: Removed.
2989         * loader/CachedObjectClientWalker.h: Removed.
2990
2991         * loader/CachedResource.cpp: Added.
2992         * loader/CachedResource.h: Added.
2993         * loader/CachedResourceClient.h: Added.
2994         * loader/CachedResourceClientWalker.cpp: Added.
2995         * loader/CachedResourceClientWalker.h: Added.
2996
2997         * bridge/mac/FrameMac.mm:
2998         * bridge/mac/WebCoreFrameBridge.mm:
2999         * css/CSSImageValue.h:
3000         * css/CSSImportRule.h:
3001         * dom/Document.cpp:
3002         * dom/Document.h:
3003         * dom/Notation.h:
3004         * dom/ProcessingInstruction.h:
3005         * dom/XMLTokenizer.cpp:
3006         * html/CanvasPattern.h:
3007         * html/HTMLDocument.h:
3008         * html/HTMLImageLoader.cpp:
3009         * html/HTMLImageLoader.h:
3010         * html/HTMLLinkElement.h:
3011         * html/HTMLScriptElement.cpp:
3012         * html/HTMLScriptElement.h:
3013         * html/HTMLTokenizer.cpp:
3014         * html/HTMLTokenizer.h:
3015         * kcanvas/KCanvasFilters.h:
3016         * ksvg2/svg/SVGCursorElement.cpp:
3017         * ksvg2/svg/SVGCursorElement.h:
3018         * ksvg2/svg/SVGFEImageElement.cpp:
3019         * ksvg2/svg/SVGFEImageElement.h:
3020         * loader/Cache.cpp:
3021         * loader/Cache.h:
3022         * loader/CachedCSSStyleSheet.cpp:
3023         * loader/CachedCSSStyleSheet.h:
3024         * loader/CachedImage.cpp:
3025         * loader/CachedImage.h:
3026         * loader/CachedScript.cpp:
3027         * loader/CachedScript.h:
3028         * loader/CachedXBLDocument.cpp:
3029         * loader/CachedXBLDocument.h:
3030         * loader/CachedXSLStyleSheet.cpp:
3031         * loader/CachedXSLStyleSheet.h:
3032         * loader/DocLoader.cpp:
3033         * loader/DocLoader.h:
3034         * loader/LoaderFunctions.h:
3035         * loader/Request.cpp:
3036         * loader/Request.h:
3037         * loader/loader.cpp:
3038         * loader/loader.h:
3039         * loader/mac/LoaderFunctionsMac.mm:
3040         * page/Frame.cpp:
3041         * page/FrameView.cpp:
3042         * platform/gdk/TemporaryLinkStubs.cpp:
3043         * platform/mac/ClipboardMac.h:
3044         * platform/win/TemporaryLinkStubs.cpp:
3045         * rendering/RenderBox.h:
3046         * rendering/RenderContainer.cpp:
3047         * rendering/RenderImage.cpp:
3048         * rendering/RenderImage.h:
3049         * rendering/RenderLayer.h:
3050         * rendering/RenderObject.cpp:
3051         * rendering/RenderObject.h:
3052         * rendering/RenderStyle.cpp:
3053         * rendering/RenderStyle.h:
3054         * xml/XSLImportRule.h:
3055         Did renaming.
3056
3057         * platform/mac/can-convert.mm: Removed.
3058
3059 2006-07-09  Anders Carlsson  <acarlsson@apple.com>
3060
3061         Reviewed by Tim O.
3062
3063         * WebCore.exp:
3064         Add wkPathFromFont.
3065         
3066         * platform/mac/FontDataMac.mm:
3067         (-[NSFont WebCore]):
3068         Use wkPathFromFont.
3069         
3070         * platform/mac/WebCoreSystemInterface.h:
3071         * platform/mac/WebCoreSystemInterface.mm:
3072         Declare wkPathFromFont.
3073
3074 2006-07-09  Brady Eidson  <beidson@apple.com>
3075
3076         Reviewed by Maciej
3077
3078         Set the stage to remove the workaround for the SQLite BLOB corruption.  A few other small cleanups, and
3079         preparation for pruning unreferenced and unretained icons.
3080
3081         * icon/IconDatabase.cpp:
3082         (WebCore::IconDatabase::recreateDatabase):  Added another trigger to assist in icon removal
3083         (WebCore::IconDatabase::deletePrivateTables):  Cleaned up logging messages
3084         (WebCore::IconDatabase::imageDataForIconID):  #ifdefed the blobbing hack for impending removal, use the real blob by default
3085         (WebCore::IconDatabase::imageDataForIconURL):  same
3086         (WebCore::IconDatabase::imageDataForPageURL):  same
3087         (WebCore::IconDatabase::pruneUnreferencedIcons):  Will delete any icons and their data that are not referenced
3088           by any PageURL
3089         * icon/IconDatabase.h:
3090
3091         * icon/SQLDatabase.h:  Changed BlobAsVector to be unsigned char as thats the most reasonable type for
3092           a byte-buffer, and is what CFData expects
3093         * icon/SQLStatement.cpp:
3094         (WebCore::SQLStatement::getColumnBlobAsVector):
3095
3096 2006-07-09  Darin Adler  <darin@apple.com>
3097
3098         - move all but the last 12 files out of kwq directory
3099         - removed a few unused source files I discovered
3100
3101         * WebCore.vcproj/WebCore/WebCore.vcproj: Update for new file locations.
3102         * WebCore.xcodeproj/project.pbxproj: Ditto.
3103
3104         * bridge/mac/FrameMac.mm:
3105         * dom/Element.h:
3106         * html/HTMLImageLoader.cpp:
3107         * loader/Cache.cpp:
3108         * loader/Cache.h:
3109         * loader/CachedCSSStyleSheet.cpp:
3110         * loader/CachedCSSStyleSheet.h:
3111         * loader/CachedImage.cpp:
3112         * loader/CachedImage.h:
3113         * loader/CachedObject.h:
3114         * loader/CachedScript.cpp:
3115         * loader/CachedScript.h:
3116         * loader/CachedXBLDocument.cpp:
3117         * loader/CachedXBLDocument.h:
3118         * loader/CachedXSLStyleSheet.cpp:
3119         * loader/CachedXSLStyleSheet.h:
3120         * loader/DocLoader.cpp:
3121         * loader/DocLoader.h:
3122         * page/Frame.cpp:
3123         * page/Frame.h:
3124         * page/FramePrivate.h:
3125         * platform/gdk/TemporaryLinkStubs.cpp:
3126         * platform/win/TemporaryLinkStubs.cpp:
3127         * rendering/DeprecatedSlider.cpp:
3128         * rendering/RenderObject.h:
3129         * xml/xmlhttprequest.cpp:
3130         Updated includes as needed for file location changes. Changed
3131         CachePolicy uses to match new filename and enum names.
3132
3133         * loader/CachedResource.cpp: Removed.
3134         * loader/CachedResource.h: Removed.
3135         * loader/CachedResourceClient.h: Removed.
3136         * loader/CachedResourceClientWalker.cpp: Removed.
3137         * loader/CachedResourceClientWalker.h: Removed.
3138         The above files were checked in by accident a while back. The rename of
3139         CachedObject to CachedResource is now reflected in do-webcore-rename,
3140         and will be done soon.
3141
3142         * kwq/AffineTransform.cpp: Removed.
3143         * kwq/AffineTransform.h: Removed.
3144         * kwq/CacheControl.h: Removed.
3145         * kwq/DeprecatedPtrQueue.h: Removed.
3146         * kwq/FileButton.h: Removed.
3147         * kwq/FileButton.mm: Removed.
3148         * kwq/ListBox.h: Removed.
3149         * kwq/ListBox.mm: Removed.
3150         * kwq/LoaderFunctions.h: Removed.
3151         * kwq/LoaderFunctions.mm: Removed.
3152         * kwq/PopUpButton.h: Removed.
3153         * kwq/PopUpButton.mm: Removed.
3154         * kwq/SSLKeyGenerator.h: Removed.
3155         * kwq/SSLKeyGenerator.mm: Removed.
3156         * kwq/Settings.h: Removed.
3157         * kwq/TextBox.h: Removed.
3158         * kwq/TextBox.mm: Removed.
3159         * kwq/TextField.h: Removed.
3160         * kwq/TextField.mm: Removed.
3161         * kwq/WebCoreScrollBar.h: Removed.
3162         * kwq/WebCoreScrollBar.mm: Removed.
3163         * kwq/WebCoreSlider.h: Removed.
3164         * kwq/WebCoreSlider.mm: Removed.
3165
3166         * loader/CachePolicy.h: Added.
3167         * loader/LoaderFunctions.h: Added.
3168
3169         * loader/mac/LoaderFunctionsMac.mm: Added.
3170
3171         * page/Settings.h: Added.
3172
3173         * platform/AffineTransform.cpp: Added.
3174         * platform/AffineTransform.h: Added.
3175         * platform/DeprecatedPtrQueue.h: Added.
3176         * platform/FileButton.h: Added.
3177         * platform/ListBox.h: Added.
3178         * platform/PopUpButton.h: Added.
3179         * platform/SSLKeyGenerator.h: Added.
3180         * platform/ScrollBar.h: Added.
3181         * platform/Slider.h: Added.
3182         * platform/TextBox.h: Added.
3183         * platform/TextField.h: Added.
3184
3185         * platform/cg/AffineTransformCG.cpp: Added.
3186
3187         * platform/mac/FileButtonMac.mm: Added.
3188         * platform/mac/ListBoxMac.mm: Added.
3189         * platform/mac/PopUpButtonMac.mm: Added.
3190         * platform/mac/SSLKeyGeneratorMac.mm: Added.
3191         * platform/mac/ScrollBarMac.mm: Added.
3192         * platform/mac/ScrollBarMac.mm: Added.
3193         * platform/mac/SliderMac.mm: Added.
3194         * platform/mac/SliderMac.mm: Added.
3195         * platform/mac/TextBoxMac.mm: Added.
3196         * platform/mac/TextFieldMac.mm: Added.
3197
3198 2006-07-09  Darin Adler  <darin@apple.com>
3199
3200         - move 4 files out of kwq directory
3201         - make some minor project adjustments for the WebCore project
3202
3203         * WebCore.xcodeproj/project.pbxproj: Link libsqlite3 the same way we do other
3204         libraries, rather than using a custom linker option. Moved the files from their
3205         old locations to the new ones. Removed "khtml" from the list of header search
3206         paths since that directory doesn't exist any more. Eliminated STYLE_LDFLAGS
3207         and just put -umbrella WebKit in OTHER_LDFLAGS in the Production configuration
3208         (was a leftover from "build styles" in Xcode 1). Changed to use EXPORTED_SYMBOLS_FILE
3209         instead of using -exported_symbols_list directly again now that Xcode has fixed the
3210         "strip twice" bug. Removed unneeded explicit SECTORDER_FLAGS = "" settings.
3211         Removed the explicit -Y,3 option now that Xcode does that by default.
3212
3213         * WebCore.vcproj/WebCore/WebCore.vcproj: Removed some obsolete uneeded files,
3214         many of which didn't exist any more. Moved the files from their old locations
3215         to the new ones.
3216
3217         * WebCoreSources.bkl: Moved the files from their old locations to the new ones.
3218
3219         * kwq/DeprecatedCString.cpp: Removed.
3220         * kwq/DeprecatedCString.h: Removed.
3221         * kwq/TextStream.cpp: Removed.
3222         * kwq/TextStream.h: Removed.
3223         * platform/DeprecatedCString.cpp: Added.
3224         * platform/DeprecatedCString.h: Added.
3225         * platform/TextStream.cpp: Added.
3226         * platform/TextStream.h: Added.
3227
3228 2006-07-09  Darin Adler  <darin@apple.com>
3229
3230         Rubber stamped by Maciej (kinda).
3231
3232         - did the next pass of renaming (used do-webcore-rename script)
3233           this takes care of most of the remaining KWQ names (almost all)
3234
3235         * WebCore+SVG/DOMList.h:
3236         * WebCore.vcproj/WebCore/WebCore.vcproj:
3237         * WebCore.xcodeproj/project.pbxproj:
3238         * WebCoreSources.bkl:
3239         * bindings/js/kjs_dom.cpp:
3240         * bindings/js/kjs_window.cpp:
3241         * bindings/objc/DOMHTML.mm:
3242         * bridge/mac/FrameMac.h:
3243         * bridge/mac/FrameMac.mm:
3244         * bridge/mac/WebCoreFrameBridge.mm:
3245         * bridge/mac/WebCoreSettings.h:
3246         * bridge/mac/WebCoreSettings.mm:
3247         * bridge/win/FrameWin.cpp:
3248         * css/CSSPrimitiveValue.cpp:
3249         * css/CSSValueKeywords.in:
3250         * css/MediaQueryEvaluator.cpp:
3251         * css/cssparser.cpp:
3252         * css/cssstyleselector.cpp:
3253         * css/cssstyleselector.h:
3254         * dom/CharacterData.cpp:
3255         * dom/CharacterData.h:
3256         * dom/Document.cpp:
3257         * dom/Element.cpp:
3258         * dom/Element.h:
3259         * dom/EventTargetNode.cpp:
3260         * dom/EventTargetNode.h:
3261         * dom/Node.cpp:
3262         * dom/Node.h:
3263         * dom/Position.cpp:
3264         * dom/ProcessingInstruction.cpp:
3265         * dom/QualifiedName.cpp:
3266         * dom/QualifiedName.h:
3267         * dom/XMLTokenizer.cpp: Added.
3268         * dom/xml_tokenizer.cpp: Removed.
3269         * dom/xml_tokenizer.h: Removed.
3270         * editing/EditAction.h:
3271         * editing/HTMLInterchange.cpp:
3272         * editing/HTMLInterchange.h:
3273         * editing/Selection.h:
3274         * editing/SelectionController.h:
3275         * editing/TextAffinity.h:
3276         * editing/TextIterator.cpp:
3277         * editing/TextIterator.h:
3278         * editing/VisiblePosition.h:
3279         * editing/htmlediting.cpp:
3280         * editing/markup.cpp:
3281         * editing/markup.h:
3282         * editing/visible_units.cpp:
3283         * editing/visible_units.h:
3284         * html/HTMLDocument.cpp:
3285         * html/HTMLFontElement.cpp:
3286         * html/HTMLInputElement.cpp:
3287         * html/HTMLKeygenElement.cpp:
3288         * html/HTMLSelectElement.h:
3289         * html/HTMLTextAreaElement.cpp:
3290         * html/HTMLTextFieldInnerElement.cpp:
3291         * html/HTMLTokenizer.cpp:
3292         * html/HTMLTokenizer.h:
3293         * kcanvas/KCanvasContainer.cpp: Removed.
3294         * kcanvas/KCanvasContainer.h: Removed.
3295         * kcanvas/KCanvasCreator.cpp:
3296         * kcanvas/KCanvasFilters.cpp:
3297         * kcanvas/KCanvasFilters.h:
3298         * kcanvas/KCanvasMatrix.cpp:
3299         * kcanvas/KCanvasMatrix.h:
3300         * kcanvas/KCanvasPath.cpp:
3301         * kcanvas/KCanvasPath.h:
3302         * kcanvas/KCanvasResources.cpp:
3303         * kcanvas/KCanvasResources.h:
3304         * kcanvas/KCanvasTreeDebug.cpp:
3305         * kcanvas/KCanvasTreeDebug.h:
3306         * kcanvas/RenderForeignObject.cpp:
3307         * kcanvas/RenderForeignObject.h:
3308         * kcanvas/RenderPath.cpp:
3309         * kcanvas/RenderPath.h:
3310         * kcanvas/RenderSVGContainer.cpp: Added.
3311         * kcanvas/RenderSVGContainer.h: Added.
3312         * kcanvas/RenderSVGImage.cpp:
3313         * kcanvas/RenderSVGImage.h:
3314         * kcanvas/RenderSVGText.cpp:
3315         * kcanvas/RenderSVGText.h:
3316         * kcanvas/device/KRenderingPaintServer.h:
3317         * kcanvas/device/KRenderingPaintServerGradient.cpp:
3318         * kcanvas/device/KRenderingPaintServerGradient.h:
3319         * kcanvas/device/KRenderingPaintServerPattern.cpp:
3320         * kcanvas/device/KRenderingPaintServerPattern.h:
3321         * kcanvas/device/KRenderingPaintServerSolid.cpp:
3322         * kcanvas/device/KRenderingPaintServerSolid.h:
3323         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3324         * kcanvas/device/quartz/KCanvasItemQuartz.h:
3325         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
3326         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3327         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
3328         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
3329         * ksvg2/css/CSSValueKeywords.in:
3330         * ksvg2/css/SVGRenderStyleDefs.cpp:
3331         * ksvg2/misc/KCanvasRenderingStyle.cpp:
3332         * ksvg2/misc/KSVGTimeScheduler.cpp:
3333         * ksvg2/svg/SVGAElement.cpp:
3334         * ksvg2/svg/SVGAnimateTransformElement.cpp:
3335         * ksvg2/svg/SVGAnimateTransformElement.h:
3336         * ksvg2/svg/SVGGElement.cpp:
3337         * ksvg2/svg/SVGHelper.cpp:
3338         * ksvg2/svg/SVGHelper.h:
3339         * ksvg2/svg/SVGImageElement.cpp:
3340         * ksvg2/svg/SVGLinearGradientElement.cpp:
3341         * ksvg2/svg/SVGMarkerElement.cpp:
3342         * ksvg2/svg/SVGMaskElement.cpp:
3343         * ksvg2/svg/SVGMatrix.cpp:
3344         * ksvg2/svg/SVGMatrix.h:
3345         * ksvg2/svg/SVGPatternElement.cpp:
3346         * ksvg2/svg/SVGRadialGradientElement.cpp:
3347         * ksvg2/svg/SVGSVGElement.cpp:
3348         * ksvg2/svg/SVGStyledElement.h:
3349         * ksvg2/svg/SVGStyledTransformableElement.cpp:
3350         * ksvg2/svg/SVGStyledTransformableElement.h:
3351         * ksvg2/svg/SVGSwitchElement.cpp:
3352         * ksvg2/svg/SVGTextElement.cpp:
3353         * ksvg2/svg/SVGTransformable.h:
3354         * ksvg2/svg/SVGUseElement.cpp:
3355         * kwq/AffineTransform.cpp: Added.
3356         * kwq/AffineTransform.h: Added.
3357         * kwq/DeprecatedCString.cpp: Added.
3358         * kwq/DeprecatedCString.h: Added.
3359         * kwq/DeprecatedPtrQueue.h: Added.
3360         * kwq/FileButton.h: Added.
3361         * kwq/FileButton.mm: Added.
3362         * kwq/FormDataMac.mm: Added.
3363         * kwq/KWQCString.cpp: Removed.
3364         * kwq/KWQCString.h: Removed.
3365         * kwq/KWQComboBox.h: Removed.
3366         * kwq/KWQComboBox.mm: Removed.
3367         * kwq/KWQEditCommand.h: Removed.
3368         * kwq/KWQEditCommand.mm: Removed.
3369         * kwq/KWQFileButton.h: Removed.
3370         * kwq/KWQFileButton.mm: Removed.
3371         * kwq/KWQFormData.h: Removed.
3372         * kwq/KWQFormData.mm: Removed.
3373         * kwq/KWQKHTMLSettings.h: Removed.
3374         * kwq/KWQKIOGlobal.h: Removed.
3375         * kwq/KWQKSSLKeyGen.h: Removed.
3376         * kwq/KWQKSSLKeyGen.mm: Removed.
3377         * kwq/KWQLineEdit.h: Removed.
3378         * kwq/KWQLineEdit.mm: Removed.
3379         * kwq/KWQListBox.h: Removed.
3380         * kwq/KWQListBox.mm: Removed.
3381         * kwq/KWQLoader.h: Removed.
3382         * kwq/KWQLoader.mm: Removed.
3383         * kwq/KWQPageState.h: Removed.
3384         * kwq/KWQPageState.mm: Removed.
3385         * kwq/KWQPtrQueue.h: Removed.
3386         * kwq/KWQResourceLoader.h: Removed.
3387         * kwq/KWQResourceLoader.mm: Removed.
3388         * kwq/KWQScrollBar.h: Removed.
3389         * kwq/KWQScrollBar.mm: Removed.
3390         * kwq/KWQSlider.h: Removed.
3391         * kwq/KWQSlider.mm: Removed.
3392         * kwq/KWQTextEdit.h: Removed.
3393         * kwq/KWQTextEdit.mm: Removed.
3394         * kwq/KWQTextStream.cpp: Removed.
3395         * kwq/KWQTextStream.h: Removed.
3396         * kwq/KWQWMatrix.cpp: Removed.
3397         * kwq/KWQWMatrix.h: Removed.
3398         * kwq/ListBox.h: Added.
3399         * kwq/ListBox.mm: Added.
3400         * kwq/LoaderFunctions.h: Added.
3401         * kwq/LoaderFunctions.mm: Added.
3402         * kwq/PopUpButton.h: Added.
3403         * kwq/PopUpButton.mm: Added.
3404         * kwq/SSLKeyGenerator.h: Added.
3405         * kwq/SSLKeyGenerator.mm: Added.
3406         * kwq/Settings.h: Added.
3407         * kwq/TextBox.h: Added.
3408         * kwq/TextBox.mm: Added.
3409         * kwq/TextField.h: Added.
3410         * kwq/TextField.mm: Added.
3411         * kwq/TextStream.cpp: Added.
3412         * kwq/TextStream.h: Added.
3413         * kwq/WebCoreEditCommand.h: Added.
3414         * kwq/WebCoreEditCommand.mm: Added.
3415         * kwq/WebCorePageState.h: Added.
3416         * kwq/WebCorePageState.mm: Added.
3417         * kwq/WebCoreResourceLoaderImp.h: Added.
3418         * kwq/WebCoreResourceLoaderImp.mm: Added.
3419         * kwq/WebCoreScrollBar.h: Added.
3420         * kwq/WebCoreScrollBar.mm: Added.
3421         * kwq/WebCoreSlider.h: Added.
3422         * kwq/WebCoreSlider.mm: Added.
3423         * loader/Cache.h:
3424         * loader/CachedCSSStyleSheet.cpp:
3425         * loader/CachedImage.cpp:
3426         * loader/CachedObject.h:
3427         * loader/CachedObjectClientWalker.h:
3428         * loader/CachedResource.h:
3429         * loader/CachedResourceClientWalker.h:
3430         * loader/CachedScript.h:
3431         * loader/CachedXBLDocument.h:
3432         * loader/Decoder.h:
3433         * loader/DocLoader.cpp:
3434         * loader/DocLoader.h:
3435         * loader/FormData.h:
3436         * loader/ImageDocument.cpp:
3437         * loader/PluginDocument.cpp:
3438         * loader/TextDocument.cpp:
3439         * loader/loader.cpp:
3440         * loader/loader.h:
3441         * page/Frame.cpp:
3442         * page/Frame.h:
3443         * page/FramePrivate.h:
3444         * page/Page.cpp:
3445         * page/Page.h:
3446         * platform/DeprecatedPtrList.h:
3447         * platform/DeprecatedPtrListImpl.cpp:
3448         * platform/DeprecatedPtrListImpl.h:
3449         * platform/DeprecatedString.cpp:
3450         * platform/DeprecatedString.h:
3451         * platform/DeprecatedStringList.cpp:
3452         * platform/DeprecatedStringList.h:
3453         * platform/DeprecatedValueList.h:
3454         * platform/DeprecatedValueListImpl.cpp:
3455         * platform/DeprecatedValueListImpl.h:
3456         * platform/FloatSize.h:
3457         * platform/Font.cpp:
3458         * platform/KURL.cpp:
3459         * platform/RegularExpression.cpp:
3460         * platform/RegularExpression.h:
3461         * platform/SegmentedString.h:
3462         * platform/StreamingTextDecoder.cpp:
3463         * platform/String.cpp:
3464         * platform/StringImpl.cpp:
3465         * platform/TextEncoding.cpp:
3466         * platform/TransferJob.cpp:
3467         * platform/TransferJob.h:
3468         * platform/TransferJobInternal.h:
3469         * platform/gdk/FrameGdk.cpp:
3470         * platform/gdk/TemporaryLinkStubs.cpp:
3471         * platform/mac/ClipboardMac.h:
3472         * platform/mac/ClipboardMac.mm:
3473         * platform/mac/CursorMac.mm:
3474         * platform/mac/DeprecatedStringMac.mm: Added.
3475         * platform/mac/FontCacheMac.mm:
3476         * platform/mac/FontMac.mm:
3477         * platform/mac/FoundationExtras.h:
3478         * platform/mac/ImageMac.mm:
3479         * platform/mac/KURLMac.mm:
3480         * platform/mac/MouseEventMac.mm: Removed.
3481         * platform/mac/QStringListMac.mm: Removed.
3482         * platform/mac/QStringMac.mm: Removed.
3483         * platform/mac/TransferJobMac.mm:
3484         * platform/mac/WebCoreTextArea.h:
3485         * platform/mac/WebCoreTextArea.mm:
3486         * platform/mac/WebCoreTextField.h:
3487         * platform/mac/WebCoreTextField.mm:
3488         * platform/mac/WidgetMac.mm:
3489         * platform/win/TemporaryLinkStubs.cpp:
3490         * rendering/DataRef.h:
3491         * rendering/DeprecatedRenderSelect.cpp:
3492         * rendering/DeprecatedRenderSelect.h:
3493         * rendering/DeprecatedSlider.cpp:
3494         * rendering/InlineFlowBox.cpp:
3495         * rendering/RenderApplet.cpp:
3496         * rendering/RenderBlock.cpp:
3497         * rendering/RenderBlock.h:
3498         * rendering/RenderContainer.cpp:
3499         * rendering/RenderFileButton.cpp:
3500         * rendering/RenderFlexibleBox.cpp:
3501         * rendering/RenderFlow.cpp: