Changeset 100042 in webkit
- Timestamp:
- Nov 11, 2011, 3:54:58 PM (15 years ago)
- Location:
- branches/subpixellayout/Source/WebCore
- Files:
-
- 10 edited
-
dom/Element.cpp (modified) (9 diffs)
-
rendering/RenderBox.cpp (modified) (2 diffs)
-
rendering/RenderBox.h (modified) (1 diff)
-
rendering/RenderBoxModelObject.cpp (modified) (3 diffs)
-
rendering/RenderBoxModelObject.h (modified) (1 diff)
-
rendering/RenderInline.cpp (modified) (2 diffs)
-
rendering/RenderInline.h (modified) (1 diff)
-
rendering/RenderListBox.cpp (modified) (1 diff)
-
rendering/RenderVideo.cpp (modified) (4 diffs)
-
rendering/RenderVideo.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/subpixellayout/Source/WebCore/dom/Element.cpp
r99784 r100042 345 345 { 346 346 document()->updateLayoutIgnorePendingStylesheets(); 347 if (RenderBoxModelObject* rend = renderBoxModelObject()) { 348 LayoutUnit adjustForIntRounding = rend->offsetLeft() - rend->offsetLeft().floor(); 349 return roundf(adjustForAbsoluteZoom(rend->offsetWidth() + adjustForIntRounding, rend)); 350 } 347 if (RenderBoxModelObject* rend = renderBoxModelObject()) 348 return adjustForAbsoluteZoom(rend->offsetWidth(), rend); 351 349 return 0; 352 350 } … … 355 353 { 356 354 document()->updateLayoutIgnorePendingStylesheets(); 357 if (RenderBoxModelObject* rend = renderBoxModelObject()) { 358 LayoutUnit adjustForIntRounding = rend->offsetTop() - rend->offsetTop().floor(); 359 return roundf(adjustForAbsoluteZoom(rend->offsetHeight() + adjustForIntRounding, rend)); 360 } 355 if (RenderBoxModelObject* rend = renderBoxModelObject()) 356 return adjustForAbsoluteZoom(rend->offsetHeight(), rend); 361 357 return 0; 362 358 } … … 376 372 377 373 if (RenderBox* rend = renderBox()) 378 return roundf(adjustForAbsoluteZoom(rend->clientLeft(), rend));374 return adjustForAbsoluteZoom(rend->clientLeft(), rend); 379 375 return 0; 380 376 } … … 385 381 386 382 if (RenderBox* rend = renderBox()) 387 return roundf(adjustForAbsoluteZoom(rend->clientTop(), rend));383 return adjustForAbsoluteZoom(rend->clientTop(), rend); 388 384 return 0; 389 385 } … … 400 396 if (FrameView* view = document()->view()) { 401 397 if (RenderView* renderView = document()->renderView()) 402 return roundf(adjustForAbsoluteZoom(view->layoutWidth(), renderView));398 return adjustForAbsoluteZoom(view->layoutWidth(), renderView); 403 399 } 404 400 } 405 401 406 if (RenderBox* rend = renderBox()) { 407 LayoutUnit adjustForIntRounding = rend->clientLeft() - rend->clientLeft().floor(); 408 return roundf(adjustForAbsoluteZoom(rend->clientWidth() + adjustForIntRounding, rend)); 409 } 402 if (RenderBox* rend = renderBox()) 403 return adjustForAbsoluteZoom(rend->clientWidth(), rend); 410 404 return 0; 411 405 } … … 423 417 if (FrameView* view = document()->view()) { 424 418 if (RenderView* renderView = document()->renderView()) 425 return roundf(adjustForAbsoluteZoom(view->layoutHeight(), renderView));419 return adjustForAbsoluteZoom(view->layoutHeight(), renderView); 426 420 } 427 421 } 428 422 429 if (RenderBox* rend = renderBox()) { 430 LayoutUnit adjustForIntRounding = rend->clientTop() - rend->clientTop().floor(); 431 return roundf(adjustForAbsoluteZoom(rend->clientHeight() + adjustForIntRounding, rend)); 432 } 423 if (RenderBox* rend = renderBox()) 424 return adjustForAbsoluteZoom(rend->clientHeight(), rend); 433 425 return 0; 434 426 } … … 446 438 document()->updateLayoutIgnorePendingStylesheets(); 447 439 if (RenderBox* rend = renderBox()) 448 return roundf(adjustForAbsoluteZoom(rend->scrollTop(), rend));440 return adjustForAbsoluteZoom(rend->scrollTop(), rend); 449 441 return 0; 450 442 } … … 468 460 document()->updateLayoutIgnorePendingStylesheets(); 469 461 if (RenderBox* rend = renderBox()) { 470 return roundf(adjustForAbsoluteZoom(rend->scrollWidth(), rend));462 return adjustForAbsoluteZoom(rend->scrollWidth(), rend); 471 463 } 472 464 return 0; … … 477 469 document()->updateLayoutIgnorePendingStylesheets(); 478 470 if (RenderBox* rend = renderBox()) { 479 return roundf(adjustForAbsoluteZoom(rend->scrollHeight(), rend));471 return adjustForAbsoluteZoom(rend->scrollHeight(), rend); 480 472 } 481 473 return 0; -
branches/subpixellayout/Source/WebCore/rendering/RenderBox.cpp
r99908 r100042 466 466 // More IE extensions. clientWidth and clientHeight represent the interior of an object 467 467 // excluding border and scrollbar. 468 LayoutUnit RenderBox::clientWidth() const469 { 470 return width() - borderLeft() - borderRight() - verticalScrollbarWidth();471 } 472 473 LayoutUnit RenderBox::clientHeight() const474 { 475 return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();468 int RenderBox::clientWidth() const 469 { 470 return (width() - borderLeft() - borderRight() - verticalScrollbarWidth()).round(); 471 } 472 473 int RenderBox::clientHeight() const 474 { 475 return (height() - borderTop() - borderBottom() - horizontalScrollbarHeight()).round(); 476 476 } 477 477 … … 483 483 // FIXME: Need to work right with writing modes. 484 484 if (style()->isLeftToRightDirection()) 485 return max(clientWidth(), maxXLayoutOverflow() - borderLeft());486 return clientWidth() - min <int>(0, minXLayoutOverflow() - borderLeft());485 return max(clientWidth(), (maxXLayoutOverflow() - borderLeft()).round()); 486 return clientWidth() - min(0, (minXLayoutOverflow() - borderLeft()).round()); 487 487 } 488 488 -
branches/subpixellayout/Source/WebCore/rendering/RenderBox.h
r99259 r100042 181 181 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow) 182 182 // to return the remaining width on a given line (and the height of a single line). 183 virtual LayoutUnit offsetWidth() const { return width(); }184 virtual LayoutUnit offsetHeight() const { return height(); }183 virtual int offsetWidth() const { return width(); } 184 virtual int offsetHeight() const { return height(); } 185 185 186 186 // More IE extensions. clientWidth and clientHeight represent the interior of an object 187 187 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWidth and borderTopWidth. 188 LayoutUnit clientLeft() const { return borderLeft(); }189 LayoutUnit clientTop() const { return borderTop(); }190 LayoutUnit clientWidth() const;191 LayoutUnit clientHeight() const;192 LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); }193 LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth(); }194 LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }195 LayoutRect clientBoxRect() const { return LayoutRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); }188 int clientLeft() const { return borderLeft().round(); } 189 int clientTop() const { return borderTop().round(); } 190 int clientWidth() const; 191 int clientHeight() const; 192 int clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); } 193 int clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth(); } 194 int clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); } 195 IntRect clientBoxRect() const { return IntRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); } 196 196 197 197 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the -
branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.cpp
r99908 r100042 432 432 } 433 433 434 LayoutUnit RenderBoxModelObject::offsetLeft() const434 int RenderBoxModelObject::offsetLeft() const 435 435 { 436 436 // If the element is the HTML body element or does not have an associated box … … 463 463 } 464 464 465 return xPos ;466 } 467 468 LayoutUnit RenderBoxModelObject::offsetTop() const465 return xPos.round(); 466 } 467 468 int RenderBoxModelObject::offsetTop() const 469 469 { 470 470 // If the element is the HTML body element or does not have an associated box … … 496 496 } 497 497 } 498 return yPos ;498 return yPos.round(); 499 499 } 500 500 -
branches/subpixellayout/Source/WebCore/rendering/RenderBoxModelObject.h
r98872 r100042 56 56 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow) 57 57 // to return the remaining width on a given line (and the height of a single line). 58 virtual LayoutUnit offsetLeft() const;59 virtual LayoutUnit offsetTop() const;60 virtual LayoutUnit offsetWidth() const = 0;61 virtual LayoutUnit offsetHeight() const = 0;58 virtual int offsetLeft() const; 59 virtual int offsetTop() const; 60 virtual int offsetWidth() const = 0; 61 virtual int offsetHeight() const = 0; 62 62 63 63 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); -
branches/subpixellayout/Source/WebCore/rendering/RenderInline.cpp
r98165 r100042 638 638 } 639 639 640 LayoutUnit RenderInline::offsetLeft() const641 { 642 LayoutUnit x = RenderBoxModelObject::offsetLeft();640 int RenderInline::offsetLeft() const 641 { 642 int x = RenderBoxModelObject::offsetLeft(); 643 643 if (InlineBox* firstBox = firstLineBoxIncludingCulling()) 644 644 x += firstBox->x(); … … 646 646 } 647 647 648 LayoutUnit RenderInline::offsetTop() const649 { 650 LayoutUnit y = RenderBoxModelObject::offsetTop();648 int RenderInline::offsetTop() const 649 { 650 int y = RenderBoxModelObject::offsetTop(); 651 651 if (InlineBox* firstBox = firstLineBoxIncludingCulling()) 652 652 y += firstBox->y(); -
branches/subpixellayout/Source/WebCore/rendering/RenderInline.h
r96859 r100042 122 122 virtual bool requiresLayer() const { return isRelPositioned() || isTransparent() || hasMask(); } 123 123 124 virtual LayoutUnit offsetLeft() const;125 virtual LayoutUnit offsetTop() const;126 virtual LayoutUnit offsetWidth() const { return linesBoundingBox().width(); }127 virtual LayoutUnit offsetHeight() const { return linesBoundingBox().height(); }124 virtual int offsetLeft() const; 125 virtual int offsetTop() const; 126 virtual int offsetWidth() const { return linesBoundingBox().width(); } 127 virtual int offsetHeight() const { return linesBoundingBox().height(); } 128 128 129 129 virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; -
branches/subpixellayout/Source/WebCore/rendering/RenderListBox.cpp
r99784 r100042 651 651 int RenderListBox::scrollHeight() const 652 652 { 653 return max(clientHeight(), listHeight() );653 return max(clientHeight(), listHeight().round()); 654 654 } 655 655 -
branches/subpixellayout/Source/WebCore/rendering/RenderVideo.cpp
r98165 r100042 301 301 } 302 302 303 LayoutUnit RenderVideo::offsetLeft() const303 int RenderVideo::offsetLeft() const 304 304 { 305 305 if (const RenderBlock* block = rendererPlaceholder(this)) … … 308 308 } 309 309 310 LayoutUnit RenderVideo::offsetTop() const310 int RenderVideo::offsetTop() const 311 311 { 312 312 if (const RenderBlock* block = rendererPlaceholder(this)) … … 315 315 } 316 316 317 LayoutUnit RenderVideo::offsetWidth() const317 int RenderVideo::offsetWidth() const 318 318 { 319 319 if (const RenderBlock* block = rendererPlaceholder(this)) … … 322 322 } 323 323 324 LayoutUnit RenderVideo::offsetHeight() const324 int RenderVideo::offsetHeight() const 325 325 { 326 326 if (const RenderBlock* block = rendererPlaceholder(this)) -
branches/subpixellayout/Source/WebCore/rendering/RenderVideo.h
r90069 r100042 76 76 77 77 #if ENABLE(FULLSCREEN_API) 78 virtual LayoutUnit offsetLeft() const;79 virtual LayoutUnit offsetTop() const;80 virtual LayoutUnit offsetWidth() const;81 virtual LayoutUnit offsetHeight() const;78 virtual int offsetLeft() const; 79 virtual int offsetTop() const; 80 virtual int offsetWidth() const; 81 virtual int offsetHeight() const; 82 82 #endif 83 83
Note:
See TracChangeset
for help on using the changeset viewer.