Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 498c08c

Browse files
committed
Increased the specificity of CSS rules. Introduced the .ck class for editor UI components (see: ckeditor/ckeditor5#494).
1 parent 66d67c0 commit 498c08c

14 files changed

+104
-96
lines changed

src/imagetextalternative/ui/textalternativeformview.js

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default class TextAlternativeFormView extends View {
109109

110110
attributes: {
111111
class: [
112+
'ck',
112113
'ck-text-alternative-form',
113114
],
114115

tests/image.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe( 'Image', () => {
6060
setModelData( model, '[<image alt="alt text" src="foo.png"></image>]' );
6161

6262
expect( getViewData( view ) ).to.equal(
63-
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
63+
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
6464
'<img alt="alt text" src="foo.png"></img>' +
6565
'</figure>]'
6666
);
@@ -73,7 +73,7 @@ describe( 'Image', () => {
7373
setModelData( model, '[<image src="foo.png" alt=""></image>]' );
7474

7575
expect( getViewData( view ) ).to.equal(
76-
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
76+
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
7777
'<img alt="" src="foo.png"></img>' +
7878
'</figure>]'
7979
);
@@ -89,10 +89,10 @@ describe( 'Image', () => {
8989
);
9090

9191
expect( getViewData( view ) ).to.equal(
92-
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
92+
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
9393
'<img alt="alt text" src="foo.png"></img>' +
9494
'</figure>]' +
95-
'<figure class="ck-widget image" contenteditable="false">' +
95+
'<figure class="ck ck-widget image" contenteditable="false">' +
9696
'<img alt="alt text" src="foo.png"></img>' +
9797
'</figure>'
9898
);
@@ -103,10 +103,10 @@ describe( 'Image', () => {
103103
} );
104104

105105
expect( getViewData( view ) ).to.equal(
106-
'<figure class="ck-widget image" contenteditable="false">' +
106+
'<figure class="ck ck-widget image" contenteditable="false">' +
107107
'<img alt="alt text" src="foo.png"></img>' +
108108
'</figure>' +
109-
'[<figure class="ck-widget ck-widget_selected image" contenteditable="false">' +
109+
'[<figure class="ck ck-widget ck-widget_selected image" contenteditable="false">' +
110110
'<img alt="alt text" src="foo.png"></img>' +
111111
'</figure>]'
112112
);

tests/image/converters.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe( 'Image converters', () => {
215215
} );
216216

217217
expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
218-
'<figure class="ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
218+
'<figure class="ck ck-widget image" contenteditable="false"><img alt="foo bar" src=""></img></figure>'
219219
);
220220
} );
221221

@@ -228,7 +228,7 @@ describe( 'Image converters', () => {
228228
} );
229229

230230
expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
231-
'<figure class="ck-widget image" contenteditable="false"><img src=""></img></figure>'
231+
'<figure class="ck ck-widget image" contenteditable="false"><img src=""></img></figure>'
232232
);
233233
} );
234234

@@ -241,7 +241,7 @@ describe( 'Image converters', () => {
241241
} );
242242

243243
expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
244-
'<figure class="ck-widget image" contenteditable="false"><img alt="baz quix" src=""></img></figure>'
244+
'<figure class="ck ck-widget image" contenteditable="false"><img alt="baz quix" src=""></img></figure>'
245245
);
246246
} );
247247

@@ -253,7 +253,7 @@ describe( 'Image converters', () => {
253253
setModelData( model, '<image src="" alt="foo bar"></image>' );
254254

255255
expect( getViewData( viewDocument, { withoutSelection: true } ) ).to.equal(
256-
'<figure class="ck-widget image" contenteditable="false"><img src=""></img></figure>'
256+
'<figure class="ck ck-widget image" contenteditable="false"><img src=""></img></figure>'
257257
);
258258
} );
259259
} );

tests/image/imageediting.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ describe( 'ImageEditing', () => {
381381
setModelData( model, '<image src="foo.png" alt="alt text"></image>' );
382382

383383
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
384-
'<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
384+
'<figure class="ck ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
385385
);
386386
} );
387387

@@ -402,7 +402,7 @@ describe( 'ImageEditing', () => {
402402
} );
403403

404404
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
405-
'<figure class="ck-widget image" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
405+
'<figure class="ck ck-widget image" contenteditable="false"><img alt="new text" src="foo.png"></img></figure>'
406406
);
407407
} );
408408

@@ -415,7 +415,7 @@ describe( 'ImageEditing', () => {
415415
} );
416416

417417
expect( getViewData( view, { withoutSelection: true } ) )
418-
.to.equal( '<figure class="ck-widget image" contenteditable="false"><img src="foo.png"></img></figure>' );
418+
.to.equal( '<figure class="ck ck-widget image" contenteditable="false"><img src="foo.png"></img></figure>' );
419419
} );
420420

421421
it( 'should not convert change if is already consumed', () => {
@@ -431,7 +431,7 @@ describe( 'ImageEditing', () => {
431431
} );
432432

433433
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
434-
'<figure class="ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
434+
'<figure class="ck ck-widget image" contenteditable="false"><img alt="alt text" src="foo.png"></img></figure>'
435435
);
436436
} );
437437

@@ -444,7 +444,7 @@ describe( 'ImageEditing', () => {
444444
'</image>' );
445445

446446
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
447-
'<figure class="ck-widget image" contenteditable="false">' +
447+
'<figure class="ck ck-widget image" contenteditable="false">' +
448448
'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w"></img>' +
449449
'</figure>'
450450
);
@@ -464,7 +464,7 @@ describe( 'ImageEditing', () => {
464464
} );
465465

466466
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
467-
'<figure class="ck-widget image" contenteditable="false">' +
467+
'<figure class="ck ck-widget image" contenteditable="false">' +
468468
'<img alt="alt text" src="foo.png"></img>' +
469469
'</figure>'
470470
);
@@ -479,7 +479,7 @@ describe( 'ImageEditing', () => {
479479
'</image>' );
480480

481481
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
482-
'<figure class="ck-widget image" contenteditable="false">' +
482+
'<figure class="ck ck-widget image" contenteditable="false">' +
483483
'<img alt="alt text" sizes="100vw" src="foo.png" srcset="small.png 148w, big.png 1024w" width="1024"></img>' +
484484
'</figure>'
485485
);
@@ -494,7 +494,7 @@ describe( 'ImageEditing', () => {
494494
} );
495495

496496
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
497-
'<figure class="ck-widget image" contenteditable="false">' +
497+
'<figure class="ck ck-widget image" contenteditable="false">' +
498498
'<img src="foo.png"></img>' +
499499
'</figure>'
500500
);
@@ -514,7 +514,7 @@ describe( 'ImageEditing', () => {
514514
} );
515515

516516
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
517-
'<figure class="ck-widget image" contenteditable="false">' +
517+
'<figure class="ck ck-widget image" contenteditable="false">' +
518518
'<img src="foo.png"></img>' +
519519
'</figure>'
520520
);
@@ -536,7 +536,7 @@ describe( 'ImageEditing', () => {
536536
);
537537

538538
expect( getViewData( view, { withoutSelection: true } ) ).to.equal(
539-
'<figure class="ck-widget image" contenteditable="false">' +
539+
'<figure class="ck ck-widget image" contenteditable="false">' +
540540
'<img alt="alt text" src="foo.png"></img>' +
541541
'</figure>'
542542
);

0 commit comments

Comments
 (0)