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

T/1226 Refactored how markers removal is converted from the model to the view #1347

Merged
merged 13 commits into from
Mar 16, 2018

Conversation

scofalik
Copy link
Contributor

@scofalik scofalik commented Mar 8, 2018

Suggested merge commit message (convention)

Other: Refactored how markers removal is converted from the model to the view. Closes ckeditor/ckeditor5#4233.

@scofalik scofalik requested a review from pjasiun March 8, 2018 15:21
@coveralls
Copy link

coveralls commented Mar 8, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling fe31554 on t/1226 into dbbcc04 on master.

@scofalik
Copy link
Contributor Author

scofalik commented Mar 8, 2018

Related PR ckeditor/ckeditor5-link#178

@scofalik scofalik changed the title T/1226 T/1226 Refactored how markers removal is converted from the model to the view Mar 8, 2018
* @returns {Set.<module:engine/view/attributeelement~AttributeElement>|null} Set containing all the attribute elements
* with the same `id` or `null` if given element had no `id`.
*/
getAllClonedElements( element ) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getter should not be a writer method. It should be a method of an element. You should not require creating view.change block to call getter, because this block causes rendering.


for ( const element of boundElements ) {
if ( element.is( 'attributeElement' ) ) {
for ( const clone of element.getCustomProperty( 'clonedElements' ) ) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't getAllClonedElements be used here?

}

group.add( element );
this.setCustomProperty( 'clonedElements', group, element );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a protected property instread of a custom property.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only make sure it is cloned well ;)

…are broken during wrapping. Introduced `view.Writer#getAllBrokenSiblings`.

Changed: Changed how `view.Writer` wraps and unwraps elements, now it bases on `view.AttributeElement#id` too.
Removed: Removed `HighlightAttributeElement`.
…roller` to `conversion.DowncastDispatcher`.

Changed: Use markers binding provided by `conversion.Mapper` in `conversion.downcast-converters`.
…s groups and how `conversion.Mapper` uses this information.
*/
get priority() {
return this._priority;
}

/**
* Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
* and then two elements are considered similar if, and only if they have the same `_id`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id

* Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}
* if this element has no `id`.
*
* @returns {Set.<module:engine/view/attributeelement~AttributeElement>|null} Set containing all the attribute elements
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will never return null.

@pjasiun pjasiun merged commit f6de5f5 into master Mar 16, 2018
@pjasiun pjasiun deleted the t/1226 branch March 16, 2018 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markers removal
3 participants