Skip to content

Commit 6c31bd5

Browse files
committed
remove Linebox.end()
1 parent 253b3bc commit 6c31bd5

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/layout-text.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,6 @@ export class Linebox extends LineItemLinkedList {
14011401
return this.head != null;
14021402
}
14031403

1404-
end() {
1405-
return this.endOffset;
1406-
}
1407-
14081404
height() {
14091405
return this.ascender + this.descender;
14101406
}

test/text.spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,10 @@ describe('Lines', function () {
479479
this.layout('<div style="width: 0;">eat lots of peaches</div>');
480480
const [inline] = this.get('div').children;
481481
expect(inline.paragraph.lineboxes).to.have.lengthOf(4);
482-
expect(inline.paragraph.lineboxes[0].end()).to.equal(4);
483-
expect(inline.paragraph.lineboxes[1].end()).to.equal(9);
484-
expect(inline.paragraph.lineboxes[2].end()).to.equal(12);
485-
expect(inline.paragraph.lineboxes[3].end()).to.equal(19);
482+
expect(inline.paragraph.lineboxes[0].endOffset).to.equal(4);
483+
expect(inline.paragraph.lineboxes[1].endOffset).to.equal(9);
484+
expect(inline.paragraph.lineboxes[2].endOffset).to.equal(12);
485+
expect(inline.paragraph.lineboxes[3].endOffset).to.equal(19);
486486
});
487487

488488
it('breaks between shaping boundaries', function () {
@@ -494,7 +494,7 @@ describe('Lines', function () {
494494
/** @type import('../src/layout-flow.ts').IfcInline[] */
495495
const [inline] = this.get('div').children;
496496
expect(inline.paragraph.lineboxes).to.have.lengthOf(2);
497-
expect(inline.paragraph.lineboxes[0].end()).to.equal(13);
497+
expect(inline.paragraph.lineboxes[0].endOffset).to.equal(13);
498498
expect(inline.paragraph.items).to.have.lengthOf(3);
499499
});
500500

@@ -507,7 +507,7 @@ describe('Lines', function () {
507507
/** @type import('../src/layout-flow.ts').IfcInline[] */
508508
const [inline] = this.get('div').children;
509509
expect(inline.paragraph.lineboxes).to.have.lengthOf(2);
510-
expect(inline.paragraph.lineboxes[0].end()).to.equal(13);
510+
expect(inline.paragraph.lineboxes[0].endOffset).to.equal(13);
511511
expect(inline.paragraph.items).to.have.lengthOf(2);
512512
});
513513

@@ -531,8 +531,8 @@ describe('Lines', function () {
531531
const [inline] = this.get('div').children;
532532
expect(inline.paragraph.items).to.have.lengthOf(2);
533533
expect(inline.paragraph.lineboxes).to.have.lengthOf(2);
534-
expect(inline.paragraph.lineboxes[0].end()).to.equal(9);
535-
expect(inline.paragraph.lineboxes[1].end()).to.equal(13);
534+
expect(inline.paragraph.lineboxes[0].endOffset).to.equal(9);
535+
expect(inline.paragraph.lineboxes[1].endOffset).to.equal(13);
536536
});
537537

538538
it('measures break width correctly', function () {
@@ -666,8 +666,8 @@ describe('Lines', function () {
666666
/** @type import('../src/layout-flow.ts').IfcInline[] */
667667
const [inline] = this.get('div').children;
668668
expect(inline.paragraph.lineboxes).to.have.lengthOf(3);
669-
expect(inline.paragraph.lineboxes[0].end()).to.equal(6);
670-
expect(inline.paragraph.lineboxes[1].end()).to.equal(11);
669+
expect(inline.paragraph.lineboxes[0].endOffset).to.equal(6);
670+
expect(inline.paragraph.lineboxes[1].endOffset).to.equal(11);
671671
});
672672

673673
it('ignores empty spans when assigning padding to words', function () {

0 commit comments

Comments
 (0)