~ubuntu-branches/ubuntu/jaunty/kde4libs/jaunty

« back to all changes in this revision

Viewing changes to khtml/rendering/render_box.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Wenning, Jonathan Thomas, Andreas Wenning
  • Date: 2009-04-01 05:55:52 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090401055552-uel5di5f3xiftax3
Tags: 4:4.2.2-0ubuntu1
[ Jonathan Thomas ]
* New upstream release (LP: #344709, #348823):
  - Bump upstreamversion and runtimedeps in debian/rules
  - Remove kubuntu_65_kcmdlineargs_decoding_svn934640.diff, applied upstream

[ Andreas Wenning ]
* Remove patch kubuntu_69_do_not_show_plasma_popups_over_screensaver.diff,
  applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
579
579
    if (shouldPaintBackgroundImage) {
580
580
        int sx = 0;
581
581
        int sy = 0;
 
582
        int rw = 0;
 
583
        int rh = 0;
582
584
        int cw,ch;
583
585
        int cx,cy;
584
586
        int scaledImageWidth, scaledImageHeight;
585
587
 
586
588
        // CSS2 chapter 14.2.1
587
589
 
588
 
        if (bgLayer->backgroundAttachment()) {
 
590
        if (bgLayer->backgroundAttachment() != BGAFIXED) {
589
591
            //scroll
590
592
            int hpab = 0, vpab = 0, left = 0, top = 0; // Init to 0 for background-origin of 'border'
591
593
            if (bgLayer->backgroundOrigin() != BGBORDER) {
602
604
            }
603
605
 
604
606
            int pw, ph;
 
607
            pw = w - hpab;
 
608
            ph = h - vpab;
605
609
            if (isRoot()) {
606
610
                // the root's background box 'spills out' to cover the whole canvas, so we have to
607
611
                // go back to its true edge for the purpose of computing background-size
608
612
                // and honouring background-origin
609
 
                pw = width() - hpab;
610
 
                ph = height() - vpab; 
 
613
                rw = width() - hpab;
 
614
                rh = height() - vpab; 
611
615
                left += marginLeft();
612
616
                hpab += marginLeft() + marginRight();
613
617
                vpab += marginTop() + marginBottom();
614
618
                top += marginTop();
 
619
                scaledImageWidth = rw;
 
620
                scaledImageHeight = rh;
615
621
            } else {
616
 
                pw = w - hpab;
617
 
                ph = h - vpab;
 
622
                scaledImageWidth = pw;
 
623
                scaledImageHeight = ph;
618
624
            }
619
 
            scaledImageWidth = pw;
620
 
            scaledImageHeight = ph;
621
625
            calculateBackgroundSize(bgLayer, scaledImageWidth, scaledImageHeight);
622
626
 
623
627
            EBackgroundRepeat bgr = bgLayer->backgroundRepeat();
624
628
            if (bgr == NO_REPEAT || bgr == REPEAT_Y) {
625
629
                cw = scaledImageWidth;
626
 
                int xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth);
 
630
                int xPosition;
 
631
                if (isRoot())
 
632
                    xPosition = bgLayer->backgroundXPosition().minWidth(rw-scaledImageWidth);
 
633
                else
 
634
                    xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth);
627
635
                if ( xPosition >= 0 ) {
628
636
                    cx = _tx + xPosition;
629
637
                    cw = qMin(scaledImageWidth, pw - xPosition);
641
649
                cw = w;
642
650
                cx = _tx;
643
651
                if (scaledImageWidth > 0) {
644
 
                    int xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth);
 
652
                    int xPosition;
 
653
                    if (isRoot())
 
654
                        xPosition = bgLayer->backgroundXPosition().minWidth(rw-scaledImageWidth);
 
655
                    else
 
656
                        xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth);
645
657
                    sx = scaledImageWidth - (xPosition % scaledImageWidth);
646
658
                    sx -= left % scaledImageWidth;
647
659
                }
648
660
            }
649
661
            if (bgr == NO_REPEAT || bgr == REPEAT_X) {
650
662
                ch = scaledImageHeight;
651
 
                int yPosition = bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight);
 
663
                int yPosition;
 
664
                if (isRoot())
 
665
                    yPosition = bgLayer->backgroundYPosition().minWidth(rh - scaledImageHeight);
 
666
                else
 
667
                    yPosition = bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight);
652
668
                if ( yPosition >= 0 ) {
653
669
                    cy = _ty + yPosition;
654
670
                    ch = qMin(ch, ph - yPosition);
667
683
                ch = h;
668
684
                cy = _ty;
669
685
                if (scaledImageHeight > 0) {
670
 
                    int yPosition = bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight);
 
686
                    int yPosition;
 
687
                    if (isRoot())
 
688
                        yPosition = bgLayer->backgroundYPosition().minWidth(rh - scaledImageHeight);
 
689
                    else
 
690
                        yPosition = bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight);
671
691
                    sy = scaledImageHeight - (yPosition % scaledImageHeight);
672
692
                    sy -= top % scaledImageHeight;
673
693
                }
674
694
            }
675
 
            if (layer())
 
695
            if (layer() && bgLayer->backgroundAttachment() == BGALOCAL)
676
696
                layer()->scrollOffset(sx, sy);
677
697
        }
678
698
        else
804
824
            path.arcMoveTo(r, 0);
805
825
            path.arcTo(r, 0, 90);
806
826
        } else
807
 
            path.moveTo(rect.topRight());
 
827
            path.moveTo(rect.x() + rect.width(), rect.y());
808
828
 
809
829
        // Top left corner
810
830
        if (tl.hasBorderRadius()) {
811
831
            const QRect r(rect.x(), rect.y(), tl.horizontal * 2, tl.vertical * 2);
812
832
            path.arcTo(r, 90, 90);
813
833
        } else
814
 
            path.lineTo(rect.topLeft());
 
834
            path.lineTo(rect.x(), rect.y());
815
835
 
816
836
        // Bottom left corner
817
837
        if (bl.hasBorderRadius()) {
818
838
            const QRect r(rect.x(), rect.y() + rect.height() - bl.vertical * 2, bl.horizontal * 2, bl.vertical * 2);
819
839
            path.arcTo(r, 180, 90);
820
840
        } else
821
 
            path.lineTo(rect.bottomLeft());
 
841
            path.lineTo(rect.x(), rect.y() + rect.height());
822
842
 
823
843
        // Bottom right corner
824
844
        if (br.hasBorderRadius()) {
826
846
                          br.horizontal * 2, br.vertical * 2);
827
847
            path.arcTo(r, 270, 90);
828
848
        } else
829
 
            path.lineTo(rect.bottomRight());
 
849
            path.lineTo(rect.x() + rect.width(), rect.y() + rect.height());
830
850
 
831
851
        path.closeSubpath();
832
852
    }