Changeset 99613 in webkit
- Timestamp:
- Nov 8, 2011 1:14:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 24 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r99612 r99613 1 2011-11-08 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10262225> Allow RenderView to have columns 4 https://bugs.webkit.org/show_bug.cgi?id=71840 5 6 Reviewed by Simon Fraser. 7 8 * fast/multicol/pagination-h-horizontal-bt.html: Added. 9 * fast/multicol/pagination-h-horizontal-tb.html: Added. 10 * fast/multicol/pagination-h-vertical-lr.html: Added. 11 * fast/multicol/pagination-h-vertical-rl.html: Added. 12 * fast/multicol/pagination-v-horizontal-bt.html: Added. 13 * fast/multicol/pagination-v-horizontal-tb.html: Added. 14 * fast/multicol/pagination-v-vertical-lr.html: Added. 15 * fast/multicol/pagination-v-vertical-rl.html: Added. 16 * platform/mac/fast/multicol/pagination-h-horizontal-bt-expected.png: Added. 17 * platform/mac/fast/multicol/pagination-h-horizontal-bt-expected.txt: Added. 18 * platform/mac/fast/multicol/pagination-h-horizontal-tb-expected.png: Added. 19 * platform/mac/fast/multicol/pagination-h-horizontal-tb-expected.txt: Added. 20 * platform/mac/fast/multicol/pagination-h-vertical-lr-expected.png: Added. 21 * platform/mac/fast/multicol/pagination-h-vertical-lr-expected.txt: Added. 22 * platform/mac/fast/multicol/pagination-h-vertical-rl-expected.png: Added. 23 * platform/mac/fast/multicol/pagination-h-vertical-rl-expected.txt: Added. 24 * platform/mac/fast/multicol/pagination-v-horizontal-bt-expected.png: Added. 25 * platform/mac/fast/multicol/pagination-v-horizontal-bt-expected.txt: Added. 26 * platform/mac/fast/multicol/pagination-v-horizontal-tb-expected.png: Added. 27 * platform/mac/fast/multicol/pagination-v-horizontal-tb-expected.txt: Added. 28 * platform/mac/fast/multicol/pagination-v-vertical-lr-expected.png: Added. 29 * platform/mac/fast/multicol/pagination-v-vertical-lr-expected.txt: Added. 30 * platform/mac/fast/multicol/pagination-v-vertical-rl-expected.png: Added. 31 * platform/mac/fast/multicol/pagination-v-vertical-rl-expected.txt: Added. 32 1 33 2011-11-08 Vineet Chaudhary <vineet.chaudhary@motorola.com> 2 34 -
trunk/Source/WebCore/ChangeLog
r99612 r99613 1 2011-11-08 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10262225> Allow RenderView to have columns 4 https://bugs.webkit.org/show_bug.cgi?id=71840 5 6 Reviewed by Simon Fraser. 7 8 Tests: fast/multicol/pagination-h-horizontal-bt.html 9 fast/multicol/pagination-h-horizontal-tb.html 10 fast/multicol/pagination-h-vertical-lr.html 11 fast/multicol/pagination-h-vertical-rl.html 12 fast/multicol/pagination-v-horizontal-bt.html 13 fast/multicol/pagination-v-horizontal-tb.html 14 fast/multicol/pagination-v-vertical-lr.html 15 fast/multicol/pagination-v-vertical-rl.html 16 17 * WebCore.exp.in: Export Page::setPagination() for WebCoreTestSupport. 18 * css/CSSStyleSelector.cpp: 19 (WebCore::CSSStyleSelector::styleForDocument): Set the column axis and the column gap in the 20 document style if the view is paginated. 21 * page/Page.cpp: 22 (WebCore::Page::setPagination): Added this setter. 23 * page/Page.h: 24 (WebCore::Page::Pagination::Pagination): 25 (WebCore::Page::pagination): Added this getter. 26 * rendering/RenderBlock.cpp: 27 (WebCore::RenderBlock::requiresColumns): Added and moved some logic to here from... 28 (WebCore::RenderBlock::setDesiredColumnCountAndWidth): ...here. 29 * rendering/RenderBlock.h: 30 * rendering/RenderBox.cpp: 31 (WebCore::RenderBox::paintRootBoxFillLayers): Changed to use the new RenderView::backgroundRect() 32 instead of unscaledDocumentRect(). 33 * rendering/RenderView.cpp: 34 (WebCore::RenderView::requiresColumns): Added this override that always returns true if the view 35 is paginated. 36 (WebCore::RenderView::backgroundRect): Added. In the paginated case, returns a rectangle stretching 37 across all columns. 38 * rendering/RenderView.h: 39 * testing/Internals.cpp: 40 (WebCore::Internals::reset): Also reset pagination. 41 (WebCore::Internals::setPagination): Added this setter for testing. 42 * testing/Internals.h: 43 * testing/Internals.idl: 44 1 45 2011-11-08 Vineet Chaudhary <vineet.chaudhary@motorola.com> 2 46 -
trunk/Source/WebCore/WebCore.exp.in
r99509 r99613 743 743 __ZN7WebCore4Page12setGroupNameERKN3WTF6StringE 744 744 __ZN7WebCore4Page13rangeOfStringERKN3WTF6StringEPNS_5RangeEj 745 __ZN7WebCore4Page13setPaginationERKNS0_10PaginationE 745 746 __ZN7WebCore4Page14setMediaVolumeEf 746 747 __ZN7WebCore4Page15addSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r99450 r99613 1162 1162 else 1163 1163 documentStyle->setDirection(docElementRenderer->style()->direction()); 1164 } 1165 1166 if (frame) { 1167 if (Page* page = frame->page()) { 1168 const Page::Pagination& pagination = page->pagination(); 1169 if (pagination.mode != Page::Pagination::Unpaginated) { 1170 documentStyle->setColumnAxis(pagination.mode == Page::Pagination::HorizontallyPaginated ? HorizontalColumnAxis : VerticalColumnAxis); 1171 documentStyle->setColumnGap(pagination.gap); 1172 } 1173 } 1164 1174 } 1165 1175 -
trunk/Source/WebCore/page/Page.cpp
r98472 r99613 666 666 } 667 667 668 void Page::setPagination(const Pagination& pagination) 669 { 670 if (m_pagination.mode == pagination.mode && m_pagination.gap == pagination.gap) 671 return; 672 673 m_pagination = pagination; 674 675 setNeedsRecalcStyleInAllFrames(); 676 backForward()->markPagesForFullStyleRecalc(); 677 } 678 668 679 void Page::didMoveOnscreen() 669 680 { -
trunk/Source/WebCore/page/Page.h
r97640 r99613 252 252 void setDeviceScaleFactor(float); 253 253 254 struct Pagination { 255 enum Mode { Unpaginated, HorizontallyPaginated, VerticallyPaginated }; 256 257 Pagination() 258 : mode(Unpaginated) 259 , gap(0) 260 { 261 }; 262 263 Mode mode; 264 unsigned gap; 265 }; 266 267 const Pagination& pagination() const { return m_pagination; } 268 void setPagination(const Pagination&); 269 254 270 // Notifications when the Page starts and stops being presented via a native window. 255 271 void didMoveOnscreen(); … … 383 399 float m_deviceScaleFactor; 384 400 401 Pagination m_pagination; 402 385 403 bool m_javaScriptURLsAreAllowed; 386 404 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r99024 r99613 4507 4507 } 4508 4508 4509 bool RenderBlock::requiresColumns(int desiredColumnCount) const 4510 { 4511 return firstChild() 4512 && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis()) 4513 && !firstChild()->isAnonymousColumnsBlock() 4514 && !firstChild()->isAnonymousColumnSpanBlock(); 4515 } 4516 4509 4517 void RenderBlock::setDesiredColumnCountAndWidth(int count, LayoutUnit width) 4510 4518 { 4511 bool destroyColumns = !firstChild() 4512 || (count == 1 && style()->hasAutoColumnWidth() && style()->hasInlineColumnAxis()) 4513 || firstChild()->isAnonymousColumnsBlock() 4514 || firstChild()->isAnonymousColumnSpanBlock(); 4519 bool destroyColumns = !requiresColumns(count); 4515 4520 if (destroyColumns) { 4516 4521 if (hasColumns()) { -
trunk/Source/WebCore/rendering/RenderBlock.h
r99024 r99613 907 907 908 908 bool logicalWidthChangedInRegions() const; 909 909 910 virtual bool requiresColumns(int desiredColumnCount) const; 911 910 912 public: 911 913 LayoutUnit offsetFromLogicalTopOfFirstPage() const; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r99462 r99613 873 873 } 874 874 875 // The background of the box generated by the root element covers the entire canvas, so just use 876 // the RenderView's unscaledDocumentRect accessor. 877 paintFillLayers(paintInfo, bgColor, bgLayer, view()->unscaledDocumentRect(), BackgroundBleedNone, CompositeSourceOver, bodyObject); 875 RenderView* view = this->view(); 876 LayoutRect backgroundRect = view->backgroundRect(); 877 flipForWritingMode(backgroundRect); 878 paintFillLayers(paintInfo, bgColor, bgLayer, backgroundRect, BackgroundBleedNone, CompositeSourceOver, bodyObject); 878 879 } 879 880 -
trunk/Source/WebCore/rendering/RenderView.cpp
r99099 r99613 22 22 #include "RenderView.h" 23 23 24 #include "ColumnInfo.h" 24 25 #include "Document.h" 25 26 #include "Element.h" … … 172 173 transformState.applyTransform(t); 173 174 } 175 } 176 177 bool RenderView::requiresColumns(int desiredColumnCount) const 178 { 179 if (m_frameView) { 180 if (Frame* frame = m_frameView->frame()) { 181 if (Page* page = frame->page()) 182 return frame == page->mainFrame() && page->pagination().mode != Page::Pagination::Unpaginated; 183 } 184 } 185 return RenderBlock::requiresColumns(desiredColumnCount); 174 186 } 175 187 … … 681 693 } 682 694 695 LayoutRect RenderView::backgroundRect() const 696 { 697 if (!hasColumns()) 698 return unscaledDocumentRect(); 699 700 ColumnInfo* columnInfo = this->columnInfo(); 701 LayoutRect backgroundRect(0, 0, columnInfo->desiredColumnWidth(), columnInfo->columnHeight() * columnInfo->columnCount()); 702 if (!isHorizontalWritingMode()) 703 backgroundRect = backgroundRect.transposedRect(); 704 return backgroundRect; 705 } 706 683 707 IntRect RenderView::documentRect() const 684 708 { -
trunk/Source/WebCore/rendering/RenderView.h
r99099 r99613 168 168 169 169 IntRect unscaledDocumentRect() const; 170 LayoutRect backgroundRect() const; 170 171 171 172 IntRect documentRect() const; … … 191 192 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&, bool* wasFixed = 0) const; 192 193 virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const; 194 virtual bool requiresColumns(int desiredColumnCount) const OVERRIDE; 193 195 194 196 private: -
trunk/Source/WebCore/testing/Internals.cpp
r99485 r99613 377 377 } 378 378 379 void Internals::setPagination(Document* document, const String& mode, int gap, ExceptionCode& ec) 380 { 381 if (!document || !document->page()) { 382 ec = INVALID_ACCESS_ERR; 383 return; 384 } 385 386 Page::Pagination pagination; 387 if (mode == "Unpaginated") 388 pagination.mode = Page::Pagination::Unpaginated; 389 else if (mode == "HorizontallyPaginated") 390 pagination.mode = Page::Pagination::HorizontallyPaginated; 391 else if (mode == "VerticallyPaginated") 392 pagination.mode = Page::Pagination::VerticallyPaginated; 393 else { 394 ec = SYNTAX_ERR; 395 return; 396 } 397 398 pagination.gap = gap; 399 400 document->page()->setPagination(pagination); 401 } 402 379 403 void Internals::reset(Document* document) 380 404 { … … 391 415 passwordEchoEnabledBackedUp = false; 392 416 } 417 418 if (Page* page = document->page()) 419 page->setPagination(Page::Pagination()); 393 420 } 394 421 -
trunk/Source/WebCore/testing/Internals.h
r99485 r99613 90 90 void setScrollViewPosition(Document*, long x, long y, ExceptionCode&); 91 91 92 void setPagination(Document*, const String& mode, int gap, ExceptionCode&); 93 92 94 bool wasLastChangeUserEdit(Element* textField, ExceptionCode&); 93 95 String suggestedValue(Element* inputElement, ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r99485 r99613 63 63 void setScrollViewPosition(in Document document, in long x, in long y) raises(DOMException); 64 64 65 void setPagination(in Document document, in DOMString mode, in long gap) raises(DOMException); 66 65 67 boolean wasLastChangeUserEdit(in Element textField) raises (DOMException); 66 68 DOMString suggestedValue(in Element inputElement) raises (DOMException); -
trunk/Source/WebKit2/ChangeLog
r99606 r99613 1 2011-11-08 Dan Bernstein <mitz@apple.com> 2 3 <rdar://problem/10262225> Allow RenderView to have columns 4 https://bugs.webkit.org/show_bug.cgi?id=71840 5 6 * win/WebKit2.def: Export Page::setPagination() for WebCoreTestSupport. 7 1 8 2011-11-08 Jon Lee <jonlee@apple.com> 2 9 -
trunk/Source/WebKit2/win/WebKit2.def
r98624 r99613 170 170 ?scrollElementToRect@FrameView@WebCore@@QAEXPAVElement@2@ABVIntRect@2@@Z 171 171 ?setDOMException@WebCore@@YAXPAVExecState@JSC@@H@Z 172 ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z 172 173 ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z 173 174 ?setScrollbarsSuppressed@ScrollView@WebCore@@QAEX_N0@Z
Note: See TracChangeset
for help on using the changeset viewer.