ec72cc8fa6af2f7250c2e7c2be1050bdd420f71c
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
2
3         Reviewed by thatcher, levi
4
5         * editing/ReplaceSelectionCommand.cpp:
6         (WebCore::ReplaceSelectionCommand::doApply):
7         Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
8         position pasted into must be split to avoid block nesting.  We now split unnecessarily
9         some times, but the end merge cleans up for us.
10
11 2006-05-11  David Hyatt  <hyatt@apple.com>
12
13         This patch makes drawHighlightForText a completely cross-platform method
14         implemented by the GraphicsContext.  The platform-specific implementations
15         of the method in the Font class have been eliminated.
16
17         Reviewed by andersca
18
19         * platform/Font.h:
20         * platform/FontData.h:
21         Remove the drawHighlight methods.  Change the selectionRect method in
22         Font to return a FloatRect so that the GraphicsContext can do an accurate
23         fill.
24
25         * platform/GraphicsContext.cpp:
26         (WebCore::GraphicsContext::drawHighlightForText):
27         Implement the drawHighlightFunction in terms of the cross-platform
28         Font selectionRect functions and a new float-based fillRect graphics context
29         function.
30
31         * platform/GraphicsContext.h:
32         * platform/cairo/GraphicsContextCairo.cpp:
33         (WebCore::GraphicsContext::fillRect):
34         * platform/cg/GraphicsContextCG.cpp:
35         (WebCore::GraphicsContext::fillRect):
36         Add the new float-based fillRect function for Cairo and CG.
37
38         * platform/mac/FontData.mm:
39         (WebCore::CG_draw):
40         (WebCore::ATSU_draw):
41         Removed the CG and ATSU drawHighlight methods.  Remove the drawing of
42         the background from the deprecated draw methods (they'll be removed
43         soon).
44
45         * platform/mac/FontMac.mm:
46         (WebCore::Font::selectionRectForText):
47         * platform/win/FontWin.cpp:
48         (WebCore::Font::selectionRectForText):
49         Change selectionRectForText to return a FloatRect instead of an IntRect,
50         so that the GraphicsContext can do a precise fill.
51
52         * rendering/InlineTextBox.cpp:
53         (WebCore::InlineTextBox::selectionRect):
54         (WebCore::InlineTextBox::positionForOffset):
55         Modify the callers who expect an int-based selection rect so that they call
56         enclosingIntRect.
57
58 2006-05-11  Darin Adler  <darin@apple.com>
59
60         Reviewed by Adele.
61
62         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
63           REGRESSION: focus() on input field selects all text within it
64           (was: cannot select cities on British Rail reservation site)
65
66         Test: fast/forms/double-focus.html
67
68         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
69         Changed to only call setFocusNode, select, and revealSelection
70         if the element is not already focused. Also changed to use return
71         a bit more rather than else.
72
73 2006-05-11  Darin Adler  <darin@apple.com>
74
75         Reviewed by Tim Hatcher (earlier version).
76
77         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
78           use the preprocessor for IDL files
79
80         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
81         driver script, passing "-E" so we only preprocess, "-P" so we don't get
82         "#line" directives, and "-x c++" so we handle both C and C++ comments.
83         Removed the code to eliminate comments since the preprocessor handles that.
84         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
85         updated it to do the same way as above.
86
87 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
88
89         Reviewed by Darin.
90
91         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
92         Add support for mozilla-style node constructors as properties of the window object
93         
94         * DerivedSources.make:
95         * WebCore.xcodeproj/project.pbxproj:
96         Add new generated files.
97         
98         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
99         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
100         * bindings/js/JSHTMLElementWrapperFactory.cpp:
101         (WebCore::createJSWrapper):
102         Specify the KJS namespace for JSHTMLElmement.
103                 
104         * bindings/js/kjs_dom.cpp:
105         (KJS::toJS):
106         Create a WebCore::JSHTMLDocument for document nodes. Also, create
107         JSDocumentFragments for document fragments (instead of plain node objects).
108         
109         * bindings/js/kjs_html.cpp:
110         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
111         (KJS::JSHTMLDocument::JSHTMLDocument):
112         (KJS::JSHTMLDocument::getOwnPropertySlot):
113         Add a prototype for JSHTMLDocument and move all functions there.
114         
115         (KJS::JSHTMLElement::JSHTMLElement):
116         (KJS::JSHTMLElement::getOwnPropertySlot):
117         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
118         
119         (KJS::JSHTMLElement::getValueProperty):
120         (KJS::JSHTMLElement::putValueProperty):
121         Remove title setter and getter. Those are autogenerated now.
122         
123         * bindings/js/kjs_html.h:
124         (KJS::JSHTMLElement::):
125         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
126         
127         * bindings/scripts/CodeGeneratorJS.pm:
128         Always generate a prototype object, regardless of whether the object has any functions or
129         constants.
130         
131         Use the type of generator attributes to determine what constructor to use. This is useful for
132         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
133         
134         * dom/DocumentFragment.idl: Added.        
135         * html/HTMLDocument.idl: Added.
136         * html/HTMLElement.idl: Added.
137         
138         * page/DOMWindow.idl:
139         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
140         an alias for the Document constructor.
141         
142 2006-05-11  David Hyatt  <hyatt@apple.com>
143
144         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
145         make it the new API for Font and GraphicsContext when drawing/measuring
146         text.
147
148         Reviewed by andersca
149
150         * platform/Font.cpp:
151         (WebCore::m_finalRoundingWidth):
152         (WebCore::WidthIterator::advance):
153         (WebCore::WidthIterator::normalizeVoicingMarks):
154         (WebCore::Font::width):
155         (WebCore::Font::canUseGlyphCache):
156         (WebCore::Font::drawSimpleText):
157         (WebCore::Font::drawText):
158         (WebCore::Font::floatWidth):
159         (WebCore::Font::floatWidthForSimpleText):
160         * platform/Font.h:
161         (WebCore::TextRun::m_to):
162         (WebCore::TextRun::operator[]):
163         (WebCore::TextRun::data):
164         (WebCore::TextRun::adjustFrom):
165         (WebCore::TextRun::adjustTo):
166         (WebCore::TextRun::characters):
167         (WebCore::TextRun::length):
168         (WebCore::TextRun::from):
169         (WebCore::TextRun::to):
170         * platform/GraphicsContext.cpp:
171         (WebCore::GraphicsContext::drawText):
172         (WebCore::GraphicsContext::drawHighlightForText):
173         * platform/GraphicsContext.h:
174         * platform/mac/FontMac.mm:
175         (WebCore::addDirectionalOverride):
176         (WebCore::overrideLayoutOperation):
177         (WebCore::ATSULayoutParameters::initialize):
178         (WebCore::Font::selectionRectForText):
179         (WebCore::Font::drawComplexText):
180         (WebCore::Font::drawHighlightForText):
181         (WebCore::Font::floatWidthForComplexText):
182         (WebCore::Font::checkSelectionPoint):
183         * platform/win/FontWin.cpp:
184         (WebCore::hackishExtentForString):
185         (WebCore::Font::floatWidth):
186         (WebCore::Font::drawText):
187         (WebCore::Font::drawHighlightForText):
188         (WebCore::Font::selectionRectForText):
189         (WebCore::Font::checkSelectionPoint):
190         * rendering/InlineTextBox.cpp:
191         (WebCore::InlineTextBox::selectionRect):
192         (WebCore::InlineTextBox::paint):
193         (WebCore::InlineTextBox::paintSelection):
194         (WebCore::InlineTextBox::paintMarkedTextBackground):
195         (WebCore::InlineTextBox::paintTextMatchMarker):
196         (WebCore::InlineTextBox::offsetForPosition):
197         (WebCore::InlineTextBox::positionForOffset):
198         * rendering/RenderBlock.cpp:
199         (WebCore::stripTrailingSpace):
200         * rendering/RenderFlexibleBox.cpp:
201         (WebCore::RenderFlexibleBox::layoutVerticalBox):
202         * rendering/RenderImage.cpp:
203         (WebCore::RenderImage::imageChanged):
204         (WebCore::RenderImage::paint):
205         * rendering/RenderText.cpp:
206         (WebCore::RenderText::cacheWidths):
207         (WebCore::RenderText::widthFromCache):
208         (WebCore::RenderText::trimmedMinMaxWidth):
209         (WebCore::RenderText::calcMinMaxWidth):
210         (WebCore::RenderText::width):
211         * rendering/RenderTextField.cpp:
212         (WebCore::RenderTextField::calcMinMaxWidth):
213         * rendering/bidi.cpp:
214         (WebCore::RenderBlock::tabWidth):
215         (WebCore::RenderBlock::checkLinesForTextOverflow):
216         * rendering/render_line.cpp:
217         (WebCore::EllipsisBox::paint):
218         * rendering/render_list.cpp:
219         (WebCore::RenderListMarker::paint):
220         (WebCore::RenderListMarker::calcMinMaxWidth):
221         (WebCore::RenderListMarker::getRelativeMarkerRect):
222
223 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
224
225         Reviewed by darin
226
227         * editing/ReplaceSelectionCommand.cpp:
228         (WebCore::ReplaceSelectionCommand::doApply):
229         Removed the code to find out if we must later add smart replace whitespace.  We can 
230         wait until we've done the insertion to figure it out, and the position sampled (startPos)
231         to make the decision about trailing whitespace was wrong.
232         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
233         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
234         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
235         whitespace (2 and 3 were reversed because the end merge must happen before we can know
236         whether or not we need to add a trailing space).
237         Don't do an end merge if the last node inserted was a br because the end merge will 
238         clobber it.
239         
240         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
241         brs where [br, 0] is at the end of a block and not at the start of a paragraph
242         are the ones that are collapsed because of quirks mode.
243
244 2006-05-10  David Hyatt  <hyatt@apple.com>
245
246         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
247         Font and make them static methods (inlined in the header).  Make the rounding
248         hack character table a static member as well.  Remove the redundant space/rounding
249         functions from FontData.mm.
250
251         Reviewed by darin
252
253         * platform/Font.cpp:
254         (WebCore::):
255         (WebCore::m_finalRoundingWidth):
256         (WebCore::WidthIterator::advance):
257         * platform/Font.h:
258         (WebCore::Font::treatAsSpace):
259         (WebCore::Font::isRoundingHackCharacter):
260         * platform/mac/FontData.mm:
261         (WebCore::overrideLayoutOperation):
262         (WebCore::createATSULayoutParameters):
263         (WebCore::initializeWidthIterator):
264         (WebCore::advanceWidthIterator):
265         * platform/mac/FontMac.mm:
266         (WebCore::overrideLayoutOperation):
267         (WebCore::ATSULayoutParameters::initialize):
268
269 2006-05-10  Darin Adler  <darin@apple.com>
270
271         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
272
273 >>>>>>> .r14297
274 2006-05-10  David Carson <dacarson@gmail.com>
275
276         - Fix for bug 8833. Removed inline keyword from functions declared
277         in .mm and .cpp files. inline function code needs to reside in the
278         header file for the linker to find the code. 
279         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
280
281         Reviewed by Darin, landed by Timothy.
282
283         * platform/Font.cpp:
284         (WebCore::isSpace):
285         * platform/mac/FontData.mm:
286         (WebCore::widthForGlyph):
287         (WebCore::isRoundingHackCharacter):
288         (WebCore::glyphForCharacter):
289
290 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
291
292         Reviewed and landed by Anders.
293
294         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
295           REGRESSION: Words render on top of each other when fallback font is used
296
297         Already covered by several pixel tests in fast/text
298
299         * platform/Font.cpp:
300         (WebCore::Font::drawSimpleText):
301
302 2006-05-10  David Hyatt  <hyatt@apple.com>
303
304         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
305         drawing and measuring of runs up into the Font class.  The fast code
306         path is in Font.cpp and is designed to be mostly cross-platform.  The
307         slow code path is in FontMac.cpp and is Mac-specific.
308
309         Reviewed by darin
310
311         * WebCore.xcodeproj/project.pbxproj:
312         * platform/Font.cpp:
313         (WebCore::isSpace):
314         (WebCore::):
315         (WebCore::isRoundingHackCharacter):
316         (WebCore::m_finalRoundingWidth):
317         (WebCore::WidthIterator::advance):
318         (WebCore::WidthIterator::normalizeVoicingMarks):
319         (WebCore::Font::primaryFont):
320         (WebCore::Font::setAlwaysUseComplexPath):
321         (WebCore::Font::canUseGlyphCache):
322         (WebCore::Font::drawSimpleText):
323         (WebCore::Font::drawText):
324         (WebCore::Font::floatWidth):
325         (WebCore::Font::floatWidthForSimpleText):
326         * platform/Font.h:
327         * platform/FontData.h:
328         (WebCore::FontData::platformData):
329         * platform/GlyphBuffer.h: Added.
330         (WebCore::GlyphBuffer::GlyphBuffer):
331         (WebCore::GlyphBuffer::isEmpty):
332         (WebCore::GlyphBuffer::size):
333         (WebCore::GlyphBuffer::glyphs):
334         (WebCore::GlyphBuffer::advances):
335         (WebCore::GlyphBuffer::fontDataAt):
336         (WebCore::GlyphBuffer::swap):
337         (WebCore::GlyphBuffer::glyphAt):
338         (WebCore::GlyphBuffer::advanceAt):
339         (WebCore::GlyphBuffer::add):
340         * platform/mac/FontData.mm:
341         (WebCore::isSpace):
342         (WebCore::isRoundingHackCharacter):
343         (WebCore::FontData::widthForGlyph):
344         (WebCore::m_ATSUMirrors):
345         (WebCore::FontData::xHeight):
346         (WebCore::FontData::smallCapsFontData):
347         (WebCore::findSubstituteFont):
348         (WebCore::rendererForAlternateFont):
349         (WebCore::findSubstituteRenderer):
350         (WebCore::FontData::findSubstituteFontData):
351         (WebCore::computeWidthForSpace):
352         (WebCore::FontData::updateGlyphMapEntry):
353         (WebCore::extendGlyphMap):
354         (WebCore::extendWidthMap):
355         (WebCore::createATSULayoutParameters):
356         (WebCore::FontData::glyphForCharacter):
357         (WebCore::advanceWidthIterator):
358         (WebCore::shouldUseATSU):
359         * platform/mac/FontMac.mm:
360         (WebCore::ATSULayoutParameters::m_padPerSpace):
361         (WebCore::addDirectionalOverride):
362         (WebCore::initializeATSUStyle):
363         (WebCore::overrideLayoutOperation):
364         (WebCore::ATSULayoutParameters::initialize):
365         (WebCore::disposeATSULayoutParameters):
366         (WebCore::Font::drawComplexText):
367         (WebCore::Font::floatWidthForComplexText):
368         (WebCore::Font::drawGlyphs):
369         * platform/mac/WebCoreTextRenderer.mm:
370         (WebCoreSetAlwaysUseATSU):
371
372 2006-05-10  Darin Adler  <darin@apple.com>
373
374         - another try at fixing the Windows build
375
376         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
377         instead of unicode().
378
379 == Rolled over to ChangeLog-2006-05-10 ==