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